The whole idea of this project was born from Pokémon itself, the damage types and their efectiveness and resistance has little to do with reality. Like... ¿Plants are strong against water? Water its literally number one cause of death in house plants. And so on...
So the noble idea was to make a game that helps you understanding better chemistry. But do not look like a educative game, so we did some kind of auto-chess/clash royale roguelike-grid Arena. It has many references but to be honest, not anything like it.
A short video of the entry, cinematic and gameplay for the very first mission of the game
The idea its pretty simple, you draw a card, that has a cost, and that summons a unit on the battlefield, that goes straight to the enemy.
Well, not allways, depends of the unit, some of them have different ways to move. Like look the the closest enemy. Or the weakest in the battlefield.
Then, there is the deck configurator. Where you can pick one hero and 60 cards.
The hero is allways a scientist, we have 3 to choose. Each hero has a basic attack, that may be AoE or Unitarget. They also have damage type to attack, for example Curie, deals radioactive damage.
Every hero has a ultimate, that gets charged with time, once its ready, a button on the screen appears to choose when and where use that skill.
For Curié and Darwin its an AoE buff for your units, but for Cajal its an AoE Damage stun for your enemies.
Similar to heroes are units, but they actually move and use ultimate on their own.
They are modular, very customizable, so they can have multiple attacks, ultimates and many different parameters. Then an AI decides what they can use in every case.
So they are kinda inteligent and autonomous, so you can command instead of micro-manage them
This project was a challenge in a lot of ways. I'm starting with the caos around the developement itself, the fact that make the game die before even born. I had to re-do the GDD at least 3 times completely, because of the changes made for the gameplay and the target audience.
It was going to be a PVP Online game for Mobile, one player vs another. No campaing. Just play, win coins and buy cards. Like Clash Royale.
Then the direction changed, and suddenly we were aiming to a game for VR and PC which of course, needed better graphics and different interactions, you know... Mobile and VR are completely different to manage one is buttons UI and the other one is touchy touchy 3D thingys.
Finally after two more twist not relevant enough to mention, we ended up with a single player roguelike version with progresion, campaing and story, aiming only for PC. Which again, mean more and more changes.
This project started in 2019 and ended up in 2024, but developement was on and off during that time so its not exactly a 5 years develop experience, but its quite hard to measure.
Animations
Animations was one of the main issues of the game. As you can see, we have different skeletons, but every unit, has the same states, so the ABP has to be the same code for everyone, but skeleton and animations are different.
Thats when ABP_Template came in handy. I made a common code with all the state machine detaills and animation status and exposed everything to variables.
So that way, i just had to create a child from the main ABP_Character_Template and change the variables.
It worked like a clock, a solid foundation makes big buildings, otherwise they start to collapse over themselves. (And i did not want to copy paste and maintain 20 up to 60 different ABPs)
It had some tricky states. Attacks and skills override the ABP, they are montage played OVER that state, so they are not in the state machine. Then we have states loopables, like idle, walk, and so on... but we have some transitions WITH loop, like victory and defeat, those had a boolean flag to enter play the first part of the animation and then enter in the loop state to keep the animation going. I would prefer to use some blend by enum node and forget about tree, but... well, life isn't perfect so i had to adapt.
Thats the easy part, just to make all the events and functions needed to keep everything under control. Speed up an animation to match the real time of the in-game colddown, notify the unit about the damage or the end of an animation, ... the usual.
And thats the part i was talking about before, one class, many skeletons, many animations. All the variables do not fit in one image but you get the idea. A map with status and animation, a variable with the skeleton, and so on.
Path finding
The idea was to have a board, with square tiles, to represent in an easy way, where the units are moving, and what range do they have. That was way more attractive than just use a landscape with free movement.
Everyone out there is using the Navigation System, with the sensor pawn, and that things... it is crap. Buggy, expensive and not enough flexible to be bend at your needs/will.
Which is a "Cartesian coordinate plane" you know, the X,Y coordinate from the math subject in school, were we draw weird curves and that. Well it actually has a use, i studied some math about it and some algorithms.
Our units are supposed to walk forward to the enemy, so... you do not really need an algorithm for that, just... y++ and go on.
But, i have 6 different AI, 2 of them are for the hero and generator, which are just "towers". But the other 4 has different ideas in mind.
Assasin: Goes for the enemy with less current HP
Berserker: Goes for the closest enemy
Basic: Just forward and stops if someone is close enough to be attacked
Unstoppable: The same as basic, but it does not stop, does not look for other people in the board, he ignores every other being in the board, its like a train.
There is many ways to find the "best" path from on point to another. And by so, there is many algorithms.
I ended up using two different algorithms, a basic chess like algoritm and a euclidian (green=>blue) for complex scenarios.
The second one, was the best, euclidian is the best way to avoid blocked cells and find the sortest path to the enemy hero, but it was expensive.
Why? Keep reading
I did not created a board with "empty" spaces, that would have been a waste of pointers and memory. So i only created squares where there should be squares.
As you can see al movement its 2D calculated by the grid and coordinates and based on if a cell its ocuppied by an ally, enemy or does not even exist
And finally, as you can create a bottle neck, units needs to be able to find a different way to reach destiny.
Otherwise they just got loop bugged behaind your own troops
The many different shapes, not only provided me with richest gameplay but also an issue again with the pathfinding.
So the answer was simple, use the simple algorithm first, if that fails or is too long, then use the complex one.
Performance was something i've been working forever since the begining and having 40+ units looking for a path every step they give was not an option.
This is why i only find path at start, or when they are about to move to an ocupied cell.
Multiplayer
So as i said, there was a multiplayer version of it. The whole game its coded to be a multiplayer game, when a player host a session and the other joins.
The whole thing its still coded to be multiplayer, just in case we finally open a different mode of pvp or something.
I made different designs, standalone server, self hosted server, ... all of them work, not much to mention here, just the same, but multiplayer.
Game Design
Of course, one of my dish signatures in any project i do its datatable modular system.
Every skill, buff, debuff, unit stat and detaill to custom any unit, spell, hero, generator, ... It's on a simple datatable which is managed in google sheets (for comfort) and then imported to the game.
It makes the balance task pretty easy, as you can change, measure, try and redo it all again without touching the code. Even if its myself the math guy and the developer, it is a healthy way to organice a project for the revision control system or potential new workers on the project.
Everything else
Well, a lot of classic code, nothing special worth to mention besides doing it. Just simple code. (If you want to play i still have a zip the .exe)
Card colection system to custom decks
AI to think what skill to use and what to do
Give orders to units
Main menu, expedition, hud, ui,...
Gameplay system for the unit, stats and skills, ...