Jump to content

[OLD] [BUGFIX] [MOD] Repairing the retrofitting function for the caves' Fumarole Biome.


Adgycarp
  • Pending

I was informed by the comments inside This post that the retrofitting for fumarole biome was patched by klei. Cheers ^_^
This means that the solution in this topic is now redundant. The mod will become unlisted, but accessible for archiving purposes. It should not be necessary. Any affected world with the wrongly generated biome could be partially fixed by following the OG topic from the link above ↑

Original post:
In its current state, launching an old world without a Fumarole Biome will undergo retrofitting, but there is a bug in the code that messes up the retrofitting data. More specifically, the map's topology is not applied properly.

For instance, when it was applied on my world, it spawned the (predefined) land, but without the properties that are unique to the biome.
Instead what happened, is that the biome's properties appeared elsewhere on the map, in this instance it was the Guardian's maze that was affected. 90 degree weather in the labyrinth.

And now I know why.

I will elaborate the reason in the next section.
For the time being I have published a mod that you can enable only before the retrofitting process. It will make the biome spawn the way it should. If klei updates the code and implements this, or a different solution, then the mod will not be needed anymore.

https://steamcommunity.com/sharedfiles/filedetails/?id=3621943768

After having implemented this fix, the biome looks like this:

image.jpeg.06d16442d9f5219868258c8af4f37efa.jpeg
It contains the icon for the fumarole biome, as indicated by the mod "Biome Indicator" by Uber Steve.

 


Steps to Reproduce

 Inside "scripts/map/caves_retrofit_land.lua" there is the local function "AddTileNodeIdsForArea"

local function AddTileNodeIdsForArea(world_map, node_index, left, top, width, height)
	for x = left, left + width do
		for y = top, top + height do
			world_map:SetTileNodeId(x, y, node_index)
		end
	end
end

This is a good function, notice how it contains " x = left, left + width (...) "


The error lies within the local function "FromBeyondRetrofitting_Fumarole". I won't include the whole thing for the sake of cleanliness, you can see for yourself inside the scripts.zip within your game's installed files. However I shall mention the relevant bits:

  1. Defining the biome's size through local main_area_size = 30 
  2. Defining a top and left through local function  " FindOpenArea " ; this has main_area_size entered as params for both width and height.
  3. Defining a node index through local topology_node_index = AddTopologyData
  4. Assigning the NodeId's to the tiles through the local function AddTileNodeIdsForArea(world_map, node_index, left, top, width, height)
    4.1 The added params are: (world_map, topology_node_index, left + main_area_size + 1, top + main_area_size + 1, main_area_size - 1, main_area_size - 1)

The error comes from " left + main_area_size + 1, top + main_area_size + 1 "
The AddTileNodeIdsForArea function already contains " left + width " and " top + height ", so essentially the params highlighted above are added for a second time, redundantly. This results in the biome's topology/properties being assigned to a different location.

If you edit the highlighted parts from 4.1 into " left + 1, top +1 ", then the function will behave like it should.


This should also fix all the earlier mentioned issues regarding the retrofitted Fumarole Biome that others have reported. Such as enemies not spawning, absence of global heat aura, regrowth, rift/biome related boulderbough loot tables.

 

  • Like 2



User Feedback


@sukeme 

@erikac14 @erikac14

@Phoenix_Cobra @Phoenix_Cobra

@shadowDigga

 

 

@lattematcha @lattematcha

https://forums.kleientertainment.com/profile/1376007-sukeme/

Pinging the authors of related bug reports, in case you guys are interested for a retrofitting solution. Hope you don't mind!

Edited by Adgycarp
i failed at pinging users
  • Big Ups 2
  • Potato Cup 1

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...