Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm thinking of adding a Lua interpreter in my game, giving various objects in the game script access to allow mods.

By how much should I expose to the scripting environment, I'm not sure.

Should I allow low-level access?

For example, should I just give the scripts a function to move a character (takes care of moving, playing walk animation, everything needed).

Or should I allow low-level functions instead: a function to play animation, separate from the function that moves the character, a function to receive damage (that won't care where the damage came from), perhaps even a function that just teleports a character anywhere.

One worry is that players would hack things that aren't meant to be. Then again, why not just let them do that?

EDIT: People have also pointed ease of use for the modders as a good concern, as well as being a security risk for the player's PC, so feel free to discuss those points as well in your answer.

share|improve this question

closed as not constructive by Byte56, Trevor Powell, bummzack, Josh Petrie, Sean Middleditch Apr 7 '13 at 19:59

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

In case you are familiar with Piranha Bytes' Gothic series: the first two games had mod kits that consisted of a world editor and... all of the games' sources. You had infinitely more possibilities to do something nice this way, than by using some limiting tools. I also have them to thank for a huge part of my interest in game development (mainly programming). Were it not for those sources... – user15805 Apr 5 '13 at 14:12
Good question, I wish more developers would think about this before releasing their game, as some games have insanely complex editors without the need for that (trials ^^), and some games come with an editor in which you can hardly produce something worth downloading. Would +10 if I could, but I can't so I'll +1 :< – Kevin Apr 5 '13 at 14:24
this is kind of a if you want to, do it type question. – GameDev-er Apr 5 '13 at 18:34

Personally, I would allow 'low-level' access to modders. Your worry isn't really all that it seems - remember, if someone really wants to change something they shouldn't, they'll reverse engineer your game and change it anyway (or find some creative method, such as transferring a Skyrim game from Xbox or PS3 to the computer for the console).

The question (to me, at least) is more of 'Will the added functionality available in the Modding API (or equivalent) result in feature bloat / make it too complicated?'. The best solution may be to give the modders two choices - one is the simple system that can move a player where they can only access high-level commands such as 'move player to a, or from b to c', but the other may be 'move player from a to b, through c, with animation d at speed e'. As you can see, this does get complicated fairly quickly, and so it may be better just to avoid the low-level commands, and see what creative ways players / modders can come up with to achieve their goals.

share|improve this answer
I agree, especially if the game is going to be singleplayer-only. I don't see anything wrong with letting players do what they want if it's not going to upset competitive play. – jmegaffin Apr 5 '13 at 13:19
Competitive scenes often benefit greatly from modding tools. 80% of the maps used Starcraft are community created (Blizzard blows so hard at making maps), Halo maps where heavily altered using the forge introduces in halo 3. Dota style games are literally a mod of the original Starcraft. Almost all competitive games have strong histories of being molded by the community. I would say modding tools are a must for any competitive multiplier game, simply because multiplayer games take years to mature into something that is actually competitive. – ClassicThunder Apr 5 '13 at 14:11

One worry is that players would hack things that aren't meant to be. Then again, why not just let them do that?

Modders usually create mods without commercial interest, so they add free value to your game. When your modding interface allows enough freedom, people might even buy your game just because of the mods (just think about how many Half Life 1 copies were bought by people who just wanted to play Counter Strike - and that was before Valve hired the developers).

Giving modders as much freedom as possible is a valuable effort because it allows them to create much more creative mods.

But keep in mind that their freedom to influence everything should be confined to your game, and not beyond it. When your modding API is too powerful, it might become a security risks to the end-users.

When you expose file APIs, mods could read personal data of the user, change settings of other programs or even drop malware. When you expose networking APIs, mods could forward personal information to a 3rd party server or even turn your game into a spam- and DDoS relay. The chance to get infected by malware through a malicious mod would make people wary of installing them and greatly hamper the enjoyment which is brought by an active modding community.

share|improve this answer

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