Page 1 of 2

Front Warrior Grass Generator

Posted: Sun Mar 27, 2011 12:19 am
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...

Posted: Sun Mar 27, 2011 12:23 am
by Radikalizm
Any screenshots?

Posted: Sun Mar 27, 2011 12:29 am
by devsh
Later, I will upload the whole implementation, design etc.

Posted: Sun Mar 27, 2011 1:52 am
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?

Posted: Sun Mar 27, 2011 2:12 am
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....

Posted: Sun Mar 27, 2011 2:16 am
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.

Posted: Sun Mar 27, 2011 2:24 am
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.

Posted: Sun Mar 27, 2011 3:34 am
by Lonesome Ducky
Ah I see. How large on the level files usually?

Posted: Sun Mar 27, 2011 3:45 am
by devsh
maybe < 20mbs, I'll implement streaming so it will be better on RAM :)

Posted: Sun Mar 27, 2011 7:15 pm
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

Posted: Sun Mar 27, 2011 7:36 pm
by serengeor
Any hacker around here who could get that file?

Posted: Sun Mar 27, 2011 7:50 pm
by devsh
sorry, fixed
I've been up for 32 hours

Posted: Sun Mar 27, 2011 7:54 pm
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...

Posted: Sun Mar 27, 2011 8:15 pm
by devsh
this is school work, and I'm up 32 hours to finish it before tommorow

Posted: Mon Mar 28, 2011 12:13 pm
by devsh
and some stuff I made with it
Image
Image

Uploaded with ImageShack.us