Implementing a simple XML based Scripting Language for an XNA Game

前端 未结 5 1229
闹比i
闹比i 2021-01-07 08:38

I\'m working with a team on a 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 contro

5条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-07 09:37

    Do you necessarily need to interpret the scripts at runtime? You say your development is content driven, which is a good thing to do. But you don't necessarily need your scripts to be interpreted in order to take advantage of the increase in speed and efficiency from using XML or a scripting language.

    I'm following Shawn Hargreaves' example of creating XML data and allowing the Content Pipeline to compile it into a .XNB. If you implement a scripting system or integrate an existing and make a ContentPipeline project for it, you can compile just the scripts that were added or modified, very little downtime between runs in comparison to recompiling the whole darn game.

    And I definitely wouldn't go for XML, XNA may automatically have an importer for it, but it will be ugly as hell trying to use it. XNUA was supposed to be a lua library for XNA that's supposed to work well enough for this sort of thing.

    Making designers compile to .XNB isn't all that different from the crap you have to do in engines like Source anyway.

    Also, I found the following useful for thinking about scripted events:
    Riverman Media - Object Oriented Programming, the Scripted Event System
    Brandon Furtwangler - First Impressions Matter

提交回复
热议问题