Quantcast
Channel: User Martin - Stack Overflow
Viewing all articles
Browse latest Browse all 38

How to implement a composable character/skill system in the Godot 4.0 Game Engine?

$
0
0

I am currently experimenting with a prototype for a MOBA style game using Godot.

I am struggling to figure out a way to manage the characters and their skills.

All characters will have similar attributes (Name, health, run speed, strength and so on). However, the skills will be different for all characters (although some will be pretty similar, for instance projectile based skills would have things like: distance, speed, texture/vfx) that should be configurable but allow for re-usable behaviors when possible.

I am not sure how to build something that will allow for simple maintenance/programming.

I tried to use resources for the skills and characters. However, it looks like resources might not be the way to go since I can't seem to have different behavior/scripts for each resource instance.

I.E:Skill Resource

Name: Frost ArrowSpeed: 20Texture: frostarrow.png

However, I don't think I can attach code to it, or if so, I haven't found out how.

I also tried with a PackedScene. While I can have custom code using a scene, I can't figure out how to access the skill name from the packed scene.

And then, for the Character. I think for this one, I can use a Resource.I would have a Name, Sprites/3D model and so on. I would like to have a way to assign skills to my characters.

And from my player controller, be able to access those skills to display them on screen and call them when needed.


Viewing all articles
Browse latest Browse all 38

Latest Images

Trending Articles





Latest Images