Forum

> > Stranded II > General > Waves?
Forums overviewStranded II overviewGeneral overviewLog in to reply

English Waves?

4 replies
To the start Previous 1 Next To the start

old Waves?

Guest

Quote
Hey I've played the game and I love it. I love the game play its really simple to learn how to make stuff and do things.

As a blitz3D programmer I was wondering how you did that awesome wave effect in the game? Like the waves that crash against the terrains? If you could post some source maybe?

Thanks,
Toaster

old Re: Waves?

Guest

Quote
95% chance you won't look at this but...
There is a wave sprite in "your stranded folder\sprites\wave0_a.bmp"
I don't know how they got it to work but you can edit it to be more appealing...

old Re: Waves?

jeepohahyo
User Off Offline

Quote
Bloodshot has written
95% chance you won't look at this but...
There is a wave sprite in "your stranded folder\sprites\wave0_a.bmp"
I don't know how they got it to work but you can edit it to be more appealing...

You don't have to be a programmer to do this. Load up your favorite graphics software and do it yousrself if you want it.

old Re: Waves?

DC
Admin Off Offline

Quote
The waves are simple sprites with the texture mentioned above.
I determine their position and rotation by checking the height of the terrain.
this is done in the following steps:

1. Create Array: create an 2 dimensional array with the size of the terrain diveded by a number (depending on the level of detail / wave closeness you want to have)

2. Find Shore: check the corresponding height of the terrain at each field in the array and set the value to 1 if the height is close to the sea level (= shore -> wave)

3. Confine: check every 8 adjoining array fields of each field in the array which has the value 1. set their value to 0 if the corresponding terrain height is higher than the height at the field you're currently checking. I do this to remove multiple rows of waves because I just want one row of waves which encircles the terrain

4. Create "Wave Spawns": Afterwards create a type instance at every array field with the value 1 (the array itself is not longer needed when you did this). Save the corresponding position in a x- and a z-field in this type.

5. Detect Directions: Use a pivot (or sin+cos) to detect the directions of each wave spawn. This is done by checking the height-difference of the terrain in all directions (I check every 30°). The wave direction is the direction were the height-difference is the highest. It has to be saved in a field of the type too.

Additionaly you can check the distance between wave spawns and the shore in the inverse direction of the wave spawn in order to remove waves in small waters like lakes and rivers

In the game you just have to create wave sprites at every wave spawn which is in the field of view of the player.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewStranded II overviewForums overview