How to make game scene like SIM2?

I want to make a simulation game like SIM2, I’ve read panda3d tutorials, and some code Snipplets, but all these games load the the scene in one time when game initial. I want to let player can design the scene like SIM2? such as make a road in ground, add a tree or a house.
I know how to add a object(house tree…) to scene, just put the object’s model to render or to a node. but how to put a road to ground? the player maybe make a road or dig a poor, so many different texture need to render to ground, somewhere grass, somewhere road…, And the ground height maybe change too when player dig a poor or Level down the ground, How to implement these?

Hmm… that’s a pretty wide-open design question. If I wanted to build something like this, I’d probably work towards the following milestones:

  1. Create (or find) a small library of models for the things I wanted to put into my house.

  2. Create a “house” which is an open box. Parent it to render.

  3. Place a chair or other object in the scene. Parent it to render.

  4. Work on the mechanism I want to use to move the chair around the room. Is the input keyboard? mouse? both? The picking tutorial (included in the samples, it’s a chess game) would be an excellent place to start.

The ability to pick up an object and move it around in a predictable, easy manner is one of the most important challenges you’ll face–and honestly, one of the most difficult. If you can get it right, everything else becomes easier, because you can keep reusing the same basic mechanism to move around walls, roads, trees, whatever.

  1. Implement collision detection of some sort. At first, you’re probably not going to want to worry about what happens when the chair hits the wall, but eventually you will need to tackle this tricky problem as well.

  2. Manipulating the ground as a height map may be easiest by generating your own geometry. See panda3d.org/manual/index.php/Defin … rtexFormat
    and
    panda3d.org/manual/index.php/Modif … metry_data

Honestly, I’d think very carefully about if I really need this functionality. Building a way to manipulate geometry in-game (with a pleasing interface) is NOT a small piece of work, and probably would not be in any traditional game engine.

  1. Textures can be manipulated on the model, and layered. panda3d.org/manual/index.php/Multi … troduction Again, there’s an awful lot of “make a house” that can be done without it. For example, switching textures on a model is pretty easy, and you don’t need to get into using TextureStages, etc.

  2. After all these mechanics were working well, I would tackle the problem of making an interface. I’d try either of 2 approaches: (a) use an orthographic lens in my main window, and render the 3d stuff in an offscreen buffer or something, then render that to a card in the main window, or (b) putting all the GUI stuff in Aspect2d.

As I understand the description of the project from your post, you’re talking about a lot of complex work. I’d estimate it would take me 2-3 months, working alone full time, to get all these features right. That’s at an absolute minimum, and if I went slow or had problems, it could easily get bigger. Perhaps you’re a faster developer than me.

I cannot stress enough the importance of working small. Get something simple working first. Then make it work well. Then figure out the smallest change you can make and try that out. Feel free to make lots of small disposable prototypes to learn how to do the complicated things you’re talking about. The more experienced I become, the less I try to design at once.

-PL-

Thanks for your answer, I’m a newbie for 3d game development, many 3d theory not clear, your answer give me great help, now making a full feauters game like SIM2 is too diffult for me, I’m just try to make a simplest sim game, the objects(like desk) can’t be move when it be put to the ground, and the ground is flat with a same height everywhere.
Now the only question bother me is how to put many different texture to this flat ground? In 2d game, the ground be splited to many tiles daimon or square, then render the different picture to these tiles, but in 3d game, the ground is a model, setTexture can only fill the ground with one texture, so when I set a grass texture to the ground model, the ground be filled by the grass, but I want to fill some particular area with road texture and some particular area with earth, How to do these?
My suppose is split the ground model to many small tile models, then put the different texture to these models, or make some new models with the special texture (road or earth) and cover them to the grass ground, but I think these aren’t right mothod for 3d game, I don’t think render the different textures to a same model different ereas is so difficult.

Actually, what you described — splitting the ground into many small tile models — sounds very practical. There are a few optimizations to be done, but basically, it’s a good idea.