heh, i know theres not one, i was trying to make one... but i feel so confused, im not trying to do it as a class or anything yet, cause that makes my brain want to explode.... ive only been coding like 8 months
anyyyways, heres the code i used, it seems to compile right, but it crashes when i run the binary...
int x=1,z=1;
f32 iX=0.0f,iZ=0.0f,iY=0.0f,y=0.0f;
IAnimatedMeshSceneNode* vegnode=0;
IAnimatedMesh* tree = 0;
tree = smgr->getmesh("tree.3ds");
while (x<10)
{
x++;
while (z<10)
{
z++ //parent is parent of terrainscenenode
//you cant call getPosition on terrainscenenode
core::vector3df<f32>(iX,iY,iZ) = parent->getPosition( );
iZ++;
terrain->getHeight(core::vector2d<f32>(iX,iZ),y);
vegnode = smgr->addAnimatedMeshSceneNode(tree,0,-1,
core::vector3df(iX,y,iZ);
}
iX++;
terrain->getHeight(core::vector2d<f32>(iX,iZ),y);
vegnode = smgr->addAnimatedMeshSceneNode(tree,0,-1,
core::vector3df(iX,y,iZ);
}
i know that'll only produce trees in a line at the moment, but im too tired to think about that, i just wanna know why its dieing... lol
just dont laugh at my newbie coding, i did this at 5 am....
well, thanks in advance
ps... someone tell niko, that girlfriends are bad ideas, that just means less time for him to work on irrlicht... bad niko... bad
vegetation generator...
This bit doesn't look right:
Shouldn't it be more like this:
Classes are you friend BTW, get to know them better
Code: Select all
//you cant call getPosition on terrainscenenode
core::vector3df<f32>(iX,iY,iZ) = parent->getPosition( );
iZ++;
Code: Select all
core::vector3df l_pos
l_pos = parent->getPosition( );
pos.Z++;
- Nova
-
- Posts: 62
- Joined: Wed Jun 09, 2004 5:51 am
why would you place tree's like this?
I can understand a generator for grass or bushes but it will be different on EVERY system so using this for tree's in anything except an RTS style game seems a very bad idea.
tree's should be placed as static objects on the map itself so that in multiplayer FPS games it's always the same and they provide cover.
it's also a problem for AI path finding unless you want them to travel through them.
nope sorry just can't see any way random generation and implamentation of trees could ever be used logicly.
I can understand a generator for grass or bushes but it will be different on EVERY system so using this for tree's in anything except an RTS style game seems a very bad idea.
tree's should be placed as static objects on the map itself so that in multiplayer FPS games it's always the same and they provide cover.
it's also a problem for AI path finding unless you want them to travel through them.
nope sorry just can't see any way random generation and implamentation of trees could ever be used logicly.
ooooooooooooooooooooooooooooo
THAT KIND...cool
actually I HAVE seen a First Person Shooter with random map and object placement Generator that you could even gain a "CODE" for and use it to regenerate a random map made with some sort of algerithmic Map generator.
The name of the game is soldier of fortune 2: double helix
to me it's a oldy and a classic and I'm not that young or old it's just that it was one of the first games I ever bought for pc and one of my favorites that I played to DEATH.
I'm currently waiting for what looks to be some of the best mods for recent first person shooters in history.
I learned how to map for the quake 3 engine with this game and RTCW.
Might be worth getting a copy
THAT KIND...cool
actually I HAVE seen a First Person Shooter with random map and object placement Generator that you could even gain a "CODE" for and use it to regenerate a random map made with some sort of algerithmic Map generator.
The name of the game is soldier of fortune 2: double helix
to me it's a oldy and a classic and I'm not that young or old it's just that it was one of the first games I ever bought for pc and one of my favorites that I played to DEATH.
I'm currently waiting for what looks to be some of the best mods for recent first person shooters in history.
I learned how to map for the quake 3 engine with this game and RTCW.
Might be worth getting a copy
-
- Posts: 37
- Joined: Fri Jul 02, 2004 5:36 pm
- Location: Albany, NY
- Contact:
pathfinding wouldn't be a problem - simplest case, for example, is you're ignoring height, and trees are the only "no go" spots - just have your entities say, "If I see a tree directly inbetween me and my current goal, either (a) hide behind tree, or (b) activate A* (or whatever algorithm you're using) to get to a point inbetween the tree and my goal".
------------------------------------------
A monkey poured coffee in my boots.
------------------------------------------
A monkey poured coffee in my boots.
------------------------------------------
I am working on vegetation generator too... but i want it to generate vegetation in a specific area on an existing map. I want to use it in a terraineditor to have 'brushes' for different vegetation types.
So the vegetation is not generated randomly during runtime of the game. For that purpose random vegetation is very useful Not everyone wants to create an FPS that uses Q3-maps or something like that...
So the vegetation is not generated randomly during runtime of the game. For that purpose random vegetation is very useful Not everyone wants to create an FPS that uses Q3-maps or something like that...