So what is scripting? Scripting is an interface that exposes C++. A script has functions and classes. Programs written to handle scripts use a special run-time environment that can interpret rather than compile and automate the execution of tasks which could alternatively be executed one-by-one by a programmer or scripter. What this means is that there are files that are read in by the engine to determine the game's logic. This is good because you do not have to recompile this logic every time it is modified.
Here is a list of scripting languages that we came up with in class:
Squirrel
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhzIz5b2uIczgfR85FaecLFxq6pdERmgOZFs36ckRY8N8l7qDrO80Uy5bvaVsH0ctkNl3kOgRkMgo4A9yNAxbqI1QUKAvklQUCKCsrNAhgdivKcYYPPxoQ_cs9-jUKVD-4Y2PAr5l17sP-/s1600/scriptingBooks.jpg)
Lua
Python
JavaScript
ActionScript
HeroScript
MEL
GameMonkey
ChaiScript
Quake C
UnrealScript
I left Quake and Unreal at the end because these two languages are singled out to be specifically for their own engines. These are techincally scripting languages but they are most efficient inside of their respective engines.
In class we also talked about Data Declarative types of scripting languages. For example Ogre's particle engine is a data declarative scripting style. It declares a specific type of data and how it is going to be used. Below I have an example of a data declarative scripting languages:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSo5Jgg_DCbiPu4GKIP0qZK4QsNVj8JmZWkDxg_rKDj2zidlCXunDE3uri5IGNe9HuSQFs-GCM7wgiUhOsEgRa0MRtkvJ4zp6EjCU8B2nQY4YBDRdHU_PSvVRF2KXO3ru4t6fWxVdt5a4U/s1600/doom.jpg)
XML allows to creates your own language. DOM
<character Name "Joe">
<strength> 5 </strength>
</character>
<particleSystem ID = "fire">
<force>0,0,5
</force>
</particleSystem>
In this example the code is defines a character named Joe and then a particle system called fire that has a force of 5 in the z direction. This is really simple to read and write code. If you are looking for an easy Data Declarative then use XML. This allows you to load and initialize these before run time. In Doom 3 they had all of their data files as XML.
On a side not, we discussed file formats for objects that can be loaded in game. COLLADA only has about three engines use this format. I don't recommend using this and instead using fbx or obj formats. That's about all I wanted to say about the file types since I want to focus on scripting.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiz8Q8XcJWwt8w4x7rQ6bCTSlvqDBZEh2p8LzTbEbGE-1BKA_Dj4KN92gntHWYf8olwHgSWt-CYChEQ_TSybrPAJWOv5JAdtrksRs8-_gRdyGgDP4-cy90PIFIMCegvtXUv21lJBIIl4NL/s1600/quake.jpg)
There are also interpreted languages. It has a just in time (JIT) compiler. It compiles while it runs rather than waiting for it to compile first. Here is a list of Interpreted languages.
Python
Java
and all other scripting languages listed above.
I like these interpreted languages because it minimizes the amount of initial compile time leaving more time for debugging. Java is half interpreted and half runtime.
The point of scripting is to remove the parts of C and C++ that coders don't like. Basically allows you to simply and quickly create gameplay code. A lot of the functionality of the scripting and it does not touch the engine code. The great thing about scripting is when you are tweaking small variables you don't have to recompile your engine everytime you do.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaac9a58rewrx6JYrdbxAtQldRvbNuZd9pcM0D_RUdbI672-qUidMz6IMZ4c86r7-Kaj4D76hCbHmM9uixuHZ_-uBzqx87-KUdvy3W9ucjIROCKiOuZ2jOebmHAYMKnvjNQajyaIWosCQf/s1600/unity.jpg)
Interpreted, runtime, and Data Declared languages are the ones we need to focus on in this course since we need a runtime language for our engine and either an interpreted or data declared language for the scripting in the game.
There are other types of languages too. Here I have a small list of other language types plus some examples of these languages:
Procedural Languages
These languages are based on the concept of the unit and scope. This would have a long list such as C, Java, Perl, Python etc.
Functional Languages
LISP
F#
Haskell has a lot of multithreading capability.
Logic Based Languages
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYgYkzc_gHaYqZSBuTR55F0GwP63BTnMJe_ugodGWC_rbprxk7-1fBDaEx7ZrwlvTCwjLMAhBUAr-7KjCBmine-gUSfh23y70vj8sI57k_7OuDxNxe32ubn3GiOZLJCkIWelFMBHDeAI5L/s1600/unreal_technology1.jpg)
Prolog Languages
These languages are genereal purpose logic programming languages associated with AI and computational linguistics.
GUI Programming Language
LegoLogo
Alice
.Net
Visual Basic
ShaderLang - insomniac
No comments:
Post a Comment