Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / sea simulation

Author
Message
Tom_d
20
Years of Service
User Offline
Joined: 3rd Jun 2004
Location:
Posted: 7th Jun 2004 23:13
hey check out this sea simulator i put together, its not great - a tough one to get right. you'll need an image called "water.bmp" in the same directory or you could rem out the matrix texturing and have it in wireframe

arrowkeys-camera
shift/control - change sea strength
return - start a wave

any suggestions or ideas?
thanks.

ps heres a water texture i found on the net that you could use

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 8th Jun 2004 02:51
That's pretty cool.

"eureka" - Archimedes
Yyrd
20
Years of Service
User Offline
Joined: 29th Mar 2004
Location: Under some bridge
Posted: 9th Jun 2004 01:40
hmmm .. how does this work?
can you explain it?
can it be done with x file version matrix ,since martix eat up power?
Tom_d
20
Years of Service
User Offline
Joined: 3rd Jun 2004
Location:
Posted: 9th Jun 2004 02:31
it uses the sin() function to create nice smooth waves - i guess you could use the object driven matrix commands that Phaelax has cleverly created:

http://darkbasicpro.thegamecreators.com/?m=forum_view&t=32935&b=6

this would be the same thing just with an object instead of a matrix which would be quicker
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 9th Jun 2004 02:51
actually, i'm afraid using an object would be slower. Updating the object is very slow compared to the update command for the matrix. That's the only downside.

"eureka" - Archimedes
gbuilder
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: New Zealand
Posted: 9th Jun 2004 10:56
Quote: "any suggestions or ideas?"


You could have the camera bobble about too, then it would be like being on a boat.

gbuilder.

AMD900mhz, 256mb Ram, 64mb GForce2 MX400 Graphics card, Windows 98se.
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 10th Jun 2004 02:08
Is this DBPRO????

Got anime?
I do.
Tom_d
20
Years of Service
User Offline
Joined: 3rd Jun 2004
Location:
Posted: 10th Jun 2004 13:21
yep it is - i've made a few modifications so it will work in classic though, just hit the source button.
Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 12th Jun 2004 00:03
I tried the classic version but it just came up with

"error at line 79 matrix tile does not exist"



The happenings of tommorow are behind us now
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 12th Jun 2004 00:12
The classic version worked perfectly fine for me, the actual water looks fake the motion is incredibly realistic for DBC, great job, I think I'll put it in my FPS, if that's okay, and you'll be in the credits if I can put it in my FPS...

Got anime?
I do.
Tom_d
20
Years of Service
User Offline
Joined: 3rd Jun 2004
Location:
Posted: 13th Jun 2004 00:55
heh thanks for the feedback,
anime - course you can use it, be nice to see it go to some use
robot not sure why that is works fine on mine, conflicting version of dbc maybe?

i think i'm gonna try and add in an object which bobs around based on the surrounding matrix heights, wouldn't be easy.. but thanks for the idea gbuilder i'll try to make it at least a bit realistic!
PantheR RIP
21
Years of Service
User Offline
Joined: 7th Jul 2003
Location:
Posted: 13th Jun 2004 07:58
I wonder is it possible to make an ultra realistic water with the usage of shaders in DBPRO? I'm not familiar with an FX files format so it is difficult for me... May be someone can try out?

Also, i wonder, if it is possible to apply such FX on a matrix? Cause it is bossible to create mesh matrix with memblocks - but it takes VERY much time to process tile height operations when it is compared with Standard Matrix operations.

By the way, increasing matrix resolution we are increasing smoothness of the waves but this is also produce too less FPS. On the other side Mesh Matrices is faster in that case. Damn! Both methods have it's own dissapointments!! How do i choose the best one?
Tom_d
20
Years of Service
User Offline
Joined: 3rd Jun 2004
Location:
Posted: 13th Jun 2004 17:05
hmm i don't know much about shaders at all but I think your right that they couldn't be applied to a matrix. As for the impossible decision that is tricky! I haven't ever tried memblock matrixes, is it a significant slowdown for height changes?

i was thinkin to improve the water realism to have a second still matrix underneath the water one and then ghost the water matrix. might try that not sure if it will look any good...

the only thing i can think of is keep as a matrix but have a function that works out which tiles can be seen based on the camera angle/position and only make height changes for them.. hmm maybe thats way harder than it sounds!
kenmo
22
Years of Service
User Offline
Joined: 7th Sep 2002
Location:
Posted: 13th Jun 2004 22:09 Edited at: 27th Jun 2012 06:10
check the source.
PantheR RIP
21
Years of Service
User Offline
Joined: 7th Jul 2003
Location:
Posted: 14th Jun 2004 12:46
Nice shading =) I wanted to do it too =))

Tom_d: I think second matrix will bring serious slowdown to whole process... I'll think about what we can do in this situation.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 16th Jun 2004 19:57
Quote: "I tried the classic version but it just came up with

"error at line 79 matrix tile does not exist"
"


If you get this, remove the c:\ part of the Load Image. Mainly in Kenmo's code.

Vusay
20
Years of Service
User Offline
Joined: 5th Mar 2004
Location: Ozzfest (Yeah right)
Posted: 20th Jun 2004 01:00
I also get the 'error at line 79 matrix tile does not exist' message and there isn't a 'c:\' in the load image part. I wouldn't normally ask but i'm desperate. please help. thanks.

he who runs away, lives to fight another day
Vusay
20
Years of Service
User Offline
Joined: 5th Mar 2004
Location: Ozzfest (Yeah right)
Posted: 22nd Jun 2004 22:38 Edited at: 22nd Jun 2004 22:39
Because it dosn't work with my Darkbasic Classic I've made my own little thing. Go to the codebase and type in 'Cruiser'. It dosn't come with media and the game's a little (humph) but it's a start. Tell me what you think of how the boat moves. It's as real as I can get it. If you can't be bothered to go to the codebase get the code below but I'd go and take a look anyway at my shot to see what it looks like with textures.


PLEASE someone tell me what you think. Cheers.

he who runs away, lives to fight another day

Login to post a reply

Server time is: 2024-11-23 19:24:36
Your offset time is: 2024-11-23 19:24:36