Menu

Navmesh and other AI stuff

EugeneLoza
2016-12-22
2016-12-24
  • EugeneLoza

    EugeneLoza - 2016-12-22

    Michalis, hi!
    I've tried to figure out how TCastleCreatures AI works, but I couldn't find the procedure where it is described... Could you point me to the right unit? Namely I'm interested in using navmesh or its analogue used and the pathfinding algorithm so that I can implement creatures behaviour in a turn-based game on a non-grid map. I'll need to make a new AI due to game specifics, but I don't want to invent a bicycle by creating a separate navmesh analogue during map generation :)...
    Please, don't write a lot... I feel so uncomfortable for taking so much of your time. Just point me to the unit and maybe some algorithm description if you were using a known implementation.

     
  • Michalis Kamburelis

    To find paths we're using a simple graph of waypoints and sectors. It's briefly documented on http://castle-engine.sourceforge.net/creating_data_levels.php . It's basically a simplified version of the navmesh idea, with various shortcomings (in particular, it has to be designed manually by level designer in Blender), but works Ok in simple cases.

    The way to use creatures is described in tutorial on http://castle-engine.sourceforge.net/tutorial_resources_using_existing.php . It's all implemented in the CastleCreatures unit. One of the larger games using it is "the castle", on github https://github.com/castle-engine/castle-game . It is also used by fps_game example, with many comments. You can see how waypoints and sectors are set also in "the castle" and fps_game levels.

    The creature type WalkAttack uses the sectors and waypoints to run toward enemies.

    BTW, I think I'll rename tutorial->manual soon, calling it "manual" may be more appropriate. What do you think?

    Sorry for the chaotic writing, I'm writing on a cell phone:) Don't worry about me, I like writing answers about things that work in the engine:)

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB