I want the player to be able to play with multiple different characters or avatars, which have different properties and gameplay. This is a lot of gameplay variety for relatively not that much work. Basically, I have all the framework to support parametrized player characters with varying stats and whatnot. I just need to be able to select different ones based on player’s wants. The difficult part is any unique abilities they would have. The moderately tedious part is all the initial setup and UI and such, which I will do now.

First, let’s make a bunch of avatar definition assets (and it is always assets):

That way I can specify any properties that apply for for that avatar. And I can refer to the avatar by either its (savable) type value or with via fully qualified data class. For now, I will just track its type and how it is unlocked (some specific in-game trigger that unlocks it, the default being always unlocked):

I am also adding additional editor-time debug for this, so I can quickly unlock any avatars I need for testing:

Of course, none of this is wired to anything, so I need to use the avatar somehow in gameplay. This is where my player’s mob definition comes in, which I can link to the avatar:

And then each avatar can get their own specific player mob with its own values:

So these can have all sorts of different options and such. In fact, one thing I can de-hardcode is the weapon the player gets:

And so the actual player definition is chosen from the avatar that I now have to properly pass to the world. This also means I need to track of the current player’s avatar in the progress system, so they can resume with the same avatar.

Next, I need to create UI to let the player pick an avatar/character. I will also add a difficulty selection UI while I’m changing the same code anyway.

This just selects the default first avatar. Of course, I need to provide an actual list of avatars for the player to select, so I need to display the available ones:

And ideally I want to show all the possible characters, even when some are locked, but only allow picking unlocked ones:

I would also like some additional info to show to the player when they pick them, so they can quickly see what they do:

And I can also properly hint to the player about the yet-unavailable characters:

Of course, I have to manually fill all of this in, but at least it’s all externalized and centralized:

I can update and expand a few common character features that I know will differ without going into the actual differences. For example, they will have different animators and death setups (and this is a good time to remove excessive player sprites). So the player that spawns uses the right sprite:

And I have my assets nicely organized for all of this:

Well, that makes it for the character/avatar framework. I have not yet decided what individual characters will do exactly and what unique gameplay they will have. I also have to implement character special “moves” first, as that is their main active gameplay difference. I’ll get back to their individual details late.

I have been slacking a bit lately (read: motivational slump), so hopefully I can pick up the pace a little.


MicroRogue DevDiary #48 – Player characters
Tagged on:         

Leave a Reply

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