Let's fix that stuttery walk when chars are at 60-80% zoom

Started by Alan v.Drake, Sat 10/09/2011 11:08:50

Previous topic - Next topic

Alan v.Drake

That thing was REALLY bugging me, having characters walking around like they got a limping leg or something was really frustrating  (they moved 3 paces then instead of going forward the character would just stand in the same place showing the next animation frame, rinse repeat )

Well, if you too had the same problem, this might be the answer to your prayers.


ac.cpp ( line 6370 )
Code: ags

  // 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;
	}
  }


I do not fully understand what I have done, since I'm not privy to the inner workings of AGS I merely bruteforced the code until I got a reasonable result. It gets the job done, for me at least.

If you want to give it a go this is the compiled acwin.exe:
http://www.filesonic.com/file/1925183084/acwinzoomfriendly.rar


- Alan

David Ostman

This has been bugging me to no end, and it's on my list to fix, so I guess I can tick that one off and save some well-needed time. Thanks, greatly appreciated :)

hedgefield

Sounds great, I look forward to seeing it in the next build!

SMF spam blocked by CleanTalk