Front Warrior Grass Generator

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Front Warrior Grass Generator

Post by devsh »

UPDATE - FINAL VERSION WITH HALF COMPLETE USER GUIDE

Here you go : http://www.mediafire.com/?ucbm8aaromr36bv

ALL OTHER DOWNLOADS ARE OUT OF DATE


UPDATE - BUGS FIXED
New zip
http://frontwarrior.googlecode.com/file ... evised.zip

Hi all, this is a special program (source included+example)
one runs through a terrain and outputs a file with the foilage
another is a demo of how to use this

http://frontwarrior.googlecode.com/files/FWGrass.zip

The generator program takes one argument, the path to xml input file. You feed the terrain model, a vegetation map in the input file. Alpha channel represents how many plants are there (more opaque more plants), In the input file you specify density (the bigger the farther apart the plants are, so smaller means more plants) and many vegetation types (plants, up to 32), their textures, scales, position and scale variations, ratios(to each other), and a colour channel of the vegetation map they are assigned to. Each channel hightens the probablility of planting a plant with that channel flag in the input file.

The generator outputs 3 million plants, weighing 1.2 GB in memory (300mb compressed) in 27 minutes on a singe core 2.16ghz. On my school's hyperthreaded 3ghz it takes 7 mins.

The example uses a file with 40 thousand plants. It takes the path to the grs file as the argument. Please extract the two directories next to each other.

The output file is zip compressed, and the generation of plants is multithreaded (4 threads, should run nice on i7). The plants are in quads, but quadtree is not supported yet. Nor is streaming for huge vegetation coverage.

NOTE: The windows EXE is out of date, please recompile. Linux should be fine.

this is my best piece of programming in C++ yet...
Last edited by devsh on Tue May 10, 2011 3:22 pm, edited 3 times in total.
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

Later, I will upload the whole implementation, design etc.
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

This sounds cool, but 7 mins on a hyperthreaded 3ghz processor seems like a lot. I'm assuming you have less plants when it's actually used in Front Warrior?
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

7 mins to author a level, not to load it, it loads in a few secs. plus we would have to be crazy at FW to have 1.2gb of mesh data in foilage....
Insomniacp
Posts: 288
Joined: Wed Apr 16, 2008 1:45 am
Contact:

Post by Insomniacp »

I had a similar idea in the works for my world generator. I wouldn't use an image approach as I feel rgba is limiting in the ability to vary planting. I am also simulating weather so I would need tropical plants, plains, deserts and things like that based on the geography and weather patterns. I will definitely take a look at your code and see how you chose to implement things though.
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

for an MMO you would really need to implement streaming the quads from different files etc, then even if you streamed from large files you'd need to compress only the vertex and index buffers so you dont have to load the entire file to memory.
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Ah I see. How large on the level files usually?
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

maybe < 20mbs, I'll implement streaming so it will be better on RAM :)
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

I fixed some bugs, etc so its fully functional and nice now. Have fun with the new zip
http://frontwarrior.googlecode.com/file ... evised.zip
Last edited by devsh on Sun Mar 27, 2011 7:50 pm, edited 1 time in total.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Any hacker around here who could get that file?
Working on game: Marrbles (Currently stopped).
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

sorry, fixed
I've been up for 32 hours
ChaiRuiPeng
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Post by ChaiRuiPeng »

devsh wrote:sorry, fixed
I've been up for 32 hours
i wish i had that freedom... i have to do school work... help bàba and stuff... :(

i have so much work to do on my project but so little time...
ent1ty wrote: success is a matter of concentration and desire
Butler Lampson wrote: all problems in Computer Science can be solved by another level of indirection
at a cost measure in computer resources ;)
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

this is school work, and I'm up 32 hours to finish it before tommorow
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

and some stuff I made with it
Image
Image

Uploaded with ImageShack.us
Post Reply