AI for Panda3D: PandAI v1.0!

Maybe instead of showing the videos on the manual we could do this.

Since the documentation right now is on a google site ( and wont need server support ). We can just link videos to go to the site page and see the video.

Im not sure, maybe it wont be that hard to embeed a video.
thats more preferrable for me.

Yup. I prefer that too! Just an alternative.

I will look into it.

@Anon

I looked into the embed code and unfortunately it isn’t working on the Panda Wiki. I will put up a thread in the forums and see if anyone has an idea.

On another note, the documentation is coming out pretty well. Slowly but steadily :slight_smile:

Hm, well Im not very experienced with wikis, only edited existing pages before.
The only videos Ive seen on this site are simply links to googlevideo, youtube and vimeo. I remember Gogg wanted to convert and upload few of the existing videos in a higher quality to the Panda3d server, but I havent heard anything for months. Right now theres this incomplete page: panda3d.org/video
I dont even remember have I got there.

I’m sure rdb and the rest will be able to help you somehow.

I’m quite new to Panda3D programming so forgive me if I say something newbish or wrong ><.

I currently managed to use the AI library to have AI chasing the player. However, I was hoping that I could alternate the speed of the AI throughout the entire game.

I read in one of the posts in the previous thread

So I set a variable to the 5th param, ‘self.lectspeed’.

And have a task continuously update self.lectspeed.

Don’t worry about the self.xpos variable I’m just reusing a task I used last time but it works. Printing the self.baddySpeedIncrease and self.lectspeed shows a change in both variables but the AI does not seem to be running any faster during the change.

Could someone point me in the right direction ^^"? Thanks alot.

@DUMMIbears

Changing the variable which you had passed in intially, will not change the attribute which is stored for max force for the AI Character. It is not linked to the variable but the value.

You have to call :

void setMaxForce(double max_force);

on your AI Character, to actually change the max force.

In the Steering Behaviors documentation, look through the helper functions for the AICharacter for maybe a different way to accomplish this too.

Hope that helps!

Hey NNair, I think it would be better if you had the example files uploaded to the panda server.

Yeah, that’s a good idea. Will speak to rdb about it. I should be able to finish the remaining manual documentation by this week’s end, so will change that too.

NNair>
Thanks for replying :slight_smile:.
But I’m just wondering can that be used for Python?
Thanks again.

In its simplest form :

AIworld = AIWorld(render)

AIchar = AICharacter(“seeker”,self.seeker, 100, 0.05, 5)

AIworld.addAiChar(self.AIchar)

AIchar.setMaxForce(20);

Good news !

I finally finished uploading all the documentation on the Panda3D manual and it looks great.

I think this should make it easy to find anything PandAI related from now on.

Check it out!

Its a good addition.
Im not sure if its current location in the manual is good, though. maybe a bit higher, between collision detection and physics, but im not the one to decide.

Some things I noticed:

  1. in the second page the import should be in code tags

  2. i probably said this before, but you should upload the files to the panda server like the rest

  3. i notice you dont have a C++ equivalent of the codes in the second page, and the opposite in some other pages. In the manual pages you can toggle between C++/Python in the top of the page, it shouldnt be hard for some to port the C++ lines to Python and vice versa, but this is not how the rest of the manual pages are done.

  4. i dont think you need to explicitly say that the actul library is open source and where to get the code, since its part of panda now…

Other than that, its done in my opinion.

@Anon

  1. Done

  2. Spoke to Reinier about this, lets see if he comes up with a solution.

  3. Your right, I will try and put some more time to translate this into c++.

  4. Changed

Thanks for your input.

Hi,i am trying to create obstacles in my game and get error

self.AIBehaviors.obstacleAvoidance(1.0)
self.AIWorld.addObstacle(self.arrow)

self.AIWorld.update()

AssertionError: !is_infinite() at line 60 of c:\panda3d-1.7.0\built\include\boun
dingSphere.I

@driver

Did you try to download and execute the demo at :

panda3d.org/manual/index.php … _Avoidance

Also, this doesn’t seem to look as much a PandAI error as a Panda3D one, could you maybe paste a simple version of your code here for me to debug.

yes and demo works,but only demo

and thats not all,if i add dynamic or static obstacle,panda crash

Well dynamic and static obstacles are to be used only for path finding which is not part of Steering behaviors. So if it is obstacle avoidance ( a simpler method than path-
finding ) that you want, then I would suggest slowly modifying the demo till you get what you want.

This would definitely give you a better start than starting yourself from scratch.

i use pursue
i am working on rts game and game current have 10.000 lines of code.
everithing works fine except this,
here is my code

self.AIWorld = AIWorld(render)

self.AIChar =AICharacter(“worker”,self.worker,60,0.5,15)
self.AIWorld.addAiChar(self.AIChar)
self.AIBehaviors = self.AIChar.getAiBehaviors()
#self.AIBehaviors.initPathFind(“models/navmesh.csv”)
self.AIBehaviors.obstacleAvoidance(1.0)
self.AIBehaviors.addObstacle(self.house)