Learn You a Game Jam Day 11 - Character Night!


Obviously I will be working on characters throughout the rest of the jam, but tonight I need to get all the infrastructure built to produce more at will.  I am almost there!

So first thing, I had a on_body_enter trigger for the Item when a body (character) enters its ItemPick 2DArea that calls body.pick_me_up(self) asking the entering body to pick it up.  That means ever CharacterBody2D is going to have to have this function, but only Guildies will actually use it, every one else will just pass.

That... just did NOT work.  I was thinking about it wrong, WAY wrong.  I don't need the physics engine to pick up the item, I already have an active "Go Pick Up The Item" function working, AND it knows the node_id of the item it wants to pick up AND how far away it is AND it can only come from a Character actively TRYING to pick it up.  My current version of this action was just going to the item and then depending on the Item collision detection to start the chain of events to Reparent the item to the item slot of the character.

Instead, we can use the TICKET_pick_up_item to run an actual ACTION_pick_up_item  - before it was just using a simple walk_to_node to walk to the item and that's it.  Basically I was over thinking it and trying to use Godot physics detection when I don't need to and it just make things much, much more complicated.

Hot DAMN it worked.  First I had to use the system I was building to detect when the close enough to pick up - not Godot Area / Physics Body detection.... its easier because I'm already polling these the Node_id and distances.  It's an ability like any other, just move to range and use it, range is just 5 pixels in this case so you have to be on top of it.  But no other Character will even notice them, they are just Sprites to them.

The problem I had after the Guildie was picking it up but not turning was because I built in flags to turn on and off "Holding Item" and "Available to Pick Up" on the Guildie and Item respectively, and I wasn't setting them when I was trying to do the appropriate action, so the Type initialization just saw the "Holding Item" flag was off and made him a Guildie.  Fixed!

So my Guildie now... eventually... moves to the Novice Crozier and picks it up, puts it into its Item Slot and runs the Type initialization function that removes the GuildieType core from the Type Slot and instantiates a PriestType core instead.

POOF - Guildie becomes a Priest!  Now it behaves just like the other Priest, with the basic Slime go to Main Tank behavior. No Lottery, none of the changes we made to the Guildie type over the last few days are here... its now completely an old outdated Priest!


I took a moment, this is a major break point in this project... I know how to do everything else or I can live without it.  Picking up an item, removing an old Type and replacing it with the New type based on the Item is the CORE of the game, without it... there is no game.  And it wasn't easy to figure out.  Getting the Lists going for vision and targeting also worked like I knew it would, but actually grinding out the code was tough.

The Behavior System, also CORE to the game, works GREAT. Great, Great, Great, Great and wow is it expandable.  I can add things like a Pre-hopper that OTHER CHARACTERS and even the Game Manager can load for various purposes so that when your next lottery comes up the Character is not the only one with a say in what happens...

Like Cinematics that are never timed the same, but will eventually play out.  A DIRECTOR node (sort of like a Game Manager, but for cutscenes) will feed TICKETS into the hoppers of the appropriate Characters to make a predetermined scene play out eventually, but never the same way twice.  If the damned Guildies can remember their marks and lines! Cinematic!

How about Achievement/Memory system that can add behaviors based on events that have happened to the Character that DONT disappear when the type switches.  The ability to confuse or out right control an opponent by overloading their hoppers (or more likely they control YOUR guys this way).

Its just so damned versatile and easy to use.  If ever you need to STRONGLY SUGGEST a character do anything, you just pump their hopper up with the right instructions and they will... usually... do it.  Something like "Dodge Incoming Arrow" because its TICKET function will pole for Arrows and their targets and it will pump in TICKETS if they are "heading right for us!" - modified by  based on Agility or other stats (Luck?).

Like V-E-R-S-A-T-I-L-E

Ok, so the rally system, I want to try to use GROUPS to set this up.  Every character gets Type and Affiliation Groups when they are initialized, I thought I'd use groups more in targeting and still may.  But I can use it here to set up the rally system without a lookup list.

And with some minor hiccups I pull it off.   At first I added RallyPoints to my Old MainTank scene (the first one before I made the MainTankType Core and the Item/Type system) because they are practically the same looking.  So the Guildies did nothing after one picked up the Item.  Once I put the Rally Markers in the right scene, and then added them to the right groups...

The Guildies now will rally to the points that are in the groups they are in, including a catch all for ALL Guildies plural with an S because that's the Affiliation, Guildie singular is the Type, and a Priest type that nothing Rallys to yet becuse the Priests are running on Dumb Slime Tech..

Speaking... of... which... Now that Rally Points are figured out and we aren't just dumbly moving towards the tank...

Time to iterate baby!  Now I know I should be setting this up better - components and resources and what not, but for now I'm just copying the Guildies script as Priest script and dropping it in with the Pick up Item removed and a Heal replacing it.  Lots of repeated code.  I'll clean things up in Polishing if I have time.  Same for the Hopper system, I know I can just have a third argument on the ticket for "there are this many of this specific ticket in the hopper" rather than make hundreds and thousands of entries in arrays.

Again, maybe in Polish.  I'm just happy it works for now...

Anyway - on to my first Priest and first REAL ability (sorry Guildie, I will give you a rock throw soon) - ACTION_heal_friend !

The copy paste work well. The new Guildie behavior copied over but the Heal is acting buggy.  Not a problem, but I might call it a night there.  Still not where I planned to be, but honestly I'm OK with where I got.


My BOY picked up his Item and became a PRIEST!

Get Guildies

Leave a comment

Log in with itch.io to leave a comment.