top of page
Search
  • Writer's pictureRob

Movement, battle mechanics and playing with Shaders


Last week I made some great progress on some core aspects of the game surrounding movement. Figuring out a system which sat nicely on top of Unity’s tiling code was a little fiddlier than I first expected but it’s a problem which is almost completely solved now! I actually ended up altering my A-Star pathfinder to use Dijkstra’s algorithm (pronounced dextra’s). This is essentially the same as A-Star except it doesn’t take into account the heuristic value of a path node which essentially means the actual distance between the node and the destination is irrelevant when finding the best path, the only thing that matters is the cost to traverse the node itself. I did this so I could use the same algorithm to do retrieve all available squares the player can move to and easily display them. I still have a few more things down the line with the pathfinding and node system such as determining line of sight, but it’s coming on really well!


The player now moves!

Having implemented the game’s first card, the Movement card, you can now use that to move the player around the board! Check it out!



The hardest part about this piece of work was actually getting those little green tiles to draw nicely! But it was certainly made a lot easier by Unity’s Shader Graph



This essentially let me click and drag code around and build shaders in HLSL (high level shader language) without ever writing a line of code! Which is great because HLSL can be very fiddley and I’ve not written any since university so being able use shaders without having to re-learn all that stuff will really help get things done faster.


Basic enemy behaviour

There is now a simple enemy in the game. It’s just placeholder art of course (along with the rest of the art). The goblins just dumbly move towards and attack the player when in an adjacent square to her. The attack has no visual representation at the moment but they are reducing the players hit points. They also take the water terrain into account and take the fastest route to the player avoiding each other along the way.



The player can fight back!

I’ve now implemented the game’s first attack card! This was quite fun to do. I wanted to be able to play they cards and choose the target in a single click so I created this nice animation where the card shrinks when playable and then the range for the attack is revealed, allowing you place the attack card onto the target square and execute the attack!


That’s it for me this week! Overall a successful week, I just need to add a few more card effects and concepts and then I will consider Alpha 0.01 of the game complete! I have my minimum viable product! It’s a very small game! But it’s technically playable :-D

86 views0 comments

Recent Posts

See All

Comments


Commenting has been turned off.

ABOUT DOUBLE ONE

Hello! Thanks for visiting. Right now Double One is just a lone developer. Me. Who has thrown their lot in at work to make their own way into the world as an indie game developer. I've got an idea, some concept art, and a basic prototype of a thing I think is going to be fun. So watch this space and wish me luck!

- Rob -

  • Black Facebook Icon
  • Black Twitter Icon
  • Black Instagram Icon
bottom of page