Scripting Ian P. Warfield CSE 497 - Topics on AI and Computer Game Programming October 25, 2004.

Slides:



Advertisements
Similar presentations
Halo 3 Objective Trees: A Declarative Approach to Multiagent Coordination Damián Isla Bungie Studios.
Advertisements

PHP I.
Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Designing Reusable Frameworks for Test Automation
Software Development Languages and Environments. Programming languages High level languages are problem orientated contain many English words are easier.
Programming Types of Testing.
Evis Trandafili Polytechnic University of Tirana Albania Functional Programming Languages 1.
Detailed Design Kenneth M. Anderson Lecture 21
RED DEAD REVOLVER Artificial Intelligence Critique By Mitchell C. Dodes CIS 588.
1/18 CS 693/793 Lecture 09 Special Topics in Domain Specific Languages CS 693/793-1C Spring 2004 Mo, We, Fr 10:10 – 11:00 CH 430.
Chapter 3.2 C++, Java, and Scripting Languages “The major programming languages used in game development.”
COMP205 Comparative Programming Languages Part 1: Introduction to programming languages Lecture 3: Managing and reducing complexity, program processing.
MERTIS: Modifiable, Extensible, Real-Time, Interactive Simulation Leandro Basallo ◦ Ryan Leigh ◦ Sam Talaie ◦ Regan Snyder with Dr. Sergiu Dascalu and.
Programming Languages Structure
Guide To UNIX Using Linux Third Edition
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
Software Development Unit 6.
Matthew J Mattia CSC  Cumbersome Code  Consistent/Predictable design (GUEPs #5, CD’s #10)  Display “proper” amount of information  Including.
CORE MECHANICS. WHAT ARE CORE MECHANICS? Core mechanics are the heart of a game; they generate the gameplay and implement the rules. Formal definition:
Section 8.4 Insertion Sort CS Insertion Sort  Another quadratic sort, insertion sort, is based on the technique used by card players to arrange.
Operations Management
CASE Tools And Their Effect On Software Quality Peter Geddis – pxg07u.
What is RobotC?!?! Team 2425 Hydra. Overview What is RobotC What is RobotC used for What you need to program a robot How a robot program works Framework.
Introduction to High-Level Language Programming
CSE 380 – Computer Game Programming Scripting and Lua Lua.
Dr. Ken Hoganson, © August 2014 Programming in R STAT8030 Programming in R COURSE NOTES 1: Hoganson Programming Languages.
Introduction to FORTRAN
Topic #10: Optimization EE 456 – Compiling Techniques Prof. Carl Sable Fall 2003.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
ICOM 5995: Performance Instrumentation and Visualization for High Performance Computer Systems Lecture 7 October 16, 2002 Nayda G. Santiago.
Introduction GAM 376 Robin Burke Winter Outline Introductions Syllabus.
Au’15 select topics By: Matt Boggus. List o’ stuff Game genres Party minigames Arena first person shooter 3D platformer/puzzler Horror Game technology.
Introduction Algorithms and Conventions The design and analysis of algorithms is the core subject matter of Computer Science. Given a problem, we want.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
CSE 219 Computer Science III Program Design Principles.
28-29 th March 2006CCP4 Automation STAB MeetingCCP4i and Automation 1 CCP4i and Automation : Opportunities and Limitations Peter Briggs, CCP4.
Component Technology. Challenges Facing the Software Industry Today’s applications are large & complex – time consuming to develop, difficult and costly.
This material is approved for public release. Distribution is limited by the Software Engineering Institute to attendees. Sponsored by the U.S. Department.
CS 350, slide set 5 M. Overstreet Old Dominion University Spring 2005.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Achieving Believable Psychosocial Behaviour in Non-player Characters in Modern Video Games Christine Bailey, Jiaming You, Gavan Acton, Adam Rankin, and.
A Reusable Scripting Engine for Automating Cinematics and Cut-Scenes in Video Games M. McLaughlin and M. Katchabaw Department of Computer Science The University.
The System Shall… Provide the ability to render 2D/3D graphics, these graphics will be represented by assets like models textures, and shaders. Manage.
Guide to Linux Installation and Administration, 2e1 Chapter 11 Using Advanced Administration Techniques.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Software Development in HPC environments: A SE perspective Rakan Alseghayer.
F.E.A.R. Game AI Evaluation by Robert Rak. What is F.E.A.R. ? FEAR is a First Person Shooter game Player takes on the role of an elite strike force team.
Topic 4 - Database Design Unit 1 – Database Analysis and Design Advanced Higher Information Systems St Kentigern’s Academy.
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
Finite State Machines (FSM) OR Finite State Automation (FSA) - are models of the behaviors of a system or a complex object, with a limited number of defined.
ITERATION. Iteration Computers are often used to automate repetitive tasks. Repeating identical or similar tasks without making errors is something that.
Finite State Machines using Alice Stephen Cano CIS 4914 Senior Project Wednesday December 5th.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
Perl Ed Finegan. Overview of Pearl Perl is a high-level programming language written by Larry Wall. It derives from the C programming language and to.
Software Engineering 2004 Jyrki Nummenmaa 1 Why new software methodologies The classic waterfall-model based techniques are strongly based on the.
CSC141 Introduction to Computer Programming Programming Language.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
A Level Computing – a2 Component 2 1A, 1B, 1C, 1D, 1E.
Types for Programs and Proofs
Learning to Program D is for Digital.
Methodologies By Akinola Soyinka.
Application Development Theory
Anne Pratoomtong ECE734, Spring2002
CO Games Development 2 Week 19 Extensions to Finite State Machines
Unit# 9: Computer Program Development
Von Neumann Architecture
ICT Gaming Lesson 3.
Lecture 7 Algorithm Design & Implementation. All problems can be solved by employing any one of the following building blocks or their combinations 1.
Creating behaviours: MOVEMENT
Presentation transcript:

Scripting Ian P. Warfield CSE Topics on AI and Computer Game Programming October 25, 2004

Definition of Scripting “Scripting is the technique of specifying a game’s data or logic outside of the game’s source language.” – AI Game Programming Wisdom 2 “A script is a program that automates a sequence of tasks… Early script languages were often called batch languages or job control languages. –

Advantages of Scripting Game designers can write a lot of code for comparatively little effort The scripting language can be designed specifically for the game under development, minimizing programming overhead Scripts can be changed more easily than code

Advantages of Scripting The more “moddable” your game is, the more people will buy it and the longer it will be marketable If your game is popular enough, you can license your game engine to other developers This business practice was spurred by the popularity of DOOM and Quake Later games, such as Quake 3, Unreal, and DOOM 3 were designed specifically with this in mind

Disadvantages of Scripting Nonprogrammers are required to program Creating a custom scripting language is an extra step in the game development The new language requires technical support and tools for debugging

Levels of Scripting Level 0: Everything hard-coded in the source language Level 1: Stats and locations specified in files Level 2: Scripted non-interactive cutscene sequences Level 3: Lightweight logic specified by tools or scripts, as in a trigger system Level 4: Heavy logic in scripts that rely on core functions in the game engine Level 5: Everything coded in scripts

Level 0: Hard-coded AI

Quickest to code, especially for small development teams or small projects Scales very poorly; difficult to debug complex programs Best suited for simple projects Used in the earliest games such as Pong, Space Invaders, and Pac-Man

Level 1: Data Specified in Files

The player’s character, his enemies, the surrounding objects, and the goals all remain the same – only the arrangement is different Scales extremely well in terms of game size but poorly in terms of game extensibility Suitable for repetitive games with multiple levels Used in early games such as Super Mario, Lode Runner, and Chip’s Challenge

Level 2: Scripted Cutscenes

Scripted cutscenes were actually quite rare until recently Game designers traditionally prefer to pre- render cutscenes Game engines did not have the power to render cutscene-quality graphics on-the-fly So this is a little out-of-order

Level 2: Scripted Cutscenes Now that game engines can render high quality graphics, scripted cutscenes are preferred Cost and file size are both dramatically improved Scripting also allows for adaptive cutscenes depending on story developments Used in games such as Half-Life and Star Trek Voyager: Elite Force

Level 3: Trigger System

Functions are coded in C/C++ and linked by scripts Scripts consist of “events” which trigger actions or possibly other events Offers best balance of flexibility, ease of use, power, speed, and extensibility Used in Freespace 2

Level 4: Heavy Script Logic

Only the core functions are coded in C/C++; most of the logic is in the script Handle interesting events and character AI, but let the game handle physics, etc. Offers large degree of flexibility while still providing a solid code foundation Used in Unreal and Half-Life

Level 5: Everything in Scripts

The bare minimum of functions are coded in C/C++; everything else is scripted Scripts resemble full-fledged programming languages Offers maximum degree of flexibility but carries most of the same risks as conventional programming Used in Jax and Daxter

Level 5: Everything in Scripts Nearly all the run-time code written in GOAL (similar to LISP) Code could be modified on-the-fly No need to recompile the engine Debugging took much less time There were setbacks, however Compiler took a long time to develop Developers had to create their own debugging and support utilities Programming in GOAL required adjustment from C/C++

Achieving a Balance Most games are designed for scripting at Level 3 or Level 4 Flexibility of scripting combined with power of C/C++ Libraries, tools, profilers, debuggers are still available

Achieving a Balance Level 3 and Level 4 can be thought of as “declarative” and “imperative” models, respectively Declarative – program in terms of “what” needs to be accomplished Imperative – program in terms of “how” to accomplish it

Declarative Model No implicit state, no assignments Expression evaluation instead of instruction sequencing Recursion instead of loops Tends toward “functional” programming paradigm, used in LISP

Declarative Model Sample code: ( when ( is-destroyed “NTD Repulse” ) ( send-message “Well done” ) )

Imperative Model States defined in variables Variable modification through explicit assignment Loops and iterative sequences of statements

Imperative Model Sample code: ship *ship_ctr; for (ship_ctr = GET_FIRST(ship_list); ship_ctr != GET_LAST(ship_list); ship_ctr = GET_NEXT(ship_ctr)) { if (strcmp(ship_ctr->name, “NTD Repulse”) == 0) { if (ship_ctr->flags & SF_DESTROYED) { message_queue_add(“Well done”); break; }

A Level 3 Demonstration FRED – the FReespace EDitor Visit the Freespace 2 community forums at

Summary Core C/C++ functions do the hard work and the script provides the creative element Scripting provides the flexibility and moddability your game needs to be successful The write-time advantage far outweighs the run-time and development-time disadvantage Choose an appropriate level of scripting that balances flexibility and user-friendliness with the power of your underlying game engine

Sources Combs, Nathan, and Jean-Louis Ardoint. Declarative versus Imperative Paradigms in Games AI. Definition of Script (computer programming). Game Engine. Niestadt, Jan. Implementing a Scripting Engine. Patel, Amit. Amit’s Game Programming Information. students.stanford.edu/~amitp/. students.stanford.edu/~amitp/ Rabin, Steve, et al. AI Game Programming Wisdom 2. Hingham: Charles River Media, Inc., Scripting. Simpson, Jake. Game Engine Anatomy Sweeny, Tim. UnrealScript Language Reference. White, Stephen. Postmortem: Naughty Dog's Jak and Daxter: the Precursor Legacy.