Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Say I'm making this big game in C# with XNA.

What options do I have to include a scripting feature to my code base?

share|improve this question
2  
What features, specifically, of a scripting engine do you actually need? The vast majority of things a scripting engine gives you are already available in C#. –  Andrew Russell Sep 28 '10 at 7:31
    
Basically, I'm thinking to make something like a GUI base XNA game maker. So you use this game maker and access my C# classes and functions from script to implement game play. –  astk Sep 28 '10 at 8:06
1  
Who's the end user? Is this something like Klik & Play (children, hobbyists)? Or is it more like Unreal Kismet (artists and designers)? Or something different? –  Andrew Russell Sep 28 '10 at 13:00
    
Let's say like Game Maker. While it allows to implement any game mechanic, it still OK to Klik and Play. It doesn't need to have visual script editor like Kismet. –  astk Sep 29 '10 at 2:39
    
That is very different to the question that you have asked. Perhaps try asking another one that better explains your requirements. Or take my short answer, which is: use C# delegates as the basis of a system that can treat functions like objects. Use those objects to build a GUI system, or expose the system to advanced end users via C# as described in my answer. –  Andrew Russell Sep 29 '10 at 6:00
add comment

2 Answers

up vote 15 down vote accepted

I advocate not using a scripting language in C#. C# is already solves the vast majority of problems that a scripting engine is used to solve. Just use C# in the way you would use a scripting language.

Because I've been over this several times before, here is some reading material for you:


UPDATE: If you want a live-editing workflow, try this cheeky method for using Edit and Continue.

share|improve this answer
add comment

If you plan on targeting the XBox360 or Windows Phone 7, then your options are limited. Those platforms do not support runtime code generation, so your only option would be an interpreted language. I would recommend steering clear of interpreted languages, as their performance tends to range from "sub-par" to "abysmal".

If you are only targeting Windows, and you really need/want a scripting language, then have a look at IronPython or IronRuby. Both target the DLR and perform very well (for being dynamic languages).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.