Some questions regarding panda3d

hi everybody,
since I’m new to panda3d, i’de like to ask some questions (I’ve read the manual, but i have these questions), and i will ask them if appropriate.

  1. for path finding using, how possible is for example character a follows character b, and character c evades it? and how can i change the behaviors at real-time?
  2. for panda3d.bullet, i want the player walk. how possible is that? i want to add footstep sounds, etc and using an interval, i want to make it walk and/or run, depending the tile the player is at (if he is at a grassy area, i want it to play the footstep sound on grass, etc)
  3. how can i implement fires and explosions?
  4. for collision detection, how can i calculate the amount of the damage that happened? should i use Contacts?
  5. for audio, I want to play my cutsceens, How can i fade out the other sounds to play them? does panda3d have a feature for that?
    thanks for your help.

I want you to read

hi again,
the manual needs more explanations. for example, setFriction(), setRestitution() etc are not properly explaned. just they are explaned in the API.
also for fadeing, setVolume() is my best option.
I’ve read the manual, but i have to crall the api for the other stuff

(I don’t know much about Panda’s AI features, so I’ve omitted that question.)

  1. All of the things that you describe there are very possible. When using Bullet, I’ve found that implementing footstep sounds that vary by surface can be a little clunky, but it is nevertheless quite possible.

  2. Do you mean in terms of logic, or visual effects? If the latter, how you go about them may depend on the visual style that you have in mind, but I might suggest particle effects as one possibility. Another might be billboarded, animated sprites.

  3. How do you want it to work?

  4. It seems that you’ve found the “setVolume” method. In addition to this, since you mention fading other sounds out for cutscenes, let me mention that, if I’m not much mistaken, you can have multiple sound-effect “audio managers”. If all of your non-cutscene sounds are controlled by one manager, and all of your cutscene sounds by another, you could potentially fade the volume of the one as you raise the volume of the other, affecting all sounds in each as a group.

regarding visual effects, nope. my game is only based on audio.
but, my problem is implementing explosions.
as I’ve googled, people were saying to apply impulse on the object. but i’m not quite sure.
regarding collision detection, it should be dependent on speed of the both objects, and how much was the force and impulse. but I don’t know how to get that.
thanks for your reply.

Ah, I see.

Well, for explosions, applying an impulse to objects affected by an explosion seems like the right approach to me.

Regarding collision detection, I seem to recall that getting impulses from Bullet can be tricky. However, does your game require a particularly rigorous simulation? You can easily enough get the velocities of the objects in question, and perhaps use the dot-product of those (normalised) to get an idea of the intensity of the impact.

That said, detecting the event of a collision can be tricky in Bullet; I’d suggest searching the forums for methods of doing that.

With all that said, how detailed a physics simulation do you have in mind? If you don’t mind a simple simulation, have you considered Panda’s built-in physics system? It perhaps doesn’t have the depth and detail of Bullet, but I’ve found that it’s much easier to get notifications of collisions in the built-in physics system.

hi again,
again thanks for your reply.
yes panda3d’s physics system seems easier to use, but the thing is, i want to work with character controllers which is although incomplete in bullet itself, but panda3d doesn’t have it in it’s physics engine
once again, thanks for your replies.

@serega-kkz, thanks again for giving the link to me to check it out
I thaught getAiBehaviors() is a function of AIWorld
since i have problem in my sight, these errors happen.
again, sorry for taking your time.

How complex a controller do you need? For a simple game (just moving around a surface, colliding with walls, and no jumping) a simple controller can be made using Panda’s physics system, I think.

(And jumping can be done, I believe–it just adds a bit of complexity to things.)

I would suggest avoiding any physics system to make a character controller. It is hard to get the exact behaviour you want out of a physics system. You should carefully consider whether your game actually needs a physics system or whether a collision system suffices, and you will avoid yourself a lot of trouble.

That’s a fair point–I tend to not distinguish between a “physics system” and a “collision system”, which is perhaps over-broad. To clarify, then, I was suggesting that you use Panda’s collision system, not Panda’s physics system. (I’d honestly forgotten that the latter existed. ^^; )

I think it would be a compromise to create a character based on a bullet ray, by analogy with the panda collision system.

But in that case, unless the game calls for the more-rigorous physics simulation, what is gained by using Bullet instead of Panda’s collision system? Conversely, using Bullet incurs the loss of the rather handy collision-entries provided by Panda’s collision system, which, based on a previous post, seem likely to be useful.

To be clear: I’m arguing for Panda’s collision system here, but I’m not opposed to the use of Bullet. Indeed, I use it myself in one of my own projects. However, I think that both Bullet and Panda’s collision system have their uses. Thus I want to question whether the latter might not be suited to this project, based on what’s been posted. If in the end Bullet turns out to be a better fit here, then I doubt that I will gainsay that!

If not required, then obviously not use. What can be best learned with the test. For example, create a big map for a collision and make sure that the bullet or collision panda shows FPS more.

Nevertheless, I proceeded from the fact that physics is required, and the use of a panda collision for a character and a bullet for physics is expensive for a processor.

That’s fair! I’m just not yet confident that physics is required.

actually, regarding collision and physics system, the thing is that, both require some calculations.
but physics system adds physics dynamics, which requires some tuning sometimes to get the result
unfortunately, my idea is not colliding with walls, colliding with different things. better explaining, a simple soccer game, which requires physics.

Actually, I think that a simple soccer game could well be done using Panda’s collision system. You’d have to be careful with a fast-moving ball (but then, that’s true in Bullet too, I think), and bouncing might call for a bit of extra code in a collision-event, but it could be done.

With that said:

Depending on the specific features that you intend, I might be inclined to make my own character-controller whether using Bullet or Panda’s collision-system: a simple soccer game doesn’t seem likely to call for anything terribly complex in the movement of its players, I imagine. (Although I stand to be corrected on that!)

The physics of the ball might be easier done using Bullet. It’s not impossible by any means in either system, but I suspect that Bullet will do more of the work for you.

Conversely, as I mentioned above, I find that it’s easier to get collision information from Panda’s collision-system than from Bullet.

for a very simple soccer game, you are right. but when players collide, or a player tackles another player’s foot, then it requires a collision detection in order for example for refferry to give yello, red card, or don’t give a card.

Collision-detection, but not necessarily a physics-system, I think.

In any case, in my admittedly-vague knowledge of soccer/football, aren’t such violations based on how the event happens (such as tackling from the wrong side, or suchlike) rather than the speed of the collision?