# Fixed movement and Rotate.

Hi,

I seem to be having a problem with fixed movement and rotate. I’ll try to articulate the problem the best I can.

I am making a WRG style miniatures game. I want the unit to rotate 360 points. I also want it or a group to be able to recoil a fixed distance…or to be able to move directly forward, left or right 1 point with the press of a key (CTL F, CTL L, CTL R).

When I make small turns, the unit will only go forward to the top of the screen. When I make square turns (90 180 270) the unit moves correctly.

I am wondering if this is a problem with rounding ff coordinates (limitation) or if this is a bug. The movement performs much better when I use larger numbers. For instance. If I set move to 30 points forward, it seem to move better but not necessarily in the exact direction indicated.

Thanks for the help in advance,

John

On May 27, 2009, at 7:38 AM, jacar wrote:

That would seem to indicate that the distance moved is part of the
problem.

With a very short movement, there isn’t really a lot that can be done
as far as moving the unit while still having it retain integer
coordinates.

To make a quick picture, look at the following:

±–±–±–+
| a | b | c |
±–±–±–+
| | X | |
±–±–±–+

With what is fundamentally a square grid, the only movement
possibilities for a 1 unit move generally upward from “X” are “a”, “b”
or “c”. So, if you have a counter that is rotated 5Â°, and it moves
one unit, it will have to go to “b”, and not to “c”. You would start
getting movement to “c” once the angle gets big enough. But
effectively, you can only have 8 different directions for a 1 step move.

I would have thought that moves of around 30 or so would give you a
lot better resolution, down to around 2 degrees. (Ï€ x 30 x 2 ~ 180)

Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

That’s kind of what i was thinking.

The larger movement does work pretty well. However, it is noticeably off though. So for stuff like recoiling/retreating, it will work well enough. All other movement will have to be free-form I suppose.

Thus spake “jacar”:

If it doesn’t work properly, please file a bug report:

sourceforge.net/tracker/?group_ … tid=594234

J.

Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thanks for the link. I’ve posted it as a bug. We shall see what happens.