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.

DarkBASIC Professional Discussion / grass - and populating the terrain with it

Author
Message
Stevie
User Banned
Posted: 23rd Aug 2004 10:07
Just been to the alien codecs site - to check out when there new tree prduct is coming out - which is tomorrow so thats good - but i also downloaded there landscape grass demo - which shows a mass populated landscape full of foilage - and moving trees. It looked very awesome indeed. Anyone know of a similar plugin for dark basic??
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 23rd Aug 2004 17:57
I doubt you'd find much, foliage is quite tricky to do well, most people simply place plains on the terrain with a grass texture - but there are several approaches. It'd be nice to see an overlay foliage mesh system included with the terrain plugin, but there's little chance of that - so you should look into plains and sticking them to the surface of the terrain.


Van-B


Muhahahahaha.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 23rd Aug 2004 18:44
Yes, lots of small plains with a greeny grass texture hsoudl suffice. Try and place grass with the same base colour as the terrain so it'll blend in nad not look to obvious

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 23rd Aug 2004 21:22 Edited at: 23rd Aug 2004 21:22
Okay I'vegot something really cool working with the advanced terrain demo. It's a bit like treemagik's grass, which fades off and positions itself around the player.

You'll need a grassy texture,

Put this before the main loop:



And this in the main loop:



It is horrible and uncommented though

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Stevie
User Banned
Posted: 23rd Aug 2004 21:25
Thanks David - gonna check it now
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 24th Aug 2004 11:00
That's pretty cool code...

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Aug 2004 19:13
Thanks

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Aug 2004 20:19
Okay quickly skimming over...

The sphere is there to represent the player's position.

Don't know what you're doing with object size y(), you might try to make a matrix and use that ground height instead.

You won't have set alpha mapping on, which will sorta destroy the effect You oculd try with fade object

Here's a distance function to replace object distance()



Good luck with it

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Aug 2004 20:46
Quote: "The object size y() was the height of the sprite itself.. so it was at ground-ish level.. I saw no matrix and I was thinking along the lines of you using DBPro with it's new 'ohh.. I don't need a matrix to get groubnd height now, I'll just use this, space, here.'"


What are you talking about? :/

It uses the new terrain demo, and hence the terrain ground height command. You could convert it over by making a matrix and using that ground height instead.

Oh, and I see you've put the chunk of code that I said goes in the main loop just before it heh

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Aug 2004 21:32 Edited at: 24th Aug 2004 23:25
Quote: "Oh, and I see you've put the chunk of code that I said goes in the main loop just before it heh"


Quote: "THERE IS NO MAIN LOOP!!!"


Quote: "Okay I've got something really cool working with the advanced terrain demo.

Put this before the main loop:

+ Code Snippet

And this in the main loop:

+ Code Snippet"


You need the ADVANCED TERRAIN DEMO to run it. The code fits INTO THAT DEMO.

[edit]

Mouse - just realised - I included a command in there that only I have... how did you run it? Did you run it?

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 25th Aug 2004 00:16 Edited at: 25th Aug 2004 00:17
If you mean object distance(), I duplicated it. Rather more simply than yours actually-- I just got the absolute value of cam x - obj x + absolute of cam z - obj z. You don't want y distance in there because the grass should remain on steep slopes!

I've been messing with the code a good deal, got ~2500 grass particles waving with my sine wind on a large, lush green landscape, and it's truly fantastic. Thanks !

The only real problem I have is that I have no blade of grass texture... the one I made looks more like a little pyramid of animal dung. So the grass sort of sucks even though the effect itself is cool . Would you mind sharing yours?

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Aug 2004 01:13
I use the one that came with VanB's holiday demo. YOU can get it from there.

Quote: "If you mean object distance(), I duplicated it. Rather more simply than yours actually-- I just got the absolute value of cam x - obj x + absolute of cam z - obj z. You don't want y distance in there because the grass should remain on steep slopes!"


Oops heh - it was knocked up quickly! I wrote object distance() as a TPC and forgot to add a camera distance() so I just used the temp sphere trick.

I knocked up a newer version - you get a good effect check for particles that are far away and positioning them closer than the actual range.

Also mind posting your sine wind? I haven't quite got it right

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 25th Aug 2004 01:55
Actually I'm still debugging the wind at this point, but once it's solid I'll put the wind stuff up with some screenies. It's the same wind I use for my rain and snow effects, but the function's giving me problems with 5.5 and the grass isn't rotating quite right.

But once it's solid ...

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Aug 2004 02:09
Do you find some grass flickers? Must be a problem with the fading somewhere...

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 25th Aug 2004 02:56 Edited at: 25th Aug 2004 03:01
Yeah, but I actually changed the code a good deal... mine now instantly dissapears and sets its alpha to 0 and replaces itself when you get too far away in any given direction. Not randomly replacing, but at the edge of the player's scope of vision. So the grass appears to roll nicely.

It's still buggy but here's the latest screen:



Edit: In case you're curious, that's with 3,500 grass particles all around the player. The rain's something I integrated from my primary project (unrelated to this-- man was it a pain to put in in-- shouts to Kentaree and las6). The grass textures are all from limefly.

Looks sort of Serious-Sammish doesn't it ?

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Aug 2004 03:09
Yes

Perhaps you could darken the grass texture? It'd fit in better.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 25th Aug 2004 03:11
Good idea, I'm working on that. Also d/ling to Serious Sam 2 demo to get some ideas...

Btw, it turned out grass waving around was absolutely not working, so nevermind that . My bad.

Stevie
User Banned
Posted: 25th Aug 2004 05:33
Mouse - doesnt your fame rate drop with all the grass like mine did - also when animating the grass did u adnimate it all???
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 25th Aug 2004 05:43
Well, I'm not sure what my fame rate was in the first place. I don't think the grass impedes it; I still seem to be getting a lot of attention and fan mail. I'll check though.



Seriously-- yes, it does eventually, of course. On my TNT2 the frame rate SUCKS with that much grass. But on a better video card it probably wouldn't even flicker. All the grass isn't 1/50th of the polys of the terrain.

No, I didn't animate it.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Aug 2004 05:45
You could instance the grass

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 25th Aug 2004 06:05
I am !

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Aug 2004 08:11
That's probably why it's running so well

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Stevie
User Banned
Posted: 25th Aug 2004 14:21
Yep Instancing is the way. I ran a few tests just to see what load the frame rate could handle and i was so so surprised. I though mass population of foilage effects was impossible - especially using the cloan command -but then tried the instance command - and i could put 800 grass cluster objects to the screen!!!!!!!!! without the frame rate dropping below 70!!!!!

I am sure but sure learning that huge games can be achieved in DB - of a fantastic quality - its just the way u use the commands. Last night i only had 14 trees on screen - some animated and 40 grass clusters - all using the clone command- ad my frame rate was under 18!!!!!!!

Just changing CLOAN to INSTANCE made all the difference
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Aug 2004 17:38
Quote: "without the frame rate dropping below 70!!!!! "


And you were doubting DB...

ps - it's clone

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 25th Aug 2004 21:18
One query (mainly because I can't be bothered waiting till later to test this) - If you instance a boned object, does it stay in the same place? or does it reset the object frame. I'm using a multiple plain boned mesh for foliage, and I adjust bones to change the look of the thing, it'd be ideal if I could *rubber stamp* these things instead of using multiple objects.


Van-B


Muhahahahaha.
Stevie
User Banned
Posted: 25th Aug 2004 21:26
Yes Van - this is whats great. Using Davids animating tree code - previoously using clone i had to animate each tree inidividually within the loop.

However using instance - allows u only to animate the original object and everything that is an instance off that moves too!!!!!!!!!!!!!!!!!!! So better frame rates, sipler code. Thats what its all about!!
teh game wiz
21
Years of Service
User Offline
Joined: 24th Feb 2004
Location: EWS
Posted: 26th Aug 2004 08:02
looks good tho i need a decent texture to see it well. cant find any good ones

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 26th Aug 2004 08:10
Either get them of VanB's demo or http://www.limefly.net/html/modules.php?name=coppermine&file=thumbnails&album=16

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
teh game wiz
21
Years of Service
User Offline
Joined: 24th Feb 2004
Location: EWS
Posted: 26th Aug 2004 08:18 Edited at: 26th Aug 2004 08:20
thanx, tried using my own images but the plains were just black... maybe i was using currupt images or summit. anyway looks realy good now, you should use this in your m2 game

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 26th Aug 2004 18:33
Already doing so

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
teh game wiz
21
Years of Service
User Offline
Joined: 24th Feb 2004
Location: EWS
Posted: 27th Aug 2004 01:21
heres a screen of it with a good terrain and some trees


Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 27th Aug 2004 01:36
game wiz-> Looks good. To get rid of the grey lines above the grass, open up the .png and enlarge the image a bit on the y axis.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 27th Aug 2004 02:44
Looks very good game wiz! (wishes he had far cry)

My grass is famous

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 27th Aug 2004 03:29
Genuinly great idea & code on your part .

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 27th Aug 2004 03:35
Thanks

It looks really good when the terrain colour matches the grass colour... I think las6 has a texture on limefly for that.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 27th Aug 2004 04:21
I know the topic here is about grass, but Mouse that is a cool looking plasma effect on your gun.


So.... Anyone else here thinking of a little environment demo competition?

"eureka" - Archimedes
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 27th Aug 2004 04:45
Thank you. It looks better now.

http://www.dbspot.com/darkmouse/pheerme.jpg

But I'm not working on it anymore, back to other projects.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 27th Aug 2004 05:35 Edited at: 27th Aug 2004 06:03
Mouse, that is a VERY cool laser effect

Phaelax: Maybe

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Stevie
User Banned
Posted: 27th Aug 2004 06:01
Hi - Game Wiz - do u use Geoscape for your terrain creations?? and if so how did u do that road/path feature. When i do this in geoscape my maps dont load in exactly as i do them - i think this is due to the scaling terrain commands not being set right.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 27th Aug 2004 06:04
Nope he uses Far Cry

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"

Login to post a reply

Server time is: 2025-06-06 16:10:49
Your offset time is: 2025-06-06 16:10:49