SnapCracklins

  • Joined Mar 18, 2022
  • 27 best answers
  • Solo indie game dev, building a horror title in Godot 3.5 currently. AKA negative_development.
    90% chance of being an octopus in a human suit.

  • Hello good evening, morning or afternoon depending on the time you read this message, I want to inform you that I made some corrections in the game such as :

    • the player no longer respawns in the middle of the screen but now there is a system to respawn in a nearby point and outside the tilmap(suggestion by @SnapCracklins ).
    • I solved a couple of bugs in the pause menu in the restart option and another one in the first level that could prevent to complete it.
    • now the game screen is expandable and the html version has a fullscreen button.
  • @xyz ok cool to know. so if i do have code parse over the variables, would it better to not assign a value and leave it null? or just use a control if loop (in code) to pass that variable unless it has relevant data?

    @SnapCracklins i want to have a bunch of nodes that the player can create with a button.... Then sort them into respective categories depending on the value of certain variables. I am hoping to use a collision shape attached to the body as well and yes possibly have them be effected by an area 2d acting like a container to keep them in place. I do want them to act as objects though that bounce around. Its part of a project i am attempting that almost every element of UI is involved and passing/changing the values of the nodes depending on buttons/sliders/etc

    AS ALWAYS.... I REALLY APPRECIATE ALL THE HELP!!!!!!

    • xyz replied to this.
    • @SnapCracklins ok very interesting. When running as Dedicated Server, both clients who connect - their player id which is set from add_player (which is called from on_connect step of the multiplayer class) is a unique id 123456, however calling multiplayer.get_unique_id() in the _ready() func it is 1 on both clients.
      So my characters spawn and simply given Id 1, theyre not 'told' by the server what their Id should be ? Im not sure..

    • @SnapCracklins yeah I double checked. I can get it working as a Listen Server (so 1 player is hosting, and another joins) but I could only do that by turning off Camera3D in my spawn_player func before adding to the scene, then running the code above.
      However this does not work when running as a Dedicated Server (so 1 headless server, both players join as guest). Same thing happens as before where player 1 joins has correct camera, player 2 joins has correct camera but suddenly player 1's camera becomes player 2's camera and is static

      -- multiplayer.gd
      func add_player(id: int):
      	print('add_player', id)
      	var chara = character_tscn.instantiate()
      	chara.player = id
      	
      	var spawnpoint:Node3D = find_spawn_point(current_level_scene)
      	chara.position = spawnpoint.transform.origin
      	chara.name = str(id)
      	
      	# turn off camera when spawning
      	chara.get_node('Camera3D').current = false
      	
      	current_level_scene.get_node('Players').add_child(chara, true)
      	
      
      -- character.gd
      func _ready():
      	if player == multiplayer.get_unique_id() :		
      		$Camera3D.current = true
      		($Camera3D as InterpolatedCamera3D).target = $CameraGame
    • Thanks for the pointer to the docs - I totally missed that.

      @SnapCracklins That's also useful - thanks!

    • Well, just tried updating the colors on the sRGB profile in Aseprite and exporting that and now it looks the same between Aseprite and Godot, but looks different in Affinity, which has color profile already set as sRGB... So Im not sure this is the best way of doing this.

      I also found this issue in github, which is probably the exact same issue, without solution unfortunately. And in that case, I do think the issue is with Godot.
      Im not sure how to proceed, using the sRGB profile in Aseprite so it looks ok in Godot but wrong everywhere else is not ideal solution.

      I also found some more discussions where people suggested the same thing as @SnapCracklins where setting the sRGB to enabled in the import settings helped, but again. that was in 3.X version and is not present in the 4.X version.

      • Hello @SnapCracklins,

        From project settings -> rendering -> quality ? Yes, it's on.

        Another informations in case of: the buildings and vehicles are put in a YSort node and the scale of the annimated sprite size scale's node are below to 1.

      • Thanks @cybereality and @SnapCracklins

        This is all new to me despite having programming experience in the past. It's a real rabbit hole and amazing to learn new methods. I've managed to try out using signals with a test Child Node and connecting to it in the main scene, passing the node name and the fact that the LMB has been pressed.

        Now I'm thinking I'll try creating a signal bus in an autoloaded singleton so all the children can send signals with that and the main scene can connect to it. And as cybereality mentioned about disabling the other children when one is clicked, I could add all the children to a group, then when one is selected, remove that one from the group, disable the group whilst I'm dragging the selected one (or whatever) then add it back to the group upon de-selecting it.

        That's my thinking anyway. There may well turn out to be a better method for that! But the more I learn, the better I get and the more I can help others on their own journey with Godot.

      • @Syl20 Okay, thank you. Thanks to the shader you posted it became obvious that there's an issue in the code. Yours works fine. I have no idea what is going on as I don't really know anything about shader coding. However, I was at least able to combine the two into one that works. Code is here:

        @SnapCracklins Truth is I couldn't tell a good shader from a bad one. Don't know enough about themn. If you know a better one that does directional blur/motion blur, please tell me.