Mafia II Bringing city to life Martin Brandstätter Jan Kratochvíl.

Slides:



Advertisements
Similar presentations
Swarm-Based Traffic Simulation
Advertisements

Driving In Different Environments & Situations
Driving In Urban Traffic
CHAPTER 6 BASIC MANEUVERS.
Office of Risk Management Driving in Inclement Weather.
CYCLE SAFETY. Cycle Safety Learning Objective: –Children to understand what constitutes appropriate behaviour for cyclists and how to be as safe as possible.
Right and Left Turns.
Chapter 10: Negotiating Intersections
Sample questions from the Rules of the Road units of the Driving Theory syllabus. ESOL for Driving.
Driving Safety Off-Road Vehicles Lander University Office of Safety and Compliance.
CHAPTER 9 DRIVING IN URBAN TRAFFIC
Share the Road Lesson Plan. “Share The Road” Lesson Plan: Why??  Usually little or no training for cyclists, motorists, and pedestrians on safe interactions.
Intersections & Right of Way
Are these people jogging on the proper side of the roadway? YES…always face traffic.
Transportation Tuesday TRANSPORTATION TUESDAY The five seeing habits while driving…. Observation and concentration are required at all times while driving.
Safe Driving Tips.
Driver Education Chapter 3
Chapter 9 Driving in Urban Traffic
Partial Lesson first 20 out 65 slides 4 Lane Strategies and Rules of the Road.
Ch. 6 - Passing NY State DMV 1. The law requires that we drive on the right side of the road.  When we are allowed to pass other vehicles, we usually.
Driving In Urban Traffic
Unit 3 – Driver Physical Fitness
NEGOTIATING INTERSECTIONS
Part one: Strategies/Tactics and Rules of the Road
Expressway Driving. Characteristics of Expressway Driving Roadway Speed Interchanges No cross traffic Median Tollbooths Entrance/exit ramps Limited access.
Defensive Driving Have a Space Cushion Leave an escape route To avoid a collision you may need to: Stop Turn Speed Up Communicate (Horns & Lights) Always.
MODULE 2 THE DRIVER. FACTORS INVOLVED IN COLLISIONS Three factors in collisions, of which you only have control over the first two; – 1. Driver – 2. Vehicle.
1 Constant Following Distance Simulations CS547 Final Project December 6, 1999 Jeremy Elson.
lesson 3.3 STARTING, STOPPING, STEERING, AND TARGETING
Drive Right Chapter 7 Negotiating Intersections Unit 4
Chapter 9 Driving in City Traffic More Complex!! Why? 1.Traffic is more dense – more cars, trucks, buses and pedestrians per mile than on rural roads.
Interacting With Other Users. Most collisions occur when two or more objects try to occupy the same space at the same time. Drivers must identify movement.
MODULE 5 Objectives: Students will learn to recognize moderate risk environments, establish vehicle speed, manage intersections, hills, and passing maneuvers.
ARTIFICIAL CITY A TRAFFIC SIMULATION. INSPIRATION SimCity 4 CitiesXL
Urban Traffic Traffic is more dense City traffic hazards are closer Use IPDE Process.
Artificial Intelligence in Game Design Dynamic Path Planning Algorithms.
NEGOTIATING INTERSECTIONS
Jumping, Climbing, and Tactical Reasoning Section 2.5 Tom Schaible CSE 497 – AI & Game Programming.
Basic Driving Maneuvers Entering Traffic, Lane Changes, and Turning NV Driver Education Curriculum Unit 3: The Driving Task Presentation 6 of 7.
Unit 4 Chapters 7, 9, 10 and 11.
I-CAR. Contents Factors causing accidents and head on collision Existing technologies New technologies Advantages and drawbacks conclusion.
lesson 4.2 BASIC DRIVING MANEUVERS
Driving in City Traffic.  This chapter discusses the skills necessary to navigate driving situations in city traffic.
Intersections.
Catch Me If You Can Group 20 B 鍾政達 B 陳建男 B 何雨帆.
Partial lesson 18 of 64 slides Other City/Suburban Strategies and Rules of the Road.
Module 5 Terena Wibecka Lauren Megan Block 1X. Processing Information 1.A driver needs visibility, space, and time to safely operate a vehicle. 2.A vehicle.
CHAPTER 5 DEFENSIVE DRIVING. I. Preventing Accidents A. Most accidents are caused by driver error. B. Standard Accident Prevention Formula: 1. Be Alert.
Basic Maneuvers Chapter Six. Moving into Traffic Visibility: check oncoming traffic and the road. Notice others Time: is there enough time to move into.
DRIVER EDUCATION CHAPTER 3 1. What is every driver’s #1 priority? safety 2. In NJ, all front seat occupants must wear what? seatbelts 3. Who is responsible.
Module 5 Brooke, Kendra 1 st Block Y day. Processing Information A driver needs time, space and visiblity to safely operate a vehicle. A vehicle needs.
Intersections.
Adjusting to Urban Traffic Following & Meeting Traffic Managing Space in Urban Traffic Special Urban Situations.
Performing Basic Vehicle Maneuvers
ARTIFICIAL INTELLIGENCE
UNIT 3 Foundations of Effective Driving
ADVANCED DRIVER ASSISTANCE SYSTEMS
International Interdisciplinary Seminar
Ch. 5: Defensive Driving Smojver.
PRESENTED BY:BHABESH RANJAN MAHAKUD
Unit 3 – Driver Physical Fitness
Unit 4: Vision and Space Management
Driving in City Traffic
Signs and Symbols from Instant Art Traffic Signs CD-ROM
What is The Smith System?
Chapter 9 Environments and Traffic Settings
Alabama Driver Manual Chapter 3
lesson 3.3 STARTING, STOPPING, STEERING, AND TARGETING
lesson 14.3 MANAGING SPACE IN CITY TRAFFIC
Presentation transcript:

Mafia II Bringing city to life Martin Brandstätter Jan Kratochvíl

Content Ideas for creating living city Filling city with elements Basics of artificial intelligence Specific examples: –Pedestrians –Traffic cars

Living city Full of life Variability No restrictions for player Seamless streaming

Filling city with elements Static geometry Grass, garbage, etc Translocated objects Pedestrians Cars

Empty street

Translocated objects Translocator Many types of objects –Lamps, chairs, benches –Billboards, neons, traffic signs, semaphores –Trees, shrubs –Action points, and more

Translocator Multiple grids Storing only GUID, position, rotation & scale High & Low range Spawn is not optional

Street with translocated objects

Pedestrian spawning Where to spawn? –Position –Visibility –Usability Spawn points –Kynapse nodes

Kynapse visualization

Pedestrian despawn When to despawn a Pedestrian? –Is too far away –Is not visible for too long –Is not in any action Line of death

Car Spawn Little bit more complicated Data from roadmap Three types –“Translocated” –Parked –Moving

Spawn in black area Annulus P

Egg P

Advanced Egg P

Spawn points example

Car despawn Reasons to get despawned: –Not visible and not moving towards player –Be too far away and out of sight Visible cars are never despawned Police has special rules

Empty street

Street with translocated objects

Final Street

ActionPoints Sidewalk graph with crossings Actionpoints Destructible Objects with ActionPoints

Basics of artificial intelligence Brain Hierarchy Black Board Messaging Basic Behaviours Behaviour tree Ai and Script Comunication

Brain Hierarchy Small Brain Base Brain Single Brain Human Brain Car Brain Boat Brain Train Brain Team Brain

Basic Behaviours brain object small parallel selector composite team behaviour

More Behaviours Desire Desire Commander Desire Composite Slave and mapping factory

selector commander Composite commander commander commander Parallel Slave Action 0 Action 1

Ai and Script Communication Designers demands –script running in parallel with AI –script running without AI –script running with some parts of AI

Script Configuration Alive Parallel ScriptParallel Action 0 Action 1 Main Selector Desire Script AI Desire 0 AI Desire 1

Script commands Lua Script Message New Command Move,Turn,Anim,.. Desire Script Parallel Script

Script wants Exclusive Control Lua Script Message Script Control TRUE Desire Script Parallel Script

Script Gains Exclusive Control Lua Script Message Script Control TRUE Desire Script

Script Returns Control to AI Lua Script Message Script Control FALSE Desire Script Parallel Script

AI Gains Exclusive Control Lua Script Message Script Control FALSE Desire Script

AI wants Exclusive Control Lua Script Message AI Control - Reason Selector Script

Civilian Archetype Archetype configuration Behavior sub-tree wander Action-Point scripts

Wander Configuration Wander Parallel Wander Selector Crossing AP Scan Get In car Special Desire Wander Around Wander Slave Wander Style

Driving Roadmap Wandering driver Hunter – police, gangster, … Escaper – taxi, gangster, mission car

Roadmap Catmull-Rom splines Whole city roadmap is about 400Kb –Including all necessary meta information No 3 rd party library Crossroads are defined using splines as well

Catmull-Rom spline Special case of cubic Hermit spline Relatively easy to compute Spline is going through its interpolation points Tangents are continuous over multiple segments

Roadmap

Basic driving 1.Interpolate some position before you 2.Set wheels to point at this position 3.Set speed to something 4.You are done

Speed Desired speed is influenced by –Behavior – traffic lights, crossings, follower, … –Obstacle –Curve Every “desire” can only lower the desired speed

Curve speed Iterative algorithm Input –Preferred deceleration –Centripetal acceleration –Expected braking distance –Max speed

Curve speed ca – centripetal acceleration cr – curve radius L – segment length

Behavior speed Example: stop before crossing d – distance to crossing a – preferred deceleration of car

Obstacle speed Obstacle detection –Subdivision queries – no static scene Detection ahead on desired path Avoid obstacle if possible and desirable Adjust speed to obstacle speed Aggressiveness playing its role

Navigation point Interpolation on spline Shift to fit correct lane Random shift Obstacle shift

Navigation points

Crossroad Team AI Priority for each car Main roads Traffic lights Aggression & green wave

Crossroad

Hunter Police & gangsters Need to go off roadmap Player drops info behind him Need of collision scene tests

Escaper Special case of wandering car May be aggressive Crossroad trespassing is not random Has to ensure that he will reach its destination

Special behaviors Avoiding special cars Jam detector Collision detector Horn reaction …

Q&A