Game Development Community

Using terraformer.cc

by Jared Hoberock · in Torque Game Engine · 01/14/2002 (6:30 pm) · 2 replies

I am currently working on a project for randomly generated terrains using the torque terraformer class. I'm having trouble getting anything to work. I keep getting segmentation faults that seem to be stemming from the ResourceManager. The trouble is that there's little documentation out there for engine modifications and trying to reason through all the code is a little daunting. Is there anyone out there that knows where to start with actual c++ modification and using the terraformer class? Here's my main() by the way:

#include "editor\terraformer.h"
#include "stdio.h"

int main(int argc, char **argv)
{
Terraformer *generator;
Heightfield *map;
U32 heightMapHandle = 0;


ResourceManager->create();

generator = new Terraformer();

generator->clearRegister(heightMapHandle);

generator->terrainFile(heightMapHandle,"C:\\GarageGames\\v12\\example\\data\\terrains\\test\\test1.ter");
delete generator;

return 0;
}


Thanks for your help.

Jared

#1
06/05/2008 (5:54 am)
I would just like to point out that I am working on the same thing and I'm very unhappy about the quality of code. The terrain source is loaded with cryptic operator precendence, one letter variables without description comments, actually, there isn't a comment anywhere.

I should also mention that this type of code isn't worth a reference in my opinion. If I have to rediscover all the answers for myself, why should I credit GG when I write a terrain generator based off of the terrain code? Especially since I paid to aquire the code, I don't see why I should.
#2
06/05/2008 (6:54 am)
You could write your own code without using any of the terraformer code as even a cursory reference. But just like citing any previous research in an academic endeavor, you should always credit the original sources that aided you...even if they only aided you in heading a different direction entirely and rolling your own implementation.