Pirates & Ninjas
P&N: Plan Project summary Architecture User Interface World Creation (town) World Content Creation Game Play Artificial Intelligence
Project summary Presentation Technologies used Architecture User Interface World Creation (town) World Content Creation Game Play Artificial Intelligence →Project summary P&N: Plan
Project summary Presentation Technologies used →Project summary P&N: Plan
Project summary Presentation Technologies used →Project summary P&N: Plan
Architecture Data Flow Buffer Management Tool Game Application Aggregator Video Manager Audio Manager Network Manager Main AI →Architecture
P&N: Architecture Game application + player input Main AI Aggregator Buffer Video Manager Buffer Network Manager Buffer Audio Manager Buffer
P&N: Architecture AI Aggregator Buffer Video Manager Buffer Network Manager Buffer Audio Manager Buffer →Data Flow Read Write Game application + world data + player input Player Management Buffer Management Tool
P&N: Architecture →Data Flow Why so many buffers? –Multi threaded applications Calls must be ‘safe’ –No simultaneous writes to data –Less lock necessary for synchronization –Easy duplication of information –Thread info transmission and network works the same way Use the same buffers Buffer management tool
P&N: Architecture →Buffer Management Tool Aggregator Packet Destination: Packet Source:Anywhere AggregatorVideoAudioNetwork Buffer Management Are we playing a multiplayer game ? Should the packet be copied to the network ? No AudioVideo
P&N: Architecture →Buffer Management Tool Aggregator Packet Destination: Packet Source:Anywhere AggregatorVideoAudioNetwork Buffer Management Are we playing a multiplayer game ? Should the packet be copied to the network ? Yes No AudioVideo Network or Video PM Yes AI
P&N: Architecture Game application + player input Main AI Aggregator Buffer Network Manager Buffer Audio Manager Buffer →Game Application Video Manager Buffer
P&N: Architecture →Game Thread Game Application World player elements monster elements room listInteractible elements Player Management Graphic Renderer Manages Player Input Holds Game Data Renders Graphics Manages Player Menu Manages Main Menu
P&N: Architecture Initialize Data references (Resources) Initialize Data holder (World) Initialize Monster Type Generator (MTG) Initialize Audio Manager thread (AM) Initialize Aggregator thread (Agg) Initialize Artificial Intelligence thread (AI) Initialize Network thread (Net) (multiplayer) →Game Thread: Init
P&N: Architecture →Game Thread: Running For each player: –Create a player management (PM) –Treats input via the PMs from the players Manages main menu Manages play time initialization Updates the graphics Renders the graphics
Player Management P&N: Architecture →Game Thread: PM Inputs Buffer Management Tool
Game application + player input Main AI Aggregator Buffer Network Manager Buffer Audio Manager Buffer P&N: Architecture →Aggregator Video Manager Buffer
P&N: Architecture →Aggregator Thread AGGREGATORAGGREGATOR Handles its buffer Updates spell position Handles spell effects Updates spell cool downs Handles dynamic elements Handles interactive elements Buffer Management Tool
P&N: Architecture →Aggregator Thread Two working mode: –Master mode Single player or multiplayer and host –Slave mode Multiplayer and client Difference in the working mode: –A master aggregator will calculate spell effects regarding life –It will also create the world and send it to the slave aggregators
Game application + player input Main AI Aggregator Buffer Video Manager Buffer Network Manager Buffer Audio Manager Buffer P&N: Architecture →Video Manager
P&N: Architecture →Video Manager
Game application + player input Main AI Aggregator Buffer Network Manager Buffer Audio Manager Buffer P&N: Architecture →Audio Manager Video Manager Buffer
P&N: Architecture →Aggregator Thread AUDIOAUDIO Handles its buffer Play sound with 3D effects Play music in random loop Buffer Management Tool
Game application + player input Main AI Aggregator Buffer Video Manager Buffer Network Manager Buffer Audio Manager Buffer P&N: Architecture →Main AI
P&N: Architecture →Main AI Thread Wakes Monster Main AI Monster Element MovementDecision Making Monster Element MovementDecision Making Monster Element MovementDecision Making Monster Element MovementDecision Making Monster Element MovementDecision Making Monster Element MovementDecision Making Monster Element MovementDecision Making Monster Element MovementDecision Making When the Main AI thread wakes a monster it: Creates a decision making thread Creates a movement thread A monster can also ‘learn’
Project summary Architecture User Interface World Creation (town) World Content Creation Game Play Artificial Intelligence →User Interface P&N: Plan
Project summary Architecture User Interface World Creation (town) Parameters Room Generation World Content Creation Game Play Artificial Intelligence →World Creation P&N: Plan
Project summary Architecture User Interface World Creation (town) Parameters Room Generation World Content Creation Game Play Artificial Intelligence →World Creation P&N: Plan
P&N: World Creation Number of rooms in the world Common border size between 2 room Size of doorway between 2 room Compacity level of the world Max number of branching room Straightness of the walls between 2 room Number of test made to place a room →World Creation: Parameters
Project summary Architecture User Interface World Creation (town) Parameters Room Generation World Content Creation Game Play Artificial Intelligence →World Creation P&N: Plan
P&N: World Creation Respects set of constraints: Border overlapping for 1 pixel The world must stay close at all time to keep players in Respects the parameter inputted by the player You must be able to go from any room to any other room →World Creation: Room Generation
P&N: World Creation →World Creation: Room Generation We use logical operation to combine rooms together 28 & 193 = & 193 = & 199 = 4
P&N: World Creation →World Creation: Room Generation
Project summary Architecture User Interface World Creation (town) World Content Creation Building Creation Monster Generator Game Play Artificial Intelligence →World Content Creation P&N: Plan
Project summary Architecture User Interface World Creation (town) World Content Creation Building Creation Monster Generator Game Play Artificial Intelligence →World Content Creation P&N: Plan
P&N: World Creation →World Content Creation: building
Project summary Architecture User Interface World Creation (town) World Content Creation Building Creation Monster Generator Game Play Artificial Intelligence →World Content Creation P&N: Plan
P&N: World Creation →World Content Creation: Monster
Project summary Architecture User Interface World Creation (town) World Content Creation Game Play Artificial Intelligence →Game Play P&N: Plan
Project summary Architecture User Interface World Creation (town) World Content Creation Game Play Artificial Intelligence →Artificial Intelligence P&N: Plan
Artificial Intelligence –Movement Path finding Orientation –Decision Making –Learning Methods Decision per decision AI versus AI AI versus player →Artificial Intelligence
P&N: Plan Artificial Intelligence –Movement Path finding Orientation –Decision Making –Learning Methods →Artificial Intelligence
P&N: Plan Artificial Intelligence –Movement Path finding Orientation –Decision Making –Learning Methods →Artificial Intelligence
P&N: Artificial Intelligence →Decision 6 possible decisions –Move (towards and away from target) –Flee –Switch target –Counter target –Cast offensive spell –Cast defensive spell We sort the efficiency of the decisions and then act on the best one
P&N: Artificial Intelligence →Decision: Move Movement is based on answers to: –Am I already moving? –Am I casting a spell? (instant? Y/N) –Need to move to cast best offensive spell? –Need to move to cast best defensive spell? –Is my target immune? –Where can I go? (number of directions)
P&N: Artificial Intelligence →Decision: Flee Fleeing is based on answers to: –Am I fleeing? –Are some of my friends fleeing? (contagion) –Is my group well? (Sufficient life) –Can I kill my target before it kills me? –Do I have lots of friends?
P&N: Artificial Intelligence →Decision: Switch & Counter Counter is based on answers to: –Is my target casting? –Is the counter useful? (right magic school) –Is the counter on cool down? Target switching is based on answers to: –Is my target immune to my spells? –What is the best spell I can cast on any enemy? –Am I cornered?
P&N: Artificial Intelligence →Decision: Offense Offense is based on answers to: –Am I already moving? –What is the best offensive spell I can cast? –Is my group well? –Is my target well? –Can I kill my target before it kills me?
P&N: Artificial Intelligence →Decision: Defense Defense is based on answers to: –Am I already moving? –What is the best defensive spell I can cast? –Is my group well? –Is my target well? –Can I kill my target before it kills me?
P&N: Plan Artificial Intelligence –Movement Path finding Orientation –Decision Making –Learning Methods →Artificial Intelligence
P&N: Artificial Intelligence →Learning Methods Decision per decision For each decision we say it is good or bad Long process and un-scalable since an AI takes a decision every second AI versus AI If the AI loses then it means the decision it made were wrong AI versus player Same as AI vs AI however it a player playing. It should make the AI stronger
Questions ? Thank you for listening
P&N: Plan Data Description –Elements DynamicInteractiveStatic –Rooms –Spells –Talents →Data Description
Game application + player input Main AI Aggregator Buffer Video Manager Buffer Network Manager Buffer Audio Manager Buffer P&N: Architecture →Network Manager
P&N: Architecture →Network Manager Thread Client Buffer Client Buffer Host AI Buffer All aggregators do not do everything Why ? Because the data would become incoherent
P&N: Plan 2 Buffers –In –Out Each buffer has a read and write method –Write is a locked operation because different thread may access it –Reads are made by the network manager –Reads write data to: Aggregator Network Stream →Network Manager Thread