Hi everyone, I'm developing a turn based rpg game (for hobby), and I'm facing the problem of how to set the team member's positioning (coordinates) in the battle, according to the count of members on that team.
Examples:
If the team has one member, then it will be put on position "B".
If the team has two members, the first go to the position "A" and the second goes to "C".
and so on, up to six members.
These are the position configurations, according to the amount of team members:
1 member
2 members
3 members
4 members
5 members
6 members
For now, I'm saving all six possibilites in arrays, and reading it according to the team count.
This is quite ugly, since it is very hardcoded and might not be well applied to all maps of the game.
Also I thought on another solution, marking the game map with all those position configurations.
But there is another problem, this way all game maps need to be marked and this job can be quite annoying.
Does anybody know a prettier solution for this problem?
Waiting for suggestions
Turn Based Battle - Positioning the team
- almondega
- Halfling
- Posts: 67
- Joined: Mon Jun 23, 2008 7:34 pm
- Location: Brazil
- Klaim
- Old One
- Posts: 2565
- Joined: Sun Sep 11, 2005 1:04 am
- Location: Paris, France
- x 56
- Contact:
Re: Turn Based Battle - Positioning the team
There are placement algorithms that you can use, with automatic adjustments depending on the context.
Basically, just use algorithm that draw shapes on your grid (like cross, circles, etc).
Then, make the player chose which "shape" should take the team.
Look at Baldur's Gate way of handling it.
Basically, just use algorithm that draw shapes on your grid (like cross, circles, etc).
Then, make the player chose which "shape" should take the team.
Look at Baldur's Gate way of handling it.