Jump to content
  • Advertisement
Sign in to follow this  
ZackHeckman

Would like suggestions for scripting

This topic is 2613 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So as I've been working on various games in my time I feel like I should have a scripting tool / engine. My idea here ( and I mostly explain this through example because I'm not quite sure what I'm looking for ) is to have like a C# tool that lets you write scripts but I mean writing now why wouldn't I just like write them in a .txt and .... idk maybe someone here has an idea lol. The whole concept is to instead of mass producing .cpp's and classes or extending a CEnemy class to 500,000,000 lines of code to contain all the enemies AI and behaviors or even the same with like items in the game, have a scripting engine and tool to quickly and easily produce enemies and weapons. The game is being written in XNA and I'm basically looking for the most efficient way to do content creation that is not a million classes. I realize I said cpp earlier even though it's XNA but I hope in some way during this rant I've explained my problem that I'd love suggestions for. I want to write some sort of scripting engine for this because I believe that'd be the best way to create content but if I'm wrong someone please suggest something I'm all ears and would love to hear all suggestions. Sorry for the wall of text :(

Share this post


Link to post
Share on other sites
Advertisement
Yeah, you idea is quite correct and I believe it's common used in the gaming industry. :)

But, why write your own script engine? You are wasting your time.
There are bunch of existing great script engine.
I recommend you have a look at Lua, it's popular in game development, and very simple to use, also simple to bind.
If you don't mind heavy script engine, I really like Javascript, there is great Google V8 engine (300K line of code though).

Share this post


Link to post
Share on other sites
Oh no absolutely not, I am by no means trying to write my own scripting engine. I'm not a big fan of reinventing the wheel. I'm wondering like what would be a good solution to the problem that is hundreds and hundreds enemies weapons obstacles and items in a game without having to hard code it all recompile every time and just generally suck in that aspect lol. Like if I wanted to write a fireball spell and actively test it without having to recompile the game what's the best direction to head in?

Share this post


Link to post
Share on other sites
Data-driven design. Build code that can handle general case projectiles (launch, travel, payload, etc...) then feed the system data to represent a fireball, including fireball animations and a script to describe what happens when the fireball hits. Write code to instance a general monster, then feed it the data for a hundred thousand specific monster instances.

In a data-driven approach, you don't hard-code anything. Everything is representable as data, and the program simply operates on that data. One aspect of embedded scripting languages such as Lua, as far as data-driven is concerned, is the idea of code-as-data. Since the script is interpreted, entity behaviors can often be written as script code rather than hard-coded into the engine. The engine provides the hooks and such, the script provides the data that describes the behaviors in terms of the hooks into the code.

Share this post


Link to post
Share on other sites
What would you say is the best Scripting language for such design, JTippetts? Well best scripting language ( or rather ease of implementation and use ) to get into an XNA engine?

Share this post


Link to post
Share on other sites
Alright so what I hear is the problem is that XNA recompiles all files regardless of type at runtime anyways so even if I were to change a script the game would have to recompile. I guess with that being said is there any sort of solution that is the effectiveness of scripting that I'm looking for as described by JTippetts that works with XNA?

Share this post


Link to post
Share on other sites
I was talking about using C# to make a tool to write scripts which would be exported into XNA, not scripting for a C# game. There is no real reason to write a tool in C# though, notepad works just fine I was just overthinking.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!