As part of my player progression, I decided to make a “goal” system. A goal being broadly defined as some sort of simple objective to be reached. Kind of like mini-achievements or challenges. A lot of games do these and they really help with having a sort of “progress gauge” on your stuff. They are also nice little rewards for your actions. Sort of like the game is keeping track of your achievements and doesn’t just drop you there and forget.

So, firstly, we need a new asset. Honestly, everything I do starts with those word. But here we go:

For starters, I’ll just fill in some rough ideas I have for the kind of goals that I might use:

Of course, I need the goal to reach a certain threshold, such as the number of kills for a kill goal:

And, as with other assets, I can collect them all in a big ‘ol goal collection asset:

And now I can go on making many goals. I think I will have a goal progression, such as getting increasingly bigger numbers of kills:

I can easily preview all these in my collection and adjust as needed:

In fact, I also am adding a little editor button to hide all the extra detail, so I can easily list all the assets:

I also think I need a “previous step” for goals that are in a chain. Mostly for UI purposes:

Not sure yet how I will actually display and organize these, but at least I have the concept ready.

Anyway, to tie this all together I need a goal system:

This will track the goals that the player has achieved and will actively check for new completions as they do actions in the world. This system can then grab the goals I made:

It can then compare all the target goal values to in-game tracked values based on goal types. There’s quite a lot of hard-coding in the code for this, but it cannot be avoided. After all, there’s one place kills are registered, another where enemy types are tracked, another where damage is received, etc. But I am keeping it all cleanly organized so I don’t make a mess of inter-system wiring. Also similar goals share code, like the Kills 1/2/3 ones, so I only even write code for checking kills once.

I also really need an editor-time debug overview of all my goals. It definitely needs to show the completed goals:

Now, I have no idea what the values I am trying to reach are. Like, how many kills do I have? So I need a similar statistics system editor-time debugger for all the value I might be adding:

And finally, I want to list all the goals that I am tracking and their status (green – complete; white – available; gray – locked):

So now I have a working pipeline to track and complete goals. Of course, they don’t do anything. So I will add rewards for completing goals, namely experience and bonuses:

I am not yet sure how I want to split these — do I use both, only one? I will probably award experience for specific tasks and give bonuses for numerical milestones.

Wiring bonuses is super-easy since I made my bonus system very dynamic. I just need to gather bonuses from the goal system:

I am also anticipating that some things I don’t want to hard-code, but I have no idea where to define them. So I’ll make a goal rule asset, where I can put miscellaneous items:

And this is linked from goals system that can query it for any info it needs:

Now I just need to create and fill out and wire a whole lot of goals… oh boy. I’ll discuss this separately. Not to mention UI, which I will also discuss separately later.

MicroRogue DevDiary #78 – Goal framework
Tagged on:         

Leave a Reply

Your email address will not be published. Required fields are marked *