Presentation is loading. Please wait.

Presentation is loading. Please wait.

RTS Game Design Difficulties October 20, 2004 Stephen Lee-Urban.

Similar presentations


Presentation on theme: "RTS Game Design Difficulties October 20, 2004 Stephen Lee-Urban."— Presentation transcript:

1 RTS Game Design Difficulties October 20, 2004 Stephen Lee-Urban

2 Overview 7.4: Random Map Generation for Strategy Games 7.5: Transport Unit AI for Strategy Games Stainless Steel Studios’ Empire Earth Shawn Shoemaker

3 Overview 7.4: Random Map Generation for Strategy Games 7.5: Transport Unit AI for Strategy Games Stainless Steel Studios’ Empire Earth Shawn Shoemaker

4 6 th year in game industry B.S. and M.S. in computer engineering from Virginia Tech. Worked for Intel, now works for Stainless Steel Studios shansolox@yahoo.com

5 Stainless Steel Studios Dedicated exclusively to designing RTS games RT 3D game engine: TITAN 2.0 –Windows, complete source (c++), 40+ person years –3 million units sold (got cash?)got cash? Empire Earth –Released Nov 2001 –“… a new high-water mark for realtime strategy fans.” GameSpy’s Dave Kosak –Same lead game designer (Rick Goodman) as AOE Empires: Dawn of the Modern World

6 Overview 7.4: Random Map Generation for Strategy Games 7.5: Transport Unit AI for Strategy Games Stainless Steel Studios’ Empire Earth Shawn Shoemaker

7 7.4: Maps? Subset of map generation in general Successfully implemented in E.E. Examples…

8 Birds-Eye

9 Fancy 3D View

10 If You Were Asked… Make a system to generate maps –Tile-based –RTS –Multi-player What qualities should these maps have?

11 These Maps Must be ______? Fair –Land per player –Resources per player –No strategic advantage Predictable –Similar by type –Allow for diff. outcomes Reproducible –Seed & type & size –Number of players Varied –Size –Type Relatively Quick –Many in-game systems not running –Impatient to start

12 Shoemaker’s Mapmaker 1.dll & 50+ script files Different.dll can be specified 7 scripts for each map type Inputs –# players, # teams –Size –Climate –Type –Random # seed

13 Intermediate Results Visualization tool created for 2D arrays –Land/Water –Height –Height/Water –Combined Map engine integrated late into game

14

15 Solution Overview Step 1: Place players (blank map of H 2 O)

16 Solution Overview Step 2: Grow player land

17 Solution Overview Step 3: Add flatlands to map

18 Solution Overview Step 4: Generate elevations map

19 Solution Overview Step 5: Combine the two (obeying rules)

20 Solution Overview Step 6: Fix cliffs and other anomalies

21 Solution Overview Step 7: Distribute resources to players Step 8: Place trees Step 9: Paint map with terrain textures Step 10: Place initial units for players Step 11: Place wildlife Steps 9 through 11 won’t be covered.

22 Step 1: Details Placement directly effects land growth How would you do this? Algorithm: –Inscribe one large disk onto map –Assign one random loc. per player w/in disk –Repeatedly push closest of player points apart until distribution sufficiently optimal “optimal” is a map attribute Specifies how evenly players must be placed

23 Step 1: Results Predictable player locations. Desirable? –Keeps maps balanced –Tunable through map attributes Assign player to points after placed. Why? –Teams adjacent to each other –Enemies somewhat symmetrically opposed What about colonization? “Dummy” players… –Placed after real players, on in/outside of disk. Why? –Dummies’ land grown after real players. Why? –Give the dummies resources too.

24 Step 2: Details Land is a resource in RTS games! –Allocate fairly –Must appear “natural” Clumps, modifiable script attributes –clumpSize –clumpNumber –Chaos level World starts as H 2 O What’s a clump?

25 Step 2: Clumps Grow until –size == clumpsize Create new clump some dist away at random, chaotic angle –Can’t grow any larger Make new clump of limited size Continue until number == clumpNumber Two growth methods, step & completion

26 Step Clump Growth 1 st tile is players starting location Choose one valid random edge per iteration

27 Valid Clumps Different types have different rules –Don’t take owned land –Don’t make peninsulas Island Clumps:

28 Step Clump Discussion Why is stepwise growth desirable? –Fair each player has equal chance to grow –Preventative Hinders one’s land “surrounding” another’s Avoids “starvation” –Opportune Makes good on the importance of placing players! Remember the dummies!

29 Completion Clumps Why bother, steps are awesome?! How about step 3?step 3

30 Step 4: Details 2D height map array Fractals (esp. diamond sq.) –Quick & easy –Realistic looking elevation Once again, map attributes –Min, max, initial elevation What about “noise”? –Filter used to smooth out jagged artifacts

31 Step 5: Details Remember “obeying rules”?obeying rules Algorithm: –if( landNH2O[i][j] == FLAT ) ignore heightMap –if( landNH2O[i][j] == LAND && height[i][j] == WATER ) Raise value in height[i][j] to preserve natural look –if( landNH20[i][j] == WATER && height[i][j] == LAND ) Lower height[i][j] to landNH2O[i][j] level Why not negate in the last two cases?

32 Step 6: Details We’ve got anomalies again! Wouldn’t negating have worked? Re-apply filter

33 Step 7: Resource Allocation Each player gets same amt. of each w.r.t. other players Randomly placed within rings centered on players’ starting locs. Validation –Some resources can’t be placed on terrain features –Resources restricted in min. distance to other resources –Resources restricted in min. dist to start loc Once again, map attributes –Amount of each resource –Size of ring

34 Step 8: Place trees Plentiful; Restrict pathfinding Can the clump class be re-used? Map attributes –Number forests/player –Size of forests –Number of clumps/forest Some areas of map marked as forest free Player-owned land does not restrict growth

35 Scripts Language to manipulate map attribs Basic text parser and data structures Things like: –#resources per player –Max altitude in height map –Player land allocation –Climate (terrain/forest/animal texture set) Small changes yield map variations

36 Scripts: Pros Allow for incremental map type devel. –New attribs for new maps –Add attribs to parser –Matching code added to map generator –Offload some tasks from programmers to designers –Modability/extensibility/variety Next steps… –Island map w/teams: allow land for team-members to merge –Tweak elevations: island maps become canyon maps –Tweak clump size: island maps become river maps

37 Scripts: Cons Unfortunately: –One master script per type of random map –One script per size of type of map –In each script, subsections for each qty. of players (# berries? # gold?) You can imagine: –Scripts can become hard to manage –Manuals needed to explain types & attribs –Additional tools to edit attribs across files –Designers are not programmers Programmers must create map “templates” Designers simply “tweak”

38 Buyer Beware! Can’t explicitly place particular terrain features –“super-tile” design approach –Fairer/more visually appealing Designers are not programmers Chokepoints are possible & unfair Resource placement can still yield advantages

39 Overview 7.4: Random Map Generation for Strategy Games 7.5: Transport Unit AI for Strategy Games Stainless Steel Studios’ Empire Earth Shawn Shoemaker

40 7.5: Transport Unit AI Move passengers around map Passengers are land based units Unit AI  Micro level for specific piece What are some of the challenges? –Many units must work together to achieve common goal. –Attempt to minimize player frustration. –Adhere to expected RTS transport standards.

41 Transport Hierarchy Transport types? Most difficult? Transport Air Transport Building Transport Land Transport Naval Transport helicopter balloon bunker city hall horse armored personnel carrier ships subs

42 If You Were Asked… Make a transportation strategy –Unit level AI –Passengers are land based units –Minimize input needed from player What would you do? –Use FSM based system? –Use HTN based system?

43 Solution Overview Implemented via FSMs –Jarret Raim and Chad Hogg covered these –Other options available –One FSM for passengers, one for transports All units have high-level goals –Based on player input –Decomposed into small steps

44 Solution Overview High level goals, part 1 –Loading Units instructed to board become “passengers” Complications –Mult. units meeting as one –Coordination / Interaction of unit AI –Prevent exploits

45 Solution Overview High level goals, part 2 –Unloading Transport instructed to “disembark” passengers Complications –Transport must move within range of unload loc. –Guess intended unload loc. & modify as necc. –Prevent exploits »Unreachable locations »Teleportation through walls

46 Passenger FSM

47 Note no “unload” action! Why? Other considerations –Don’t wait forever –Keep trying to reach rendezvous point “Freeloaders”; pretty easy…

48

49 Transport FSM Note both FSMs have a “load” goal Other considerations –Pick up passengers along way to rendezvous –Inform excess passengers when full –Continue to move toward unload point even if in range

50 Loading High level goal to enter transport Both passengers & transport given goal Passengers in range of transport load Key: agree on rendezvous point

51 Rendezvous Point Where transport/passengers will meet Particular transport class determines initial point Passengers then validate that point If unreachable || permanent blocking units –Adjust point by considering tiles surrounding initial rendezvous point (same validation) –First valid tile chosen, or original if none found

52 Transport Type R.P. Air Transport –Do most of moving Not slowed by terrain Don’t consider collisions –Passenger nearest transport used as R.P. Building Transport –Building location

53 Transport Type R.P. Land Transport Algorithm –Nearest passenger determined (assumes…) –Line cast from nearest pass. to transport Tiles underneath line determined One tile on line is selected as R.P. –Based on transport & nearest passenger’s “relative max. velocities” –Goal: make travel distance for nearest & transport the same since “their speeds are nearly equal” –Does this make sense?

54 Transport Type R.P. Naval Transport Algorithm –Land/H 2 O interface locations needed (2 RPs) –Dist. btw. RPs <= transport load range –Choose shore tile closest to passengers as Land RP –Water tile adjacent to Land RP picked –Adjust both RPs until reachable by everyone Potential problems?

55 Loading Range Distance from transport to passenger Land & Air –Performance-friendly bounded pathfinder from passenger to transport –Prevents teleportation Building –Same as Land & Air –Considers border tiles of transport upon failure

56 Loading Range Naval Algorithm T Cast Ray 1 st shore tile == test tile

57 Loading Range Naval Algorithm T a  false if( D1 <= LR ) if( D2+D1 <= LR ) if( !pathfind( p, T ) ) a  lineOfFireOK( p,T ) else a  true return a Problems?

58 Unloading High level goal to disembark passengers Only transport given goal As passengers exit, use subtile placement –Prevents collisions (passengers, terrain, etc.) –Prevents “teleporting” Key: determine unload point

59 Unload Range Distance check btw. ULR and UP When in range –Verify first passenger can path to UP from T –Verification uses pathfinder Illustration of Unload Points

60 Unload Points Each transport class determines TDP, FPP, and UP Points validated after calculation –Validated for each passenger/transport –Points must be (nearly) reachable –Final UP may be changed from CP

61 Transport Type U.P.s Air Transport –Transport destination not constraining –FPP == UP –Points subject to pathfinding of land units Building Transport –Placement code same as unit production –T == TDP == FPP –Remember sub-tile placement!

62 Transport Type U.P.s Land Transport –Same pathfinding restrictions as cargo –TDP == FPP == UP == CP –Different pathfinder for Siege tower unload Allow placement over wall unit Special power

63 Transport Type U.P.s Naval Transport –TDP == closest water tile from CP (ray) –FPP == (adjacent land tile to TDP) –Adjust UP from CP Ray btw. FPP and CP Tiles under ray are potential UPs Actual up  –Potential UP closest to CP and <= ULR –Use pathfinding to verify CP from UP

64 Transport System: Pros Decent job at naval transport Supports special design (siege tower) Reusable for garrisoning

65 Transport System: Cons Imperfect No coordination btw. multiple transports –Cut each other off –Hog unload location Pathfinding tests get expensive

66 Sources AI Game Programming Wisdom 2 http://www.stainlesssteelstudios.com http://www.3dgamers.com/games/empiree arthhttp://www.3dgamers.com/games/empiree arth


Download ppt "RTS Game Design Difficulties October 20, 2004 Stephen Lee-Urban."

Similar presentations


Ads by Google