New Guy Here - Questions Inside

Return to General Discussion

New Guy Here - Questions Inside

Postby SolarLune » Mon Feb 20, 2012 12:32 pm

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...

2. 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.

3) 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... :?

4) 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!
Visit my homepage at SolarLune Games: http://www.solarlune-games.blogspot.com

Also, visit my game development tutorial site at Game Up!: http://www.solarlune-gameup.blogspot.com
User avatar
SolarLune
 
Posts: 10
Joined: Wed Nov 02, 2011 1:39 pm

Postby SolarLune » Mon Feb 20, 2012 9:09 pm

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...
Visit my homepage at SolarLune Games: http://www.solarlune-games.blogspot.com

Also, visit my game development tutorial site at Game Up!: http://www.solarlune-gameup.blogspot.com
User avatar
SolarLune
 
Posts: 10
Joined: Wed Nov 02, 2011 1:39 pm

Re: New Guy Here - Questions Inside

Postby powerpup118 » Tue Feb 21, 2012 1:56 am

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)


SolarLune wrote: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.

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

SolarLune wrote: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?

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.

SolarLune wrote: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...

I can only answer this, again, with the above

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

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


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

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)


SolarLune wrote:3) 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... :?

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

Code: Select all
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


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

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
User avatar
powerpup118
 
Posts: 325
Joined: Sat Apr 17, 2010 11:59 pm

Postby SolarLune » Tue Feb 21, 2012 2:45 am

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.
Visit my homepage at SolarLune Games: http://www.solarlune-games.blogspot.com

Also, visit my game development tutorial site at Game Up!: http://www.solarlune-gameup.blogspot.com
User avatar
SolarLune
 
Posts: 10
Joined: Wed Nov 02, 2011 1:39 pm

Postby powerpup118 » Tue Feb 21, 2012 3:38 am

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
User avatar
powerpup118
 
Posts: 325
Joined: Sat Apr 17, 2010 11:59 pm

Postby SolarLune » Tue Feb 21, 2012 3:42 am

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.
Visit my homepage at SolarLune Games: http://www.solarlune-games.blogspot.com

Also, visit my game development tutorial site at Game Up!: http://www.solarlune-gameup.blogspot.com
User avatar
SolarLune
 
Posts: 10
Joined: Wed Nov 02, 2011 1:39 pm

Postby powerpup118 » Tue Feb 21, 2012 3:52 am

SolarLune wrote: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
User avatar
powerpup118
 
Posts: 325
Joined: Sat Apr 17, 2010 11:59 pm

Postby ThomasEgi » Tue Feb 21, 2012 7:17 am

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
User avatar
ThomasEgi
 
Posts: 2147
Joined: Fri Jul 28, 2006 10:43 am
Location: Germany,Koblenz

Postby SolarLune » Tue Feb 21, 2012 10:04 am

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!
Visit my homepage at SolarLune Games: http://www.solarlune-games.blogspot.com

Also, visit my game development tutorial site at Game Up!: http://www.solarlune-gameup.blogspot.com
User avatar
SolarLune
 
Posts: 10
Joined: Wed Nov 02, 2011 1:39 pm

Postby DangerOnTheRanger » Tue Feb 21, 2012 1:41 pm

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.
Free + open-source game development kit: http://openblox.sourceforge.net

My blog: http://dangerontheranger.blogspot.com
User avatar
DangerOnTheRanger
 
Posts: 240
Joined: Fri Aug 27, 2010 4:59 pm

Postby SolarLune » Tue Feb 21, 2012 1:59 pm

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.
Visit my homepage at SolarLune Games: http://www.solarlune-games.blogspot.com

Also, visit my game development tutorial site at Game Up!: http://www.solarlune-gameup.blogspot.com
User avatar
SolarLune
 
Posts: 10
Joined: Wed Nov 02, 2011 1:39 pm

Postby enn0x » Tue Feb 21, 2012 6:09 pm

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
enn0x
 
Posts: 1278
Joined: Wed Nov 08, 2006 1:39 am
Location: Germany, Munich

Postby Nique » Fri Apr 20, 2012 2:21 pm

enn0x wrote: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?
Nique
 
Posts: 12
Joined: Sat Jan 23, 2010 8:27 am

Postby enn0x » Fri Apr 20, 2012 5:34 pm

Look at direct/src/ffi/panda3d.py. This is where all modules get preloaded using the Python "imp" modules.
enn0x
 
Posts: 1278
Joined: Wed Nov 08, 2006 1:39 am
Location: Germany, Munich

Re: New Guy Here - Questions Inside

Postby markjacksonguy » Fri Apr 20, 2012 8:45 pm

powerpup118 wrote:
Code: Select all
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





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,

Code: Select all
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. :)

........

(I wish)
User avatar
markjacksonguy
 
Posts: 499
Joined: Wed Sep 28, 2011 4:06 pm

Re: New Guy Here - Questions Inside

Postby markjacksonguy » Fri Apr 20, 2012 8:55 pm

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



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. :D (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). :D
User avatar
markjacksonguy
 
Posts: 499
Joined: Wed Sep 28, 2011 4:06 pm

Re: New Guy Here - Questions Inside

Postby powerpup118 » Fri Apr 20, 2012 10:18 pm

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. :)

........

(I wish)


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.

Code: Select all
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:

Code: Select all
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
User avatar
powerpup118
 
Posts: 325
Joined: Sat Apr 17, 2010 11:59 pm

Re: New Guy Here - Questions Inside

Postby markjacksonguy » Sat Apr 21, 2012 1:30 am

powerpup118 wrote:
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! :D

More API knowledge, please! :lol:
User avatar
markjacksonguy
 
Posts: 499
Joined: Wed Sep 28, 2011 4:06 pm

Re: New Guy Here - Questions Inside

Postby rdb » Sat Apr 21, 2012 9:33 am

markjacksonguy wrote: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,

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

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


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().

https://www.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.
rdb
 
Posts: 8636
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Re: New Guy Here - Questions Inside

Postby markjacksonguy » Sat Apr 21, 2012 11:16 am

rdb wrote: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().


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. :)

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. :D
User avatar
markjacksonguy
 
Posts: 499
Joined: Wed Sep 28, 2011 4:06 pm

Postby ajimmyadams » Fri Jun 29, 2012 10:44 am

Hello Everyone.
I am jimmy Adams. How are you all. Well guys i hope that i haven't did a big mistake to join this forum... And i could meet and conversant with new friends.
ajimmyadams
 
Posts: 1
Joined: Fri Jun 29, 2012 10:31 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests