#how do i should make my combat system?
1 messages · Page 1 of 1 (latest)
Attributes are not buggy though you should be careful about the instances they are attached to being removed (like falling in the void)
Don't worry about trying to make it optimized and perfect the first try, just make it work. You can always rewrite it later.
like my idea is like
if this attribute or the other one are true
then this happens
but like i should do it with every npc or player in the game?
like using* attributes for a lot of the combat system
i mean like "isrunning" "isattacking" "isblocking" "iscrouching" boolean attributes
If its easy for you to do and conceptualize then totally do it
Personally I would store that information in a table (one table per player and npc, then store those tables in a shared module script) since it can make it eaiser to manage the data.
I like to use attributes for easy debugging but I am sure it is worse on lua memory and lag, I like to use either per-entity tables or like unit registries that hold all the information inside a modulescript. From there you can control all the combat behavior and as far as NPC enemies I use behavior trees, but idk if that was included in ur prompt its just those use the attributes you listed.
** You are now Level 5! **
They are technically probably very slightly worse for performance but its going to be inconsequential unless you have an extreme number of entities
oh thanks for confirmation