Answer the question
In order to leave comments, you need to log in
Where can I find sources for 5v5 fights in a 2D game for unity3d or another engine?
Hello everyone
How to make a 5v5 unit fight in a 2D game - like in the afk arena or idle heroes?
I want to make a game similar to dota underlords or auto chess, but with my own characters
. There you place the heroes in positions and the artificial intelligence starts a fight against another artificial intelligence. And you look at this beauty and decide what to change in battle.
Maybe there are already examples with source codes for studying?
Answer the question
In order to leave comments, you need to log in
And what about the source of the fights? You need to study game design and AI creation.
You start with game design. You write the main idea of the game: what, how what it consists of and what it affects. Just in a notepad.
Next is architecture. You determine what entities are in the game, how they are interconnected, how best to implement them. At least there is already an interface, arena, units, weapons.
You write the basic logic of objects. Those. objects must fall to the floor, arrows and bullets must fly, collide with objects, etc.
You write the basic logic of the units. those. HP, movement, attack, defense, ranged attack, death, animation control, etc. after writing, the unit must execute the commands given to it, run where you specify, shoot, beat, die ... It is possible without animations, purely on cubes.
You write tactics - the logic of the battle. those. the choice of the enemy to attack (random or subject to some logic), the choice of action (stand, shoot, run, run away, etc. again, both random and logical actions). With the simplest implementation, each unit selects a random enemy and rushes to kill him, or shoots at him until he dies.
For good, also customization, i.e. a unit can be with a sword and shield, or maybe with an ax, in armor or without, all this affects the attack / defense / movement speed / the presence of special abilities, and therefore the choice of tactics.
It will also be useful to add a reaction, i.e. if a unit is attacked, he must figure out which is better, continue to beat the one he hit, or switch to the one who offended.
This all needs to be written by yourself although of course some things can be taken from examples, such as animation control or physics. Why on your own? And because otherwise you won’t be able to write tactics and the rest of the logic, you just won’t understand what comes from. All combat logic is written based on the parameters of the units and how these parameters affect each other.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question