Scripting
Finite-State Machine Scripting Language for Designers | |
Topics: State Machines, Scripting; Genres: General
Abstract: AI is often implemented with finite state machines (FSM's) or layers of finite state machines, which are difficult for game designers to edit. Looking at typical AI FSM's, there are design patterns that occur repeatedly. We can use these patterns to make a custom scripting language that is both powerful and approachable. The technique can be further extended into a "stack machine" (pushdown automata) so that characters have better memory of previous behaviors.
Optimized Script Execution
Topics: Scripting; Genres: General
Abstract: The slow speed with which script languages are executed (compared to native code) places many limitations on a script language's potential applications. Previously only infrequently executed code placed outside of the game's inner loops has been deemed suitable for scripting, and for this reason script languages have typically only been used for story telling or customizable event-handling purposes.
Using optimization techniques presented in this article, it possible to increase script execution efficiency to near-native performance levels, enabling the use of scripting in the game's core logic, or even in a high performance 3D rendering system. The flexibility gained from switching to script-based logic means that even modifying a program's innermost mechanics is trivial, and does not come with the performance penalties one would expect.
Three stages of script execution are individually examined, and optimizations for each are presented. The techniques and principles presented can be easily applied to any existing scripting engine.
Advanced Script Debugging
Topics: Scripting; Genres: General
Abstract: Poor or missing script debugging facilities are among the principal reasons for scripts not being fully exploited in a development environment. Often, errors encountered during script execution result in crashes of the game or a "screen of death" style representation of the virtual machine's internal state just after the crash has occured.
In-depth knowledge of the virtual machine is required to interpret such information, and often the virtual machine's source code needs to be examined in order to identify the problem, which may have been caused by a virtual machine command executed long before the crash. Because all external developers (including the mod community) and most in-house script programmers lack this in-depth information, they will restrict their programming style to simple constructs that can be fixed using a trial and error process in case of a problem. Therefore even the most powerful script languages are doomed to be misused if they do not support proper debugging mechanisms.
This article shows how to incorporate known debugging capabilities from common development environments into your script system, giving your script designers and the mod community the ability to create complex scripts and use the language to its full extent, while also shortening the development period because of improved debugging capabilities for scripts.
Adding Error Reporting to Scripting Languages | |
Topics: Scripting; Genres: General
Abstract: Custom scripting languages are a controversial game development tool. Scripting languages empower non-programmers by moving game AI logic out of the C++ code. While this empowerment certainly comes with some risks, the benefits are that additional team members can create behaviors, designers can tweak AI more directly, and the AI logic is more accessible to the mod community. The most common complaint about scripting languages is that they are difficult to debug. This concern is exacerbated if non-programmers intend to write scripts. If the scripting language compiler or interpreter only gives feedback like "syntax error," non-programmers are not going to get very far. Fortunately, this problem is easily solved. The same techniques used to define the grammar of valid syntax can be used to identify and report scripting errors in plain English. This article describes how to harness the power of Lex and Yacc to generate meaningful errors when compiling scripts. The article includes C++, Lex, and Yacc code for a simplistic language called Simple.
Empowering Designers: Defining Fuzzy Logic Behavior through Excel-Based Spreadsheets | |
Topics: Scripting, Fuzzy Logic; Genres: Sports, Baseball
Abstract: Putting game development back into the hands of the game's designers is critical to keeping a project on schedule. How does that happen? What is the easiest way to let a game designer work on their own with a minimum amount of interaction from a technical source? Using Visual Basic for Applications and some basic applications, it is possible to design an interface which does both of these things, as well as having the added benefit of letting finished code stay finished.
A Modular Camera Architecture for Intelligent Control | |
Topics: Scripting, Camera; Genres: General
Abstract: Cameras play a vital role in the user experience of any game. A robust camera solution can make the difference between a game that is awkward to play and a game that plays smoothly and feels great. Unfortunately, cameras tend to be a low priority item in many game development schedules and the effort is limited to the point where the cameras stop being a nuisance. One of the reasons that the efforts stop early is the lack of a solid architecture that allows rapid, data driven experimentation with camera behaviors.
This article presents a component based camera architecture that allows non-programmers to take over the development of cameras at the point where they make the transition between technical coding and creative effort. The architecture will demonstrate the use of common AI techniques to enhance the robustness and creativity of the camera solution for any game. The techniques presented in the article will primarily benefit games that have a third-person perspective, but will also provide useful tips for other types of games.
An Introduction to Lua Ash Matheson (Center for Digital Imaging and Sound (CDIS), Burnaby, BC, Canada)
GameDev.net, 2003.
Topics: Scripting; Genres: General
Abstract: This article describes how to add the scripting language Lua to your game engine. Lua is becoming
more popular for game scripting in commercial games and this article attempts to break down the barriers
to getting it working within your own codebase.
Creating a 'Safe Sandbox' for Game Scripting Matthew Walker (NCsoft Corporation)
Massively Multiplayer Game Development, 2003.
Topics: Scripting; Genres: General, MMP
Abstract: The technical and support demands of Massively Multiplayer (MMP) games require a robust server
architecture. Yet, the nature of regular, dynamic content development risks introducing bugs that can
open opportunities for exploits or can unbalance the game. One way to mitigate this risk is to build
a 'safe sandbox' within which game designers can write code that realizes their creative intent while
insulating them from sensitive subsystems. This article explores how to create such a sandbox using the
high-level programming language, Python, to implement an encapsulated, event-driven environment that lets
designers safely focus on gameplay as their first priority.
Creating a Scripting System in C++ Greg Rosenblatt
Part 1: Introduction, GameDev.net, 2003.
Part 2: Data Manipulation, GameDev.net, 2003.
Part 3: Dynamic Loading, GameDev.net, 2003.
Part 4: The Stack and Program Flow, GameDev.net, 2003.
Part 5: Functionality, GameDev.net, 2003.
Topics: Scripting; Genres: General
Abstract: This series is intended to give the reader the information necessary to create a scripting system
of his/her own from the ground up. The reasons one would choose to create such a system from scratch
are many, most of which are analogous to reasons one would create anything else from scratch, such
as a 3D engine. Most importantly, in my opinion, is that it's a valuable learning experience.
Toward Better Scripting: Part 1 Jonathan Blow
Game Developer Magazine, October 2002.
Topics: Scripting; Genres: General
Abstract: This article deals with design issues and features when architecting a scripting language. Games
require domain-specific issues to incorporated into the language, so they differ greatly from general purpose
languages. The article references code samples found at the www.gdmag.com site. One example is of a commentator
from a game like Dance Dance Revolution. The other example is a mortar unit from a real-time strategy game.
Toward Better Scripting: Part 2 Jonathan Blow
Game Developer Magazine, November 2002.
Topics: Scripting; Genres: General
Abstract: This article deals with design issues and features when architecting a scripting language. Games
require domain-specific issues to incorporated into the language, so they differ greatly from general purpose
languages. The article references code samples found at the www.gdmag.com site. One example is of a commentator
from a game like Dance Dance Revolution. The other example is a mortar unit from a real-time strategy game.
Scripting: Overview and Code Generation | |
Topics: Scripting; Genres: General
Abstract:
Scripting: The Interpreter Engine | |
Topics: Scripting; Genres: General
Abstract:
Scripting: System Integration
Topics: Scripting; Genres: General
Abstract:
Creating Scripting Languages for Non-Programmers
Topics: Scripting; Genres: General
Abstract:
Scripting for Undefined Circumstances
Topics: Scripting; Genres: General
Abstract: Games are increasingly allowing the player to set the agenda. Want to while away hours mucking around with the game physics by throwing rocks into crowds of villagers? No problem! On the other hand, a strong storyline helps to inform the player of their goals, and provides a context for their actions. Traditionally, storylines in games have been advanced via cinematic sequences, and it is common for these to be displayed using the game engine. Can we resolve the conflict that occurs when we simultaneously afford the player the freedom to set the agenda and the game designers the ability to impose a storyline? What if a crucial moment in the story depends on the presence of the harmless little villager that the player unthinkingly threw into the ocean at the beginning of the game? Even worse, what if a non-player character under AI control intrudes into a cinematic sequence and begins to wreak havoc? In this article we discuss the features that were implemented in the game "Black & White" to allow the game designers to create storyline-advancing "Challenges" without compromising the unpredictable nature of the game.
The Perils of AI Scripting
Topics: Scripting; Genres: General
Abstract: Scripting is an enormously popular technique for developing game AI systems, but it can also be enormously dangerous. This article describes some of the considerations that you should think about very carefully before you jump on the scripting bandwagon, many of which you might not otherwise discover until it's too late. We also describe a number of the things that can go wrong when your lofty scripting language ambitions collide with the realities of game development.
How Not To Implement a Basic Scripting Language
Topics: Scripting; Genres: General
Abstract: This paper goes into some of the mistakes that were made while writing the scripting languages for Baldur's Gate and Neverwinter Nights. The four major points, which are covered with anecdotes: the lack of up-front design, ignoring early-adopter feedback, believing the code will only be used for one project, and believing the language will be used for one specific task.
Implementing a State Machine Language | |
Topics: Architecture, FSM, State Machines, Scripting; Genres: General
Abstract: This article presents a robust way to structure your state machines with a simple language. This State Machine Language will not only provide structure, but it will unleash some powerful concepts that will make programming games much easier. While the language itself is simple, it embodies some very important software engineering principles such as simplicity, maintainability, robustness, and ease of debuggine. The following article, "Enhancing a State Machine Language through Messaging," expands on this language with a powerful communication technique using messages. Each article has full soure code on the accompanying CD-ROM.
Enhancing a State Machine Language through Messaging | |
Topics: Architecture, FSM, State Machines, Scripting; Genres: General
Abstract: The previous article, "Implementing a State Machine Language," set the groundwork for a powerful language that can structure state machines in a simple, readable, and very debuggable format. In this article, that language will be expanded to encompass the problem of communication between AI game objects. This communication technique will revolutionize the State Machine Language by allowing complicated control flow and timers. Full source code is included on the accompanying CD-ROM.
Naughty Dog's Jak & Daxter: The Precursor Legacy Stephen White (Naughty Dog)
Game Developer Magazine, April 2002.
Topics: Scripting; Genres: General
Abstract: This postmortem on the PS2 game Jak & Daxter describes the pros and
cons of their custom language based on Lisp. The language supports nonpreemptive
cooperative multi-tasking and required a custom compiler. Pros include: the ability to
compile and download code while the game is running which resulted in rapid tuning and debugging,
the ability to write logic that didn't have to save state when it suspended itself for that
game tick, simplified syntax, and the ability to intermix assembly instructions with higher-level
code. Cons include: it caused a lot of grief, all support/bug fixes/feature enhancements came from
the sole programmer who was the designer of the language, it took over a year to develop the
compiler, programmers had to put up with odd quirks, missing features, and numerous bugs, gave up
third-party tools such as profilers and debuggers, hard to find programmers with Lisp experience,
and problems with memory usage (garbage collection).
A Extensible Trigger System for AI Agents, Objects, and Quests
Topics: Architecture, Trigger System, Scripting; Genres: General
Abstract:
Game Scripting in Python Bruce Dawson (Humongous Entertainment)
Game Developers Conference Proceedings, 2002.
Topics: Scripting; Genres: General
Abstract: Scripting languages allow rapid development of game behavior without the pitfalls that await
the unwary C++ programmer. Using an existing scripting language saves the time and cost of developing
a custom language and typically gives users a far more powerful language than they could create on their
own. Python is an execellent choice for game scripting, because it is easily embedded, is powerful, can
seamlessly be extended with C/C++ code, has most of the advanced features that make scripting languages
worthwhile, and can be used for automating productions tasks as well as in the game. Additionally, the books,
development tools and libraries available for Python give great opportunities for leveraging the work
of others. This session describes the presenter's experiences with integrating Python into a game engine.
It explains why Python was chosen, what the benefits have been, what problems were encountered, and
how they were solved. This session illustrates why using an existing scripting language, rather than
creating one's own, is the smart thing to do. Python is a good choice for a game scripting language, and
integration is easy, especially with the lessons that are taught in this session.
Designing a General Robust AI Engine | |
Topics: Architecture, FSM, State Machines, Scripting; Genres: General
Abstract:
Making the Solution Fit the Problem: AI and Character Control in Crash Bandicoot Andy Gavin
Computer Game Developers Conference Proceedings, 1997.
Topics: Scripting; Genres: General
Abstract:
Adding Extensible Custom Languages to Game Engines Robert Huebner
Computer Game Developers Conference Proceedings, 1997.
Topics: Scripting; Genres: General
Abstract:
Inside NHL Powerplay 96: What Are They Thinking? David Roberts
Computer Game Developers Conference Proceedings, 1997.
Topics: Architecture, Scripting; Genres: Sports, Hockey
Abstract:
Adding Languages to Game Engines Robert Huebner (Lucas Arts Entertainment)
Game Developer Magazine, September 1997.
Available Online at Gamasutra, 1997.
Topics: Scripting; Genres: General
Abstract:
The Making of HyperBlade Stuart Rosen (WizBang! Software Productions), Robert Duisberg (WizBang! Software Productions)
Game Developer Magazine, August 1996.
Topics: Scripting, Architecture; Genres: General
Abstract:
|