Page 1 of 2

Remove Expensive Mode

Posted: Mon Nov 07, 2022 4:12 am
by _CodeGreen
TL;DR
Expensive mode makes it unnecessarily complex to dynamically modify recipes and technologies in a mod, and should be removed (or at the very least changed).
What ?
For those not in the know, expensive mode is a map setting you can enable to make a select few recipes more expensive, and there's another setting for technologies to make them cost more. The technology setting is not used in the vanilla game, and only exists for mods to use.
On the surface, this is a cool mode to add some challenge to the game, without changing that much.
In my opinion, this feature has little to no value, especially when it's feature can be easily implemented as a mod, and probably better at that.
From a modder's perspective, it is one of the more annoying features to work around.
Why ?
The following examples generally apply for both recipes and technologies, however I will be using only recipes as examples.

Starting off simple, the definition for a non-expensive mode recipe might look like this:

Code: Select all

{
  type = "recipe",
  name = "iron-plate",
  category = "smelting",
  energy_required = 3.2,
  ingredients = {{"iron-ore", 1}},
  result = "iron-plate"
},
As you can see, fairly simple. It requires one iron ore, and makes one iron plate.

An expensive recipe definition might look something like this:

Code: Select all

{
  type = "recipe",
  name = "iron-gear-wheel",
  normal =
  {
    ingredients = {{"iron-plate", 2}},
    result = "iron-gear-wheel"
  },
  expensive =
  {
    ingredients = {{"iron-plate", 4}},
    result = "iron-gear-wheel"
  }
},
In normal mode, an iron gear wheel would take two iron plates to craft. In expensive mode, it will take 4 iron plates.

Both of these recipes are defined completely correctly, and are in fact taken directly from the base mod. I have no problem with either of those recipe definitions.
The "problems" start to occur when mods get involved.

According to the engine, this is a valid recipe prototype:

Code: Select all

{
  type = "recipe",
  name = "iron-gear-wheel",
  expensive =
  {
    ingredients = {{"iron-plate", 4}},
    result = "iron-gear-wheel"
  }
},
This prototype has one set of recipe data, and it will be used for both normal and expensive mode.
If a recipe should be the same for both difficulties, wouldn't it make more sense to define the recipe data like the iron plate example?
Why is it allowed for expensive to be set and not normal, and vice versa? This has no reason to exist.

One of the other things expensive mode can do is disable a recipe depending on the mode that is selected by setting one of them to false.

Code: Select all

{
  type = "recipe",
  name = "iron-gear-wheel",
  normal =
  {
    ingredients = {{"iron-plate", 4}},
    result = "iron-gear-wheel"
  }
  expensive = false
},
This will make the iron gear recipe not show up by default if expensive mode is selected from the beginning of the map.
The same can be done vice versa, where the recipe is enabled at game start in expensive mode and disabled in normal mode.
However, the recipe can still be enabled by technology unlocks and script, and it will still use the other difficulty data.
Marginally useful at best, but still unnecessary since it's the same data, and enabled can still be set through script.

So, why do we have expensive mode at all?
Adding a little bit of challenge to the game, sure, but expensive mode is limiting.
What if a mod wanted multiple levels of difficulties that the player could choose from?
What if a mod wanted different categories of things to be expensive without affecting all recipes?
What benefit does expensive mode give over a mod?

Well, you can change the value of it on world creation instead of having it be a startup setting.
Big whoop, now you can't change it after the world starts without using a mod or the editor.
What about having one place that toggles all mods' expensive recipes?
Easily doable with another mod, to unify all expensive settings into one thing.
Plus, with it being a mod, it could have more customizability than the vanilla dropdown "yes or no."

I must admit I'm a quite biased as a modder myself, and seeing many people dealing with recipes and technologies getting confused as heck with all of the different configurations has made expensive mode feel completely unnecessary to me.
I honestly don't think it will ever get removed, as it is too big of a feature for the player base not to care, and that is why I propose a modification to the way expensive prototype data is defined:

If a mod wants to make a recipe or technology have different data for expensive mode, they must set both normal and expensive properties to not nil, possibly even removing the ability to set them to anything other than a table of recipe data. This keeps the players happy as the game mode is not removed, and it makes modders happy because they don't have to deal with the possibility of crap data from other mods. Everything expensive mode can do is still possible, and is significantly cleaner to define and deal with.

Expensive mode has been forgotten for long enough, I think it's time for something about it to change.

Re: Remove Expensive Mode

Posted: Mon Nov 07, 2022 5:14 am
by KiwiHawk
Fully support! Ideally remove normal/expensive entirely. If not, some change would be very welcome! Release of Factorio 1.2 seems like the ideal time to do this.

I've taken over maintenance of Bob's mods (as well as being dev for Sea Block). Bob's Library has some support for normal/expensive but it's not something we make much use of. Getting rid would prevent a load of confusion, simplify code, and all for no significant (imho) loss in functionality.

Re: Remove Expensive Mode

Posted: Mon Nov 07, 2022 7:18 am
by FuryoftheStars
I gotta agree here. I don't (off-hand) see any real reason why expensive mode couldn't be a simple multiplier, and then if really needed, a flag for those things that should be excluded.

Re: Remove Expensive Mode

Posted: Mon Nov 07, 2022 7:42 am
by Pi-C
FuryoftheStars wrote: Mon Nov 07, 2022 7:18 am I don't (off-hand) see any real reason why expensive mode couldn't be a simple multiplier, and then if really needed, a flag for those things that should be excluded.
Expensive mode just using more of the same ingredients as normal mode is boring. The way it's working now, you could add new ingredients to expensive mode, or even provide completely different recipes (different set of ingredients, longer crafting time etc.) for normal and expensive mode. I realize that's hardly
(German readers: "kaum", nicht "schwer"/"kompliziert"!)
done as modders would have to spend much more time on balancing their recipes, but at least it is possible.

That being said, I still agree that having to consider whether a recipe has no difficulties/one difficulty/both difficulties set is a major PITA. :-)

Re: Remove Expensive Mode

Posted: Mon Nov 07, 2022 9:29 am
by jodokus31
I love expensive mode as game feature, but the realization is not optimal, esp. for modding

I disagree to remove it, but rather change it.

Re: Remove Expensive Mode

Posted: Mon Nov 07, 2022 9:54 am
by Stringweasel
Could be a dedicated mod called expensive managed by Wube. Much cleaner implementation :)

Edit: not sure how interaction would work with other mods though, so maybe not that clean.

Re: Remove Expensive Mode

Posted: Mon Nov 07, 2022 9:57 am
by Deadlock989
It's far too late to remove it now. It should never have happened, obviously, but that ship has sailed.

Re: Remove Expensive Mode

Posted: Mon Nov 07, 2022 12:10 pm
by Panzerknacker
Have you guys never played Marathon or something?

Just FYI, Marathon game mode uses expensive mode recipes and it's not a simple multiplier. The way the devs carefully handpicked the amount of ingredients for every recipe is pretty brilliant IMO.

No way this should ever be removed.

Re: Remove Expensive Mode

Posted: Mon Nov 07, 2022 1:48 pm
by Tertius
The issue is probably not that expensive mode exist, it's lack of consistency with the data definition for mods. I can only guess that expensive mode was added after the initial design and its data structures were just added like a hack but not existing data structures migrated to include expensive mode features.

Re: Remove Expensive Mode

Posted: Thu Nov 10, 2022 9:26 am
by aka13
Funny, how I got years of playtime out of it, and zero playtime out of mods.
I understand that you have fun and enjoy modding, but I still think that that is quite a leap to make, "unneeded and should be removed", simply because you dislike it.
I haven't played "nonexpensive" nonmarathon modes since its introduction.

In fact, if we put mine and your emotions aside, simply from an install base perspective I can not imagine, that there are more people who play mods, and less people, who use expensive recipes.

Re: Remove Expensive Mode

Posted: Thu Nov 10, 2022 10:12 am
by KiwiHawk
Panzerknacker wrote: Mon Nov 07, 2022 12:10 pm Have you guys never played Marathon or something?

Just FYI, Marathon game mode uses expensive mode recipes and it's not a simple multiplier. The way the devs carefully handpicked the amount of ingredients for every recipe is pretty brilliant IMO.
Yes, I have played Marathon. The changes that Expensive Recipes makes can be made into a simple mod. I imagine that if expensive recipes were removed, they would release the same functionality as a mod. If the Factorio devs don't want to do this, then I would be happy to. No functionality would be lost at all.
aka13 wrote: Thu Nov 10, 2022 9:26 am In fact, if we put mine and your emotions aside, simply from an install base perspective I can not imagine, that there are more people who play mods, and less people, who use expensive recipes.
And I can imagine the opposite. Imagination isn't data 🤷

Re: Remove Expensive Mode

Posted: Thu Nov 10, 2022 11:57 am
by aka13
Yeah, and this whole thread is opinions only :).
Some people consider the big overhaul mods fun. Some don't. That's not a reason to change the basegame and cut features from it, in my opinion.
Gregtech eventually evolved beyond ic2 and beyond minecraft, when the vision became so different, that it did not fit anymore and became too cumbersome to work with.

I can openly admit, I consider most big mods for factorio not fun, and not challenging in the ways I enjoy. I therefore voice my opinion, that I would be in opposition of removing marathon, and or making it a mod. It obviously would get less support than in gets in the base game, and I obviously am against that.

Re: Remove Expensive Mode

Posted: Thu Nov 10, 2022 1:44 pm
by jodokus31
aka13 wrote: Thu Nov 10, 2022 11:57 am
I can openly admit, I consider most big mods for factorio not fun, and not challenging in the ways I enjoy. I therefore voice my opinion, that I would be in opposition of removing marathon, and or making it a mod. It obviously would get less support than in gets in the base game, and I obviously am against that.
Agree.

One other thing, what speaks against a mod, is that you can play normal and marathon games, without restarting factorio. If a mod provides marathon recipes, you would have to sync mods to change the game type, which implies a factorio restart. (Not the end of the world, though.)

If Marathon or Expensive Mode was a simple mod like every other mods, it would be less popular and less played.
But, we don't have any official mods by Wube yet and the usual perception is, that a modded game is less legit. That also comes from steam achievements, which only work without mods

I wonder, if it gets changed, when the expansion comes out. I understood, that the expansion will be like an official mod made by Wube (+ changes, which are need to be made to the engine to support it, of course), and you can switch back to current vanilla.

I could imagine, that official mods are not handled via the regular mods menu

Re: Remove Expensive Mode

Posted: Sat Nov 12, 2022 5:47 pm
by _CodeGreen
I would like to clarify a couple things reading the replies to this post:
  1. I do not think that expensive mode will be removed, I would not be unhappy if it did, but having that expectation is unrealistic.
  2. I wanted the main takeaway of this post to be that expensive mode has problems, and how they could be fixed. Most of the post was describing those problems, removing it was the simplest/easiest solution to that.
  3. The changes I suggested in the last paragraph are what I proposed as a "better" solution, as it is a comfortable middle ground between modders and players alike, and players won't even notice a difference.
Whether or not it should be removed is ultimately only an opinion, and probably isn't worth debating about. I want to focus more on the hypothetical changes to expensive mode, not go back and forth on removing or not removing it.

Re: Remove Expensive Mode

Posted: Mon Nov 14, 2022 5:54 am
by ssilk
I see this similarly: the “right” way to implement this feature would have been to use a mod. Because mods are exactly for this kind of job.

I think wube didn’t do it, because that would mean to load a mod in the game setup-stage. But, man, that’s exactly what the game needs: loading mods without restarting the game!

How easy could this be implemented, if this would be done in a background process? And how much more things could be done? I don’t know, but this looks like an obvious door, Factorio needs to go through, even knowing that this might be really hard to do.

And it is not too late to get rid of this structure. A new mod version will come in any case and will include some incompatible changes. This change can then be added on top. They can just remove this construct, or can read it and internally convert it to the right values. Simple. :)

Re: Remove Expensive Mode

Posted: Mon Nov 14, 2022 9:53 am
by Klonan
We had a discussion prompted by this topic, and we agreed with a lot of the points,
Even internally the expensive mode causes a lot of hassle and code maintainence

Since we have already 'broken the seal' of internal/base game mods with the expansion (the expansion content will be a separate mod),
It was agreed we would make the expensive mode recipes into a small mod that will be packaged with the game.

Re: Remove Expensive Mode

Posted: Mon Nov 14, 2022 11:05 am
by aka13
Klonan wrote: Mon Nov 14, 2022 9:53 am We had a discussion prompted by this topic, and we agreed with a lot of the points,
Even internally the expensive mode causes a lot of hassle and code maintainence

Since we have already 'broken the seal' of internal/base game mods with the expansion (the expansion content will be a separate mod),
It was agreed we would make the expensive mode recipes into a small mod that will be packaged with the game.
How will that relate with steam achievements, and will deathworld be supported with the expansion?

Re: Remove Expensive Mode

Posted: Mon Nov 14, 2022 1:59 pm
by Klonan
aka13 wrote: Mon Nov 14, 2022 11:05 am
Klonan wrote: Mon Nov 14, 2022 9:53 am We had a discussion prompted by this topic, and we agreed with a lot of the points,
Even internally the expensive mode causes a lot of hassle and code maintainence

Since we have already 'broken the seal' of internal/base game mods with the expansion (the expansion content will be a separate mod),
It was agreed we would make the expensive mode recipes into a small mod that will be packaged with the game.
How will that relate with steam achievements, and will deathworld be supported with the expansion?
Using internal mods will still allow achievements as normal,
Death world should work the same as now, unless I misunderstand the query?

Re: Remove Expensive Mode

Posted: Mon Nov 14, 2022 6:03 pm
by Mernom
How many mods actually take advantage of Expensive mode, anyway? I know SE doesn't, and we just have to work around it.
I know K2 implements it through mod settings, AKA similarly to how it's going to work in the future it seems.
Any others?

If it's really underused, I'm all for trimming a cumbersome structure that people have to constantly work around.
Edit: Actually is there any mod out there that takes advantage of technology difficulty? I don't think I've seen any.

Re: Remove Expensive Mode

Posted: Mon Nov 14, 2022 9:22 pm
by pezzawinkle
I agree with most of the points here, the main problem with expensive mode(s) is the unwieldy permutations of table structures. If the regular recipe/tech structure was to be forced onto the subtable, that would at least simplify library functions instead of handling parent and child type formats at the same time.
One of the mods I work with deliberately forces that structure to simplify the rest of the library.
While the idea and flexibility is nice, it has not been utilized in many, if any mods, I have a concept, but the implementation may increase load times... any updates in this space would be nice.