Schrijver
| physics of a jump
|
ARTRAG msx master Berichten: 1538 | Geplaatst: 02 Mei 2008, 18:32   |
In many platforms jumps, falls and generally speaking kinematics and dynamics are very unrealistic...
The few lines above are just to show that having good looking and realistic jumps is easy and does not need CPU load
(I used basic for the sake of clearness but the code is aimed to ASM and C coders)
10 screen 5,2:color 15,1,5:cls
20 for x=0 to 255 step 8:line(x,0)-(x,192),4:next
30 for y=0 to 191 step 8:line(0,y)-(255,y),4:next
40 sprite$(0)=string$(32,255)
50 X = 0 : DX = 2
60 Y = 96: DY =-4*256: DDY=64
70 pset (X,Y),15
80 put sprite 0,(X,Y),15,0
90 Y = Y + DY/256 : X = X + DX
100 DY=DY+DDY
110 a$=input$(1):if Y<192 goto 70
|
|
AuroraMSX
 msx master Berichten: 1214 | Geplaatst: 02 Mei 2008, 18:46   |
A parabolic function: very good! 
For some obscure reasons, I often see SIN tables popping up in conversations like these
[edit: otoh, who needs realistic jumps. There are just too many platform games in which you can for, example, turn around in mid-air  ] |
|
ARTRAG msx master Berichten: 1538 | Geplaatst: 02 Mei 2008, 18:57   |
well, you can continue to turn around in mid-air and jump/fall according to a parabolic function
 |
|
dvik msx master Berichten: 1286 | Geplaatst: 02 Mei 2008, 19:02   |
I think some games doesn't use newtons laws on purpose. In many games I think the designer actually wants unreal physics. But yeah, setting up a rigid body model for the character and apply real force (gravity in ARTRAGs example) is not that hard so there are no excuses to not do it.
|
|
pitpan msx master Berichten: 1300 | Geplaatst: 02 Mei 2008, 19:42   |
It's a designer's choice. A parabolic function is what happens in the real world when considering jumps, fallings or even cannon balls. But you can imitate a similar behaviour with a sin or cos table. Or use fixed table jumps or linear approaches. Everything works fine if you like it!
Consider one of the most unrealistic jumps ever: Maze of Galious. But it is cool, isn't it?  |
|
dvik msx master Berichten: 1286 | Geplaatst: 02 Mei 2008, 19:54   |
Quote:
| But it is cool, isn't it
|
It is, and my point was actually that some times (actually more often than not in old school games) I think the unrealistic jumps are a desired feature, not lack of knowledge in physics. Using tables are good instead of doing the actual calculations real time. But if a natural behavior is desired, I think its good for developers to know that a sine curve is not correct. |
|
Edwin msx professional Berichten: 584 | Geplaatst: 02 Mei 2008, 20:09   |
The big advantage of parabolic jumps (apart from looking natural) is that you can easily implement variable jump heights and other effects that throw the player around. I used this exact method in MJTT. (And RNFF, since the base code came from there)
|
|
AuroraMSX
 msx master Berichten: 1214 | Geplaatst: 02 Mei 2008, 20:15   |
Quote:
| well, you can continue to turn around in mid-air and jump/fall according to a parabolic function

|
Yeah well, I meant: reverse direction - go back to where you jumped from |
|
ARTRAG msx master Berichten: 1538 | Geplaatst: 02 Mei 2008, 20:23   |
yes, like in la mulana
|
|
ARTRAG msx master Berichten: 1538 | Geplaatst: 02 Mei 2008, 20:28   |
Quote:
| The big advantage of parabolic jumps (apart from looking natural) is that you can easily implement variable jump heights and other effects that throw the player around. I used this exact method in MJTT. (And RNFF, since the base code came from there)
|
I fully agree, variable height and length can be achieved by just changing the initial speed
(no tables! just change a parameter!!!)
eg you can jump differently accordingly to the time you press the jump button
and you can also have a realistic look of the trajectory |
|
manuel msx guru Berichten: 3274 | Geplaatst: 04 Mei 2008, 13:02   |
Fully agree: parabolic is so simple, it would be crazy to use sine tables or something similar. MoG is still fairly realistic, I think. You can only change jumping direction if you actually hit a wall.
Note that IMHO, MoG has the best player character controllability I've ever seen in an MSX game  SMOOTH. FAST. PRECISE. Yes, you want that. |
|
wolf_
 msx legend Berichten: 4526 | Geplaatst: 04 Mei 2008, 13:25   |
Manic Miner has the most frightening jump!
|
|
Samor msx professional Berichten: 838 | Geplaatst: 04 Mei 2008, 14:49   |
..not to mention the games where you can't jump at all..
either way, in many cases a game wouldn't be fun if it had realistic jumping... depends on the game, of course.
...are there msx games with double jumping (jumping again mid-air; talking about realism  ) btw? Most of the more recent platform games have such a thing, but I don't think I've seen it often, if at all, on MSX.
|
|
Maggoo msx professional Berichten: 570 | Geplaatst: 04 Mei 2008, 15:12   |
IMO the parabole is the most straighforward way to implement a jump, and usually has a better "feel" than the ones using a table (be it SIN or something else). One important thing that manuel pointed out is the ability to control the character while jumping. I personally prefer when some controls are permitted vs something like say Vampire Killer.
BTW, I'd be curious to hear how people feel about the controls in VScreen (well in the Vscren demo anyway). It uses a parabole with an initial speed. It goes something like this (simplified):
gravity=1
Jump_speed=-6
while (jumping)
y=y+Jump_speed
if Jump_speed<8 then Jump_speed=Jump_speed+gravity
If obstacleup() or obstcledown() then jump_speed = 0:exit
wend
Also I usually like when there is some "inertia" in the speed of the character. I mean that when you go right the x speed doesnt go from 0 to 2 directly but goes 0,1,1,2,2.... then when you turn left it goes 2,1,0,-1,-2.... giving the impression that the main character "slides" a little bit. It's pretty much how controls work in SMB I think.
Can't remember if VScreen had a high jump (might have when presing up+space instead of just space), I'd have to check the code again  Mkid did but the controls sucked ! |
|
DemonSeed msx professional Berichten: 848 | Geplaatst: 04 Mei 2008, 15:13   |
Personally I always disliked triangular jumping curves.
Just looks like S%#$.
Quote:
| ...are there msx games with double jumping (jumping again mid-air; talking about realism  ) btw?
|
Fantasm Soldier Valis has it. |
|
|
|
|