Can somebody give me a bit of help with AI for a top-down game. Looking on "Google" does not help all it gives me is simple stuff. I want my teammates in my game to actually have proper AI. Move around, avoid walls, duck to cover, etc and the zombie to pick either a player or a team mate to target. I tried doing something similar to that but it doesn't work. Is there a way to make my teammates avoid walking into the walls? Thank you.
AI help!
Started by buzzy, Mar 25 2012 10:19 AM
2 replies to this topic
#1
Posted 25 March 2012 - 10:19 AM
#2
Posted 25 March 2012 - 10:59 AM
There are several methods you can employ - See this topic for details:
Artificial Intelligence Systems
The methods you choose depend upon your capabilities, if you are using Lite or a registered version of Game Maker and if you use GML coding. Some techniques are not available using drag and drop actions alone. There is no "one size fits all" solution. Object avoidance using dynamically created paths can offer a superior movement but they can become CPU intensive.
The simplest uses the mp_potential step method to allow the instance to step towards a target avoiding obstacles. This method does not always find the shortest path and can cause dithering but it is simple to implement and adequate for many uses.
If you have Pro / 8.1 Standards you can use mp_grid_path functions to give you superior movement but you must design the grid to fit the sprites using it. From the manual:
Artificial Intelligence Systems
The methods you choose depend upon your capabilities, if you are using Lite or a registered version of Game Maker and if you use GML coding. Some techniques are not available using drag and drop actions alone. There is no "one size fits all" solution. Object avoidance using dynamically created paths can offer a superior movement but they can become CPU intensive.
The simplest uses the mp_potential step method to allow the instance to step towards a target avoiding obstacles. This method does not always find the shortest path and can cause dithering but it is simple to implement and adequate for many uses.
If you have Pro / 8.1 Standards you can use mp_grid_path functions to give you superior movement but you must design the grid to fit the sprites using it. From the manual:
Clearly this involves some advanced functions and a bit of trial and error initially but if you are using a Lite version then you can't use this functionality.The grid-based approach is very powerful (and is used in many professional games) but it requires that you do some careful thinking. You must determine which area and cell size are good enough for solving the game. Also you must determine which objects must be avoided and whether precise checking is important. All these parameters strongly influence the efficiency of the approach.
#3
Posted 25 March 2012 - 11:02 AM
For the moving around walls I suggest that you use the mp_ systems available in GM, but for sniping and covering, you could make invisible marker objects and have the squad members choose one to go to id they are being shot at.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











