I set "adjust speed with scaling" to True for a character, and it works. But at a scaling of 65%, he isn't actually moved between two particular frames, so he just stays in place and shuffles his feet one frame long. At 50% scaling, everything looks smooth.
This happens in a game where almost nothing happens yet. I have a single walkable area that has "continuous scaling" set to True and uses 50 and 65 as min/max values. Resolution is 800x600.
Is this a known problem, or did I miss something to prevent this?
My guess is that this may easily be result of rounding error. Many things in AGS are done with integer math and scaling involves division operations which may (will) produce such mistakes.
Sort of, the offending piece of code was this:
- ac.cpp , "int wantMoveNow" function -
// scaling 60-80%, move 75% speed
if (charextra[chnum].zoom >= 60) {
if ((chi->walkwaitcounter % 4) >= 1)
return 1;
}
What I did to lessen the issue was changing it like this:
// scaling 60-80%, move 75% speed
if (charextra[chnum].zoom >= 60) {
if ((chi->walkwaitcounter % 4) >= 1)
return -1;
else if (charextra[chnum].xwas != INVALID_X) {
// move the second half of the movement to make it smoother
chi->x = charextra[chnum].xwas;
chi->y = charextra[chnum].ywas;
charextra[chnum].xwas = INVALID_X;
}
}
Hope it helps.
- Alan
Come on, how that may help the guy? :) Unless he is going to hack the engine... or you have that fixed in your own version?
Thank you, but what do I do with this? I have no ac.cpp or at least I don't know where.
Right, just use the draconian version then: http://www.adventuregamestudio.co.uk/forums/index.php?topic=44502.0
Can't blame a man for trying to get people to put their hands on the source, heh :P
- Alan
Thank you! Works perfectly :)