2D Animation Scripting

Started by
1 comment, last by Merlin Roger Avery 11 years, 6 months ago
I posted this in the graphics section and recieved no replies, so maybe I'll have better luck here!

I've been working on a 2D RPG in XNA. While browsing tutorials and videos, I've heard them mention doing animation in a seperate script file. Since tutorials are always brief and never indepth, the following questions persist:

1) Are scripting languages faster than C# for animations? Is that why we would want to use them?

2) Is this only for time/movie like animations and not animations that require input (such as pressing up to animate my sprite to move up compared to a cut scene that plays regardless of input).

3) Good, possible, and best scripting lanuage to use for animation?

4) Any other reason to use scripts in a game?

Thanks!
Advertisement
1) Are scripting languages faster than C# for animations? Is that why we would want to use them?[/quote]

Mainly because they don't require two things: a deep knowledge of underlying game code in order to design and implement cut scenes (i.e. more designer friendly), and scripts do not require a recompile of all the game code in order to test a change.

2) Is this only for time/movie like animations and not animations that require input (such as pressing up to animate my sprite to move up compared to a cut scene that plays regardless of input).[/quote]

You can technically go as crazy as you want. That doesn't mean you should (reading a script to decide how to handle a particular player input, for example). Things that you can see changing or being added to frequently during development are good targets: level layout, cut scenes, puzzle interactions, etc. Good rule of thumb: if you see the work as more design-oriented, make it script-able.

3) Good, possible, and best scripting lanuage to use for animation?[/quote]

Anything that has an interpreter for the language your game code is in. Beyond that, I don't know... Lua? Python? JavaScript? Your own (with an implementation of an interpreter of course)?

4) Any other reason to use scripts in a game?[/quote]

Pretty much as above, anything that basically dictates behavior, can be read once and only once (not executed every update), and is subject to change is a good target.
I found using scripting for animations is better than an animation data format. It tends to give more control and there always ends up some state you want to pull off your format doesn't allow.

This topic is closed to new replies.

Advertisement