TASVideos

Tool-assisted console game movies
When human skills are just not enough

Umihara Kawase Physics

work in progress


First we will define some variables and provide the memory location the game uses to reference them.

variable name memory location description
x speed 7e0408,2s positive is moving to the right
y speed 7e040a,2s positive is falling
x pos 7e0404,2u the farther to the right the higher
y pos 7e0406,2u the lower the higher
str len 7e0604,1s the amount of line out, possible to make negative somehow
str stretch 7e0602,1u the length of the line stretched
x hook 7e0500,2u x location of tip of hook (in pixels)
y hook 7e0502,2u
x dim(pixels) 7e040c,2u x dim / 64
y dim(pixels) 7e040e,2u

Note this is not the actual order things are evaluated in

Movement

Every frame:
  • x dim = x dim + x speed
  • y dim = y dim + y speed
  • if hit wall x speed = 0
  • if hit floor/ceiling y speed = 0

Gravity

  • y speed = y speed + 18

Speed limits

  • if any dimensions speed > 384 then that dimensions speed = 384

Horizontal Control

  • note horizontal control will not exceed a speed of 96
  • if on ground and pressing left/right then
    • if moving x speed += 8
    • else x speed += 16
  • if in air and pressing left/right then speed += 4

Vertical Control

  • if just jumped y speed = -256
  • if just walked off a cliff y speed = 80

Friction

  • if in air x speed -= 1 (once every 4 frames)
  • if on ground x speed -= 8 (unless walking under 96)
  • if on ground and crouching x speed -= 16 (instead of 8)

Rope

  • rope travels at 4 pixels per second
  • returns at 8 pixels per second
  • max rope length = ~104, at this length it will begin to return
  • min rope length = unknown (possible to get negative using sea horse in f36)
  • breaks when a certain force or length is reached

Rope control

  • After holding down (and not left/right) for about 10 frames rope will suck in at 2 per second
  • After holding up (and not left/right) for about 10 frames rope will release at 2 per second (todo double check)
  • Cannot pull in rope if force is too strong (unknown exact value / formula)

Rope forces

  • if str stretch > str len then do nothing
  • else a realistic forumla is used, exact formula not known but it is something like this:
  • xspeed += sin(angle) * (str stretch - str len) * 2
  • yspeed += cos(angle) * (str stretch - str len) * 2
  • max acceleration (due to rope) = 60
  • todo be more accurate, I forget what the number 72 has to do with this

Miscellaneous

  • if near ladder / exit door and press up/down then x speed = 56 in that direction
  • if get off ladder then x speed = 64
  • the fish hook is a solid object and has length, it is what causes you to move away from the wall when bouncing up and down

TODO

down, clip, lag

RSS
UmiharaKawasePhysics last edited by flagitious on 2006-09-10 15:36:06
Page info and history | Latest diff | List referrers