Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

113 Neutral

About calculemus1988

  • Rank
  1. calculemus1988

    Recast and Detour in C#

    I was recommended to use this one by the author of Recast and Detour: http://stevefsp.org/ It is c# port to recast and detour for use with unity, will give it a try
  2. calculemus1988

    Recast and Detour in C#

    I did check out the beta but it seems I will have to do my own pathfinding to have more control over things. Are you sure that Recast and Detour is actually used in Unity? Can you share a link or something to read ?
  3. calculemus1988

    Recast and Detour in C#

    I am stuck with my RTS game in Unity/C#, on the navigation system. For one I don't have enough experience and another thing, information on the topic is hard to get. I will need to buy all 4 AI Wisdom books. Doing it myself it turns out I will end up in unknown land by myself and waste time and do nothing. I decided to try Recast and Detour as my last option. I hate reading someone else's C++ but what a hell. I was wondering what do you think about rewriting Recast and Detour in C#? Any estimation how much time it might take? A dude worked 3 months at Google Summer of Code on getting Recast and Detour to work for Blender. I assume similar time, 3-5 months maybe. Thanks for any comments, warnings, suggestions
  4. calculemus1988

    A* "for dummies", in intuitive terms

    Yeah A* has saved a lot of villages so far, Dijkstra does not care about the poor people in the village
  5. calculemus1988

    How do you maintain a navmesh in RTS game?

    I decided to do my own pathfinding. I provide a short description of what I plan to do, feel free to comment. 1. Only two types of objects can change the navmesh at runtime. Trees and buildings. 2. Trees - when a tree is cut down a rectangle will be added to the navmesh, at position where the tree was so that the area is now walkable. Each minute I will do a check if I can join some rectangles for fallen trees. This way I wont lose performance and I will make sure that I dont get lot of small rectangles in the navmesh for the trees that were cut down. So that is all about trees, easy right? 3. Buildings - As in Warcraft, you can position the building at discrete positions, which means I will use a grid. There are two cases, a building is created or destroyed. When a building is destroyed it is easy, just add one rectangle(representing this building's area) to the navmesh. When a building is created it will occupy a rectangle in my grid so basically I will just cut off the cells that are inside this building's area, which will be fast to test. Then I will add the triangles around the building as in this image. http://postimage.org/image/5pnq53dzb/ So you can just walk on the green area, the yellow is the building. This is the only case where I will use triangles in my navmesh. Everything else will be done with rectangles that fit in a grid so that intersections tests are easy, when you try to create a building and update the navmesh. So the main part of the job will be dealing with the different cases of rectangle intersections. Restricting myself to a grid and not using triangles will make things easier. Well actually instead of thinking about cases, I should find myself some computational geometry algorithm that partitions a surface into rectangles. Not quadrangulation algorithm, I need only rectangles which are quads yes, but with vertical and horizontal lines only. Here is the process of creating a building: http://postimage.org/image/bzde0j8vf/ A question I have is will this cause me problems? http://postimage.org/image/wow6dzpuj/ I mean can I have two rectangles that share a side with one rectangle, or I will have to split the big rectangle like in the image below ? Thanks for any comments
  6. calculemus1988

    How do you maintain a navmesh in RTS game?

    It is much more complex than the pathfinding I did in "Programming Game AI by Example". I doubt I will find a book where NavMesh implementation is given and explained. But it seems the AI Game WIsdom series contains a lot of information on NavMeshes. As soon as I get some money next week I am ordering all 4. In my RTS project so far I got the selection system and steering behaviors. Next is the pathfinding system, seems I will spend two months or so on this. Edit: I decided to go with Recast and Detour. I will spend way too much time on pathfinding myself and I won't get the game done till October which is my deadline. If you guys can recommend some tutorials/articles or whatever on Recast and Detour please, there is no documentation for it which makes things hard.
  7. How do you maintain a navmesh in RTS game? In RTS you constantly build and destroy buildings. That means you need to update your navmesh through the game. I have done hierarchical pathfinding with two graphs, one finer and one coarser, on static map that does not change, from the book Programming Game AI by Example. I have not worked with navmeshes so far. I have no experience with maintaining a graph or mesh either, as in RTS games. Any articles or books you can recommend on the topic I would gladly read. Thank you
  8. calculemus1988

    Navigating more units as a group in RTS

    I think it is much more complicated than that
  9. I have a question related to navigating more units at once in RTS. You know you select your army in Warcraft and you send it to go somewhere on the map. Navigating one unit on the map is easy because it starts at where it is and it goes exactly to the position where it is told to, with right mouse button click. When you have more units things are a bit complicated. You can't just plan path for all units to go exactly to the spot where you tell them too. In Warcraft for example you see units first make a formation, like archers go behind and others in front for example, and then I guess one unit is picked as leader and they all follow the leader with some offset. There is such steering behavior called follow leader with offset or something you can apply. I guess the core part here is the formation thing, once you have the formation then they will all just follow one unit which is picked as leader. The leader is the one that will plan a path to where you clicked with right mouse button, but the rest will just follow him. So give me some opinions guys
  10. calculemus1988

    RTS game in Unity

    Milestone 2: Steering Behaviors You can check out a simulation example in the first post.
  11. I am working on RTS game and so far I am working in the XZ plane as if you would in XY plane. I am using Vector3 class in Unity for all operations and I set y to 0. I started using Vector3 and not Vector2, because I thought later in the game I "might" need some movement of the units in y. But let's say I have only ground units, should I use Vector2? I might get some performance gain, I mean Vector3 is used a loooot, so cutting down a dimension I suppose will improve performance... and also will make coding simpler since I wont have to worry about setting y to 0 anymore... Give me some opinions guys, thanks
  12. japro I fixed that and I got from 80 now to 150 agents. Not bad but still bad I have Wander on all my agents, and I think that sucks the performance... Now is a good time to try Unity's profiler.
  13. japro, Here is my approach, well it is from the book Programming Game AI by Example. 1. Every agent updates his cell in his own Update call. That way every agent knows in which cell he is at all times. 2. Every agent updates his neighbors list on each Update call. I have posted the code for the function above, before your post. To summarize, I only look for neighbors in those cells that intersect with the bounding rectangle of my agent. The size of that rectangle is basically how much you want the agent to see around him. That is pretty much it. One thing to note is that things are ALREADY slow even without neighbors calculation. I have Wander, Obstacle and Wall Avoidance on my agents. One improvement I can see is to look for neighbors only in nearby cells. I have 10x10 grid, that is 100 cells. Imagine every single agent at every frame, goes through ALL those cells to find which ones intersect with his rectangle, and then look for neighbors there. I cant see other improvement than that for now. Let me know what you think. EDIT: japro I just saw your post, we posted at the same time Thank you, I will fix this now.
  14. Yes I create a bounding rectangle in XZ around my agent and I test for intersection with cells. So you have rectangle-rectangle intersection tests. Then I only look for neighbors in those cells that intersect with the agent rectangle. Here is the code, it is pretty easy http://pastebin.com/Zyd8Ynbt
  15. Thank you for your quick answer. Yes my agents move mainly in XZ plane, so I guess I will go with quadtree. Should I expect drastic performance improvement compared to the grid method? The grid method is basically you divide the world in cells, and you only search for neighbors in cells that intersect some bounding rectangle around your agent.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!