View Full Version : Movement Limit like Turn Based Game

04-24-2011, 10:32 AM
Hi All.

I see that there is a entity movement control, which causes entity to go to clicked mouse position. Also handles if the position is reachable or not.

First of all how can I limit movement to a number grid. There may be different movement limits for different entitys.

As you can guess, I'm trying to create a turn based strategy game like warlords or heroes. But in isometric world I guess I should use some trick for x and y coordinates. And also I guess I have to set grid sizes like(16*16) or (32*32). So in every 32x movement limit decreases 1 until reaches to 0.

Can you give me a little clue. Where do I have to start ? Can I use engine's movement algorithm with a little edit for turn based movement or do I have to create A* algorithm for isometric turn based game?

04-25-2011, 01:38 AM
Hmm. Well, if I was doing a strategy game such as say, chess, I'd probably break it up like this:

1. Be able to convert a clicked position to an X/Y position in the grid and vice/versa
2. Compute piece movement/rules using pure grid data (could be lua, but I'd prefer to do all the work in a C++ side component probably..)
3. Use the grid data to draw something visually pleasing on the screen to represent it. After it's working, maybe add animation of the pieces moving from position to position.

It really depends on the game, but I'd probably ditch the existing a*/movement/physics system completely, it's just going to confuse and slow you down most likely.