New Guy Here - Questions Inside

Hey. I’m SolarLune, a guy who likes to make games in his free time. I’ve been looking into game engines recently, and I’ve decided to try out Panda3D a bit more than previously. I was wondering a few things.

  1. I’ve got Aptana Studio (with PyDev) installed on my comp, and I was hoping to have at least a little code-completion stuff set up. I saw from this thread how to get a code-completion file for Eclipse (which Aptana’s based off of, right?). Anyway, I downloaded and used the script in Aptana to generate a ‘panda3d.core.pypredef’ file. I specified that file’s parent folder in Aptana’s Predefined Completions list, but it didn’t help. Anything else I’m missing?

1b. In addition / As an alternative, does anyone know of a plugin that would just run a ‘dir()’ function on the highlighted file? That would help to at least show the structure of the object specified. I suppose that’s not possible, though, since it would have to run all the lines in the script up to that to define the variable to run ‘dir()’ on…

  1. I’m using the Chicken exporter for Blender with Blender 2.61, and I’m suprised at how fairly simple it is. I’m glad that it’s not a huge problem to export a mesh simply and quickly. When it comes to animation, I see that it’s from a frame beginning to a frame end. It’d be cool to have Blender Action support, but in any case, I was wondering:

A) how easy is it to animate objects at a specific speed (play animations quickly, slowly, backwards, etc)?

B) Can you code bone movements yourself, to, say, have a character look at something, or aim toward an object?

EDIT: Oh, and here’s another couple of questions.

  1. I thought that I recall that you could use Blender as a kind of ‘scene editor’ by using game properties to mark locations (empties?). Maybe I’m off, but I thought that I recalled that… :confused:

  2. How easy is it to animate 2D objects? Not GUI elements per se, but actual 2D objects that face the camera - sprites? Just wondering.

Thanks a lot for any help!

Is anyone gonna help me out with some of these? It’s been 9 hours, but I suppose that’s not THAT much time… Can anyone at least help me with the code-completion problem? I could probably figure the rest out on my own…

Let me try at all this:
(As a side note 24 hours is a good time to wait, people may be in other time zones you know)

Awesome, glad to see you’re going to try panda3d, we’ll all be happy to see your creations!

I personally have never used IDE’s or anything above a text editor with syntax high-lighting, all I do know about this topic is that most of panda3d is written in C++, so most auto-complete systems will be broken or require some sort of manual work. I’d try asking about it through whomever develops Aptana Studio.

I can only answer this, again, with the above

There is documentation on controlling animations on the Actor Animations manual page

Yes.
Look at the looking-and-gripping example provided with panda3d’s samples, it shows having a character’s head ‘look at’ a target (the mouse in this case)

Blender has a tagging system under the Game Logic panel, and tags are exported through chicken, onto the nodes themselves. For instance:

mymodel.findAllMatches('**/=monster_type=evil_lamp')
# returns all objects tagged in Blender with "monster_type" set to "evil_lamp"

mymodel.findAllMatches('**/=monster_type')
# returns all objects tagged in Blender with "monster_type", no matter what the value string is

It’s mostly limited to your artwork. You could write a simple script (or class) that would create a flat card, and load a new texture onto it at each fps intervals, you would need to create the images themselves that show the animation however.

Otherwise you’d have to animate only by moving the entire image, or by using 2d animation in Blender, by simply creating flat animated models.

Hope this helps,
~powerpup118

Thanks for the reply. Too bad about the IDE, but it’s not that big of a deal. Glad to hear about the rest, particularly the tagging system. So, creating a card isn’t just an egg, huh? Will a 2D sprite take 3D space? Also trying to understand how Bullet works into the game engine. It’s kind of complex - I wanted to have a car drive about. There’s an example of this with Bullet’s physics, but would it just be simpler for someone like me to use the built-in physics (Just trying to get the Bullet Hello World example to show up with custom geometry’s proving a bit difficult for me)?

Anyway, thanks again.

The IDE may work and quite put, I was simply saying I have no clue about them, so perhaps someone with more experience in this area will reply.

You could just use an egg in place of sprites
You could just use an card in place of sprites
What’s the difference? A card is generated through the CardMaker class, or through egg-texture-cards (command line), which simply generates an egg for you.

Essentially there is no difference between an egg and a card, a card is more or less a term for an egg generator which generates a flat egg model.

A 2d object (egg, sprite, card, abbreviate it how you will) can take up an 2d or 3d scene graph, one will have an orthographic camera (render2d) and the other with have a perspective camera (render) Both the 2d and 3d scene graph will have X, Y, and Z coordinates, meaning that the Y will control which objects are in front or back, only one issue would be that render2d will stretch, aspect2d may work, attaching an orthographic lens to the 3d scene (render) would work better in most cases.

You can find more information about attaching an orthographic lens to the 3d scene, on the Orthographic Lens manual page.

Bullet is a complex engine however, most physics engines are. IMO, Bullet is the most feature complete physics engine for Panda3d, I can almost assure you that using Bullet will be easier for making a car, than using the built-in physics engine. This discussion would go better after you know more about Panda3d’s scene graph system, and how nodes interact with each other through their parent-child relationship. Once you understand this a bit more, using Bullet will be a piece of cake for you.

Hope this helps,
~powerpup118

Maybe you’re right, because I don’t know a whole lot. I read through the Scenegraph manual section (I think), but maybe I should read it again just to be sure. It’s a bit confusing when trying to tie it in with Bullet. The parent-child relationship and node-based scenegraph concepts seem pretty simple, though.

With Bullet, (kill me for saying any of this, you may), things kind of work like magic, you have a parent (the bullet object/node) which get’s magically moved to a new position and rotation (as per the physics calculations etc, and properties you’ve set on the bullet node itself) and you have the child, which is the visual aspect for the bullet object/node.

That way when using Bullet, the visual aspect automatically follows the actual Bullet one. Mostly it’s very simplistic and easy to use. If you still have lots of issues doing it, try posting what you have so far under the scripting issues section that way others can look at your code and suggest what you’re doing wrong and how to fix it.

Cheers mate,
~powerpup118

note: there are also animated-cards samples in panda’s sample-folder.

@solarlune, can you confirm that you are using blender 2.61 with chicken (not yabee)?. because afaik chicken only works up to blender 2.49b

D’oh, my mistake. I was using Yabee. Anyway, thanks for the help, guys. I’ll have to work on learning more about Bullet, and I’ll try asking questions over at the Scripting section. Thanks!

Quick note about auto-completion: At least with Eclipse (using PyDev), auto-completion works on a per-file basis for every term I’ve already typed somewhere else out of the box.

Yeah, that’s a nice feature that I appreciate. It’s too bad that I can’t get any completion of any built-in terms, though.

About auto-completion: VS2010 with Python Tools 1.1 is quite new, but the auto-completion is pretty good. All of the standard python library is provided, and if you add a reference to a pyd it gets scanned too. Just Panda3D dll are problematic, because of the combination of C++ API and Python API in one DLL (we have to do magic to load them up infront when starting Panda3D).

http://pytools.codeplex.com/wikipage?title=Features%20Editor#Intellisense

What kind of magic are you talking about?

Look at direct/src/ffi/panda3d.py. This is where all modules get preloaded using the Python “imp” modules.

The thing is, I wish you could make changes to sub-objects of a model this way. I would be nice if one could type,

KK = findAllMatches('**/=moster_armL');
KK2 = findAllMatches('**/=moster_armR');
KK.setTexture("RotTexture.jpeg");
KK2.setTexture("BoneTexture.jpeg");

KK.hide();
KK2.hide();

God… That would have been so fitting and for any engine. It just makes the developers job easier and allows for some really great effects, as well as open up the flood gates for some really tight programming.

rdb, could you please add this API functionality to Panda 1.7.0 and 8.0?

Just joking. :slight_smile:

(I wish)

That brings back memories. The game Xenogears for PS1 did the same thing. The game world itself was 3D but the characters were all hand drawn sprites.

That was one of the greatest traditional style RPGs ever made to me. It really kept me playing and I was dragged into the characters and storyline 100% of the way. :smiley: (it was about fun factor, characters and story with games like that. Those were the good old gaming days)

It would be a lot of work though… Doing all the animations x number of times because of the possible facing directions. Of course, if you design your characters evenly in terms of looks, you could simply flip some animations from left to right.

I would love to produce RPGs like Xenogears one day (but with today’s graphics of course). :smiley:

Well that’d be almost plain stupid to add, the reason I say almost, is because this is (arguably) basic functionality of the Python programming language, a for loop.

KK = render.findAllMatches('**/=moster_armL')
KK2 = render.findAllMatches('**/=moster_armR')

for np in KK:
    np.setTexture(loader.loadTexture("RotTexture.jpeg"))

for np in KK2:
    np.setTexture(loader.loadTexture("BoneTexture.jpeg"))

for np in KK:
    np.hide()

for np in KK2:
    np.hide()

Or just plain and simple:

for KK in render.findAllMatches('**/=moster_armL'):
    KK.setTexture(loader.loadTexture("RotTexture.jpeg"))
    KK.hide()

for KK2 in render.findAllMatches('**/=moster_armR'):
    KK2.setTexture(loader.loadTexture("BoneTexture.jpeg"))
    KK2.hide()

IMO, operating on groups of NodePath’s returns by findAllMatches() is just a useless feature, only saving a few lines, and complicating learning Panda for people who actually know Python, or general programming, as opposed to having to learn some backend, where you can apply operations on nodes within groups.

Again this is all very arguable, I’m just saying that in my personal opinion, a for loop is more commonly understandable to newcomers, and just makes things simpler.

Hope this helps,
~powerpup118

Yes, it helps knowing what is returned is a list type data structure. If I would have known that, I would have figured that out. I’ve said it before, one is only limited by knowledge of the APIs.

And I don’t have full knowledge of the APIs. If that info was sitting around in the Manual, it was well hidden in text.

With that knowledge gained, combined with the way I write my own collision detections and pathfinding APIs, I feel I could create a P3D MMORPG and keep fps up.

I questioned that until now, but hey…

Thanks! :smiley:

More API knowledge, please! :laughing:

Have you not even tried it? That code should work just fine (assuming you meant someNode.findAllMatches and not simply findAllMatches).

findAllMatches does not return a list; it returns a NodePathCollection, which is iterable (as powerpup118 showed), while it still provides methods such as setTexture() and hide().

panda3d.org/reference/devel … ection.php

This functionality is actually from before NodePathCollection was made iterable, so it was more difficult to perform operations on a large amount of nodes back then. Nowadays, it provides only minimal benefit over simply iterating over it as powerpup118 suggests; but it is still a bit faster, especially for large numbers of nodes.

I believe I typed, “list type data structure”; in essence, I was saying…iterable. I guess I should have used better wording there.

That’s the reason I couldn’t get the code to work the first time; because I didn’t think what was returned was something that could be looped over.

No big deal, I have no usage for such a thing with my current project, but it will come in handy for other types of games. :slight_smile:

Just finished adding a MoveToPoint function for individual character or group. The code work for my app is coming along quite ‘smoothly’.

All the years python programming is paying off. :smiley: