Game file/Modding overhaul

Discussion about Mods for Prison Architect

Moderator: NBJeff

User avatar
a__gun
level3
level3
Posts: 281
Joined: Wed Sep 26, 2012 4:16 pm
Location: UK

Game file/Modding overhaul

Postby a__gun » Wed Dec 16, 2015 11:40 am

Been playing Prison Architect on and off since pretty early in the alpha and first its got to be said that it was a fantastic build process and I think this really is a great game.

Recently I've been trying to create a few simple mods for the game, primarily for my own use, and I've been really surprised just how limited the modding system is. I've always tinkered with the games I play and over the years have enjoyed making small tweaks and occasionally large overhauls, so I like to think I've got some idea what's going on when it comes to modding.

It seems to me that a lot of the limitations stem from the way the game files are structured - everything is grouped into list files/spritebanks. This is what's responsible for the hard limit on how many new sprites a mod can add (no more than 2048x2048px of sprites for all running mods) and also causes some things (such as UI elements) to only be able to be updated by one running mod. I believe the way forward would be to split everything out into its own file - one txt file contains the details of one object, and one png file contains one sprite. So this:

Code: Select all

main.dat
-/data/
--/materials.txt
--/objects.png


Would become this:

Code: Select all

main.dat
-/objects/
--/RoadGate/
---/object.txt
---/sprite.png
--/Door/
---/object.txt
---/sprite.png
-/materials/
--/Gravel/
---/material.txt
---/sprite.png
(etc)


The sprite definition within objects and materials would then become a path to the relevant file. Define rooms like this too and suddenly we can have multiple mods adding room icons without breaking each other. I know this looks unwieldy, but in practice breaking everything down like this makes it so much easier to find exactly what you are looking for and make changes to the right things.

I'm aware this is quite a large scale change and would almost certainly require a complete re-write of the way the game loads pretty much all its data files, but I really think that a strong modding community is one of the best ways to prolong the life of a game (Just look at KSP) and in order to have that you've got to open up the game files as much as you can.

Probably just a pipe-dream, but keen to hear what others think about this. Who knows, maybe the upcoming modding API changes will solve all my problems and this will all be redundant!
User avatar
Brento666
level3
level3
Posts: 290
Joined: Wed Sep 02, 2015 9:23 pm

Re: Game file/Modding overhaul

Postby Brento666 » Wed Dec 16, 2015 2:03 pm

Not a pipe dream at all; the devs have stated your exact approach recently on the reddit "AMA"...
They fully realise the way it's organised right now is limiting but are facing performance issues/improvements simultaneously(!)

...So it is left to be seen when performance and/or mod-limit will be fully tackled, but the focus will be on these topics, AS WELL as the creators are now looking in to sprucing up the mod-api for scripts(!!)

The AMA left me with the impression things are prioritized and incoming :mrgreen:
User avatar
a__gun
level3
level3
Posts: 281
Joined: Wed Sep 26, 2012 4:16 pm
Location: UK

Re: Game file/Modding overhaul

Postby a__gun » Wed Dec 16, 2015 4:59 pm

Yea I did read through the AMA but didn't see anything specific with regards to the modding changes. Did you mean this? Because I think that is just talking about multiple sheets not replacing sheets with individual sprites....
User avatar
Brento666
level3
level3
Posts: 290
Joined: Wed Sep 02, 2015 9:23 pm

Re: Game file/Modding overhaul

Postby Brento666 » Wed Dec 16, 2015 11:06 pm

Yeah Gun, that's part of it.. I think some questions and answers got retracted after, idk why.

In other answers they touched on optimization and the mod-api... granted they didn't go into detail too much, but that's logical...

I got the feeling they are focusing on these points, but I'm not involved in the process; so can't confirm any actions or methods the team is using. :mrgreen:

-Btw, if you want to be certain your solution will be read by IV; I suggest heading to Mantis, to find and add your suggestion to the existing entry for mod-limit there. (The team isn't constantly checking the forums themselves.)
elDiablo
level5
level5
Posts: 3111
Joined: Thu Mar 14, 2002 12:23 pm
Location: London, UK

Re: Game file/Modding overhaul

Postby elDiablo » Thu Dec 17, 2015 8:32 am

We didn't remove any of the answers from the AMA after it was finished. We did the AMA to be open about the development of the game, and wouldn't want to remove answers afterwards.

As a__gun found in the comments, we are looking at fixing the sprite sheet limitation problem to allow unlimited sprite additions. I doubt (though this isn't a definitely answer either way at the moment) that we will change the way files are loaded into the game as that would require changing how our files are loaded in, as well as all previously created mods. Best case scenario we give ourselves months of work in order to support old and new style file loading, worst case we break hundreds of previously created mods. Neither case looks good to me.

Expect the file structure to stay the same for now. It is a legacy of the fact that Prison Architect wasn't designed with modding in mind, but it's not likely to change now. We will be working on fixing the sprite sheet limitation though, so your mod will (eventually) be able to include a larger (or maybe multiple) sprite files. Hope that helps!
User avatar
a__gun
level3
level3
Posts: 281
Joined: Wed Sep 26, 2012 4:16 pm
Location: UK

Re: Game file/Modding overhaul

Postby a__gun » Thu Dec 17, 2015 2:12 pm

Thanks for the reply elDiablo. I'm well aware changes on this scale are very unlikely to be made at this point in the process, just wanted to get the idea across I suppose. Can you comment on whether more spritebanks will be able to be appended to by mods (complaints.spritebank, interface.spritebank etc) or are we going to be stuck with access just to objects.spritebank?
User avatar
Brento666
level3
level3
Posts: 290
Joined: Wed Sep 02, 2015 9:23 pm

Re: Game file/Modding overhaul

Postby Brento666 » Thu Dec 17, 2015 6:57 pm

elDiablo wrote:We didn't remove any of the answers from the AMA after it was finished. We did the AMA to be open about the development of the game, and wouldn't want to remove answers afterwards.
...

Hi Diablo / Gun!

I didn't mean to suggest it was IV that pulled questions.. It was probably the OP's of the questions..
Some are just gone, no big deal. I remember reading stuff that isn't there now..

Also me saying the way ahead for IV was similar to what a__gun described was not aimed at the details in his suggested approach..
-Rather that atm sprites are combined in a large 2048x2048 grid, and that this will have to change, in order to break the limit open..!(something that was talked about by IV in the AMA, I believe..)

Anyway, hoping for some performance-optimization, more api-access and less of a sprite-limit in next update(s)..
-I've avoided using ANY sprites in most of my ten released mods(!) A next mod with sprites will put me at/over the limit, using just my own mods(!)

Should I max out on my mods alone, my modding-efforts will cease.. Already many mod-users are crossing the sprite-limits and mistakenly blame the mods for it..
->I would in the meantime, greatly appreciate it if the game would simply display a message to the user, with an explanation of what is happening. And to disable some mods, it would make things a lot clearer(!!)

Thanks guys, have a merry Xmas!!
ChristianLJB
level0
Posts: 7
Joined: Fri Nov 29, 2013 10:07 pm

Re: Game file/Modding overhaul

Postby ChristianLJB » Thu Dec 17, 2015 11:02 pm

elDiablo wrote:Best case scenario we give ourselves months of work in order to support old and new style file loading, worst case we break hundreds of previously created mods. Neither case looks good to me.


I feel like you've presented yourself with a false dilemma here. I might not be the most experienced modder, but I know I would be willing to sacrifice a little bit of time updating old ideas to a new format if it meant more possibilities for future ideas; especially if it meant my mods were compatible with most (if not all) other mods. In other words, sacrificing "hundreds of previously created mods" now for an improved modding layout may just result in thousands of mods which are compatible with each other in the future.

Mod users might be upset for a short while, but in the end I think they will be happy.

You should also consider the marketing potential more mod compatibility will offer. For example: I might recommend this game to a friend, but the vanilla game might not fit their play style/preference. If there aren't many mods or collections of mods to remedy that, then you may have just lost a sale. On the other hand, more mod compatibility brings more modders, which means more mods, which means more potential players.

That's just my perspective on the situation, though. Feel free to correct me if I'm wrong :)

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 1 guest