Post news RSS DevLog - Tiny Introduction to Modding

I show off a small portion of the modding for the game.

Posted by on

The backend work has been intense these past few weeks. Why?

Great Question!

Part of this is of course the nature of storing the mass amounts of data that a simulation produces into an accessible package, but the other half is my determination to expose as much of the game as possible to modders.

I have a strong belief that modding extends the life of a game, however the wonderful community producing content for the SCP wiki are writers and artists, not coders. They have produced wonderful content, but would likely be unable to pick up a coding language.I wanted to find a way for non-coders to add content to the game.

I found that in JSON. JSON files are text files with a simple organization. Unlike many other data formats JSON is pretty easy to read. Here is an example.


Guess what? That is the most complicated it gets. Lets take a look at some of the Foundation's JSON. This file is full of the data that makes up the world.


This is a portion of the North America region data. You can see it as an array of "countries" (indicated by square brackets) and the top country is the United States (so I suck at alphabetizing... sorry). Inside clearly labeled are various pieces of data the game expects a country to have defined. Changing these changes the game's behavior for that country. You can also see that each country has an array of "cities". Say you want to personalize your experience a bit. Add your hometown. Lets do it.


How boring! Brazil doesn't have any cities much less your Brazilian hometown ;) Lets fix it.


Boom done. There will now be a new city in the game. Because its defined here the game knows its a city in Brazil and will create the city related code and object automatically. In the future there might be more variables that can be defined within a city but for now this is enough.

BUT WAIT! Your city list is below gridSquares when in the US data it was above!

Yep JSON doesn't care as long as its present.

BUUUUUTTT WAAAIIT! What if I type something wrong?!?!?!

Well for most mistakes there are free online tools like JSONlint. They will help you like so.


I will also have guides, and hopefully tools to help generate the JSON for you. Its really quite simple and powerful. And will hopefully unlock the potential for every user to tweak the game if they want to.

But does it really work?

Yes. Yes it does.


Comments
RagnarokX
RagnarokX

I like it. I think modding is a very strong argument for a game these days. I mod a lot :D
I havent tried json yet, its mostly XML and lua, but it looks pretty much similar, should be piece of cake.

Good job, keep going !

Reply Good karma Bad karma+1 vote
riscvul Author
riscvul

It is very similar to XML and lua. Less structured than XML and no code like lua. Just simple readable data storage.

Reply Good karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.