• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Turn-based Movement

Status
Not open for further replies.
Level 9
Joined
Feb 17, 2009
Messages
291
Hello, I'm working on a Heroes of Might and Magic project right now (awesome game by the way), and I'm currently in a bind mentally for how to create movement for heroes on the world map and creatures on the battle screen.

So first, it's a turn based game of course. Your hero has a movement speed (how -far- they can move), and your hero's army creatures have their own speed values, too. This speed controls when they move in combat -and- how far they can move.

The problem is I can't think of a good way to replicate this system in a real time game. You can also move in any direction (unlike Heroes III, where it's generally 8 directions, and then combat is a hexboard) and you can end your turn at anywhere in between your starting location and your maximum distance.

I really have no idea how to start tracking this kind of thing or how to detect their movement in order to decrease it.

I will +rep anyone who's willing to contribute to my brainstorming, thanks for reading

~Clov
 
Level 5
Joined
Jul 25, 2008
Messages
126
Maybe make all units movement speed and 0 and then they have an ability that increases their movement speed for x amount of seconds, in which there "turn" would be over. For when they move perhaps mana could be a factor in that i.e. unit uses above mentioned spell for movement which drains all their mana and that unit will replenish it with mana replenish rate. The faster the rate the faster they can have their "turn" again.
 
Level 9
Joined
Feb 17, 2009
Messages
291
For a true "turn" effect, you'll probably want to count how many spaces a unit moves before disabling its movement.

For the battle itself, there's a little trick you can do to make units only move to the "grid" points - capture its X position, divide by 128, convert to integer, convert back to real, multiply by 128.

Edit: Oops forgot to include this one derp o_O

The only thing I'd say about this is that if I use grid tracking then it might limit how well they can move (I'm wanting to take advantage of the freedom to move outside the chess board style, but still keeping the speed values from the chess board style game)

Or maybe use blink ability and no movement

This seems like it'd be the easiest way, the only problem I forsee is that it'd only be good for flying units (Angels and dragons for instance) because they can ignore obstacles like other enemies, but land units such as a crusader need to be blocked physically by them.

I don't know if I could make them attack at the same time as blinking, either. Because in Heroes III you can move next to an enemy but that doesn't force you to attack him, you could just be blocking his movement or protecting one other. Maybe two blinks, an attack where he picks all units in 100 range and another where it's strictly for movement? That doesn't solve the first issue though..

Or simply use pause / unpause. I would probably use that mechanism.

Could you throw a few more details at me for some inspiration on this one?

--

Thanks all you guys for helping, I really appreciate it! Will try and rep everyone (if it lets me).
 
Status
Not open for further replies.
Top