Project M.AI.S. Multi-threaded AI system Per Erskjäns game engineer.

Slides:



Advertisements
Similar presentations
Xi Breakthrough Player CSE 486 B Fall 2012 Miami University.
Advertisements

MINJAE HWANG THAWAN KOOBURAT CS758 CLASS PROJECT FALL 2009 Extending Task-based Programming Model beyond Shared-memory Systems.
Lecture 3: Parallel Algorithm Design
Recursion vs. Iteration The original Lisp language was truly a functional language: –Everything was expressed as functions –No local variables –No iteration.
Spark: Cluster Computing with Working Sets
How do games work? Game Workshop July 4, Parts Sprites/pictures Map/background Music/sounds Player character Enemies Objects.
GridFlow: Workflow Management for Grid Computing Kavita Shinde.
Next Section: Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis (Wilson & Lam) –Unification.
Scripting Languages For Virtual Worlds. Outline Necessary Features Classes, Prototypes, and Mixins Static vs. Dynamic Typing Concurrency Versioning Distribution.
The new The new MONARC Simulation Framework Iosif Legrand  California Institute of Technology.
Center for Embedded Computer Systems University of California, Irvine and San Diego SPARK: A Parallelizing High-Level Synthesis.
Cmpt-225 Simulation. Application: Simulation Simulation  A technique for modeling the behavior of both natural and human-made systems  Goal Generate.
Knight’s Tour Distributed Problem Solving Knight’s Tour Yoav Kasorla Izhaq Shohat.
The hybird approach to programming clusters of multi-core architetures.
Parallelization: Conway’s Game of Life. Cellular automata: Important for science Biology – Mapping brain tumor growth Ecology – Interactions of species.
Parallel Game Engine Design or How I Learned to Stop Worrying and Love Multithreading.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Carolyn Seaman University of Maryland, Baltimore County.
Multi-core Programming Thread Profiler. 2 Tuning Threaded Code: Intel® Thread Profiler for Explicit Threads Topics Look at Intel® Thread Profiler features.
Introduction Overview Static analysis Memory analysis Kernel integrity checking Implementation and evaluation Limitations and future work Conclusions.
1 Scalable and transparent parallelization of multiplayer games Bogdan Simion MASc thesis Department of Electrical and Computer Engineering.
Threads, Thread management & Resource Management.
Implementing Processes and Process Management Brian Bershad.
f ACT s  Data intensive applications with Petabytes of data  Web pages billion web pages x 20KB = 400+ terabytes  One computer can read
Heaps, Heapsort, Priority Queues. Sorting So Far Heap: Data structure and associated algorithms, Not garbage collection context.
Recursion Textbook chapter Recursive Function Call a recursive call is a function call in which the called function is the same as the one making.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Marie desJardins University of Maryland, Baltimore County.
An Implementation and Performance Evaluation of Language with Fine-Grain Thread Creation on Shared Memory Parallel Computer Yoshihiro Oyama, Kenjiro Taura,
2008/9/24 Kim, HyungSeok. HyungSeok Kim, Konkuk University Part I: Framework – 1. Windows creation – 2. Renderer – 3. Lights and Objects/Model loading.
GAM 200 Club. How to Game Engine GAM 200 Club Zachary Nawar.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
Chapter 3.6 Game Architecture. 2 Overall Architecture The code for modern games is highly complex (can easily exceed 1M LOC) The larger your program,
U N I V E R S I T Y O F S O U T H F L O R I D A Hadoop Alternative The Hadoop Alternative Larry Moore 1, Zach Fadika 2, Dr. Madhusudhan Govindaraju 2 1.
Object Oriented Analysis & Design Game Patterns. Contents  What patterns are  Delegation  Game Loop  Scene Graph  Double Buffering  Component 
Trojan Rabbits. (10/31) Functional minimum: Tile/Grid-based Game "Engine" (Shaun & Michael) Game Objects Created (Timothy) User Interaction Movement (Yan)
DynamicMR: A Dynamic Slot Allocation Optimization Framework for MapReduce Clusters Nanyang Technological University Shanjiang Tang, Bu-Sung Lee, Bingsheng.
An Efficient CUDA Implementation of the Tree-Based Barnes Hut n-body Algorithm By Martin Burtscher and Keshav Pingali Jason Wengert.
Threads, Thread management & Resource Management.
PARALLEL TREE MANIPULATION Islam Atta. Sources Islam Atta, Hisham El-Shishiny. System and method for parallel processing TX, US, Experimental.
I MAGIS is a joint project of CNRS - INPG - INRIA - UJF iMAGIS-GRAVIR / IMAG Efficient Parallel Refinement for Hierarchical Radiosity on a DSM computer.
By Nitin Bahadur Gokul Nadathur Department of Computer Sciences University of Wisconsin-Madison Spring 2000.
Tuning Threaded Code with Intel® Parallel Amplifier.
Fiber Based Job Systems Seth England. Preemptive Scheduling Competition for resources Use of synchronization primitives to prevent race conditions in.
B ERKELEY P AR L AB Lithe Composing Parallel Software Efficiently PLDI  June 09, 2010 Heidi Pan, Benjamin Hindman, Krste Asanovic  {benh,
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
递归算法的效率分析. When a function is called... A transfer of control occurs from the calling block to the code of the function --It is necessary that there be.
CERN Openlab Openlab II virtualization developments Havard Bjerke.
Chapter 4: Threads Modified by Dr. Neerja Mhaskar for CS 3SH3.
Multi-threading the Oxman Game Engine Sean Oxley CS 523, Fall 2012
Done By: Ashlee Lizarraga Ricky Usher Jacinto Roches Eli Gomez
Ioannis E. Venetis Department of Computer Engineering and Informatics
Game Architecture Rabin is a good overview of everything to do with Games A lot of these slides come from the 1st edition CS 4455.
Parallel Patterns Reduce & Scan
OPERATING SYSTEMS CS3502 Fall 2017
STUDY OF PARALLEL MONTE CARLO SIMULATION TECHNIQUES
A task-based implementation for GeantV
Task Scheduling for Multicore CPUs and NUMA Systems
Introduction to Parallelism.
Review.
Chapter 4: Threads.
Chapter 4: Threads & Concurrency
Chapter 4: Threads.
Workshop II UU Crowd Simulation Framework
CIS 488/588 Bruce R. Maxim UM-Dearborn
Tail Recursion.
Interpret the execution mode of SQL query in F1 Query paper
Activation records Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Multithreading Why & How.
Computer Graphics Matrix Hierarchies / Animation
Activation records Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Crowd Dynamics AI in C++
Presentation transcript:

Project M.AI.S. Multi-threaded AI system Per Erskjäns game engineer

Project goals A system that scales to the number of available cores. AI implemented with a data oriented behavior tree. Work with a data oriented mindset. Flocking behavior with simple graphical representation. AI behavior not the main focus.

Project reasons Get experience working with a multi-threaded environment. Get experience working with a behavior tree. Train my self in data oriented design.

Result 50 – 85 % framerate gain with 2 threads. Not tested on quadcore computer. Gain depends on computational cost. Only one class with heritage.

Result A data oriented behavior tree. A component based entity system. There are many oppertunities for optimization, was not a focus.

System design Scheduler Graphics system Movement system AI system Sensory system Framework Main loop update changes Distribute changes

System design One change que per thread, using thread local storage. Each system have ownership over 0 – many attributes. Only one owner per attribute. Max number of entites are preallocated into system specific arrays at application start.

System design Serial or parallel system update depending on entity numbers. In parallel update the update loop is split in to tasks. Intel Threading Building Blocks, used for task managment.

Behavior tree design The implementation is a data oriented solution without heritage, virtual functions and recursion. The whole tree is laid out in a flat array in a depth first order.

Behavior tree design All nodes share the same data structure; struct BehaviorTreeNode { node_types::Enum node_type; union { u32 end; BehaviorFunction execute; }; }; After the creation of a tree (or loaded it from disk) the array is run through a initiation function to set the correct function pointers.

Behavior tree design Each AI entity is represented as a BehaviorTreeInterpreter object, containing a blackboard (keeps the entity knowledge) and a pointer to the appropriate behavior tree. On each frame an interpreter function loops through the behavior tree.

Behavior tree design The parent nodes are pushed or poped to/from a stack and used to decide how to handle a return state from a behavior function.

Problems Not to many problems but some things that took more time than needed to solve. Some really stupid misstakes like a (–) instead of a (+) in some calculations. Some strange bugs with SFML.

Conclusion Did learn much, both small and big things. Learned most from research, not implementation. Didnt get as deep knowledge of task managment as planed. Mainly because of TBB. Unit testing could have helped.

Questions ?