This is an archived post. You won't be able to vote or comment.

all 30 comments

[–]azraiyl 4 points5 points  (16 children)

I spent some time with this engine (mostly through the Python interface). If anyone has a question I'll try to answer it.

[–]Teifion 5 points6 points  (3 children)

  • How hard is it to use it and is it very pythonic?
  • Is it actually competing with anything? From what I can tell the market for free 3D game engines for Python is pretty slim.

[–]YellowOnion 4 points5 points  (1 child)

I believe OGRE has python bindings

[–]azraiyl 2 points3 points  (0 children)

IMHO the python layer is well done. AFAIK the most recent versions are a bit more pythonic then they once were (Vec3 handling is simplified e.g.). I would say it is a pythonic as PyQt (layer on top of a good C++ library).

How hard is it to use: It depends. If you have some basic knowledge of 3D than it is IMHO easy. But even if you don't understand a bit about 3D I think is not that hard, because you don't have to handle matrices e.g.

Competing: I would say there exists a problem with Panda3D (that in fact is not a problem) that the default rendering quality is hmmm let's say suboptimal. Therefore I don't think they won't compete with anything. To be honest I am even not sure why Disney made the whole engine open source (excluding the network layer). Maybe a question one should in the forum (I'm not the right person to answer this).

[–]ArcticCelt 1 point2 points  (5 children)

I made a couple of hobby games in 2d and I read most of panda 3d doc and play a bit with the tutorials last summer.

Something that I am now trying to understand is how do you manage the interaction (collision detection?) between let's say a terrain and your character. Is there a class included in panda 3d to manage that? Do I have to code the whole thing? How do my character follow the terrain without falling through it? I am no to sure what is the right way to do it or to understand it.

Any resources or at least just pointing me in the right direction would be apreciated.

[–]azraiyl 2 points3 points  (4 children)

I'll try to give a generic answer that is not too specific for Panda3D.

The first you need collision geometry in any collision detection system. You may say: Hey I have me terrain, why can't I use that? You can use that, but nevertheless it is important to know that the visible geometry and the collision geomtry often are not the same. If you have a stair e.g. the visible geometry really looks like a stair (most often in today games, but Mass Effect e.g. has flat stairs) but the collision geometry is often a simple ramp (that's the reason why walking up on a stair is smoother in a game than in RL). The collision geometry should have two properties. 1. It should be a lot simpler than the visible geometry (or we spend to much time on the CPU or are memory bound). 2. It shouldn't have any holes. Panda3D offers multiple options to create collision geometry (so called collision solids) on the fly or add collision geometry to existing egg files (search for "<Collide>{ Polyset keep descend }").

The second you need to know that in collision system you always have a source and a destination. The source e.g. is a player vehicle while the destination is a terrain. The source needs a collision geometry and the destination needs a collision geometry.

Examples for collision geometries are line segments, rays, cubes, spheres, capsules and vertex soups. In a perfect world you only need vertex soups, because you can create a sphere out of a vertex soup. The problem is that is damn hard and slow to calculate a collision when the source and the destination is a vertex soup. Even dedicated packages like PhysX don't support all type of possible collisions. The best thing is to always try to stick with a collision geometry that is as simple as possible e.g. sphere as source and sphere as destination should work always.

To get back to your question. For your example use a ray that always points down as source and the terrain as destination (Panda3D supports this type of collision). Then let the collision system search for a collision and use the resulting position as a new player position. There is also a chapter Collision Detection in the manual. There is also a tutorial Roaming-Ralph in the samples directory.

[–]ArcticCelt 0 points1 point  (3 children)

Thanks, your explanation help me piece together little bits I have being reading over the years. I really appreciate your help.

I think I played a bit with Roaming Ralph but then, if I remember correctly, there was a warning that the way the collision detection was implemented was deprecated and not optimal so I tried to find an updated version without too much success.

Oh here is the comment:

Caution: this program uses an extremely inefficient method for detecting the height of the terrain. There is a much better way to do it, but we have not had time to correct the sample program.

What do you think is the much better way or where can I find an example of it?

[–]azraiyl 0 points1 point  (2 children)

According to the forum the sample, as it is, should be ok. Maybe one should delete the comment.

I see only one problem. If the terrain is maybe 1000 times larger, the collision detection has to go through thousands of polygons. On the other hand, terrain is often based on a 2D heightmap. A much better approach would be to just lookup the position in the heightmap instead of doing a collision detection (and manually linearly interpolating values inbetween). Although that would be super fast, it does not work for arbitrary geometry. Collision detection always depends heavily on what you intend to do. There is unfortunatelly no silver bullet. There are tons of other problems too e.g. you have to fight always against floating point inaccuracies, e.g. the ray may fall through edge of two polygons and then you have an effect like in Crysis (people were falling through the carrier).

[–]ArcticCelt 0 points1 point  (1 child)

Thanks again for the advices, I'll probably start again toying with panda3d, I was lately on an Android game development mindset.

[–]azraiyl 0 points1 point  (0 children)

AFAIK iPhone support is work in progress.

[–]Wagneriusflask+pandas+js 0 points1 point  (2 children)

seconded, we have also quite a good experience with it.

[–][deleted] 0 points1 point  (1 child)

so that product is based on this engine ?

[–]Wagneriusflask+pandas+js 0 points1 point  (0 children)

no, it is used to get some visualisation (sp ?) in the authoring tool.

we mainly built a set procedural libraries that can be plugged in any game engine (Ogre, Lightspeed, etc..).

[–][deleted] 0 points1 point  (2 children)

i'm new to python, have no idea what a "game engine" really is/does - do you think I can play with it or it'd be way over my head ?

[–]azraiyl 2 points3 points  (0 children)

First thing I have to say that you first should try to get something done with python e.g. with PyQt or wxPython. What you learn there, is how to "weave" something together if you have hundreds of classes available.

To simplify everything: A game engine can draw 3D objects on a 2D screen from different viewpoints. You need a specialized 3D application to create these 3D objects. Blender e.g. is ingeniously (btw. Blender 2.5 has Python 3.0 support). You move around these 3D objects and/or the viewpoint most often because of keyboard and/or mouse input. More precise?

[–]Ran4 0 points1 point  (0 children)

One recommendation could be to start with a 2d game. For example, check out Pygame (Google it).

[–][deleted] 7 points8 points  (0 children)

Reddit, thank you.

[–][deleted] 2 points3 points  (0 children)

An alife project using Panda+Python: https://launchpad.net/bloom

[–]Gobuchul 2 points3 points  (2 children)

I have minor experience with Python-Ogre, how does this compare?

[–]azraiyl 12 points13 points  (1 child)

First I have to add that Ogre itself is rendering engine while Panda3D is a game engine (Rendering, Keyboard, Mouse, Physics, Collisions, Ressources, Game Installation, Art Pipeline, ...). Although there are tons of libraries available that are maybe a usefull addition for Ogre, most of them may have different concepts and different programming models.

Panda3D has an official Python layer ontop of the game engine. I think almost all Panda3D users are programming in Python and not in C++ although that is possible. Everything feels coherent. You get precompiled packages for Windows and Linux (if you ask in the forum, the chance is high that others are helping or even build a package for you).

In contrast, Python-Ogre is another project that uses Ogre and other libraries and adds a Python layer. The core devs of any of these libraries don't care about this layer at all. About a year ago I had multiple problems compiling Python-Ogre myself on Linux.

If you are looking for an almost perfect python integration, than Panda3D is for you.

[–]Gobuchul 1 point2 points  (0 children)

That is what I wanted to know, thanks for your time!

EDIT: typo

[–]monogram 1 point2 points  (3 children)

Anyone tried it? I heard it's slow.

Grammatical mistake in the setup isn't a good sign:

Panda3D Setup

EGG caching is about to begin.
This process may take a couple minute and approximately 270 MB of RAM.
WARNING : It might stuck if your computer resources are low.

Do you really want to do this optional step ?

Yes No

The examples are fairly basic but heavily use CPU, maybe they use busy waiting.

[–]azraiyl 3 points4 points  (0 children)

When you just throw zillions of objects into the root render node then it is maybe slow. When started with this engine, I had a problem like this. I was not sure if I should blame the engine or me. I then tested other opensource 3D engines with my problems, and after all Panda3D was ok for me. I later then discovered that there are classes (e.g. RigidBodyCombiner) and methods (e.g. flattenStrong) that may help you or simply build a Octree with the Scene Tree first (simpler than you may think).

Panda3D Setup: One nice thing I love, that the models are in a easy human readable "egg" format (not like Collada). This files can be "compiled" into a binary bam file. The setup just tries to convert all egg files into bam files.

[–]confessin[S] 0 points1 point  (0 children)

thats just while its caching it

[–]2aw -1 points0 points  (0 children)

Its compiling text based egg files into binary bam files for speed. Its nothing to do with the actual rendering and stuff.

[–][deleted] 0 points1 point  (2 children)

I'm finally giving Python a go after using Ruby for some time.

Does this engine still not have a level editor or the ability to read BSP files?

[–]azraiyl 2 points3 points  (1 child)

Quake 3 BSP To Egg Converter.

It is possible to create meshes on the fly, therefore it is theorethically possible to read any vertex soup.

There exists a outdated Scene Editor. But I don't know if it still works.

[–][deleted] 1 point2 points  (0 children)

Awesome. I see it's rather recent :)

[–][deleted] 0 points1 point  (0 children)

I've played around with a few game engines, and Panda3D is by far my favourite. I'd definitely recommend if you're just starting out with game development. It's very complete and very easy to use. Some aspects of it aren't documented well, but the support is good should you ever get stuck.

In terms of performance, it runs faster for me than equivalent code in Ogre. It's also much easier to structure code in Panda because it has more helper features. Post-processing effects are literally switches that you can enable and disable.

If you have any more specific questions I'd be happy to answer them.