Font Size: a A A

Game Scripting Engine Design And Realization

Posted on:2008-02-05Degree:MasterType:Thesis
Country:ChinaCandidate:Y ChenFull Text:PDF
GTID:2208360245455646Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
Game script is the carder of computer game logic,it runs within the computer game scripting engine.The introduction of game script can avoid the "hard-coded" of computer game logic,so it will greatly improve the efficiency of the development of computer games.Several dynamic programming languages which are suit to act as the computer game scripting engine have been forwarded now in foreign countries,such as Python,Ruby,Lua etc.,and domestic computer game development companies are starting to apply these game scripting engines in developing their own computer games.This paper introduce the design and implementation of a simple game scripting engine XtremeScript scripting system,the core of designation can be summaried as:Write the computer game logic into script files,rather than hard coding into computer game application,then the virtual machine will execute these script files and return the results to the computer game application through specific function invoking interfaces.XtremeScript scripting system includes three parts:XtremeScrpit compiler, XVM virtual machine,XVM assembler.XtremeScript compiler can compile XtremeScript language into XVM assemble language,XtremeScript language is a subset of C language and XVM assemble language is a language which analog to INTEL assemble language;XVM assembler can assemble XVM language into byteword which can be executed by XVM virtual machine;XVM virtual machine is a software which mocking the acts of XVM assemble language CPU and run within the host programs,such as computer game programs,it identifies and executes the bytewords which are assembled into by XVM assembler,and returns the corresponding results to the host programs.This paper analyzes and researchs the principles and mechanisms of a simple game scripting engine—XtremeScript scripting system,builds a game scripting system which can be put to use,and provides a feasible way to design and implement a scripting system.After absorbing the essence of original work,this paper analyzes and optimizes the related algorithms and programming structures—rewrite the compiler and assembler based on the syntax-directed rule to clarify the programming structure, replace the original algorithms with more effective algorithms(such as simple register allocation algorithm based on stack principle and decision tree algorithm based on hard-coded.),simplify the codes generated by scripting system,improve the speed of execution greatly.
Keywords/Search Tags:Scripting Engine, Virtual Machine, Assembler, Compiler
PDF Full Text Request
Related items