Ocean

The mud client can display an ocean. Oceans are designed to be cheap yet look realistic from and distance and close up. The following is sea shore close up:

files/oceanclose2.jpg

The following is the ocean from the sky:

files/oceandistance.jpg

Oceans can be built into the terrain so you can build the terrain and ocean in one model (terrain building). For example:

files/seamilkshape.jpg

A second larger terrain can be placed outside of the terrain to give the appearance of the ocean going off to the horizon. For example in milkshape:

files/sea.jpg

In this distance it can look at follows:

files/seaouter.jpg

In the mud client package this outer ocean is in the file:

c:\program files\mudclient\client\models\sea.ms3d

When a player is close to the sea shore a single wave can be displayed rolling towards the shore. For example:

The ocean is made up of quads that contains surf and quads that are further out to sea.

files/seaquads.jpg

The red dots indicate quads that are close to the shore and will have surf while those with green are those that just connect up the surf quads. The following is a shot looking down from the sky:

files/surfmesh2.jpg

Again the surf quads are red and are square. The following diagram represents a surf quad which is a single red dot in the picture above. The mud client will convert a surf quad like in the picture above into a set of quads that make up a single rolling wave coming into the shore:

files/surfdiag.jpg

The way the mud client knows what is a surf quad (red dot) as opposed to all other quads is through the 'y' value of the quad. If for example the y value of the quad is '8.920000' and the surf has 'surfy' as '8.920000' then that quad is considered a surf quad and the mud client will replace it with 5 quads like in the diagram above. Then when a player moves close to the shore the wave will start to roll. Also in order that the mud client check that a freeform has surf quads the freeforms 'surfbyy' attribute should be set to true.

The parameters that specify how the wave rolls in specified in surfs. In surfs a SURF element has a 'surfy' attribute and if it matches the y value in the freeform then the SURF parameters will apply to that quad. For example you can specify the height of the wave ('waveheight'), the speed of the wave ('wavetimes'), how wide the wave is ('wavewidth') and how close the wave should break to the shore ('shorewidth'). Also you can specify how close a player needs to be to the wave before the quads wave starts rolling ('distancewavesenabled').

There are unlimited surfs elements therefore any number of different type of surfs can be used in the mud client.

Specifying sound
In Shattered World the sound of surf is specified by the mud eg {rpx332.0,300.0,ssurf} using set_sound("surf"); in swlpc. You can also set the sound of surf by setting the 'sound' attribute in position and placing many in a parentmaps staggeredposition.