'Swimmable' water in terrain

Advanced game related topics
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Of course it's purebasic!

The code is pretty simple...

I'm detecting the terrain height and when it goes below a certain level triggers a blue thick fog ...

The water bubbles are just 2d sprites on the screen ;)

I'll post the code tonight, when i get back home!
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post by Nik »

It'S definitly cool but I think the blue of the water can be improved to let it look even more realistic
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Here it is!

Get it while it's hot ;)

File:363kb->Water.zip
Image

I'm now working on a water map system that will eliminate the fringe between the water and the terrain.

--- PROBLEM SOLVED ----

Set the screen to 32bits and the hard edges are gone!
Roger
User
User
Posts: 33
Joined: Thu Feb 16, 2006 1:53 pm

Post by Roger »

Thank you very much for the code. I'm sorry to say I managed quite a bit of it by myself already, but the upgoing bubbles were nice.

If I manage to get my app to allow me to take screenies I'll post some pictures of it :D
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Screenshots are easy ;)

When the app quits, just add this

Code: Select all

Grabsprite(1,screenx,screeny)
Savesprite(1,"c:\screenshot.bmp")
End
Or just define a screenshot key like F12 !
Roger
User
User
Posts: 33
Joined: Thu Feb 16, 2006 1:53 pm

Post by Roger »

Well, here are my screenshots as promised :) Don't worry about the ugly cursor, that's a bit blurred because i convert the screenshot from bmp to jpg, it looks good in-game ;)

Image

and, underwater, only without your bubbles:

Image
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Wow!!!!

Niceeeee ....

Your water looks better in the intersections!

Btw, which program do you use to create the terrain ?
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Yep, looks great !
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post by Nik »

Hmm somwhow I think we should have something like thsi and/or the physics example form Fred in the Standard examples and on the website
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

wwooooooowwwwww roger very nice! when can we expect the first world of rogercraft by your hand?

:-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
DarkDragon
Addict
Addict
Posts: 2347
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

Well in the second picture I would do the fog a bit darker, so no light-blue in it.
bye,
Daniel
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

buááááá Image

No one appreciates my work....

LOL

I have a better idea for the water :twisted: wait and see ungrateful ones...
Roger
User
User
Posts: 33
Joined: Thu Feb 16, 2006 1:53 pm

Post by Roger »

Num3 wrote:Wow!!!!

Niceeeee ....

Your water looks better in the intersections!

Btw, which program do you use to create the terrain ?
I used L3DT for this terrain, after I found a link to it somewhere on these forums :P As for the intersections, I just used your suggestion about the 32-depth screen, and that solved it. No fancy other thingies, just that ;)


Edit: Your example was of invaluable worth, num3 ;)
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Image

@Fred : Can you please check the 16bit screen feature/bug in ogre ???
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

num3, we love you too, come here

<insert appropriate hugs and kisses and pat on the head>

now, you're a good boy as you included the source

something that cannot be said of roger, grrrrr
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply