1 / 32

Lecture 25 - Strategy

Lecture 25 - Strategy. CS 490/590 Wesley Kerr. Final Presentation. Two Parts Presentation Time : 5 minutes total – teaser to convince people to play your game Potential outline Team: who you are and who did what Game concept/pitch Technology What languages/libraries

sabine
Télécharger la présentation

Lecture 25 - Strategy

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 25 - Strategy CS 490/590 Wesley Kerr

  2. Final Presentation • Two Parts • Presentation • Time: 5 minutes total – teaser to convince people to play your game • Potential outline • Team: who you are and who did what • Game concept/pitch • Technology • What languages/libraries • Platforms supported • Timeline • Screenshots from prototypes • Screenshots from now

  3. AI Model AI gets information AI gets a slice of processor time AI turned into on-screen action

  4. Tactical Locations • Retreat (rally) points • Used by military simulations to prevent routs • Cover points • Marked locations behind barrels, crates • Shadow area • Stealth games use the shadowed areas to hide • Sniper locations • Other points that provide tactical advantage for one side • ambush points, hot spots, sinking sand

  5. One Step Further • What are the qualities of a good sniper position? • Good cover • Good view of approaching enemy • Construct a tactical graph that contains multiple pieces of information for each tactical waypoint • Supports both types of points necessary for a sniper position • Choose the locations that achieve both cover and neighbor with a reconnaissance location. • Types of waypoints in a tactical graph • Cover / Shadow / Exposed • What can we decide with this? • Ambush points • Sniper locations • Close cover points • For reloading and hiding

  6. Reasoning • Tactical graphs are useful for reasoning • Imagine that you want to perform a hit and run on the enemy. • Lots of visibility • Lots of exit routes • An algorithm for automatic detection with this type of reasoning is very complicated and sophisticated • For instance, the node C is a has several exits available and good visibility. • You don’t perform a hit and run in the middle of the room • Have the level designer mark these nodes for you! • This is what tends to happen.

  7. Tactical Waypoints • Issues so far • Context Sensitivity • Cover waypoints • Not simply a matter of being behind the barrel • To get good cover, you need to place the barrel between you and the enemy • Sniper locations • Only good when they haven’t been discovered • Easy solution • Add directional information to the waypoint graph • Cover – N,S,E,W • Additional information as well – crouched, standing • Harder solution • One state per waypoint • Do line of sight queries to determine amount of cover as needed

  8. Context Sensitivity

  9. Tactical Information • Treat tactical information as regular information • Incorporate tactical information into your decision tree/FSM/HFSM • IF cover point close THEN go to it • Incorporate tactical waypoint graph into pathfinding • When you need to have sneaky AI, choose the path that minimizes your exposure • When you need to have dumb AI, choose the path that maximizes your exposure

  10. Collecting Tactical Information • Human Level Designers • Humans are very good at quickly selecting a subset of the points that offer cover, etc. • This is the primary reason we use level designers to do this for us. • Issues • Level designers should be concerned with the flow of the level and making sure that it is fun to play. • They should not be concerned with inputting all of the information that your AI need to mount a successful attack.

  11. Automatic Generation of Tactical Information • Cover points • Randomly select points in the room and cast rays to see if they would hit a character stationed at the tactical waypoint • Gotchas: • How do you handle multiple heights in the level? • Visibility points • Perform many line of sight tests • Rough approximation of the volume of the level that can be seen from the waypoint. • Shadow points • Requires an illumination model of the scene • Naive: For each waypoint, test several random points around it to calculate the average light intensity • Better: You are only as hidden as the brightest part of your anatomy • If your head is lit up and your body is hidden, then you aren’t hidden!

  12. Automatic Generation of Tactical Information • Other techniques • Record player traces (i.e. make your testers work for you!) • Reveals locations where players are making use of cover • Condense a pathfinding waypoint grid • Start with a very, very fine grained grid • Keep waypoints that have the highest values. • Keep waypoints that have high values and are hard to reach • Two close nodes separated by a wall • Issues • Recording traces requires lots of people to play the game and more time to process the trace information • Condensing a pathfinding grid isn’t a cheap algorithm

  13. Tactical Analyses • First task: Decide on representation of level • Chunk the level such that all of the area within the chunk has the same properties • Example: In a shadow map, all of the points in the chunk will have roughly the same illumination level • Techniques • Tiles, floor polygons, navigation meshes, etc.

  14. Influence Maps • Keeps track of the current balance of military influence at each location • Contributing factors • Proximity of enemy unit • Proximity of a base • Duration since last occupied • Current weather • Surrounding terrain • Financial state of each military • Equations of influence

  15. Terrain Analysis • Extract useful data from the structure of the landscape • Difficulty of the terrain • Useful for pathfinding • Avoid marching through the swamp if there are other options • Visibility of each location • Similar to waypoint analysis • Degree of shadow • Ease of escape • Choke points

  16. Terrain Analysis • Frag-map • Each node in a grid has two pieces of information • The number of people killed or shot in this square • The number of people shot or killed from this square • AI can query this map and have it influence where they move to. • Notable example of this type of analysis • Team Fortress 2

  17. Types of Strategic Analysis • Category 1: Unchanging properties of the level • Gradients in outdoor landscapes (assumes static landscape) • Shadow calculation (assumes constant lighting model) • Generally computed offline • Category 2: Slowly changing properties of the level • Updates that work slowly, or consider only a handful of locations at a time • Military influence in an RTS • Coverage of a fire station or a police station in a city simulation game • Category 3: Quickly changing properties of the level • Almost the whole level needs to be recomputed each frame • Techniques to limit computation time • Only perform calculations on most important areas • For example: For an AI looking for defensive cover, we only need to consider those enemies that are currently attacking it

  18. Combining Information • We’ve covered several different analysis techniques • How secure is a square in the game? • How much visibility is available from a square in the game? • Other details about the environment • Distance to other units • Allows us to avoid clustering everyone into the same area • How do we combine the terms?

  19. Combining Information • Option 1: • Quality = Security * Visibility * Distance • Option 2: • Quality = (Security * Visibility) / Tower Influence

  20. Potential Fields • Like an influence map • Two types of charges • Positive charges attract the AI agent to them • Negative charges repel the AI agent away from them

  21. Ranged Attacks with Non-Linear

  22. Avoiding Local Minima

  23. Additional Information • Army field manuals • http://www.globalsecurity.org/military/library/policy/army/fm/ • Terrain Analysis • Terrain Analysis for Realtime Strategy Games • Dave Pottinger, Game Developer Conference 2000 • Tactical Analysis • Lars Liden, 2001 Talk • http://ai.eecs.umich.edu/people/laird/game-seminar/Liden.ppt • Terrain Reasoning for 3D action games • William van der Sterren, GDC 2001 • http://www.cgf-ai.com/docs/gdc2001_paper.pdf • Conference Proceedings • AIIDE ‘09 • A Multi-Agent Potential Field-Based Bot for a Full RTS Game Scenario • Johan Hagelback, Stefan J. Johansson • Books • Game Programming Gems 1-7 • AI Game Programming Wisdom 1-4 • Potential Fields • http://aigamedev.com/open/tutorials/potential-fields/

More Related