Refactor and new combat


Hello all! Not much to share this time as most of my effort has gone towards refactoring the game’s code. Here you can see some of the fruits of that effort (click for full image):

The thing to notice is that lines 102-106 in the old code are no longer needed, because I’m no longer using streams to construct network packets. Basically, network packets, such as those that contain the data needed to show the game world, no longer need to be put together in a specific order. This is because we are now using Google’s Protobuf to serialize data.

Anyways, I did have some time to implement new features, such as the start of a new combat system:

There’s now a stamina system which works pretty much like you’d expect: attacking and blocking take cost stamina, running out of stamina causes you to become exhausted.

There’s also a parry - you can interrupt an enemy attack by striking first.

The new combat also comes with a full range of sword swinging animations:

I’ll definitely flesh this out a lot more when the refactoring is done. Me and my friend who’s helping me with the code will be focusing on making the code easier to use, more readable, and more functional. The next big effort on this front is a refactor of the network code, which I’ll write a post about at some point. Basically, we are moving to a model where clients can only send inputs to the server, and the server manages the entire game state. This is the type of model that multiplayer FPS games use, because it prevents a basic kind of cheating: a naughty client sending erroneous messages about the game state to the server. Currently this is perfectly possible in Demon Island.

Anyways, that about wraps it up for now. Until next time, bye!

Comments

Log in with itch.io to leave a comment.