how to do a Real game environment?


I’m a beginner in panda 3d.
My biggest problem is I cannot find a good way (which method?) to make a complete game environment.
For example, if I want to make an FPS in outdoor, I need to create terrain, trees, buildings, some accessories (lamps, etc…).
So… what’s the procedure to assemble all the pieces all together?
If I create the whole environment inside a single .x file (terrain, furnitures, etc…) how can I manage single object visibility?
Instead, if I create single objects, how can I assemble them exactly (object 3D coordinates)?

Thank you.

this is actually what’s missing atm, a scene editor. there is a old one in the panda source, a new one i’ve worked on but is stale atm and maybe a new one in development.

without a scene editor you can model a scene in a 3d editor. if you have objects that are placed at several positions you can create empties and analyze the file in python (afaik used in the roaming ralph sample), then place the model at the empty’s position.

if you’re really going to make a fps, it’s not that much additional work (because making a fps itself is much work) to make a editor that fits your needs.

When you say “empties” you mean invisible objects, with a specific name, that will act as “markers” for real objects? Good idea!
One question: which object can I use in my 3d editor (ac3d) to make it? A flat invisible triangle? A pyramid? Or… ?
What is the best way to make a marked in a 3d modeler (sorry but I’m a programmer, and I will make some models just for prototype - I need to find a good modeler for my game).

Thank you for your quick help!

dunno what ac3d supports and if empties are exported to x files. but as the name “empties” already suggest, those objects dont contain any geometry at all. most editors offer such objects, either as “empties” or “null” objects

Thank you, I will check such objects in AC3D (or wings 3d, or misfit).

Thank you again!

Currently, I am using Blender along with the Chicken Egg exporter as a pseudo level editor. This works pretty good for my game, where I don’t necessarily need to do a lot of in-game tweaking of objects or my environment.

With ForceEmpty and Logic tab properties, you can export nodes that contain data which can be read and parsed by Python code. At some point, I can post an example of this, though some of the examples included with Panda3d do this already. (Roaming Ralph and Ball-in-a-Maze IIRC use specially named nodes in the Egg file to trigger things.)

What’s nice is that Chicken already supports the Dupligroup feature of Blender, which means you can build separate assets that get imported (literally, linked, so any changes carry over) into another scene. This is how I handle buildings and other static structures that I reuse through my level.

I am sure you could apply this to the Maya or even Max, as the exporters for Egg are fairly mature from what I understand.

Yes, I understand what you say. My only “problem” is I’m a programmer, and I found in ac3d a good (and easy!) 3d modeller. I learnt it in an hour (even if I do not use all its potential).
I know that Blender as a great 3d editor, but for me it is too much.
However, I will try to follow your suggestions using ac3d (or wings 3d) :slight_smile:

Technically, if you can get something from whatever program into an Egg format, you can go and add in the necessary tags and such by hand since Egg files are just text.

You could do things like export a collection of individual objects that only have a single triangle in their mesh, or something like this. That should get you a Group reference in your Egg file that you can then hand-edit.

Not familiar with AC3D, so you might have to export from it into some other format that a Panda3d converter can read. (Such as X2Egg.)

I use Blender for exporting, but I personally model/texture in Lightwave.

This is really interesting! I didn’t open egg files. Yes in this way, if ac3d does not export NULL objects (or similar) I can put some “dummy” objects then find them by hand.
One question about it: what’s the right “text” to be inserted in a egg file to create a “marker”?

You can search nodes fairly easily. Searching the Scene Graph.

Just using a special name is one way to do it. But you can also place tags on nodes, too. Here’s an example from one of my levels, straight out of the Egg file:

<Group> SunLight {
  <Transform> {
    <Matrix4> {
      -0.858010 0.397982 0.324149 0.000000
      -0.440257 -0.245782 -0.863577 0.000000
      -0.264066 -0.883824 0.386167 0.000000
      236.231873 147.545380 60.412998 1.000000
  <Tag> color { 0.99,0.98,0.82 }
  <Tag> lightType { Directional }
  <Tag> intensity { 2.0 }
  <ObjectType> { model }

So, in my Python code, I do something like this:

lightMarker ="*/SunLight")
color = lightMarker.getTag ('color')
intensity = float (lightMarker.getTag ('intensity'))

This is great! I think this is perfect to make a complete 3D environment in a 3d editor, then manage single objects from Panda.

(I will make some scripts in newLisp << my preferred scripting language :wink: >> to “automatically” manage these markers in egg files:

AC3D -> .x -> EGG File -> newLisp script for markers update

Thank you!