What language features are needed for game scripts?

I learn the scripting language of the game and ask myself that people involved in the gaming industry are considering the main subjects / properties for a good game script. This includes things like:

  • static and dynamic types
  • Who should it be aimed at: programmers or designers?
  • (should it look like C?)
  • How high should it be? (C vs Lisp for example - or imperative versus functional)
  • What should he do. How fast should it be?

In addition, I heard from several sources that scripts are usually very simple because they are written more by designers than programmers. Is that the case?

+5
source share
4 answers

How about looking at languages ​​that are actually used to write scripts in games like Python and Lua for some ideas?

Both of them are dynamically typed, and in terms of syntax, Python is very different from C, and Lua is not very similar to C.

Probably the reason they are used for game scripts is the ease of embedding the language as a scripting mechanism, if something else. If a language should be designed with designers in mind, then perhaps the language requirements should be changed to fit the needs of designers, rather than having a language that integrates more easily into the game.

+7
source

, ( , , ) .

- . .

, , . , . , , . (, , , .)

, , , , , . .

. , , . : , .

- Lua Python.

+3

Python , LUA.
, XNA, (, , ) , LuaInterface IronPython.

+1

, . , , , - , . , C/++, .

( TES Construction Set ):

script MagicCaveDoorScript
    on UseAction
        if HasItem magicDoorKey
            PlaySound2D magicDoorOpen
            ChangeArea magicCave01
        else
            Message "You need the magic door key to enter..."
        end
    end
end

- , , , , , , Lua Squirrel , ..

One of the good aspects of creating a “simpler” scripting language is that the implementation is not as complicated as more complex languages, and it will also allow you to easily create tools for creating scripts using the graphical interface, for example, choose from a list of sounds to play, a list monsters to attach, etc.

+1
source

All Articles