Posts: 4
Joined: 7/13/2012
Hello, I am currently involved in my current project called "Year of the comet" you can find more details on my profile.
The issue here is that myself and 2 other programmers have been working tirelessly at trying to create a turn-based mechanic for which the armies move on. Not only that, but we are also trying to get the movement down aswell. Suggestiongs, help, and are appreciated. Also, I'm not afraid to completely breakdown and restructure my engine (it's sloppy as it is)
We are using GML and are open to extensions if need be so that we can progress further in the game.
Many thanks!
Posts: 17
Joined: 2/21/2010
Do you mean you are trying to come up with a gameplay mechanic that allows for a turn based game without grid motion, or that you are having trouble implementing an idea you guys have already?
If the former, the first thing that comes to my mind is the Worms series. You essentially have direct control over a member of your army for a limited amount of time, and can move and attack in that period. Or, you could replace grid based motion with a radius the characters can move in.
If you have an idea already but just need help implenting it, more info is needed as to what exactly you want to accomplish.
Posts: 4
Joined: 7/13/2012
It's essentially like Hearts of Iron.
Each army is given 1 move per turn to move to any adjacent territory. At the end of that phase, the player is given the opportunity to end the turn.
Posts: 17
Joined: 2/21/2010
I see, so you're having trouble determining which territories are adjacent?
Posts: 4
Joined: 7/13/2012
I actually resolved that, I'm using an array to handle that.
Now I need some way to get my army to interpret what region it's currently in. Once that's done, I can proceed to let the army read off the array and highlight adjacent regions when selected.
Posts: 17
Joined: 2/21/2010
Is each region an object? If so just set a variable in each army to the regions id, and then update when needed.
If each region is not an object, you could probably assign each a unique I'd and use that anyway. The specifics of how to do that really depend on what it is though.
Posts: 4
Joined: 7/13/2012
each region is indeed being treated as an object. The only problem though is that there is only once object being used for armies, and there are several on the board. So I need to figure out a way that would allow me to place armies in the room editor, but they would be able to figure out what region they were placed in.
Posts: 17
Joined: 2/21/2010
Only two ways I can think of:
1) Use the creation code of the room or the army object in the room to set the x/y coordinate of the country each army starts in. Then use instance_position to fill up the an array (or ds_list or something) that defines the country each army is in.
2) Use the creation code of the room or the army object in the room to directly set the id of the country each army is in.
Neither of these is ideal, as it would be impossible to just look at the world map in the editor and know where the armies are. If you really don't want to use objects for each individual army though, I don't think you have much choice.