Jump to content

  • Log In with Google      Sign In   
  • Create Account


Planned Terrain Generation


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 chrisprij   Members   -  Reputation: 156

Like
1Likes
Like

Posted 18 March 2013 - 11:09 AM

Hello Everybody smile.png 
 

So currently I'm working on a project where I'm making a semi-clone of an already existing game so I can grasp the technical aspects of creating the 3D backbone from scratch in C++ (using SDL to create window and load images, but that's about it, I want to learn most of the game-coding stuff from scratch, which is fun for me), and already have a template to follow for how the game, map, events, etc. should be planned out. Right now, I'm pretty well into making the engine, but I am catching one snag -- I'm working on creating mesh-making tools, which isn't so bad right now because most things are squares/boxes and stuff, so I made tools to put in squares, select textures, etc. to make those run smoothly.

 

My current problem comes when trying to do terrain that deals with mountains, caves, and more complex terrain than just a straightforward flat town and box buildings. I sort-of understand how to make terrain based on noise or hight maps and such, but I was wondering what you all have in ideas for developing mostly pre-planned terrain?

 

I want to take the terrain from the first game that I'm semi-cloning and recreate it in 3D (the previous game is in 2D). So I have a bit of open room to maneuver with that change in display from 2D to 3D, but I still want the land to roughly follow the land in the 2D game. Any ideas?

 

Basically think of making a clone of zelda or harvest moon, from one of their old gameboy games (2D top-down game with an expansive world). It's that type of conversion.

--> instead of "ladders" and scene changes (screen goes black when you enter building, then reappear inside), I want everything to work as a 3D world; everything should not need those transitions.

 

NOTE: Sorry for being so secretive. ph34r.png I just want to keep my project a surprise for when I release it for people to test out and enjoy biggrin.png



Sponsor:

#2 BCullis   Crossbones+   -  Reputation: 1813

Like
1Likes
Like

Posted 18 March 2013 - 01:32 PM

I was wondering what you all have in ideas for developing mostly pre-planned terrain?

As in, not procedurally generated, but hand-modeled?

 

Use a 3d editor and import the mesh.  Or if you're interested in the learning aspect, do what I did and write a custom level-building tool that lets you "paint" terrain geometry (things like raise/lower terrain).

 

Edit: for more detail, I wrote a tool that uses picking to figure out where I'm pointing at my terrain mesh in the viewport, selects all nearby vertices in the mesh data based on my current brush radius, and applies the current modifier to all those vertices.  So if I have "lower terrain" selected, just do a -= operation on their Y values to lower the terrain in that area.  Then you can get fancy and do things like tune-able brush falloff (to simulate a smooth brush border) where the vertices closer to the edge of the brush aren't affected as much as the ones in the middle, and so on.


Edited by BCullis, 18 March 2013 - 01:35 PM.

Hazard Pay :: FPS/RTS in SharpDX
DeviantArt :: Because right-brain needs love too

#3 chrisprij   Members   -  Reputation: 156

Like
0Likes
Like

Posted 18 March 2013 - 02:08 PM

As in, not procedurally generated, but hand-modeled?

 

Yes, exactly. I still have freedom to do what I want, but following roughly the layout of the caves and land from the 2D game. 

 

 

Edit: for more detail, I wrote a tool that uses picking to figure out where I'm pointing at my terrain mesh in the viewport, selects all nearby vertices in the mesh data based on my current brush radius, and applies the current modifier to all those vertices.  So if I have "lower terrain" selected, just do a -= operation on their Y values to lower the terrain in that area.  Then you can get fancy and do things like tune-able brush falloff (to simulate a smooth brush border) where the vertices closer to the edge of the brush aren't affected as much as the ones in the middle, and so on.

This is exactly something I wanted to get from this question biggrin.png  Thanks for the narrowed down answer, you hit it right on the head! I'm pretty sure you clarified the whole concept when it comes to a level editor for me tongue.png For clarification, is it easiest to start with a flat mesh or some easily computed mesh, and then apply these changes to it? Once I know where to start, I think creating these tools will be much easier to accomplish. 

 

And one last question, if I may: What if you want to add "vertices" or make the scene more complex? I know that should be just another tool, but are there any ideas or topics that can get me started there as well? 



#4 BCullis   Crossbones+   -  Reputation: 1813

Like
2Likes
Like

Posted 18 March 2013 - 02:19 PM

For clarification, is it easiest to start with a flat mesh or some easily computed mesh, and then apply these changes to it? Once I know where to start, I think creating these tools will be much easier to accomplish.


It's easier to start with a flat mesh.  I generate it in the tool (it's really easy to make a flat grid of vertices, I just establish an x-step value and a z-step value, and walk through the array of verts giving them appropriate x- and z-locations.  Y is 0.).  Though if you have a pipeline to bring in external meshes, it's just as easy to model something up outside the tool and then import it to do further tweaks (and in my case, all the game-contextual stuff like triggers and props).

And one last question, if I may: What if you want to add "vertices" or make the scene more complex? I know that should be just another tool, but are there any ideas or topics that can get me started there as well?

 

Now you're talking about procedural mesh generation and even topology algorithms.  This is a huge can of worms that I'm happy to call "my current brain candy".  I can't give you any really good advice yet as I'm still sifting through it all.  Keep in mind though, this is for things like "I want to grow the terrain here, but keep the vertex density the same" or "I want to cut a hole in the terrain to stick a cave mouth prefab into, and then retriangulate the edges to fix the seam".  If you just want to add separate objects to the scene, that'll depend on the definition of your "level".  My current solution is just to keep a list of all prop (what I call my static meshes) IDs and their world transform information (location, scale, rotation).  When the level loads in the game, it reads through that data and populates it accordingly with actual prop instances.


Hazard Pay :: FPS/RTS in SharpDX
DeviantArt :: Because right-brain needs love too

#5 chrisprij   Members   -  Reputation: 156

Like
0Likes
Like

Posted 18 March 2013 - 02:34 PM

BCullis: Thank you so much for your fast response! I'll have to get to making these tools as soon as my finals are over :)

 

 

 

And one last question, if I may: What if you want to add "vertices" or make the scene more complex? I know that should be just another tool, but are there any ideas or topics that can get me started there as well?

 

Now you're talking about procedural mesh generation and even topology algorithms.  This is a huge can of worms that I'm happy to call "my current brain candy".  I can't give you any really good advice yet as I'm still sifting through it all.  Keep in mind though, this is for things like "I want to grow the terrain here, but keep the vertex density the same" or "I want to cut a hole in the terrain to stick a cave mouth prefab into, and then retriangulate the edges to fix the seam".  If you just want to add separate objects to the scene, that'll depend on the definition of your "level".  My current solution is just to keep a list of all prop (what I call my static meshes) IDs and their world transform information (location, scale, rotation).  When the level loads in the game, it reads through that data and populates it accordingly with actual prop instances.

I totally have to agree with you there; Procedural Generation has been all over my mind as I have been toying around with the idea of voxels, but I wanted to root myself in 3D graphics, polygons, and procedural generation before I move on to that. I'm hoping to get into procedural generation after this first project of mine . . . Though I might want to start reading up on it if it can help me develop some parts of my terrain on my current project. One step at a time, though, I'll have to get on to creating some level editing tools first :D

Again, thanks for the sound advice, you really helped clarify things in my situation!!!!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS