I need time to both build game and keep track of that. I have just finished to sing a song to my sons: a "ninna nanna", the italian lullaby.
We have 15 issues in my Gitlab CE. 2 of that closed. Just the name of the game and the topic. Great job! :D
Other 13 issues are a brain storming to how the game will be.
Nothing of special. We wrote in these issues all ideas, without brakes, without problems: just all ideas. Too much ideas. A flood of ideas that breaks against the wall of reality. But it was time for dream, not for reality.
Spying a lot of games, I noticed that almost all of them have a battle map.
See "Clash Royal". Clash Royal has a battle map of 20x30 squares. Time and space is quantized. A the time X all characters are inside a square, not in middle: the fluidity of movements is simply an illusion. The time and space quantized is a nice trick for the sync between clients and server.
It's a good point to start.
See Mistery of Fortune 2: exactly the same thing. A map. Squares. Characters inside squares.
Like Clash Royal every character has a behavior: the difference here is that before the battle you can modify the behavior of each warrior.
Art of conquest? The same.
So. Let's start to do the job. A map, some squares, characters and behaviors. Simply this. Then I see what I got.
I use pure javascript for now and my own library, built some years ago, for paint a canvas like a paper (rainPaper.js I call it).
Every square is an "item". An item can be anything: a tower, a lake, a character, a monster. Let's call some of theme "Goblin" and other "Tower". Every character is described in a way like that
It's a decorator pattern. An item without decorator is an item motionless.
A Goblin has as main behavior that he must go to towers. But if an enemy happens closer than 8 squares, then go to him.
If the enemy is equal or closer than 0 squares, then stop, and attack it. "go to", and "stop" simply modify the vector of speed. So it's not a behavior, but an intention. I'm thinking that now. I have to rename the decorators. I'll write an issue for that.
Done
The design works as expected. I have some perturbation but this trick is the right way
(see the blu goblin that attack the red goblinm but the other is too far so they go to towers).
Nice for a week of evening work.
Next I have seen what happens with a lot of warriors and a bigger map.
Here I've already done a fake animation between two step. So you can see some item in the middle of squares.
I 've realized how easy is to program a bowman:
Simply stop the character 20 squares before an enemy and attack him.
Nice :)
Yeah. It's not all gold. I have a lot a problems like concurrency of same positions, behaviors loop and so on... But the begin is cheering.