Jump to content
  • Advertisement
Sign in to follow this  
ambershee

Turn based, Grid based movement - score cost in, or out of cells?

This topic is 2100 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello!

 

I have a wee design conundrum that I've given some thought. I believe I've come to my conclusion, however I'd like some opinions first before talking about what I have settled on :)

 

Consider a turn based strategy game where the player moves pieces on a grid, where each cell represent some kind of terrain. An obvious example of existing systems might include Civilization's combat mechanics. If each cell has an associated movement cost, and each unit a limited number of points per turn to expend on movement, when should you apply the cost of movement.

 

Should the cost of movement be tested as you enter the cell? - i.e. after completing some movement, the pending cell has cost 3 and you have 2 remaining movement, you cannot move into it as you have insufficient movement points. You could potentially move into a different neighbouring cell that costs less to move into however.

 

Alternatively should the cost be tested after you exit the cell? - i.e in the same situation, you are allowed to move into cell Y, but as you have insufficient movement points, you are unable to exit that cell this turn. In this situation, your movement is effectively complete.

 

 

Thoughts and opinions?

Share this post


Link to post
Share on other sites
Advertisement

Advance wars(game boy advance) had a similar system, movement cost was dependent on which cell a unit (tried to) enter,

additionally, units had movement type(walking, flying, tires, some kind of rough-terrain tyres/tank-movement,) and points to go with them,

movement over a road(-cell) was 1 for every unit, movement over grass was 1 for walking/flying and 2 for normal tires, mountains and i believe hills were only accessible to walking and flying units.

 

It worked well.

 

You can possibly allow a unit to enter a cell without enough having enough movement points but disallow that unit to take it's (combat-) action,

but it would confuse the player;

since you would have to both show how far a unit can move without attacking and how far a unit can move with attacking.

Share this post


Link to post
Share on other sites

Hello!

 

I have a wee design conundrum that I've given some thought. I believe I've come to my conclusion, however I'd like some opinions first before talking about what I have settled on smile.png

 

Consider a turn based strategy game where the player moves pieces on a grid, where each cell represent some kind of terrain. An obvious example of existing systems might include Civilization's combat mechanics. If each cell has an associated movement cost, and each unit a limited number of points per turn to expend on movement, when should you apply the cost of movement.

 

Should the cost of movement be tested as you enter the cell? - i.e. after completing some movement, the pending cell has cost 3 and you have 2 remaining movement, you cannot move into it as you have insufficient movement points. You could potentially move into a different neighbouring cell that costs less to move into however.

 

Alternatively should the cost be tested after you exit the cell? - i.e in the same situation, you are allowed to move into cell Y, but as you have insufficient movement points, you are unable to exit that cell this turn. In this situation, your movement is effectively complete.

 

 

Thoughts and opinions?

 

Excellent question ambershee. Applying the movement cost at entry makes more sense to me than using it as a cost to exit the square.

 

Calculating the movement cost at exit makes it more difficult for players to take advantage of terrain to keep their opponent's units out of range.

Share this post


Link to post
Share on other sites

I would go for cost of entry. This way you can take advantage of hills and such more (or as a disadvantage). If you mix tiles I think the experience of the terrain will be more "blend" since each tile will in effect be a form of average of all surrounding tiles. In that case there is little reason to have different tiles!

 

-> movement cost should be based on entry.

Share this post


Link to post
Share on other sites

AFTER

 

It's much nicer from UI point of view, you don't confuse the player (if I can't enter mountain it means I can't enter anything because I have run out of MP). Also most games use this system.

 

I think BEFORE makes more sense for tactical wargames, it might be worth considering it there (especially if you want some units that can never enter mounts or swamps).

Share this post


Link to post
Share on other sites

Thanks for the input. To divulge a few more details about my project, I'm operating on a hexagonal grid, and (melee) units will engage in combat automatically if they enter the same tile. My intention was for the game to be a bit less 'chess rigid' in terms of rules and to allow for combat behaviour that is a little more emergent and less predictable in nature. Combat nature will indeed play an important role in which costing technique I elect to use.

 

Units will still have fairly short movement ranges (perhaps three to five movement 'points'), and can be ordered to traverse a series of tiles. Combat occurs when two melee units occupy the same tile, and the nature of that combat will be dependent on the facing of those units; units may be moving directly towards one another*  resulting in a normal combat engagement with a defined win / loss condition (loss resulting in the losing unit being forced backwards to an appropriate tile and the victor remaining on that tile), however units moving past one another** will instead skirmish, lose one or more movement points in the resulting combat, and otherwise continue their movement if capable. This allows for weaker units to hinder the movement of stronger units, as well as otherwise faster, lighter units gaining the ability to harass and disassemble slower, heavier units. It also adds additional elements of unpredictability in the player decision making process, with the option of making slow and reliable progress, or taking the risk of being disrupted by the enemy and moving more quickly. This is a simplified example, as there are other orientations units can approach one another from with differing results; I want to make position and facing of units important, unlike games like Civilization / Advance Wars, where facing plays no role at all.

 

*Unit A enters from clock-face 12 moving to 6, unit B enters from clock-face 6 moving to 12.

**Unit A enters from clock face 2 moving to 10, unit B enters from clock-face 8 moving to 4.

 

Whether movement cost is taken into account before or after movement can potentially have a radical effect on the outcome of these combats, particularly when units skirmish. If the cost is on exiting a tile, skirmishing units could be forced into a normal combat engagement as they are unable to move further, and this could be used to determine a more punishing result (exhaustion leading to poorer combat performance). Alternatively, this could be tied up neatly by costing on entry, meaning units can always pass one another and bypassing the situation where units get stuck on the same tile.

 

Finally, I have also considered costing on both entry and exit. This is good for tiles that represent certain terrain types - for example it is more difficult to climb up a hill than it is to move down it, ergo it could cost 2 points to move onto the hill, but only 1 point to move down it. You'd obviously want to adjust how many movement points a unit has to reflect this key difference.

 

I'm currently leaning towards the third consideration, as it allows for the exhaustion rule to come into effect, and defines movement on a more tactical basis, which I find desirable. I'm worried this may appear overly complicated in conjunction with combat rules, but I don't think it's too difficult for players to pick up, and unlike games like Civilization, combat is the essence of this game, with much less emphasis on the long term strategy and development side of gameplay.

 

Thoughts?

Share this post


Link to post
Share on other sites


I want to make position and facing of units important
I advice against it. Facing works well in boardgames where you can simply and naturaly place a figure slightly different. In a computer game you need separate buttons for rotating, which complicates interface and legthen the turn.

 

Facing might be OK if you meant it like direction you face after you finished your turn, for overwatch fire.

Share this post


Link to post
Share on other sites

Test when moving into a cell... but test for, "Do you have any points left?", not "Do you have enough points?".

This allows the unit to move into a cell even when the unit doesn't have enough points, as long as the unit has some points so they can always move at least one tile, even through the worst of terrain (Obviously excluding terrain which that unit is never allowed to walk on, like water if a non-water unit).

In a situation where the mountains cost 5 movement points, and the unit only gets 4 points a turn, he should still be allowed to move one tile.
If the unit has 6 movement points, he should move the first tile (subtract 5 for stepping on mountains), be left with 1 point, and since he has "some" points, even if not enough, he should get to move to the second tile (subtract 5 points, leaving a remaining -4, snapped back to 0).

For travelling over mountainous terrain that costs 5, units with 1,2,3,4, or 5 movement points can only travel 1 tile. Units with 6,7,8,9, or 10 can travel 2 tiles, units with 11-15 can travel 3 tiles, and so on.
 

//Pseudocode:
if(unit.movement > 0 && unit.canWalkOn(tile.terrainType))
{
    unit.moveTo(tile)
    
    //Because different units have different costs for terrain, and because some units might be individually and 
    //temporarily (or permanently) buffed with lower costs for specific types, so store per-unit instance.
    //Obviously varies depending on your game design.
    unit.movement -= unit.costOfMovingToTerrain[tile.terrainType]
    
    //Bind to zero, if we went negative.
    if(unit.movement < 0) unit.movement = 0;
}
Edited by Servant of the Lord

Share this post


Link to post
Share on other sites

You could do both. Double the amount of movement points each unit gets and subtract the points for moving into and moving out of a block. Example: If you have a piece of rough terrain that costs 3 movement, then the unit will lose 3 moving into and 3 moving out of. This would only be useful if movement points can be used for something else. I think doing it this way would more closely represent movement since you aren't traversing the entire terrain unless you move into and then move out of. If you only one or the other then you haven't actually traversed the whole terrain segment, only part of it.

Share this post


Link to post
Share on other sites

As you might know in Civilization series, you can move to terrain even if you don't have enough movement points as long as its not zero. I think your first question is about if you will allow or not.

 

And for harrassment , it sounds good to punish a slow unit if wanders alone but what is the precaution for it? moving around with company of a fast unit?

 

Finally for "facing and position" , Civ does this to a certain extent by fortification and terrain type  as you know, doubt further micromanagement worths trouble.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!