Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Scripting Language for an XNA RPG

Name: Anonymous 2010-08-22 0:59

Yo. I'm working on an RPG engine in C# and XNA. We're planning on targeting Windows and Windows Phone 7, but are running into issues with AI interactions and controlling player actions during cutscenes. FOr the most part, everything is extracted using the MVC design pattern, but obviously would break separation of concerns. So the idea is to have an interface (IScriptEngine) that takes an IScriptObject and updates data in the map model accordingly.
I was thinking about putting the scripts in an XML sort of syntax:
<Script Name="MoveNPC_1">
<Action Command="MoveToTile" Target="NPC_1" Value="10,2"/>
</Script>

And have the engine parse it that way. My biggest fear is performance issues and scalability.

Name: Anonymous 2010-08-22 9:15

>>1
You need to learn what XML is for. It's a declarative interchange language for computer programs. It is not meant to be hand-written by humans. At least, it really should not be hand-written by humans.

Are you seriously not allowed to just link in a Lua interpreter? If not, then at the risk of sounding like a lispfag, my recommendation would be to make your script format s-expression based. In other words, your example would look like this:

(script move-npc-1
  (move-to-tile npc-1 10 2))


The reason this sort of representation is good is because it's absolutely trivial to write a parser and interpreter for it. Seriously you could do this in 100 lines of C#.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List