Jump to content

Photo

Raft: Speed modifier


  • Please log in to reply
5 replies to this topic

#1 Mani Kanina

Mani Kanina

    Rabbits!

  • Members

Posted 10 June 2020 - 02:02 PM

There are two additions I would like to see for the standard raft item class going forwards in ZC, if at all possible.

The first is a speed modifier: Just have one of the currently unused fields for the raft class be a speed modifier, with a default value of 1.0, and taking floats. 0.5 would be half speed, 2.0 would be double the standard speed. Or just list the speed in it's flat value and let you customize that, either or is fine by me, it's a customization thing that I think would be nice.

Secondly I'd like a toggle for making link invulnerable while rafting.



#2 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 10 June 2020 - 07:06 PM

Changing the speed, I can likely do without too much nonsense. Why would you want Link to take damage, though?

 

Do you mean that Link should not be frozen during rafting, or that you just want him to be able to take damage?


  • Mani Kanina likes this

#3 Mani Kanina

Mani Kanina

    Rabbits!

  • Members

Posted 10 June 2020 - 07:24 PM

Do you mean that Link should not be frozen during rafting, or that you just want him to be able to take damage?

Just able to take damage. I only have a few brief ideas of how that would be used myself, but it seems like it would be an easy toggle to add to the item that would increase what people can do with it.

And with a higher speed raft it wouldn't be unfeasible to make some fireball dodging challenges with it, etc.

#4 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 11 June 2020 - 02:42 AM

This didn't actually take that long, nor was it particularly difficult. It does have some slight drawbacks, though.

 

For moving faster:

The max value is '5'. The formula for speed is '2^(n-1)'. This means that for a value of 5, you will move '2^4 == 16'; a full tile every frame. For a value of 3, you will move '2^2 == 4'; 4 pixels each frame.

 

For being still:

A value of 0 will stop all movement. This is useless if not being controlled by a script, as it would simply softlock the player, forcing F6. With a script, this could be used to allow the player to press a button to 'brake' the raft; perhaps to dodge obstacles. (Zoria is working on the toggling invincibility).

 

For moving slower:

The min value is '-8'. This does not use decimal, only integers. The formula for slow movement is '1 pixel per 2^(-n) frames'. This means that for a speed of '-1', you will move 1 pixel every '2^1 == 2' frames. For a speed of -3, you will move 1 pixel every '2^3 == 8' frames. For a speed of -8, the minimum, you will move 1 pixel every '2^8 == 256' frames; absurdly slow. Why would anyone want that slow? Who knows. I don't care, I'm just providing the options.

(The reason I made that the SLOWEST, is that to go any slower would require that I increase the max size of the timer.)

 

The reason that it works on powers of 2, is that if it did not, raft branches would simply stop working entirely. So, 3 pixels per frame, you just would never be able to turn the raft. And, you might just sail straight off a raft path at a corner, as well. So, that simply wasn't an option, without recoding rafting from scratch. Doing it with powers of 2, allows numerous speed options, and did not require much re-coding at all to accomplish.


  • Mani Kanina likes this

#5 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 11 June 2020 - 03:56 AM

I'll take care of the invincibility. Good to see that you are handling the other side of this, as I was going to do it tomorrow.


  • Mani Kanina likes this

#6 Mani Kanina

Mani Kanina

    Rabbits!

  • Members

Posted 11 June 2020 - 05:54 AM

This didn't actually take that long, nor was it particularly difficult. It does have some slight drawbacks, though.
 
The reason that it works on powers of 2, is that if it did not, raft branches would simply stop working entirely. So, 3 pixels per frame, you just would never be able to turn the raft. And, you might just sail straight off a raft path at a corner, as well. So, that simply wasn't an option, without recoding rafting from scratch. Doing it with powers of 2, allows numerous speed options, and did not require much re-coding at all to accomplish.

Nice! I guess this thread can be considered done and closed.

Thanks for taking the time.
  • Emily likes this


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users