Why should i use a scripting language???

Started by
15 comments, last by Metaphorically 18 years, 2 months ago
Quote:Original post by Xai
I can't imagine keeping my DATA inside my LUA / ruby scripts ... or my C++ program, or any of that. The reason, because what the hell tools out their know how to parse LUA correctly to present the lists of data to a non-scripter so they can edit them? What tools out their exist to parse these lists and generate lists of the resource files currently used in your project.

If you as I suggested just used Lua tables to store data, it would be no problem to write a tool for editing them even though I would consider it unnecessary given the simple nature of their syntax. It's just a comma separated list of key/value-pairs. You don't need to be a programmer to do that except for writing function values which no tool can do for you anyway.

And why would you need to parse it to get information from it? Just write a Lua function to iterate through the tables and gather the information you need.
Lua was originally intended to be used for data description and configuration.
Advertisement
Quote:Original post by Xai
I can't imagine keeping my DATA inside my LUA / ruby scripts ... or my C++ program, or any of that. The reason, because what the hell tools out their know how to parse LUA correctly to present the lists of data to a non-scripter so they can edit them? What tools out their exist to parse these lists and generate lists of the resource files currently used in your project.

Well, Lua. Isn't that kind of the point?

parsing lua scripts just to describe data is expensive in terms of processing units compared to XML.
Quote:Original post by Xai
i double dare you to crank out an Animation File Editor tool that edits your LUA script data - in a similar amount of time.

On this one: Why not write the editor in Lua, operating on Lua tables. Something as complex as this can be used to stream it to disk: http://www.lua.org/manual/2.1/subsection3_7_3.html
I was just reading this thread, and it seems that using scripting languages for AI would be usefull for me. I was wondering where can I get more info, and maby library's for processing scripting languages, thats free.

Do any of you use a library created by someone else (Outside your programming team) for enterpreting scripting languages for AI or whatever needed, or did you (self or with programming team) make the code to interpret it yourself.

Thank you!
My own experince so far is to hardcode AI logic and stats and whatnot into game characters.
But this scripting concept sounds interesting.
Would someone like to try and convert me to the church of scripting?
Intro to paradigm, learning resources, etc
Thanks
I think the idea wouldn't be to code AI in a scripting language, rather code the AI inside your engine and use scripting to control the AI. For example, the AI might have different attitudes that any NPC can have. Your resources (script and XML data) could control which attitude is applied under what circumstances for a specific character.

Or another example, suppose you have an AI that does pathfinding. The AI has parameters that control how hard it tries to find a path. Maybe you want one type of character that's better at it than another. Each of the character types can be defined in script and have these values to pass to the AI.

If you've got an AI that understands goals, you could use data files to describe constraints on the goals. This is kind of complicated, but I read a lot on it recently and blogged what I learned. You can have a look at tools like Graphplan for examples of this kind of resource (Graphplan is old, but I found a lot of info on it and understood it).

As for external libraries, there's Mozilla Spidermonkey for &#106avascript and Lua as mentioned earlier. For XML the classic library is Expat. (check the license before commiting on all these of course)

This topic is closed to new replies.

Advertisement