ore in starting area is low

Replaces resource spawning system, so that the distances between resources are much bigger. Railway is needed then.

Moderators: orzelek, Dark

DarkSlayerEX
Inserter
Inserter
Posts: 24
Joined: Sat Nov 15, 2014 4:33 pm
Contact:

Re: ore in starting area is low

Post by DarkSlayerEX »

Wouldn't it be possible to check whether or not the world is using the expensive recipe setting, and the expensive technology setting, in order to determine whether someone was playing "marathon"?

The game defines the following in the map-settings.lua file.

Code: Select all

    difficulty_settings =
    {
       recipe_difficulty = defines.difficulty_settings.recipe_difficulty.normal,
       technology_difficulty = defines.difficulty_settings.technology_difficulty.normal,
       technology_price_multiplier = 1
    }

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: ore in starting area is low

Post by sparr »

I read somewhere that those things aren't accessible in-game. You would need to just dead reckon from known recipes and the visible recipe prototypes, and that's a dangerous approach.

DarkSlayerEX
Inserter
Inserter
Posts: 24
Joined: Sat Nov 15, 2014 4:33 pm
Contact:

Re: ore in starting area is low

Post by DarkSlayerEX »

game.difficulty_settings.recipe_difficulty (bool in int form)
game.difficulty_settings.technology_difficulty (bool in int form)
game.difficulty_settings.technology_price_multiplier (int)

can be all be modified with /c, while also checked while in game, using the /c game.player.print() command.
I'm sure it can be used the same way out of chat console.

all recipes and techs are immediately updated to match the new values.

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: ore in starting area is low

Post by sparr »

oh, excellent.

in that case, I would be in favor of a mod setting to optionally make RSO scale resource patches to match expensive recipes/tech.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: ore in starting area is low

Post by orzelek »

There are already setting to increase starting area richness and global richness.
Trying to look at recipe costs would then require looking at tech multipliers and it will go downhill from there.
When starting game with expensive recipes or bigger multipliers you should be aware of what you are doing and think about increasing starting resources too. How RSO is supposed to guess how much more resources you need?

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: ore in starting area is low

Post by sparr »

orzelek wrote:How RSO is supposed to guess how much more resources you need?
Perhaps proportional to the cost of launching a rocket?

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: ore in starting area is low

Post by orzelek »

sparr wrote:
orzelek wrote:How RSO is supposed to guess how much more resources you need?
Perhaps proportional to the cost of launching a rocket?
And how would I know that?

Calculating it in runtime is pretty much making a mod on it's own. You would need to travel whole recipe tree for pretty much everything involved in research and building of rocket.

I still don't see convincing reason to try and go do *2 when I detect that complex recipes are enabled. Or maybe *3 ?
Pepole play in different ways and even biter settings will easily change how much materials you need to get to rail and start expanding.

DarkSlayerEX
Inserter
Inserter
Posts: 24
Joined: Sat Nov 15, 2014 4:33 pm
Contact:

Re: ore in starting area is low

Post by DarkSlayerEX »

While I know you said it wasn't going to be easy or know how to have it automatically know how much resources someone would need, I had a thought about a simple method.

Since the expensive recipes are pre-set inside of the recipes themselves, there is one factor that is less needed to be considered randomly changing. (not considering additional mods adding expensive recipes)
You can then consider that there's less calculation needed, as it would be a flat increase.
Furthermore, since this thread is only about the starting patches, you can also consider that the increase is just for players to get started, meaning a simpler formula can be considered:


Having game.difficulty_settings.recipe_difficulty = 1 could add a 25% bonus to starting ores, having game.difficulty_settings.technology_difficulty = 1 could further trigger an increase, in relation to the price multiplier.

In this case, an ore patch that starts at 200000 ore would multiply to 250000 with recipe difficulty, multiplied by 40% due to technology difficulty multiplier at 4, giving a starting ore of 350000

Granted, this could be a toggle-able that could be assigned as a mod-setting as well, so that not everyone will have this inherently active.

Formula-wise, It would probably be something like:

Code: Select all

recipe_multiplier = 1.00
if game.difficulty_settings.recipe_difficulty = 1 then
	recipe_multiplier = 1.25
end

technology_multiplier = 1.00
if game.difficulty_settings.technology_difficulty = 1 then
	technology_multiplier = 1+(0.10*game.difficulty_settings.technology_price_multiplier)-0.10
end

adjusted_richness = v.starting.richness*recipe_multiplier*technology_multiplier
with a change something like

Code: Select all

		
if v.type == "resource-ore" then
	min_threshold = adjusted_richness * rng(5, 10) -- lets make sure that there is at least 5-10 times starting richness ore at start
elseif v.type == "resource-liquid" then
	min_threshold = adjusted_richness * 0.5 * v.starting.size
end

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: ore in starting area is low

Post by sparr »

orzelek wrote:And how would I know that?

Calculating it in runtime is pretty much making a mod on it's own. You would need to travel whole recipe tree for pretty much everything involved in research and building of rocket.
Hmm... I wonder if there's call for a callable mod to answer this question.

total cost to get from 0 tech to building X item, or from current tech, or current tech and current items in logistics network, or...

I think total cost from 0 to rocket wouldn't be especially difficult to calculate.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: ore in starting area is low

Post by orzelek »

@DarkSlayerEX
Thats a nice proposal with one condition - there are no other mods at play that can modify things.

It would still be pretty convoluted - I'd need to have a setting to enable overrides based on difficulty settings. And it would need to be enabled by default then.
AFAIK expensive tech currently does pretty much nothing unless it's effects are hidden.

DarkSlayerEX
Inserter
Inserter
Posts: 24
Joined: Sat Nov 15, 2014 4:33 pm
Contact:

Re: ore in starting area is low

Post by DarkSlayerEX »

Err... Expensive tech multiplies the number of science packs needed to finish research... A Tech multiplier of 4 makes the required science pack count 4 times more expensive.

a research needing 10 science pack x1, will become 40 science pack x1

whereas 10 science pack x2 will become 40 science pack x2

as for tech_difficulty and tech_multiplier, I believe that the multiplier doesn't get used unless the difficulty flag is true.



As for the condition, I don't think that should matter too much, as you're only really needing the additional resources to begin branching out to other patches.. It should be fine, honestly


Mind you, this isn't a big issue for me honestly.. I was just trying to find a way to figure out a decent way to have this work for anyone who wanted it, should it actually be addressed.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: ore in starting area is low

Post by orzelek »

You are confusing two things.
Expensive tech is meant to switch to expensive tech definitions but there are none AFAIK.

Tech cost multiplier is a separate mechanic that has nothing to do with expensive tech setting.
You can easily see this by setting multiplier but not changing tech to expensive - multiplier will still work.

DarkSlayerEX
Inserter
Inserter
Posts: 24
Joined: Sat Nov 15, 2014 4:33 pm
Contact:

Re: ore in starting area is low

Post by DarkSlayerEX »

So I did some testing...

the good news is, I just replicated the recipe setup for expensive/normal recipes, and they do work for techs.
I made a change to steel processing so that is cost 1x50 science pack 1's for normal, and 5x50 science pack 1s for expensive, and it did change once I turned on tech difficulty.
It is definitely incorporated. It just isn't currently setup for any vanilla techs.

The bad news, however, is that in this case it does become more complicated.. There won't be any easy ways that I know of to see how complicated the recipes can become due to people wanting to make things more difficult, unless we replicate what I had done for the recipe difficulty, and just tack on an extra flat %.

Code: Select all

{
    type = "technology",
    name = "steel-processing",
    icon = "__base__/graphics/technology/steel-processing.png",
    effects =
    {
      {
        type = "unlock-recipe",
        recipe = "steel-plate"
      },
      {
        type = "unlock-recipe",
        recipe = "steel-chest"
      },
      {
        type = "unlock-recipe",
        recipe = "steel-axe"
      }
    },
	
	normal =
    {
		unit =
		{
		  count = 50,
		  ingredients = {{"science-pack-1", 1}},
		  time = 5
		},
		order = "c-a"
    },
    expensive =
    {
		unit =
		{
		  count = 50,
		  ingredients = {{"science-pack-1", 5}},
		  time = 5
		},
		order = "c-a"
    }
  },

Post Reply

Return to “Resource Spawner Overhaul”