Button to reload all mods, super useful for mod devs!
Moderator: ickputzdirwech
Button to reload all mods, super useful for mod devs!
I would like to see a button to reload all mods completely. I've had to restart factorio a good 25 times in the past 30 minutes and waiting for it to load all the sprites and everything takes a nice bit of time, in my case, a minute per restart (yes, only 5 of the last 30 was actual work, rest was waiting for loading.). it would be even more amazing to have the option to reload while playing a world, having the mods kick their migrations (if any) then an game on_load event after for complete mod starting.
as for placement of this button, I could see it going in "options" -> "other" then a button saying something like "reload all mods/game data."
to make the process even more streamlined, when a mod gets loaded, make a hash (or something like last-modified attribute but that might get platform issues when not available on a platform) of all the mod files then check what mods were changed then re-run those scripts along with all of the mods that depend on that mod in the same order as the first run. same could be done for graphics and locale.
An example of this simplicity is: just made a new item that is a type of coal, get in the world and find out I need to set a fuel value for it, go into the item prototype and add that single value into the item, hit the reload mods button, game sees only the single item prototype file has changed, run that file which updates the item, game loads as if from a save and now the item can be burned, yay!
as for placement of this button, I could see it going in "options" -> "other" then a button saying something like "reload all mods/game data."
to make the process even more streamlined, when a mod gets loaded, make a hash (or something like last-modified attribute but that might get platform issues when not available on a platform) of all the mod files then check what mods were changed then re-run those scripts along with all of the mods that depend on that mod in the same order as the first run. same could be done for graphics and locale.
An example of this simplicity is: just made a new item that is a type of coal, get in the world and find out I need to set a fuel value for it, go into the item prototype and add that single value into the item, hit the reload mods button, game sees only the single item prototype file has changed, run that file which updates the item, game loads as if from a save and now the item can be burned, yay!
Will code for Food. I also have 11+ mods!
-
- Smart Inserter
- Posts: 1847
- Joined: Sun Feb 23, 2014 3:37 pm
- Contact:
Re: Button to reload all mods, super useful for mod devs!
nifty... well, that's all about the data but I was also thinking about locale and sprites as well... though the other thread does talk abit about the sprites...FishSandwich wrote:See also: https://forums.factorio.com/forum/vie ... 84&p=76577
Will code for Food. I also have 11+ mods!
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Button to reload all mods, super useful for mod devs!
I think data does imply everything, not just code, because after all, changing the code might change the required sprites/sounds too.
Re: Button to reload all mods, super useful for mod devs!
on the other thread I've talked abit more about this but what I had came up with was to load all image files from all the mods and kinda separate the data scripts from the images... I forgot about sounds but it could also be included in the same type of process... I'm on my phone so I can't really get to into it but the other thread does talk about it and the way... I post a more detailed post tomorrow probably...bobingabout wrote:I think data does imply everything, not just code, because after all, changing the code might change the required sprites/sounds too.
Will code for Food. I also have 11+ mods!
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Button to reload all mods, super useful for mod devs!
I think one of the biggest issues with images is that if you change an icon, you have delete the cropcache file too...
Re: Button to reload all mods, super useful for mod devs!
cropcache? I haven't really worked with images very much, just using base till I actually sit down and work on them... (programmer, not an artist...)bobingabout wrote:I think one of the biggest issues with images is that if you change an icon, you have delete the cropcache file too...
Will code for Food. I also have 11+ mods!
Re: Button to reload all mods, super useful for mod devs!
This doesn't work. What if other mods read that value after your mod and do different things depending on it?vzybilly wrote:An example of this simplicity is: just made a new item that is a type of coal, get in the world and find out I need to set a fuel value for it, go into the item prototype and add that single value into the item, hit the reload mods button, game sees only the single item prototype file has changed, run that file which updates the item, game loads as if from a save and now the item can be burned, yay!
The entire data loading phase of the startup process is one large chain of each mod adding in and modifying the data.raw table. Changing any one part of the entire process requires the entire process be re-run as anything can change based off the one part.
If you want to get ahold of me I'm almost always on Discord.
Re: Button to reload all mods, super useful for mod devs!
Alright, all the data scripts can be re-run which is still 2 seconds, give or take, which that is still better than 90+ for complete restart...Rseding91 wrote:This doesn't work. What if other mods read that value after your mod and do different things depending on it?vzybilly wrote:An example of this simplicity is: just made a new item that is a type of coal, get in the world and find out I need to set a fuel value for it, go into the item prototype and add that single value into the item, hit the reload mods button, game sees only the single item prototype file has changed, run that file which updates the item, game loads as if from a save and now the item can be burned, yay!
The entire data loading phase of the startup process is one large chain of each mod adding in and modifying the data.raw table. Changing any one part of the entire process requires the entire process be re-run as anything can change based off the one part.
Will code for Food. I also have 11+ mods!
Re: Button to reload all mods, super useful for mod devs!
Loading everything might not work as well as it seems. It would make game use more memory (and possibly also VRAM) and has potential to make actual atlases much less optimized. And mem usage esp on VRAM can be a problem now when you start adding lots of mods.
I do agree that ability to reload all the mods would be useful.
Are you aware that uncompressed mods code can be edited without restarting game?
I do agree that ability to reload all the mods would be useful.
Are you aware that uncompressed mods code can be edited without restarting game?
Re: Button to reload all mods, super useful for mod devs!
Not the data scripts, which means prototypes can't change (like adding a fuel value to the new coal items). pretty much only control.lua, that is reloaded up each time you enter a world, if it's unzipped.orzelek wrote:Are you aware that uncompressed mods code can be edited without restarting game?
Will code for Food. I also have 11+ mods!
Re: Button to reload all mods, super useful for mod devs!
Using the largest set of mods I know of (the Shadow mod set with 81 mods) the data phase of the game startup is roughly 15 seconds - not 2 seconds. I don't know where you got that number from. Even still - the entire loading process involves both the data phase and the sprites loading phase. That *is* the entire startup process - there's not a part of it that can be "just re-run" instead of doing the entire thing. The entire startup process: load mod data files, create prototypes, load sprites, create sprite altas requires each step before to be done before the next can run.vzybilly wrote:Alright, all the data scripts can be re-run which is still 2 seconds, give or take, which that is still better than 90+ for complete restart...
As for the 90+ seconds - that's insane. Something is wrong with your computer if the game takes that long to startup - are you running the game in compatibility mode or do you not have Service pack 1 for Windows 7 installed?
Even with the massive shadow set of mods of the game starts In ~35 seconds for me.
If you want to get ahold of me I'm almost always on Discord.
Re: Button to reload all mods, super useful for mod devs!
2 seconds was my time for mod startup, few light mods on a crappy computer should be about the average time I assumed, it's all mostly rough estimates anyway since everyone has different setups...Rseding91 wrote:Using the largest set of mods I know of (the Shadow mod set with 81 mods) the data phase of the game startup is roughly 15 seconds - not 2 seconds. I don't know where you got that number from.vzybilly wrote:Alright, all the data scripts can be re-run which is still 2 seconds, give or take, which that is still better than 90+ for complete restart...
As for the 90+ seconds - that's insane. Something is wrong with your computer if the game takes that long to startup - are you running the game in compatibility mode or do you not have Service pack 1 for Windows 7 installed?
Even with the massive shadow set of mods of the game starts In ~35 seconds for me.
Computer info and sadness.
Code: Select all
84.240 0 packages available to download (experimental updates enabled).
84.299 Factorio initialised
94.429 Goodbye
EDIT: seemed to have accidentally skipped a small part of your post, as for the loading process, if we just say that all images in the mod directory will be loaded as sprites, doesn't that allow us to cut apart data phase from the sprites loading phase? all that would have to be done is maintain a table of file X = sprite ID Y then when we go into a world, mod wants a sprite from file X and gets it from the table. I don't really imagine that many images in a mod folder that aren't used, unless someone keeps every change they did to an image in the mod folder...
EDIT2: Seems you actually edited your post while I was working on my, lol...
Will code for Food. I also have 11+ mods!