Godot freezes and fills up my whole Ram.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nulide


while i was working on my game, the editor (4.0.2) does freeze sometime and makes my pc unusable.

While tracking the Ram-Usage with htop i noticed that as soon as it freezes it starts to fill my whole ram for no reason.
Normal ram usage was at around 1gb, as soon as it freezes it goes up to the limit of 20gb(with swap).

This happens like 5 to 10 times a day so it is really annoying.

The Crashlog reports:

ERROR: Disconnecting nonexistent signal 'changed', callable: TileMap::_tile_set_changed.

at: _disconnect (core/object/object.cpp:1331)

Did anybody of you experienced something similar?



Do you have any code attached to a tilemap node? if yes can you post it

CollCaz | 2023-05-23 13:11

I don’t think my code is causing this issue as the code does not have the @tool anotation and this behavior occurs while i am not running the game.

Here is the code anyways. It is just for modifying some layers when the player enters an area2d:

extends TileMap

#Is the interior visible?
#When true than the walls shalled be visible too
var interior_visible = false
#Is the transition done?
var done = true
#current alpha of the layer.
var alpha = 1

# Layer Index to use
var InteriorWallsID = -1
var CornerHideShellId = -1
var DoorOpenedId = -1
var ShellsId = -1

#Find index of the layers that will be modfied afterwards
func _ready():
	set_layer_modulate(5, Color(1,1,1,0))
	for i in range(get_layers_count()):
		if get_layer_name(i) == "InteriorWalls":
			InteriorWallsID = i
		elif get_layer_name(i) == "CornerHideShell":
			CornerHideShellId = i
		elif get_layer_name(i) == "DoorOpened":
			DoorOpenedId = i
		elif get_layer_name(i) == "Shells":
			ShellsId = i

func _process(delta):
			alpha -= 3*delta
			if(alpha < 0.05):
				done = true
				set_layer_enabled(DoorOpenedId, false)
				set_layer_enabled(DoorOpenedId, false)
			alpha += 3*delta
			if(alpha > 1):
				done = true
				set_layer_enabled(DoorOpenedId, true)
				set_layer_enabled(ShellsId, true)
			set_layer_modulate(InteriorWallsID, Color(1,1,1,1))
			set_layer_modulate(CornerHideShellId, Color(1,1,1,0))
			set_layer_modulate(InteriorWallsID, Color(1,1,1,0))
			set_layer_modulate(CornerHideShellId, Color(1,1,1,alpha))
		set_layer_modulate(DoorOpenedId, Color(1,1,1,alpha))
		set_layer_modulate(ShellsId, Color(1,1,1,alpha))

#If player enters a shell the interior shall be visible
func _on_shells_body_entered(body):
	done = false
	interior_visible = true

#If player exits a shell the house shall be visible
func _on_shells_body_exited(body):
	done = false
	interior_visible = false

#Executes when play is infront of the house
#Show the underlying door and play sound
#Disable layer till godot engine bug #72519 is fixed
func _on_entrance_body_entered(body):
	set_layer_enabled(ShellsId, false)
	set_layer_modulate(ShellsId, Color(1,1,1,0))

func _on_entrance_body_exited(body):
	if(not interior_visible):
		set_layer_enabled(ShellsId, true)
		set_layer_modulate(ShellsId, Color(1,1,1,1))

Nulide | 2023-05-23 13:49

Well you got a point, if your code deosn’t have tool annotation it shouldn’t cause a problem in the editor.

id say report this in the github repo, you might find help there.

CollCaz | 2023-05-24 16:34