Navigate InfoSuite
Hosted At
Link to Duke4
Advanced FX - Water - B2 : Waves

Waves

The wave effect causes a sector floor's height to oscillate. A wave sector with only four walls will attach one of its walls to an adjacent sector, which allows for the simulation of a smooth travelling wave.



Free-Floating Wave

This type of wave does not attach itself to an adjacent sector. It can also be used with multiple waves to create a very rough travelling wave effect.


Create several connected wave sectors. In order to define these wave sectors as free-floating, they must have greater or less than four walls. As in the image, simply insert an extra vertex in each wave sector to artificially increase the number of walls without changing the rectangular shape of the wave sectors (this trick was used in _SE.MAP that comes with the original game). Tag each of the wave sectors [0,1]. Raise each wave individually and texture them with the water texture (or whatever texture you prefer). Now lower all of the wave sector floors a few units below the surrounding floor. The 'first walls' can be ignored when creating free-floating waves, because they have no effect. Add the following sprites to each wave sector: S[PhaseOffset,29] (Speed[0,Amplitude]). The Speed is optional, but recommended. PhaseOffset determines the point in the wave's oscillation cycle at which the wave will begin (basically it determines the wave's initial height), and can be any value from 0-2047. Using incremental PhaseOffset values creates the necessary offset between waves for a travelling wave effect. Amplitude is the highest/lowest point the wave can reach, and can be any value from 0-32767 (low values are recommended). The Amplitude values can be either constant or incremental, for a calm or turbulent wave effect respectively.

MISSING IMAGE!




Travelling Wave

This type of wave attaches one of its walls to an adjacent sector, and can be used with multiple waves to create a smooth travelling wave effect.


Create several connected wave sectors. All of these wave sectors except the first must be four-sided. As in the image, insert one extra vertex in the first wave sector to define it as a free-floating wave sector. It will act as a 'buffer' sector to separate and prevent the wave effect from attaching itself to the surrounding floor (which looks very unrealistic). Tag each of the wave sectors [0,1]. Raise each wave individually and texture them with the water texture (or whatever texture you prefer). Now lower all of the wave sector floors a few units below the surrounding floor. Assign each wave sector's 'first wall' (with Alt + F, shown as blue in the image) on the same relative side (in the image below, each sector's right wall is set as the first wall, the 'buffer' sector's first wall is not shown since it has no effect). The first wall is the axis for a sector's slope, but strangely enough the wall opposite the first wall will attach itself to the adjacent sector. Add the following sprites to each wave sector: S[PhaseOffset,29] (Speed[0,Amplitude]). The Speed is optional, but recommended. PhaseOffset determines the point in the wave's oscillation cycle at which the wave will begin (basically it determines the wave's initial height), and can be any value from 0-2047. Using incremental PhaseOffset values creates the necessary offset between waves for a travelling wave effect. Amplitude is the highest/lowest point the wave can reach, and can be any value from 0-32767 (low values are recommended). The Amplitude values can be either constant or incremental, for a calm or turbulent wave effect respectively.

MISSING IMAGE!


Note: You can also make the 'buffer' wave sector much thinner than the others so it will be less noticeable.




Notes:

  • The height of the S determines the sector floor's centered height, so just leave it attached to the floor and adjust the floor's height instead.
  • It is not mandatory to create multiple free-floating wave sectors. You can use just one.
  • Waves can be submergible, but the effect will not be seen from underwater.


Return to top