Concern about new update regarding new wave machanic API

  • Hi!


    With upcoming update very close and with "The next update will definitely introduce true ocean waves (including new boat behaviour of course)" i wonder if API is ready to handle the following scenario:

    I use a plugin to make a boat to follow automatic route (Ferry Travel). This internally is handled by moving (teleport) the boat along some predefined route (points defined by x,z coordinate). For y axis (water level) is more ore less around 90 (depend on boat type - rowboat, sailboat, have different values).


    Now questions:

    - With new wave mechanic where water in a some point x,z will be dynamic (other than static 90) how i will determine correct height via API to know where to teleport a boat in a new point at surface of water?


    So wee need some sort of API to can calculate real height of water (with wave corrections) in some point x,z.

    Moreover this is not enough, because different boat size sink in water different depth (rowboat versus sailboat) so we need a real API function to obtain "correct" Z value so vehicle (rowboat,sailboat,etc.) can be teleported on valid,"naturally" point x,z at surface of water.


    Now i move vehicle with some code like:



    Current movement of rowboat is on flat water level. So first align vehicle to target and latter move. But with real wave ... i see this like more steps:

    - First align direction of vehicle to desired direction

    - Second move vehicle in new location

    - Last step normalize rotation (keeping aligned direction) to naturally fit current wave (this i think need to be addressed via API too!)


    red51 i hope you will take in account this API additions (if is not yet some method who can achieve this scope) for new release.


    Thx in advance!

  • Hey, that's a good point! Currently the waves are not taken into account, so setPosition() would still work, but it would cause the boat to temporarily hover above water or submerge. The API will provide a method to calculate the wave height at a specific location, but this will only help if you call vehicle.setPosition() very often (providing the final water position which also takes the waves into account)...


    We could change the setPosition() method to take waves into account automatically, but I'm not sure if that would be a good idea... right now this method allows you to set an arbitrary position (you can even set a position on land or in the air). Maybe a new "setPositionOnWater()" method would be better in this case? :thinking:


    Or maybe we change setPosition() to teleport a vehicle instantly, and add a new "moveTo()" method (which optionally takes waves into account)? This could be a cleaner solution... IMO the current behaviour isn't very intuitive anyway (I'd expect a vehicle to move to a new position instantly when calling setPosition())... the "moveTo" method could then get a few parameters, e.g. to determine if the boat should automatically adapt to waves or if a player should still be able to take control over the boat. Maybe that would be the best solution? ^^

  • Hey, that's a good point! Currently the waves are not taken into account, so setPosition() would still work, but it would cause the boat to temporarily hover above water or submerge. The API will provide a method to calculate the wave height at a specific location, but this will only help if you call vehicle.setPosition() very often (providing the final water position which also takes the waves into account)...


    We could change the setPosition() method to take waves into account automatically, but I'm not sure if that would be a good idea... right now this method allows you to set an arbitrary position (you can even set a position on land or in the air). Maybe a new "setPositionOnWater()" method would be better in this case? :thinking:


    Or maybe we change setPosition() to teleport a vehicle instantly, and add a new "moveTo()" method (which optionally takes waves into account)? This could be a cleaner solution... IMO the current behaviour isn't very intuitive anyway (I'd expect a vehicle to move to a new position instantly when calling setPosition())... the "moveTo" method could then get a few parameters, e.g. to determine if the boat should automatically adapt to waves or if a player should still be able to take control over the boat. Maybe that would be the best solution? ^^


    I like vehicle.setPositionOnWater(x,z) if that take in account wave position.

    But vehicle.moveOnWaterTo(x,z,adaptWave==true) with additional parameters don't sound bad. It can work for example to do last step to "normalize" position of boat with wave.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!