Immersive Engineering

Immersive Engineering

134M Downloads

[1.14.4] ore gen creating no silver or uranium, very little copper and bauxite

gyroplast opened this issue ยท 1 comments

commented

Description of the issue:

In 1.14.4 with IE 014-94, I found very little copper and bauxite ore, and no silver or uranium ore at all. I confirmed with the help of the Advanced X-Ray mod that, in fact, no silver or uranium ore is generated at all, and the generation of all other ores is much less than what was generated in an 1.12.2 world, which I compared against. Of course I did not (knowingly) modify the IE config and used generated default values to reproduce this issue.

Xraying for copper ore confirms very few blocks being generated. Bauxite looks similar.
screenshot: very little copper found with xray

Note how only the singular silver block in the middle of the screen is marked with a red border, there is no other silver ore in a 256 block area around me:
screenshot: no silver found with xray

I had a peek at the immersiveengineering-common.toml client config, and realized that uranium and silver uniquely have veins_per_chunk set to a value < 1.0, as opposed to all other ores which generate. Setting their veins_per_chunk to 1.0 indeed caused silver and uranium to generate!

The code of the current 1.14.4 branch isn't entirely clear to me as I lack any experience with Forge mods whatsoever and how the ore gen is implemented, but it appears there could be some confusion with veins_per_chunk, avg_veins_per_chunk, and the vein spawning chance in a chunk across implementation and config values.

Referring to IEConfig.java:438:

  	ore_copper = new OreConfig(builder, "copper", 8, 40, 72, 8);
  	ore_bauxite = new OreConfig(builder, "bauxite", 4, 40, 85, 8);
  	ore_lead = new OreConfig(builder, "lead", 6, 8, 36, 4);
  	ore_silver = new OreConfig(builder, "silver", 8, 8, 40, 4);
  	ore_nickel = new OreConfig(builder, "nickel", 6, 8, 24, 2);
  	ore_uranium = new OreConfig(builder, "uranium", 4, 8, 24, 2);

and IEConfig:473

  public static class OreConfig
  {
  	public final IntValue veinSize;
  	public final IntValue minY;
  	public final IntValue maxY;
  	public final IntValue veinsPerChunk;
  	public final BooleanValue retrogenEnabled;

  	private OreConfig(Builder builder, String name, int defSize, int defMinY, int defMaxY, int defNumPerChunk)
  	{
  		builder
  				.comment("Ore generation config - "+name)
  				.push(name);
  		veinSize = builder
  				.comment("The maximum size of a vein. Set to 0 to disable generation")
  				.defineInRange("vein_size", defSize, 0, Integer.MAX_VALUE);
  		minY = builder
  				.comment("The minimum Y coordinate this ore can spawn at")
  				.defineInRange("min_y", defMinY, Integer.MIN_VALUE, Integer.MAX_VALUE);
  		maxY = builder
  				.comment("The maximum Y coordinate this ore can spawn at")
  				.defineInRange("max_y", defMaxY, Integer.MIN_VALUE, Integer.MAX_VALUE);
  		veinsPerChunk = builder
  				.comment("The average number of veins per chunk")
  				.defineInRange("avg_veins_per_chunk", defNumPerChunk, 0, Integer.MAX_VALUE);
  		retrogenEnabled = builder
  				.comment("Set this to true to allow retro-generation of "+name+" Ore.")
  				.define("retrogen_enable", false);
  		builder.pop();
  	}
  }

and comparing the default immersiveengineering.cfg config file excerpts from 1.12.2 for silver and copper:

   # Generation config for Copper Ore.
   # Parameters: Vein size, lowest possible Y, highest possible Y, veins per chunk, chance for vein to spawn (out of 100). Set vein size to 0 to disable the generation
   I:ore_copper <
       8
       40
       72
       8
       100
    >
   # Generation config for Silver Ore.
   # Parameters: Vein size, lowest possible Y, highest possible Y, veins per chunk, chance for vein to spawn (out of 100). Set vein size to 0 to disable the generation
   I:ore_silver <
       8
       8
       40
       4
       80
    >

with the new config file format:

#Ore generation config - copper
[ores.copper]
#The maximum Y coordinate this ore can spawn at
#Range: > -2147483648
max_y = 72
#The maximum size of a vein. Set to 0 to disable generation
#Range: > 0
vein_size = 8
#The chance for a vein to spawn (relative to 1)
#Range: 0.0 ~ 1.0
veins_per_chunk = 1.0
#Set this to true to allow retro-generation of copper Ore.
retrogen_enable = false
#The minimum Y coordinate this ore can spawn at
#Range: > -2147483648
min_y = 40

#Ore generation config - silver
[ores.silver]
#The maximum Y coordinate this ore can spawn at
#Range: > -2147483648
max_y = 40
#The maximum size of a vein. Set to 0 to disable generation
#Range: > 0
vein_size = 8
#The chance for a vein to spawn (relative to 1)
#Range: 0.0 ~ 1.0
veins_per_chunk = 0.8
#Set this to true to allow retro-generation of silver Ore.
retrogen_enable = false
#The minimum Y coordinate this ore can spawn at
#Range: > -2147483648
min_y = 8

As I see it, in 1.12.2, the veins_per_chunk key is NOT describing the vein spawn chance, yet in 1.14.4, only the veins_per_chunk key exists, and its description suggests is actually sets the spawn chance, which it indeed seems to affect somehow. What I could not set was an actual veins_per_chunk value as it was done in 1.12.2, which would explain the low proliferation of bauxite and copper in particular. I have no idea how this avg_veins_per_chunk from the source plays into this, and setting a key with that name in the config was seemingly removed, but I may have overlooked an effect as I didn't go much deeper here.

Could you look into any possible mixups regarding ore generation configuration in 1.14.4 to make sure ore gen works as intended? Thank you!

I did reproduce the issue with a minimal, fresh setup and the versions described below.

Crashlog:

No crash, no obvious errors in the normal logs.

Versions & Modlist

  • Minecraft 1.14.4
  • Forge 28.2.3
  • ImmersiveEngineering 0.14-94
  • Advanced X-Ray 1.14.4-2.0.3
commented

Known and fixed: 274dccb