Jump to content

Invisible tiles when bringing labyrinth to Surface ?


Recommended Posts

Hello,

I have created a custom taskset with "TheLabyrinth" and "AtriumMaze" that I use on surface (a custom forest level). Every cave/ruin biome works fine, except these two. For some reason, they add these "invisible" tiles to the world:

 

SeenDGZ.jpg

 

The tiles look like impassable (water) but they have borders and it is possible to walk on them.

In the case of AtriumMaze (on this screen), the invisible tiles are always on the bridge connecting the maze to the rest of the world. The Atrium biome itself is fine.

In the case of TheLabyrinth however, the whole background of the biome is made of these tiles so you can just ignore the labyrinth paths by walking on apparent water.

 

Do you have any idea of what can cause it ?

I saw a FAKE_GROUND terrain in the ruins files but modifying it with addRoomPreInit doesn't work.

 

 

Edited by Saiph
Link to comment
Share on other sites

Yes sorry. Something as simple as:

worldgenmain.lua:

local require = GLOBAL.require
require("map/lockandkey")
require("map/tasks")
require("map/rooms")
require("map/terrain")
require("map/level")


local function LevelPreInit(level)

	if level.location ~= "forest" then
		return
	end

	table.insert(level.tasks, "TheLabyrinth")
	table.insert(level.tasks, "AtriumMaze")
	table.insert(level.tasks, "Residential") -- added this to show that only the 2 other ruins bug
end

AddLevelPreInitAny(LevelPreInit)

 

Here is a full working archive that produces the bug:

 

test_invisible.rar

Link to comment
Share on other sites

The caves have a special tile there that gets cleaned up in worldgen that changes the bridge to null space later on the C-side.

Reason for this is to stop worldgen from dissolving the entire area thinking it's an island when it was intentionally placed there earlier in worldgen code.

If I recall it's GROUND.FAKE_GROUND to glue the pieces together.

 

When I was tinkering with worldgen I don't recall of getting that specific tile to fix itself.  I think there's a kludge on the C-side to detect if it's the overworld or not for having it replaced with a proper tile.

Link to comment
Share on other sites

6 minutes ago, CarlZalph said:

The caves have a special tile there that gets cleaned up in worldgen that changes the bridge to null space later on the C-side.

Reason for this is to stop worldgen from dissolving the entire area thinking it's an island when it was intentionally placed there earlier in worldgen code.

This makes sense but that means the Atrium Maze should end disconnected right ? If so how can it be accessed once the fake_ground bridge gets deleted ?

 

7 minutes ago, CarlZalph said:

When I was tinkering with worldgen I don't recall of getting that specific tile to fix itself.  I think there's a kludge on the C-side to detect if it's the overworld or not for having it replaced with a proper tile.

Sorry what does c-side means ?

Link to comment
Share on other sites

I have replaced FAKE_GROUND by SAVANNA in the original game files (3 relevant occurences). The result is that there's a bridge of Savanna leading to Atrium but there are still a lot of invisible tiles in both biomes. I think your explanation is right but there is probably an other problem.

Atrium:  (notice the savanna bridge)

XHhSosm.jpg

 

Labyrinth:

PtJJUud.jpg

Link to comment
Share on other sites

On 7/27/2017 at 6:28 PM, Saiph said:

This makes sense but that means the Atrium Maze should end disconnected right ? If so how can it be accessed once the fake_ground bridge gets deleted ?

Sorry what does c-side means ?

In the base game there are

Spoiler

giant tentacle pillars, one of which when killed

brings you to the Atrium.  Since we don't have the method in question because these don't exist in the overworld, then you'd need some form of teleport to get to it.  Like a lazy explorer, or some modded character ability.

 

WorldSim:ForceConnectivity
WorldSim:SeparateIslands

One of these functions handles converting the fake ground into impassable terrain blocks, assuming the latter.

 

C-side means in the compiled executable outside of the LUA-side logic we're free to edit.

There's a lot of things happening behind-the-scenes in worldgen that the C-side does before/during/after LUA's worldgen code is called.

On 7/27/2017 at 6:32 PM, Saiph said:

I have replaced FAKE_GROUND by SAVANNA in the original game files (3 relevant occurences). The result is that there's a bridge of Savanna leading to Atrium but there are still a lot of invisible tiles in both biomes. I think your explanation is right but there is probably an other problem.

Atrium:  (notice the savanna bridge)

Labyrinth:

If I recall there's a C-side method that ensures the Atrium is attached to the 'main' land by shooting off multiple FAKE_GROUND bridges to it.

It's all stitched together with some hotglue logic all over the place in worldgen.

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
 Share

×
  • Create New...