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.

Game Design Theory / Grass building

Author
Message
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 19th Sep 2004 10:53
Also, I need to make a field of grass... not just little bush thingys like this... and I dont think i can randomly rotate those long planes. HOw many polys is this btw?

Thanks

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Manticore Night
21
Years of Service
User Offline
Joined: 23rd Oct 2003
Location: Ouinnipeg
Posted: 19th Sep 2004 10:58
Ok, your probably gonna have 0 FPS, but just make millions of them.

It's amazing how much TV has raised us. (Bart Simpson)
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 19th Sep 2004 11:38
Okay, how about, NO. lol jk, thanks anyways man, this was really really helpful. I can make a bunch of these little bush things, each plain that DBP creates is only two polys, correct? And each little bush is about 15 polys then i guess.

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Manticore Night
21
Years of Service
User Offline
Joined: 23rd Oct 2003
Location: Ouinnipeg
Posted: 19th Sep 2004 13:04
Pretty, good, better then most of my objects.

It's amazing how much TV has raised us. (Bart Simpson)
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th Sep 2004 01:52
It's a good idea to make your grass objects in a modeller, so like a cross plain mesh with 12 polygons, then load this and clone it. Also patches of grass can be made and cloned as well, like say a 2x2 metre (in scale) patch. Using individual plains is only a good idea if your gonna make an optimised grass system where you re-use the plains.


Van-B


Muhahahahaha.
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 20th Sep 2004 05:49
wait, so going by what Van said... If i did this in 3ds max(cross plain), can I still use set object transparency(from DB) cuz I dont know how do that in max. Oh yeah Van B, Im using your grass transparency image from you virtual holiday, do you mind? I'll definetly mention you in credits

Thanks!

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th Sep 2004 07:40
Actually that wasn't done by me, but I don't think he'll mind, I think it was Froggermon.

I could sort you out with a basic grass texture (PNG or DDS) if you need one.


Van-B


Muhahahahaha.
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 20th Sep 2004 10:59
so.. can I still use 3ds max and the transparency thing? Also, in your Virtual holiday thing, you just used plains, and that looked pretty convincing...

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th Sep 2004 17:52
Yeah, it did use plains, but it used a lot of them in about 3 meshes, they could have been 1 mesh though. The thing is that using a single plain object for grass is slow, using more plains in your mesh means you can get away with far less objects, to achieve the same effect. 3DS Max should be able to handle anything, I'm not clued up on bone rigging with max though, so I don't know for sure how you'd handle that part.


Van-B


Muhahahahaha.
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 21st Sep 2004 08:47
I tried making a cross plain in 3ds max, but i dunno... something got screwed up. Didnt load properly. Is having like a bunch of plains bad, say, object numbers 150-200? I need to find a way to re-use them, reposition where the camera is.

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st Sep 2004 17:19
Doing the repositioning thing is a good idea - but it's difficult.

I'd suggest you use an array index system, so you'd have a big single dimension array, and a 2D grid array. You'd check each grid location for what bits of grass are inside it, these would be added to the single dimension array, and the 2D grid array would be used as an index. Basically you need to be able to find out which objects are inside which grid locations so you know which locations need objects. You'd have like 50 objects loaded and position them at the closest grid locations to the camera. I am working on a little tutorial, it's taking a while to prepare the test data, but it should be done this week.


Van-B


Muhahahahaha.
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 22nd Sep 2004 08:24
Great! Thanks a lot Van B.

In your Virtual holiday, how many plains did you have? And how did you like merge all of them into 3 meshes? Didnt seem to slow, I still got 100+ FPS...

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 22nd Sep 2004 17:19
The foliage in that demo was created with memblocks, it's not exactly easy, but once you understand how memblock meshes work, it's really just a case of careful planning. It starts with a good foliage position, on the ground, then it plonks a plain right there are rotates randomly - it keeps doing that and moving, and all the time it's checking for a random value, at which point it starts a new foliage train.


Van-B


Muhahahahaha.
ultimate skimmer
21
Years of Service
User Offline
Joined: 24th Apr 2004
Location: u.s.a
Posted: 24th Sep 2004 04:57
if you dont mind my asking what games are those screen shots from?

ultimate skimmer
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 28th Sep 2004 12:03
Hey van b..

lol question again. If I were to make the grass sway, how would I do it? I know I need to use limbs, but, how do I set up the limbs to be at the corners of the object? If I made a grass mesh in max, do I have to set up a bone structure or something, then animate it?

Thanks

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 28th Sep 2004 19:02
Yeah, you don't really animate it - just add at least 3 static frames so DBPro can adjust it.

However, you should check out my tutorial on the newsletter - does the whole swaying boned mesh thing on an advanced terrain - even comes with an editor.


Van-B


Muhahahahaha.
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 29th Sep 2004 09:06 Edited at: 29th Sep 2004 09:10
oh! that's yours! Thank god i can get some support for it . I saw that tutorial and saw how it was swaying. Were the bones set up in ur modeling program? Or in DB? Does DB regonize bones, then you yrotated them with sin, etc.

Also, the mesh itself, just a bunch of planes made in a modeling program, right? Damn, stupid HW, I'm dying to try this out, no time though

[edit] also, what is the grass.dds for?

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 29th Sep 2004 17:19
The bone structure needs to be assigned in your modelling app, it's not an easy task, but with practice it's something you can do relatively quickly. It's just a mesh with 6 bones, one on each corner, one on the ground, and one at the top. The top bone is assigned to the top of the mesh, so little adjustments to that cause it to sway - it only uses sin to get a smooth swaying effect.

The grass.dds file is a texture for the grass plains, DDS is a directX texture format that is sorta like an optimised texture format, like it stays compressed in memory so does'nt have the same memory overheads as other formats. You can precalculate mip maps with it too, which speeds up loading times.


Van-B


Muhahahahaha.
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 30th Sep 2004 09:03
Thanks a lot man, jeezus, still caught up in damn homework, i'll try this asap .

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
ALPHA ZERO PRODUCTIONS
21
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Mom ! I forgot where we live !
Posted: 30th Sep 2004 09:16
i love grass.....not that grass

Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 30th Sep 2004 16:24
Hey so I got transparency to work in max, but, when I texture a plane, I can see the outline on the top, even when I did in in DB making plains, i noticed this . is it a problem with the .png?

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
The admiral
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location:
Posted: 30th Sep 2004 17:58
Is it loaded into dbpro cause then its because of mipmapping.

[href]www.vapourhost.com/~flyer[/href]
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 30th Sep 2004 18:00
Ahh, the famous texture edges - a neat way to get rid of this is to make sure you have no pixels around the edges (including the base of the grass image) - and then scale the texture in DBPro a little, so you'd scale it by about 1.01 - this should expand the texture and the outside edge will overlap inside the texture - meaning the edge will be a blend of blank texture instead of texture or other parts of RAM.


Van-B


Muhahahahaha.
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 1st Oct 2004 08:25 Edited at: 1st Oct 2004 08:27
using scale object texture?...didnt work.

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 3rd Oct 2004 02:42
Any idea what I should do?

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 4th Oct 2004 11:25
Also, in 3ds max, i didn't see in any texture edges... help

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 5th Oct 2004 03:35
Try...

set object texture fol,1,0

Seems to work for me at least, other than that you could disable filtering.


Van-B


Muhahahahaha.
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 5th Oct 2004 09:42
Niether one of them did the trick... darn it . I think it helped a little, but not sure.

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 7th Oct 2004 11:47
So... err... should I email rich?

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Mytho
20
Years of Service
User Offline
Joined: 30th May 2004
Location: USA
Posted: 7th Oct 2004 13:14
imagine each plane as a patch of grass. texture it, set it upright, so the character could in essence, run through it.

in the main loop, simply point the plane(s) towards the camera. then no matter how they look at the plane, it always looks like grass.

there are quite a few ways to make it smoother after you have gotten that part down.

Dare to attempt the MMORPG.
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 8th Oct 2004 08:30
Quote: "in the main loop, simply point the plane(s) towards the camera. then no matter how they look at the plane, it always looks like grass."


What do you mean? Rotate it? but then the user will see it rotating... example code plz?

STill got texture edges problem... :-(

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Oct 2004 20:56
Can you post a screenie? - it might be something to do with your texture itself, for example it's a good idea to keep everything away from the outer edges, even if it means your foliage sorta sits a few pixels from the bottom of the image. Graphics at the edges can bleed onto the opposite side and make the problem much worse.


Van-B


Muhahahahaha.
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 9th Oct 2004 08:12
Its the same texture you used in the virtual holiday thing... it looked fine in that.

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 9th Oct 2004 08:17
HEY! It works! I edited it in ImageReady and moved it up abit and the edges are gone! Thanks a LOT Van B! You're definetly going in the credits! I can see now why they made you a mod!

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Oct 2004 21:43
Cool - glad I could help.

Have you tried the latest update yet? - it stops advanced terrains working, but damn those transparencies look great now . Even transparent bitmaps without alpha look cool.


Van-B


Muhahahahaha.
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 10th Oct 2004 11:36 Edited at: 10th Oct 2004 11:36
I'll try it out... downloading now...

But its ok im not using a terrain anyways

But what exactly does it do, the transparency thing? Just makes the whole image... transparent?

[edit] ok which command do I use to make stuff transparent?

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 10th Oct 2004 15:29
Emm... also another question. Can I create fields of grass with this method? Like the one Oneka posted first? Thanks!

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 10th Oct 2004 22:46
The latest patch has a new transparency mode:

SET OBJECT TRANSPARENCY Obj,4

This gets rid of the edge defects, makes it possible to get perfect transparencies at last . To make fields, I'd use the foliage tutorial stuff - like replace the terrain with your own method, and use it to make foliage layout files.


Van-B


Muhahahahaha.
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 11th Oct 2004 06:46
Hmm okay I'll try that thx again

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 17th Oct 2004 13:59
Hey Van the grass is looking pretty good. I made a cross plain mesh in Max, it looks decent, but I cant quite get the *shape* right, like in your Virtual Holiday. I mean how you put the plains together, the rotation, etc.

Thanks!

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 25th Oct 2004 03:11
?????

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 25th Oct 2004 03:37
If you make a square plain, then copy it twice, and rotate them 120 degrees apart from the centre, that means a 6 poly mesh which is made from 3 plains (top down it would look like a X with a - through it). This is usually plenty for a good clump or bush.


Van-B


Muhahahahaha.
Oneka
21
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 25th Oct 2004 05:40
Hey I know I sure havent posted anything in this thread for a while but can I have a grass texture so I can test this


Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 28th Oct 2004 09:05 Edited at: 28th Oct 2004 09:07
Here is one with transparency, in .png format

I got this from Van-B's virtual holiday demo, but I believe it was made by Froggermon, so thank them

And thanks Van B for that info I will try this when I get time. This week has been VERY busy for me, I had a speech tournament yesterday, which I won 2nd place in and one on Saturday .

Will try ASAP.

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD

Attachments

Login to view attachments
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 8th Nov 2004 08:01
Any luck?

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Oneka
21
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 8th Nov 2004 08:12
lol no I havent done it yet Iam right now worrying about encryption..


Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!
Essence
22
Years of Service
User Offline
Joined: 12th Oct 2002
Location: The Netherlands
Posted: 18th Nov 2004 00:32 Edited at: 18th Nov 2004 00:37
Im trying to make this too.
Not that its really working but, i got an idea.

You could make a lowpoly model of a piece of grass, ex. 1 by 1 meter.
Be warned, you really need to make this very low poly.
With this method you even can make the grass move, such as moving through some wind or something. With scale/move/rotate limb.

Just place these objects around the player as far as the camera can see. Or make a distance calculator. I've got one from this forum at DarkBasic discussion.
When you are moving forward, just place the objects that are placed behind the player, to the location where the view will be updated.

So just when a grass object is behind the camera out the range, place them in front of the camera.

I dont know if this is a fast idea, but it should decrase your pre-loading time.

The only problem i have, I dont know how to code something like this in DBC..

* looks at Van-B *

Another option is to randomize the location of grass.
But if you look at games like deltaforce, they made grass so you can lay in it. Looks really nice. Bit low quality but it looks nice though. Is that a possibility in DBC ?
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 18th Nov 2004 17:45
All those distance calculations could slow down the engine a great deal. Really, an index is the fastest way to handle it. For example, if you split your terrain up into areas, like 32x32 areas that can easily be checked depending on the player position, you can precalculate what grass needs to go where.

It's easiest to simply have an array full of your foliage locations, then I'd have a big array, like foliage_index(128000), and say foliage_vis(32,32), and foliage_len(32,32), then step through each terrain area and calculate what foliage is visible inside each area. The foliage_index array stores the foliage number, and each foliage_vis indice stores the start index number. The length should also be stored, but you eventually end up with a system that lets you re-position your grass objects with a relatively quick and simply array check. You start at the index depending on the foliage_vis value, and step through each index indice for however long the data is. The cool thing is that you might only have 20 visible grass objects in one area, then 150 in the next - but when you move to the 20 grass object area, the extra grass objects would be left where they are. You could specify however many grass objects you like, and the system could easily accomodate that.

I'm not gonna pretend this is easy - so I'll make an example tonight, I use the same system for my internal collision occlusion, and that makes a big big difference to performance. The boned foliage system could be changed to do this too, but that's a bit more complicated because it needs to do more than just position the mesh.


Van-B


It's c**p being the only coder in the village.
Essence
22
Years of Service
User Offline
Joined: 12th Oct 2002
Location: The Netherlands
Posted: 19th Nov 2004 20:38
Should this be working on DBC ?
I dont have Pro anymore.. lost my cd
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 19th Nov 2004 21:04
It's really an optimisation technique, so the method should be compatible, the demo won't be though, as it'll use advanced terrains. I'll see if I can make a really simple flat version for you to test in DBC as well.

I should have it out this weekend, got kinda sidetracked.


Van-B


It's c**p being the only coder in the village.

Login to post a reply

Server time is: 2025-05-19 14:28:34
Your offset time is: 2025-05-19 14:28:34