Learn You a Game Jam - Day 5


Ok, getting down to serious business. I decided against doing separate guildies and enemies and am diving right into making a "character" scene that can do both.  Not going to worry about any neutral or other character types right now.  I will keep the MainTank its own thing from the characters for now.  It might make more sense to combine them later when the character scene is a bit more developed, but right now the behavior of the game is so focused on where the MT is and what he is doing it makes sense to keep him this way right now.  And Player controlled vs coded behavior and they don't even use the same items.

Ok, so first off.  Initial character scene, based on the slime/main_tank scenes I was working with:



As you can see I have a "Guildie" loaded up.  This is a character this is Affiliated "Guildie" but not carrying an active item.  Active, because characters can "hold" an item without using it, remaining the basic character type of their Affiliation.  You can't change your basic type and be holding an active item because the active item changes your type, so for our purposes only Guildies can hold items like this.

A Guildie affiliated Character not holding an item, or "just holding" an item (see flags), will take on the appearance and behaviors of type "Guildie".

Likewise:

A Monster affiliated Character not holding an item will take on the appearance and behaviors of the type "Slime".

This is where we start. I want to be as abstract as possible here.  I am basically treating Guildie behavior as an Item, but without an item yet.  When I add items, I just need to do the same thing, activate abstracted data but from the Item rather than the character iteself.

Yeesh.  I'm ok taking up most of this week on this though, because one I have the Item/Character dynamic set up it shouldn't be a major issue to set up many more items and classes for both the Guildies and Monsters.  The pack I am pulling from has a ton of great sprites for both, and I'd like to have a lot of variety if possible.

Speaking of which, the non-itemed Guildie sprites and the Items sprites themselves I'll be using are from https://7soul.itch.io/ and his RPG packs.  His character sprite only had a walking animation, so I took the side ones and added an idle, attack, and death animation to it.  I'm terrible at art and in particular getting the animation right, but I think I did OK here  I used Aseprite rotate selection with the head, body, and legs to get a sort of blob version of what I needed and cleaned up from there.  They are very NES Final Fantasy like, good for the role of "generic recruit", and fitting well with the more elaborate TinyRPG sprites.

Ok, so I figured out how to load resources, so I can load the appropriate CharacterSprites. For each basic character type as well as their base stats.  I sectioned out CharacterStats and GameStats with game stats being for flags and health and other constantly changing info, and the CharacterStats for Intellect and Strength and Name and other less changeable.  I'm sure I will have to refine further, the data structure is going to be complicated if I don't keep on top of it.


Spend the next few hours working on the Character scene.  I now have it down to the Character root node that will just figure out the affiliation of the Character  and if it has an item. Then it gives the character a "Type" scene in its "TypeSlot" based on the item's Type. This is like Class in most RPGs, but "Class" is restricted, so Type it is!  Here is where the character Behavior mostly is, so for instance I'm making a Slime Type Scene that is just a copy of the Sprites, Animation, KillZone, etc Nodes of the old hard coded slime scene.

The "Character" being a Body needs a direct collision shape, so I'm taking this opportunity to make a zone of control system.  The inner collider shape, the one that is on the Character root node is the one that stops everything, including friendly.  The one in the Type Slot that defines what the character does has an outer collision shape the defines basically its Zone of Control for foes but not friends.

But this Character structure is feeling really clean and abstract.  As long as the messy part is contained in the Type node in the Type Slot its fine, that's the part that's getting changed out for each Type.  Abstraction... neat!


When I get the slime acting the way I like, I save the SlimeType as a scene and then I can wipe it clean and create the next Type.  Then I just load the SlimeType into any Character's TypeSlot and its a slime!  Which the Character script itself will do as a default when it is Monsters affiliated and not holding an item.

I still have to transfer the Slime script from the hard coded slime scene to the SlimeType.  I don't know if I'm going to Signal Up, since this structure is going to be used for ALL game characters I might stick with function calls up and down.  We will see, but I feel like I'm on the right track!

I can even get the MainTank work in this Character framework as well, which is fantastic!  Feeling like a lot of progress was made today, and I'm going to keep working on it!

Get Guildies

Leave a comment

Log in with itch.io to leave a comment.