ai post mortem

15
AI Post Mortem Inside Sims Medieval By David “Rez” Graham

Upload: ophira

Post on 08-Jan-2016

48 views

Category:

Documents


2 download

DESCRIPTION

AI Post Mortem. Inside Sims Medieval. By David “Rez” Graham. What We’re Going to Talk About. Core Design Changes Quests Sim Types Profession Sims Role Sims Townies Schedules. Implementation Solutions Bouncer System Sim Scheduler. Meta Autonomy Which lot should I be on? - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: AI Post Mortem

AI Post MortemInside Sims Medieval

By David “Rez” Graham

Page 2: AI Post Mortem

What We’re Going to Talk About

• Core Design Changes– Quests– Sim Types

o Profession Sims

o Role Sims

o Townies

– Schedules

• Implementation Solutions– Bouncer System– Sim Scheduler

Page 3: AI Post Mortem

Sims AI Crash Course• Meta Autonomy

– Which lot should I be on?– Based on venue desire tuned by

designers– Schedules

• Local Autonomy– What should I do on my current lot?– Based on Utility provided for each

interaction on each object– Utility is based on Commodities, like

hunger, energy, social, etc.

Page 4: AI Post Mortem

Design Changes: Quests

• The Problem:– The Witch is back!

– Player must confront the witch in the town square

– The player arrives just in time….

– .… to see the witch go home to make a sandwich

Page 5: AI Post Mortem

• Profession Sims– Created with Create-A-Sim

– Playable

• Townies– Background characters

– Unplayable yet fully simulated

• Role Sims– Townies with a purpose

– Activated by event

– On a schedule

Design Changes: Sim Types

Page 6: AI Post Mortem

Design Changes: Schedules

• Why schedules?

• Quests:

– Remember the witch?

– Need to lock a Sim somewhere

• Work:

– No rabbit holes for work

– Need to send Sims to the right place at the right time

– Need to behave appropriately during business hours

• On Schedule:– Special work motives & socials

– Schedule Lots

– Commodities can be frozen

– Meta & Local Autonomy can be disabled

• Off Schedule:– Normal Behavior

Page 7: AI Post Mortem

Implementation: The Bouncer• Gets Sims in and out of the world one at

a time• Handles prioritized Sim requests

– General Requestso Generic request for N Simso Don’t care who gets assigned or when they

respondo Used to fill the world with Townies

– Specific Requestso Filtered by age, gender, faith, or even

SimDescriptiono Sim is locked in request

Page 8: AI Post Mortem

Implementation: Specific Requests1. Client inherits from ISimRequestor

interface

2. Client calls CreateRequest() on Bouncer Singleton

3. Bouncer creates a request and returns an ISimRequest ptr

4. The ISimRequest ptr is used as proxy to send messages to the Bouncer regarding this request

5. Bouncer uses concrete request object to send messages to the client

Page 9: AI Post Mortem

Implementation: ISimRequestor

Requestor gets notified when a Sim is actually assigned to the requestBouncer notifies client when a higher priority request comes in and it’s up to the client to handle that appropriatelyBouncer can ask the client about the Sim’s local/meta autonomy restrictions

Page 10: AI Post Mortem

Implementation: ISimRequestClient must submit the request when it’s ready and withdraw the request when it’s done

Client can update general requests to the bouncerClient controls when a Sim is unassigned from a request since it knows when this is safe

Page 11: AI Post Mortem

Implementation: Schedules

1. Schedule client calls AddScheduleByTag() on SimDescription

2. SimDescription caches the schedule data from the SimScheduler singleton

3. SimDescription calls AddSim() on ScheduledSimManager singleton

4. ScheduledSimManager creates a ScheduledSim object

5. Each tick, ScheduledSimManager iterates over all ScheduledSim’s and submits low-priority bouncer requests for any who are on a schedule.

Page 12: AI Post Mortem

Implementation: Schedules

6. Bouncer spawns the Sim

7. The Sim initializes his SimSchedulerState and sets the appropriate state based on time.

8. Every AI update, Autonomy will call RunScheduleAutonomy()

1. Submits a higher priority bouncer request

2. Reconciles all motives, freezes commodities if necessary, etc.

3. Sends the Sim to the appropriate lot.

Page 13: AI Post Mortem

Implementation: Professions & Roles

• Roles:– RoleSystem Singleton acts as

Schedule Client

– Activated by Event

– Role sim is chosen from Townie Pool based on Filter

– Sim is modified for role (Traits, skills, Equip, etc.)

– Schedule is added to SimDescription

• Professions:– ProfessionManager Singleton

acts as the Schedule Client

– Sims are created through Create-A-Sim, which generates a SimDescription object

– When not controllable by the player, Profession Sims behave according to schedule

– Sims controlled by player have their schedule removed

Page 14: AI Post Mortem

Summary

• Remember the Witch?– The Witch is now just a role

– The Role filters on Adult Female

– When activated, she is put on a 24/7 schedule

o Target Lot = Town Squareo Commodities are frozen

– When player confronts her, a new schedule is pushed

Page 15: AI Post Mortem

Thank You!

Email: [email protected]