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

Slides:



Advertisements
Similar presentations
Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Advertisements

CSE 380 – Computer Game Programming Tile Based Graphics Legend of Zelda, by Nintendo, released 1987.
Artificial Intelligence in Game Design
Wall Building for RTS Games Patrick Schmid. Age of Empires.
Soar and StarCraft By Alex Turner. What is StarCraft: Brood War? A Real-Time Strategy (RTS) computer game released in A sci-fi war simulation Continually.
Adam Miles. Transport Tycoon Deluxe (TTD): Written by Chris Sawyer for Microprose in Written almost entirely in Assembly language. Designed for.
QFD From Chaos to Organization to Success! TEAM 3641 – The Flying Toasters Ron Weber Michigan State Championships April 2013 theflyingtoasters.org.
Adam Miles.  Transport Tycoon Deluxe (TTD):  Written by Chris Sawyer for Microprose in  Written almost entirely in Assembly language.  Designed.
AI Pathfinding Representing the Search Space
Chapter 7 Introduction to Procedures. So far, all programs written in such way that all subtasks are integrated in one single large program. There is.
1 Transportation Model. 2 Basic Problem The basic idea in a transportation problem is that there are sites or sources of product that need to be shipped.
Types of Algorithms.
PSMAGE: Balanced Map Generation for StarCraft Alberto Uriarte and Santiago Ontañón Drexel University Philadelphia 1/34 August 11, 2013.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Dave Pottinger,
Automatic generation and maintenance of maps and walls.
Techniques for Dealing with Hard Problems Backtrack: –Systematically enumerates all potential solutions by continually trying to extend a partial solution.
CSE 380 – Computer Game Programming Pathfinding AI
Quick Sort, Shell Sort, Counting Sort, Radix Sort AND Bucket Sort
Artificial Intelligence in Game Design Intelligent Decision Making and Decision Trees.
Artificial Intelligence in Game Design Introduction to Learning.
Algorithm Strategies Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Artificial Intelligence in Game Design Hierarchical Finite State Machines.
Chapter 8 and 9 Review: Logical Functions and Control Structures Introduction to MATLAB 7 Engineering 161.
CompSci Recursion & Minimax Playing Against the Computer Recursion & the Minimax Algorithm Key to Acing Computer Science If you understand everything,
Nonholonomic Multibody Mobile Robots: Controllability and Motion Planning in the Presence of Obstacles (1991) Jerome Barraquand Jean-Claude Latombe.
Reference: Message Passing Fundamentals.
Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies By Jeremiah J. Shepherd Committee: Jijun Tang Roger Dougal Jason O’Kane.
SELECT A LESSON 1. A WORLD AND CHARACTERS 2. PATHS AND ENEMIES 4. USING PAGES TO CHANGE THE RULES 5. GAME ANALYSIS AND DESIGN 6-7. CREATING YOUR OWN GAME.
CORE MECHANICS. WHAT ARE CORE MECHANICS? Core mechanics are the heart of a game; they generate the gameplay and implement the rules. Formal definition:
CS Reinforcement Learning1 Reinforcement Learning Variation on Supervised Learning Exact target outputs are not given Some variation of reward is.
Quoridor Classic Game Manager Kevin Dickerson April 2004.
Super Pong Andrew Dunsmore CSC436. Overview Purpose Design Specification Software Engineering.
Implementation Yaodong Bi. Introduction to Implementation Purposes of Implementation – Plan the system integrations required in each iteration – Distribute.
Introduction to TouchDevelop
Civ89 Instructions for PowerPoint. Getting Started Civ89 is a game of military, technological, and economic conquest played with two people, identified.
Networking Networking is done via a single component that is persistent in each machine’s game. This multiplayer manager component handles all Unity RPC.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Winrunner Usage - Best Practices S.A.Christopher.
1 CO Games Development 1 Week 6 Introduction To Pathfinding + Crash and Turn + Breadth-first Search Gareth Bellaby.
Random Terrain Generation By Cliff DeKoker. About my project ● Incremental development ● Focus on creating height maps that mimic real terrain ● Allow.
Z-Town Technical Details Ben Trivett, Drew Switzer, Cameron Jett, Ryan Southard Department of Computer Science and Engineering The Ohio State University.
Minimax with Alpha Beta Pruning The minimax algorithm is a way of finding an optimal move in a two player game. Alpha-beta pruning is a way of finding.
Artificial Intelligence in Game Design Dynamic Path Planning Algorithms.
Sample Video Game & Sound. The Plan 1.Game Theme 2.Game Structure 3.Sprites 4.Trackers 5.Collisions 6.Score 7.Levels 8.Splash Screens 9.Design 10.Implementation.
Artificial Intelligence in Game Design Content Generation.
Microsoft ® Office Excel 2003 Training Using XML in Excel SynAppSys Educational Services presents:
Artificial Intelligence in Game Design Complex Steering Behaviors and Combining Behaviors.
Software Testing and Quality Assurance Practical Considerations (4) 1.
What is Testing? Testing is the process of finding errors in the system implementation. –The intent of testing is to find problems with the system.
Random Map Generation and Transport Unit AI for Strategy Games By Russell Kuchar.
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
CS324e - Elements of Graphics and Visualization Fractals and 3D Landscapes.
Types of Algorithms. 2 Algorithm classification Algorithms that use a similar problem-solving approach can be grouped together We’ll talk about a classification.
Warlords Patrick Levoshko SE 558 – Multiplayer Game Design.
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
Artificial Intelligence in Game Design Influence Maps and Decision Making.
Artificial Intelligence in Game Design Lecture 8: Complex Steering Behaviors and Combining Behaviors.
Introduction Who are we? Paul Martin – Started out in the industry 1996 as PlayStation programmer – Currently a technical director and one of the principals.
The Game Development Process: Artificial Intelligence.
Create a Halloween Computer Game in Scratch
Application of Artificial Intelligence and Graphics to Support a Three-Dimensional Game Chris Cummings.
Lesson Objectives Aims Understand the following “standard algorithms”:
CSE 381 – Advanced Game Programming Terrain
Fundaments of Game Design
Map Generation & Transport AI Ch. 7.4 & 7.5 (Stephen Lee-Urban)
  Introduction When faced with the task of designing and building a VEX robot, students (and teachers) will often immediately want to pick up their tools.
  Introduction When faced with the task of designing and building a VEX robot, students (and teachers) will often immediately want to pick up their tools.
Presentation transcript:

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

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

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

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

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

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.4: Maps? Subset of map generation in general Successfully implemented in E.E. Examples…

Birds-Eye

Fancy 3D View

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

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

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

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

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

Solution Overview Step 2: Grow player land

Solution Overview Step 3: Add flatlands to map

Solution Overview Step 4: Generate elevations map

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

Solution Overview Step 6: Fix cliffs and other anomalies

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.

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

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.

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?

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

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

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

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!

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

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

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?

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

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

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

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

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

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”

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

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.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.

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

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?

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

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

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

Passenger FSM

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

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

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

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

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

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?

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?

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

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

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?

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

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

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

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!

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

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

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

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

Sources AI Game Programming Wisdom arthhttp:// arth