Demo Progress Day 3: Battle System, Scriptable Objects and Animations


The Good

So today went a little better than yesterday. I managed to refactor a few more things, and I’ll go into some technical details once I’m done with with this week, but will likely post that on my Dev.to instead.

Part of what I did was to make the NSidedDie and its subclasses Scriptable Objects, so that makes it easier to create new ones. So I can create a D6 for players, but also custom D6s for enemies. For starters I made a BasicD6 for the player, which has one of each type of attack linked to it, but in theory this will allow me to make “Physical Focused” or “Magic Focused” variations which a player can then equip.

What I also did was to create a FourSidedDie implementation, for which I made an EnemyD4 which I can attach to my enemies. This allows them to also use the dice rolling mechanics.

I replaced some of my 3D shapes with Kenney assets. This is not what the final game will look like, but I wanted to start implementing animations and triggers to get a feel for how they work.

Lastly, I started with the battle system, which will keep track of the turns and states, will roll the dice for enemies and handle the UI inputs for the player.

The Bad

Animations are wonky. Still figuring out timings with coroutines and how and when to delete objects. A lot of this is still very hacky…

I created the D4 for the enemies, but I realized the way the ApplySkill function is implemented, everything applies to the enemies. Skills were originally designed for players only, being able to give enemies dice was an idea I had this morning.

Turns out, my current implementation doesn’t work for that… Will probably tackle that tomorrow.

With that in mind though, turns out when the enemies attack back, balancing is in order. Had to make some of the attacks stronger just to get through recording -_-”

The Ugly

I also refactored my Player and Enemy scripts to share a Unit interface, and now I feel like not only is the Health one redundant, but actually gets in the way and complicates things, so I’ll need to look at refactoring even more code.

Next up

So for tomorrow, making the enemies use the D4 is probably first on the list. Add some randomness to combat. Next up, I’d like to actually work on making skills upgradeable, and then having the upgrades trigger on enemy death.

I feel like I keep adding to the scope of what I want to achieve, but one things that is important that I need to get to before the end is actually having real dice roll on the screen. I’m thinking there are probably Assets I can use on the Unity Store, which probably also means ripping out my current DiceRoller, but I really don’t want to, since that has some special logic I don’t expect I’ll get from other dice plugins.

Unless I can get just the models and animations and the animations allow me to animate in a way that I pick the side that shows up… then I can use the result of my DiceRoller and just animate the models to show that value. That would be great…

I’ll research that a bit.

Until tomorrow then, enjoy the attached video.

Get So this is how I DIE

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.