Since I had lots of problems trying to implement my own AI, I was excited about PandAI, but it appears it is currently a bit too limited for my use. Do the devs of the lib have the resources to continue developing it and if so, it would be interesting to see some kind of priority list on what might be expected to come?
What kind of AI functionality are you looking to use? Currently the developers of PandAI are a little held up with other projects and internships, however we are hoping to add some minor tweaks and fixes to the library as soon as we get some time. Meanwhile, if you could describe the AI you want to use we might be able to help you.
Thanks for the reply JohnKol.
My idea revolves around dynamically building random levels from blocks (originally tiles but squares are so limiting) for a Diablo style game. For example, a room or a piece of a corridor would make up a single block. Since you currently can’t create autogenerate a navmesh or, as far as I can tell, input your runtime generated navmesh node data except through saving them on a file first, this is a bit of a hassle.
My next concern is the actual AI chars. I would need to have lots of models (a few dozen at least) running around after the player. If I’m not entirely mistaken, you currently can’t have the models effectively pathfinding towards a target (player) and dodge collisions with each other.
This is one of the problems I ran into when I tried to create my own A* based system with tiles. I came up with using a feeler object like you do, but updating the A* path map turned out to be very difficult
I think the scenario I described is not very unusual, but it seems to be tricky to solve for amateurs like myself. Now that I’m writing this, I also thought of line of sight. Some kind of method for checking LOS based on the navmesh node data might be useful and fast for making certain decisions like whether the AI char should try to shoot at something or not.
I would wish me some more examples how to use the code. Yeah, i know on download section is explained how to use it. But when i do this i total fail.
For example evade:
aichar does nothing until i reach his destination and then he runs away and never stops or changes direction even i move in his way. and my relax_distance is twice the panic_distance.
i tried to make a swarm. after adding them all to swarm, swarm behavior was disabled. i checked c+±code and found a function to start this behavior. but nothing changed.
examples on download section are really good, iff they would do what i expect. so some graphical examples that shows behavior would be great. only small examples not that big like rralph. just a plane and then some chars which are using the behavior.
and it would be great if you can release your examples that you used for your videos. there is this swarm example with these moving trees and those chickens.
would be really nice!
btw our advancement:
we edited code so every aichar uses the same navmesh in the world for pathfinding. disadvantage is that you can only do one A* at the same time. We don’t know how big this disadvantage is for bigger worlds but it is still possible that every aichar uses his own navmesh if coder wants to.
Another thing we did is what darek mentioned. It is possible to do a A*-search on the navmesh and a Python list with waypoints will be returned. Then you can do stuff like using physics or assure a consistent world in a p2p game (thats what we do ).
i know, not much progress but team has much to do for university in the last weeks. Next week we focus on PandAI again and hopefully fix some issues.
Thanks a lot guys for doing this! This is what open source is all about. We really hope the libraries will grow this way by adding new features and fixes. Also since you are editing the code, a few things to keep in mind,
Please make sure you are following all the Panda3D conventions. This is a must if it has to get into CVS. You can get the details here,
Comment the code clearly so that people can easily understand and make modifications in future.
It would be great to have a maintenance log at the top of each file that you are editing. This would record the new features you have added and on what date.
We want to start updating the Panda3D manual soon so that it is easier to understand and implement the AI. If you guys can maintain a document of how to use the new features you have added that will be very helpful while we update the manual.
Could you provide a code snippet of how you are using the evade function? That would really help us to find out why it is not working.
Same goes for this one too. A code snippent of how you are doing it will be really helpful. Did you add the flock object to the AI World? That is very important.
Once again thanks for all your help and suggestions. We really want to push some fixes and features into the library. We shall come up with a priority list and share it with everyone soon.[/url]
NULL - specifies if a node exists or not.
0 - exists
1 - does not exist.
Node Type - specifies if it is the main node or the neighbor node.
0 - main node.
1 - neighbor node.
GridX - row index
GridY - col index
Length - length of each cell.
Width - width of each cell.
Height - currently overwritten as 0 since height info is not used.
PosX, PosY, PosZ - position of the node in the cell.
and it tells me a little about the Navmesh.csv in the fact theatim assuming it gives all info but things i dont understand are:
ordering (does it care what order the information is in?)
what does the position of the node do?
shouldnt most of the length/widths of the cells be the same as squares are generally used?
4.does the info start at the bottom left or does it matter?
if a node does not exist does this mean not at all? if so why did we record it??
I see in the static ob demo we can make things marked as not traverable is there an easy way to setup a csv to use my terrain as completely traverable then I can mark the stuff off i need? (I use a 1024X1024 terrain for now and i would like the map to use the same size if possible)
this is just some basic info that is nice to know course some of it really dosnt matter but i think it will help since i will probable have to build my mesh by hand. (Bascally im trying to come up with a way to use your system to hand write a csv but this will be time consuming and i need to know alot of what the system does without being able to read c++ so maybe a simple tutorial on writing the csv would suffice instead of answering all this)(the plan is to use this to write a python code to write a csv it may take time but its a tool so it dosnt need to be fast)
I hope that i didnt bother you too much and thank you in advance for any help you can provide!
Edit: Course I could just need to understand NavMeshes better myself I will be researching this subject to see if I can get a better understanding and with that hopefully be able to work with navmeshes with heightmaps.
Edit 2: I think i have found a round about way to make a navmesh. I use a heightmap in blender to make the terrain export it to egg this allows me to have my terrain info so that i can use it with PandaAI. If you wish to know how to do this go to: en.wikibooks.org/wiki/Blender_3D … heightmaps
the only downside is that the ratio in blender and Panda are not exactly the same so you may have to work with Panda or blender a bit to get it working properly for you.
another thing, the completion of the seek and pursue is determined by “int(target_distance) == 0”. meaning a distance to the target < 1 will make it finish, but depending on the scale of the models used in a game this isnt very practical.
Yes you need to maintain the order as the data will be read in the same order into a vector which is then used for pathfinding.
The AI characters will be using these node positions to traverse the mesh. These are the world space coordinates of the nodes. It will be the center of each grid cell.
The constraint for the mesh is that it should have the same number of rows and columns. So if you have a rectangular mesh, then all the grid cells will not be squares and cells will have some minute dimension variance.
The info starts at bottom left if I am not mistaken. I will confirm this anyhow.
If a node does not exist (which means it is an obstacle) it will be specified as null when the data gets written into the vector during runtime. During pathfinding the A* checks if a node is traversable by doing a null check.
So you can pretty much divide your entire 1024 X 1024 map into a grid. Make sure your grid has same number of rows and columns and then find the center position of each of the grid cells and assign it as the node positions in your csv. At this point all the nodes in your grid exist and are traversable. Now in the code you can toggle whether these nodes are traversable or not. As long as the data in the csv that you generate is in the same format I don’t see why you should have any issue using our pathfinding.
Just so that we are on the same page, we use waypoint meshes in PandAI as compared to Navmesh. And we know the confusion is due to the naming convention we used to explain the mesh generation process and pathfinding. Our apologies.
That was a great responce and it really helped I managed to get it working but there are a few issues: as i already posted this info see thread below for question. There seems to be something wrong with the egg file it looks right though…
Unfortunately PandaAI currently does not support blender models. We are still working on it. The way triangles are ordered in Blender eggs are very different from how Maya and Max does it. Hopefully we can get it working soon. Meanwhile if you have access to Maya or Max you shouldn’t have any problems.