Jump to content
  • Advertisement
Sign in to follow this  
Xanather

Modding API

This topic is 1742 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

I am developing a 2D sidescroller similar to terraria and starbound, after 3 months I have written my own hard coded "engine" for the game that features lighting, tile management, world management, entity management, networking, input, user interface management, rendering, and some others...

 

My question is how would a modding API be developed, I have a feeling I am too far down the track for such an easy implementation. I am using C# 5.0 (.net 4.5) with MonoGame. This is also the first time of me having a shot at developing a real game, I still would consider myself "newbie".

Since its C# I am leaning towards reflection and importing local libraries, this seems like it would be a security issue however. I do not have much experience with reflection but I am sure I could easily pick it up.

 

Some technical aspects of that game are:
1. The game is completely server-based, hence at the moment there is no singleplayer mode since start of development has been for multiplayer.
2. Uses TCP for networking.

3. The client and server will be obfuscated, eliminating easy .net decompiled modding.

4. Some part of the game can already be modded only server-side to see client-side effects (even though the client executable was not touched).

5. The server has all authority.
 

Thoughts?

Edited by Xanather

Share this post


Link to post
Share on other sites
Advertisement

What kind of mods do you want people to be able to make, and what kind of mods do you want to disallow people from making?

Share this post


Link to post
Share on other sites

Well, primary the ability to create additional NPC's, add items, add spells/abilities, adding tiles, nothing too big that would require large modifications.

 

 

 


Why not just give them your code to have at it?

I don't want a open source game.

 

A thought: could runtime code be generated on the spot depending on several XML files containing information about new spells/abilities, etc...? My only issue there would be both sides (client + server) would need to interpret both files differently.

Edited by Xanather

Share this post


Link to post
Share on other sites

You could go the Elder Scrolls way and provide a powerful graphical editor, plus scripting for more involved modding. No need to expose actual engine's functions.

Share this post


Link to post
Share on other sites

C# can be used as a scripting language from within itself, so if you were to integrate a C# scripting framework into your engine then you could implement a lot of your game logic in C# scripts, making it easy for others to modify behavior while being able to leverage the full featureset of C#. The only difference between scripts and your core engine code would be that scripts are compiled at runtime by the engine and executed in their own application domain, among other things, to isolate them completely and help prevent them from doing Bad Stuff. Other data for your game could go in XML, or JSON, or pretty much any other human-readable format that users can modify and extend. If you want to go all-out and write a separate editor, that's also a possibility, but probably not essential for smaller games.

Edited by Zipster

Share this post


Link to post
Share on other sites

C# can be used as a scripting language from within itself, so if you were to integrate a C# scripting framework into your engine then you could implement a lot of your game logic in C# scripts, making it easy for others to modify behavior while being able to leverage the full featureset of C#. The only difference between scripts and your core engine code would be that scripts are compiled at runtime by the engine and executed in their own application domain, among other things, to isolate them completely and help prevent them from doing Bad Stuff. Other data for your game could go in XML, or JSON, or pretty much any other human-readable format that users can modify and extend. If you want to go all-out and write a separate editor, that's also a possibility, but probably not essentially smaller games.

Yeah, thanks, I will probably go down that route, it sounds like a good idea. Never thought about runtime compilation.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!