Presentation is loading. Please wait.

Presentation is loading. Please wait.

Artificial Intelligence in Game Design

Similar presentations


Presentation on theme: "Artificial Intelligence in Game Design"— Presentation transcript:

1 Artificial Intelligence in Game Design
Terrain Analysis

2 Terrain Analysis Features of terrain have good/bad influence over map areas Good locations  Possible goals to move to Bad locations  Places to avoid when moving Cover = good High ground = good Open space = bad Slow to travel through = bad

3 Terrain Analysis Must be based on realistic estimates of how terrain affects play Game engine based Example: Engine reduces hit probability by 50% when target > 100 feet above Factor into NPC deciding to move to high ground Most likely for “overhead perspective” combat games Visibility based Relevant for FPS games Example: NPCs in shadow not visible to player NPC should move to such areas

4 Terrain Analysis “Dangerous” terrain elements
Things that can damage character Terrain that might expose character to attack Areas that force character to move slowly Areas where character has chance of getting stuck Often related to edge costs, but not always Some slow terrain offers cover Forrest, darkness, etc. GASOLINE

5 Terrain Example -1 -2 -3 GASOLINE

6 Terrain and Influence Areas have influence over other areas Examples:
High ground Shadow Cover Influence over Influence over Influence over Influence over

7 Levels of Influence Amount of influence may depend on relative values between areas Influence of area i over area j for some property P = f (P(i), P(j)) May be simple difference k × (P(i) – P(j)) Example: height(i ) = height(j ) = k = Influence_Strength (i, j ) = 8 Must be based on how game engine defines advantage of area i over area j High influence over Low influence over

8 Influence and Distance
Usual assumption: Influence of terrain decreases with distance Linear dropoff out to some “range” R Influence_Strength (i, j ) treated like “strength” Given distance D (i, j ) Influence (i, j ) = Influence_Strength (i, j ) × (R – D(i, j ) )/R Influence over other areas 40 feet below this one at distances 1 - 4 Influence over area 3 units away and 40 feet lower = 2.0 5 4 3 2 1 1 2 3 4 5

9 Influence Example B Height = 50 A Height = 40 D Height = 30 C
Influence Over A B C D - 20 * 0.2 * 0.5 = 2.0 10 * 0.2 * 0.25 = 0.5 10 * 0.2 * 0.75 = 1.5 30 * 0.2 * 0.75 = 4.5

10 Total Influence Influence over others – influence others have over it
Total influence of area i = Σ influcence (i, j) – Σ influcence (j, i) j j B Height = 50 A Height = 40 D Height = 30 C Height = 20 Total Influence A B C D – 1.5 = 1.0 = 8.0 = -8.0 = -1.0

11 Combined Influences Total influence may involve many factors
A is lower ground than B A has cover while B does not Influence of cover = 4.0 Influence of B over A from height = 1.5 Influence of A over B from cover = 4 A has total influence over B of 2.5 B Height = 50 A Height = 40

12 Combined Influences Must also factor in unit-based influence maps
Good location controlled by enemy is bad place to move to! Example: Influence of B over D from height = 2.0 Influence of D over B from cannon = 3.0 Total influence of D over B = 1.0 B no longer a good place to move to! May not know that until you move there! B Height = 50 D Height = 30 C Height = 20

13 Map Analysis Complex analysis of crucial map areas Goals:
Crucial for randomly generated terrain Example: Leaders: Clash of Nations Goals: Identify chokepoints between different game zones Identify hotspots that have influence over chokepoints

14 Map Analysis Smoothing (image analysis) used to remove small areas of impassible objects Area around impassible tile T passible  T removed from analysis

15 Map Analysis Random path generation often used
For large number of examples: Select two random waypoints Use Dijkstra/A* to find shortest path between them Keep track of waypoints on path Store waypoints, path for each Waypoints with large number of paths are candidate chokepoints

16 Map Analysis Verify chokepoints
For each candidate chokepoint rerun tests that passed through it If resulting paths significantly longer (or infinite!) chokepoint confirmed

17 Tactical Waypoints in Dungeons
More difficult for dungeon world Tile centers may not give all good tactical locations Best tactical location based on cover Best tactical location based on shadow

18 Tactical Waypoints in Dungeons
Automatic creation Subdivide area into smaller tiles Find tiles with highest influences over other tiles Create new waypoints there Computationally intensive, but only need to do once Influence over other points, few points with influence over it


Download ppt "Artificial Intelligence in Game Design"

Similar presentations


Ads by Google