Underwater physics

Gazimaluke

Member
I would like to have a tile type that slows down movement. Jumping in water and still moving as fast as on ground just doesn't feel great. I don't think it needs to be major slowdown just noticeable.
 

WolfMerrik

New member
Gazimaluke said:
I would like to have a tile type that slows down movement. Jumping in water and still moving as fast as on ground just doesn't feel great. I don't think it needs to be major slowdown just noticeable.

Well, you could do this a few different ways, What I would do is, make it compares the tile type of the water if it is this tile, branch to what is basically a copy of the original gravity calculation script (to recalculate speed/etc) .
You could make new constants, like "GRAVITY_LO_WATER", "GRAVITY_HI_WATER", "MAX_VSPEED_WATER". and with using these new augmented constants, you should get a different affect.
 

WolfMerrik

New member
Would you want this to be a player only affect, or something that affects monsters too?

If you want this to be a status, You could look at changing an object status to be in the water.

Looking at ObjectBytesRasm.asm

Code:
	Object_status .dsb 12 ; required
			;;;; bits 765 = activation/deactivation
			;;;; bit 3 = reserved for edge/random spawning, but waiting for timer
			;;;; bit 0 = "hurt and invincible" (used for recoil direction)
			;;;; bit 1 = "post-invincible hurt" (still invincible but has regained input control)

Now, we see what everything but 4 and 2 is used for... I have not done any digging, but I would assume that either of these MAY be free.
We could make a tile collision with this tile type flip one of those bits to the water state, and then compare that when calculating gravity and horizontal movement speed.

I am not sure what these bits may be used for though...

There is also something in there which I have not seen:

Code:
	Object_speed_variant	.dsb 12

I would be curious to see if this can be messed around with to make this effect work
 

WolfMerrik

New member
EDIT: In searching for "Object_speed_variant" - it seems to be only used in THAT file.... so I would say it is pretty safe to use this as a flag (as well as possibly other speed types)
 

Gazimaluke

Member
WolfMerrik said:
EDIT: In searching for "Object_speed_variant" - it seems to be only used in THAT file.... so I would say it is pretty safe to use this as a flag (as well as possibly other speed types)

I will try it out when I get time. It would be a great effect.
 
Top Bottom