Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. 《programming game AI by example》

《programming game AI by example》

Scheduled Pinned Locked Moved C / C++ / MFC
game-devsysadmintutorialquestionlearning
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bestbear
    wrote on last edited by
    #1

    I'm reading this excellent book. I considered to use steering behavior in our MMORPG game server project. but if we use it all,it would consume a lot of cpu time which would be unacceptable for a server project. does any one have any experience on this topic?How could I find a proper way to use steering behavior in MMORPG server? Thank you very much.

    L 1 Reply Last reply
    0
    • B bestbear

      I'm reading this excellent book. I considered to use steering behavior in our MMORPG game server project. but if we use it all,it would consume a lot of cpu time which would be unacceptable for a server project. does any one have any experience on this topic?How could I find a proper way to use steering behavior in MMORPG server? Thank you very much.

      L Offline
      L Offline
      leon de boer
      wrote on last edited by
      #2

      You write the search algorthim as an iteration, with adjustable resolution and trigger(s). If two objects are more than X apart the search doesn't run at all unless there is a special trigger. If you haven't been "spotted" there is no need for an enemy to search and so they usually just walk a defined set of waypoints called "pathing". So movement especially for NPC's or bots usually have two different behaviours being "pathing" and "searching". Often there is also a way to get "unspotted" and NPC's/BOTs may be leashed to some co-ordinate. If they get more than some distance from the leash point they will drop "seaching" behaviour and resume "pathing". The trigger whatever that is usually establishes the "target" and it is at that point the search AI kicks in. The game design thus far made sure searching is used sparingly. Now when the search algorthim kicks in, it sets a resolution grid based upon how far the target is away. You don't need a fine grid for a target far away. So you will have a raycast which you run to each point on the grid. So when target is a long way away you still only get a small grid just they represent a big distance. That is the bit your code you currently have probably doesn't do and so you have a huge grid when the target is a long way away. So now with your grid you run the AI search algorthim to work out what direction to move to the target allowing for walls etc. If the target is a long way away the direction will only be rough but that is all it needs it will fine up as it gets closer. The problem you probably have with the AI search they have given you is the grid is massive and it gets bigger and bigger the further a target is away. That would be how the vast majority of games not just MMORPG games work. Suggested start point for reading Near-Optimal Hierarchical Pathfinding (HPA*) | AiGameDev.com[^]

      In vino veritas

      B 1 Reply Last reply
      0
      • L leon de boer

        You write the search algorthim as an iteration, with adjustable resolution and trigger(s). If two objects are more than X apart the search doesn't run at all unless there is a special trigger. If you haven't been "spotted" there is no need for an enemy to search and so they usually just walk a defined set of waypoints called "pathing". So movement especially for NPC's or bots usually have two different behaviours being "pathing" and "searching". Often there is also a way to get "unspotted" and NPC's/BOTs may be leashed to some co-ordinate. If they get more than some distance from the leash point they will drop "seaching" behaviour and resume "pathing". The trigger whatever that is usually establishes the "target" and it is at that point the search AI kicks in. The game design thus far made sure searching is used sparingly. Now when the search algorthim kicks in, it sets a resolution grid based upon how far the target is away. You don't need a fine grid for a target far away. So you will have a raycast which you run to each point on the grid. So when target is a long way away you still only get a small grid just they represent a big distance. That is the bit your code you currently have probably doesn't do and so you have a huge grid when the target is a long way away. So now with your grid you run the AI search algorthim to work out what direction to move to the target allowing for walls etc. If the target is a long way away the direction will only be rough but that is all it needs it will fine up as it gets closer. The problem you probably have with the AI search they have given you is the grid is massive and it gets bigger and bigger the further a target is away. That would be how the vast majority of games not just MMORPG games work. Suggested start point for reading Near-Optimal Hierarchical Pathfinding (HPA*) | AiGameDev.com[^]

        In vino veritas

        B Offline
        B Offline
        bestbear
        wrote on last edited by
        #3

        thank you very much,it's really a great help. there is a lot of work to do

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups