Handling vanilla tips and tricks in mods?

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Handling vanilla tips and tricks in mods?

Post by Deadlock989 »

Factorio 1.1 introduced simulations. These are used for the main menu background and also for "tips and tricks". Simulations are essentially bottled game saves or blueprints with a bit of special handling for their runtime scripts.

Because vanilla simulations are based only on the vanilla base mod, any mod that changes any vanilla prototype (most mods on the portal?) can potentially break a simulation. "Breaking" a simulation might result in mildly nonsensical or purely visually odd behaviour in the simulation, or being more overtly glitched and non-functional, or in the worst cases a Black Frame of Death. The more a mod changes, the more simulations are likely to break and the harder they are likely to break. "Overhaul" mods are screwed in this regard, is what I'm saying.

Menu simulations are relatively easy to deal with. They are cosmetic, purely for entertainment value and they're easy for a mod to disable or replace. Players can turn them off if they like. Nothing in the actual game depends on them.

Tips and tricks are an order of magnitude harder to deal with. For one thing, tip items can reference each other via dependencies. Unlike some other game prototypes, they can't be hidden. So if I remove a specific tip item, it will break any other mod that references that tip item without checking it exists. You could argue that any mod which doesn't check that a dependency reference exists is the one at fault, and the same thing already applies to almost any other kind of prototype: you shouldn't be assuming that any vanilla prototype exists because very few of them technically have to exist. That said, it's an extremely easy mistake to make, I do it all the time. Also, modders aren't typically professionals and mods shouldn't be held to professional standards.

Tips are also genuinely useful to the player. They occupy a bit of a weird space somewhere between wiki and tutorial, and are a bit naggy (I turned their notifications off the moment I found out you could). But in general they are helpful to the player. So losing them, or breaking them, is a loss.

So a modder might find themselves in a situation where they have maybe 20 broken simulations on their hands because of a mod design approach which has been perfectly acceptable for the last X years. It would take me at least a week of full time work to repair all the simulations that IR2 breaks, for example. That's simply not happening. So it's not unreasonable to simply think, sod this, and nuke the whole lot, which is my current approach. But because tracking of changes to / creation of prototypes isn't accessible to mods (even though these are tracked by the prototype loader, you can see which mods changed a prototype on in-game tooltips), there's no way of telling which tips and tricks are from the vanilla base mod and which ones are third party mod creations. So if you want to avoid killing off tip items from other mods, you have to curate your own list of vanilla tip item prototypes, knowing that the list could change with no notice at any time.

In the initial 1.1 releases there were a few teething problems (now resolved) which resulted in some speculation that maybe the better way of handling it would have been to simply disable or just don't load all vanilla simulations in any modded game. Initially I thought that was kind of harsh - there are plenty of very good mods which don't alter any vanilla prototypes or mechanics at all but just provide quality of life enhancements, which are never going to break any simulations. Now I'm starting to think it might actually be better, because my current alternatives are that either I leave a lot of completely broken simulations lying around, or I create extra unnecessary work for other modders, or I'm chained to checking every single update of the game for new tip prototypes for as long as I care.

TL;DR: Broken tips and tricks are worse than no tips and tricks. Tools to make the broken things go away easily would be useful. Your mileage may vary.
Image

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Handling vanilla tips and tricks in mods?

Post by Deadlock989 »

Potential solutions, all with pros and cons:

1. Don't load base mod tips and tricks items or menu simulations if any other mod is present. Nuclear option.

2. Provide a "hidden" field or flag for tips-and-trick-item prototypes. Recipes and technologies have this property, and items have a similar option via flags. Hidden tips would never generate notifications and are never shown in the tips list regardless of their current status; any tip depending on them would also be treated as hidden, by implication. Mods could then simply hide broken entries rather than overwriting them with nil. Other mods that depend on those hidden tips would still kind of break, but they would break invisibly rather than completely fail to load, allowing actual game play with that mod combo to continue (this is currently what happens anyway with mods that don't check hidden/enabled flags on items, recipes and technologies they depend on / copy). Mods still have the problem of knowing which ones to hide.

3. There have been modding interface requests in the past (I'm almost sure, can't find them now) to allow mods to have access to the prototype loading tracker. While this isn't ever going to be perfectly reliable for mods to check that other third party mods have changed anything (due to loading order / dependencies), it could be used to identify base mod prototypes very reliably because that always loads before any other mod.

4. Provide some sort of generic flag field for tip items, maybe a boolean or a string that defaults to false/nil, that identifies the item as a vanilla one; the base mod sets it on every item it creates. Mods can then easily track which tips are most likely to be broken in a forwards-compatible way.

5. Forget about it, and either nuke vanilla tips / break other mods, or just leave the simulations broken.
Image

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Handling vanilla tips and tricks in mods?

Post by kovarex »

Hello and nice to meet you.

I'm aware that the mods can break the simulations, but (at least at that time), I considered it to be ok to leave it for the mods to keep it compatible, mainly because I expected it to be broken by mods very rarely.

The assumption is, that since the simulations usually use very basic "core" entities, they should work, since mods rarely do things like, removing "transport-belt" or "inserter" from the game, they usually extend the game to add new entities, or change existing entities mainly by changing recipes and properites, and neither of that should break the simulations often.

Also, I don't understand the logic of wanting to remove all the vanilla simulations and keep the modded simulations. In vanilla simulations, there are basically 0 unknown variables, so they should be the easiest to keep valid compared to tips of other mods related to (possibly) vanilla entities AND some additional modded logic.

I would really like to try to find a solution that is easy enough to use, so the mods don't have to "vandalise" the simulations tips of tricks of vanilla or other mods by plainly removing them, so I would like to ask, what specific incompatibilities did you encounter, so I could try to figure out a solution for these to be solvable easily.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Handling vanilla tips and tricks in mods?

Post by Deadlock989 »

kovarex wrote:
Sat Jan 23, 2021 7:46 pm
Also, I don't understand the logic of wanting to remove all the vanilla simulations and keep the modded simulations. In vanilla simulations, there are basically 0 unknown variables, so they should be the easiest to keep valid compared to tips of other mods related to (possibly) vanilla entities AND some additional modded logic.
Third party mods are most likely going to add new tips and tricks (T&Ts) which explain features of that mod. Obviously I don't want to remove those if I can avoid it - mods shouldn't be nuking each other's prototypes. Currently, I can't completely avoid it, because third party mods might add a new T&T which is dependent on a vanilla T&T which I have nuked because it is broken and I have no other choice (e.g. hiding it) other than leaving a string of broken T&T simulations there for people to complain about. I don't want to remove vanilla T&Ts either, but if they are now broken by changes the mod has been making with minimal disruption for over a year now, and they can't just be hidden like other kinds of prototype can, then I have no choice but to overwrite them with nil (or just leaving them broken, and then deal with people trying to contact me to point it out over and over again). Also, I expect that people playing overhaul mods have much less use for vanilla T&Ts than someone playing the vanilla game for the first time, while any random mod which supplies new tips may still be unknown to them, so I have far fewer qualms about wiping out noob tutorials than I do for other modders' documentation of their mods.
I would really like to try to find a solution that is easy enough to use, so the mods don't have to "vandalise" the simulations tips of tricks of vanilla or other mods by plainly removing them, so I would like to ask, what specific incompatibilities did you encounter, so I could try to figure out a solution for these to be solvable easily.
Things overhaul mods might do / have done, that break simulations:

- Resize vanilla entities like stone-furnace from 2x2 to 3x3, and burner-mining-drill from 2x2 to 5x5, etc.
- Hide and disable entities like steel-furnace because the mod has a different progression scheme and there isn't a steel burner furnace in that scheme.
- Change the energy source of machines like assembler-1 from electric to fluid, so that it only runs on piped steam now.
- Hiding/disabling a technology which the simulation "Transfer between labs" is using to show working labs.
- Reorganising entity fast-replace groups.
- Other script errors which presumably arise from changes to prototypes but are really hard to debug if you can't see what the simulation even is now.

For me the simplest and least destructive option would be a "hidden" property or flag, like recipes, items and technologies have. Then I could easily sweep broken simulations under the carpet without vandalising them, and other mods which have created dependencies on hidden T&Ts won't prevent the game from loading (as happens now if I overwrite a vanilla T&T with nil). Other people's MMV.

You could argue that mods which take things this far should be marking the base mod as incompatible, and I don't disagree; the main thing stopping me from going in that direction is terrain and the vast amount of work it would be to create new terrain tiles with all their transitions etc.
Image

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Handling vanilla tips and tricks in mods?

Post by kovarex »

I tried to download your mod, removed the removal, and checked the state of the tips and tricks, and it doesn't seem that huge of a problem to fix it honestly, most of them are fine out of the box, just few need some fixes.
  • mining-drill (or other entities) having different bounding box can be solved on our side by making the code more generic, so it checks the bounding boxes and builds things according to them (as long as they are just a little bit different, and not crazy), this could easily solve the tips
    • alt mode
    • the entity pipette
    • z to drop
    • inserters
    • belt lanes
  • transfer-between labs could just dynamically find a technology and related packs, also doable easily on our side
  • The copy-paste-requester chest could dynamically fill the storage chest with the correct items so it still works when the recipe is different
  • The last possible problem is the blinking electricity, as you have a different system, but it is quite minor I would say
So, the conslusion is, that with enough of changes on our side (which I could do now), you could be able to just leave the tips and tricks as they are as they should work fine, can we make a deal? :)

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Handling vanilla tips and tricks in mods?

Post by Deadlock989 »

I still think it would be better if T&T prototypes had a hidden flag like the other basic prototypes and if I'm honest I still think it's a mistake to load any vanilla simulations into a modded game. But if you can make all the simulations adapt to mod changes so that they're not broken then yes, I wouldn't need to hide or delete them.
Image

PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Handling vanilla tips and tricks in mods?

Post by PFQNiet »

Deadlock989 wrote:
Sat Jan 23, 2021 11:05 pm
I still think it's a mistake to load any vanilla simulations into a modded game.
Even if the only mod is something like Even Distribution? Or Vehicle Snap?

I understand your PoV when it comes to overhaul mods - I'm making my own overhaul mod that really does break basically every simulation - but I definitely disagree with disabling tips/tricks just because a mod is installed.

A "hidden" flag would be nice though. Just because it's less "destructive" than deleting the prototypes. I had to delete a number of them because they are of mechanics that simply don't exist in my mod, such as "inserters" ;)

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5148
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Handling vanilla tips and tricks in mods?

Post by Klonan »

Deadlock989 wrote:
Sat Jan 23, 2021 11:05 pm
I still think it's a mistake to load any vanilla simulations into a modded game.
Most of the tips are fine, such as all the power ones, copy paste, drag building, trains, logistic network, ghost building, fast replace

Nuking all the vanilla tips because some of them look wonky or don't perform perfectly isn't necessary, especially if you have no way of people to even complain about it to you.

If you really want to avoid broken simulations, you can just nil out the simulation string, which will leave the rest of the tip prototype intact for things like the dependencies and categories.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Handling vanilla tips and tricks in mods?

Post by Deadlock989 »

I don't want broken ugly garbage in my mod. Vanilla save games aren't compatible with overhaul mods and we have spent years telling mod punters not to try. Then you bundle 20 of them into every modded game.

I am only nuking them because they can't be hidden more gracefully. Give us a way to hide them instead and I'll hide them instead. Come up with some dynamic solution that ensures no mod can ever break them and I'll stop nuking them. Otherwise they get nuked.
Image

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Handling vanilla tips and tricks in mods?

Post by kovarex »

Deadlock989 wrote:
Sun Jan 24, 2021 12:18 pm
I don't want broken ugly garbage in my mod. Vanilla save games aren't compatible with overhaul mods and we have spent years telling mod punters not to try. Then you bundle 20 of them into every modded game.

I am only nuking them because they can't be hidden more gracefully. Give us a way to hide them instead and I'll hide them instead. Come up with some dynamic solution that ensures no mod can ever break them and I'll stop nuking them. Otherwise they get nuked.
I think that any more debate is a waste of time on this front, do whatever, I don't really care.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Handling vanilla tips and tricks in mods?

Post by Deadlock989 »

There was never any debate.
Image

User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Handling vanilla tips and tricks in mods?

Post by ptx0 »

Deadlock989 wrote:
Sun Jan 24, 2021 12:57 pm
There was never any debate.
kovarex reached out to provide some fixes - none of this had to be done by them. you should be less combative with the people who can actually help you.
kovarex wrote: I would really like to try to find a solution that is easy enough to use, so the mods don't have to "vandalise" the simulations tips of tricks of vanilla or other mods by plainly removing them, so I would like to ask, what specific incompatibilities did you encounter, so I could try to figure out a solution for these to be solvable easily.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Handling vanilla tips and tricks in mods?

Post by Deadlock989 »

I've just removed all code from my mod that attempts to deal with vanilla tips and tricks and converted the existing mod info pages to use the optional "Informatron" mod instead. I'll release it when 1.1 stable drops. After that, if any base mod tips and tricks simulations are inaccurate or outright broken because they assume that no other mods are installed, that's just the way it is.
Image

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5148
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Handling vanilla tips and tricks in mods?

Post by Klonan »

Deadlock989 wrote:
Sun Jan 24, 2021 12:18 pm
I am only nuking them because they can't be hidden more gracefully.
Isn't nuking them just making more hassle for yourself in the long run?
Anytime we add a new tip your mod would break, and people will complain to you
if any mod adds a tip that depends on a base game tip, the errors would point to you, the other mod author would direct it to you

But just leaving them as 'broken ugly garbage' doesn't harm anybody, if someone complains just say "The Factorio devs are dumbo and I don't care",
The tip simulations purposefully don't cause any 'real errors' if the scripts go wrong, because we knew handling all conceivable mod case would be impractical

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Handling vanilla tips and tricks in mods?

Post by Deadlock989 »

Klonan wrote:
Sun Jan 24, 2021 5:22 pm
Isn't nuking them just making more hassle for yourself in the long run?
Yes. That is literally why I tried to start a discussion about it. I was just asking for a way to hide them. A simple "no" would have sufficed.

It wasn't ever about "harm". It was about having a list of broken simulations of vanilla game play in a modded scenario that you can't turn off without breaking other mods. That was only a "problem" while I was also trying to use the same tips and tricks system to provide documentation for the same mod. You and kovarex have made your feelings on this crystal clear so I've stopped trying to engage with it, gone back to the in-game wiki mod you took your "inspiration" from, and it's no longer an issue.
Image

Post Reply

Return to “Modding discussion”