[–] 8 points 6 months ago (2 children)

A hint i found on Reddit (yikes, i know) from someone who made a nice github with their solution.

Their idea is to pass the player position to the objects shaders, and then to get 2 differents normals : from object to player, and from object to camera. Once you have those, you can make a dot product to tell if they are in the same direction or not (>0.0 if their angle is less than 90°, <0.0 if it's greater, 0.0 would correspond to a 90° angle). Beware, i believe it's best to normalize both your vector to a length of 1, before using dot product if you want to get accurate results.

So once you have a negative dot product, you know both direction are opposite, so the object is between the camera and the player, and should be hidden.

On top of that, they limit that effect to a small circle around the player, to avoid making objects transparent all over the screen. You'd have to find out how to limit that effect to the field of view of the player, and i sadly have no real idea about that.

  • source
  • [–] 8 points 6 months ago

    You want human beings to go to the United States of Amurica for any reason at all?

    That ain't happening, I don't want to get jailed, thank you very much

  • source
  • [–] 18 points 6 months ago (1 child)

    I started using Godot in 4.0 and it's simply amazing. Doesn't take any disk space, opens in seconds, all tools needed in one place and you start creating in a matter of seconds.

    I'm so glad to leave unity behind.

  • source
  • [–] 6 points 6 months ago (1 child)

    Mistakes are easy to make and you want them to show up immediately instead of randomly at runtime. If you have lots of tiles, change the fields later, or manipulate the data in code you'll make a typo or forget something eventually.

    With a class, every tile is guaranteed to have all the fields, and if you give the fields explicit types, they're always guaranteed to be the correct type. If you do something wrong, you won't have to figure out why it's broken later, because the editor shows red before you even run it.

    Also, the editor autofill only works when it knows what it's working with.

  • source
  • parent
  • context
  • [–] [S] 3 points 6 months ago (2 children)

    Im a new to all this so still learning whats available to solve the problems. From what I understand that would make each tile an object and I could call its properties like tile.move_speed but thats the same as a dictionary. I dont get what the difference is or what advantages a class would provide.

  • source
  • parent
  • context
  • [–] 5 points 6 months ago

    I chose compatibility because I thought that it would be better performance since I was not using any of the advanced features in Forward+. The rendering I have is pretty flat and simple and I was hoping this post would compare the performance of the different renderers.

  • source
  • [–] [S] 2 points 6 months ago

    what are the benefits to using it in Godot?

    Primarily performance and type safety. You can get some type safety with typed GDScript, but it doesn't really compare to Rust. You also get all the language constructs for free and access to the entire Rust ecosystem, as you can depend on basically any crate you like.

    Does the game run any faster than if it were programmed in CO# or GD script?

    Yes, you can get more performance out of your CPU-intensive code compared to GDScript. If you have complex calculations or a large amount of data to process, you will fare better with Rust. The interoperability between Rust and GDScript is also quite good, so you can mix and match as much as you like. I can't really say how it compares to C#, as I have never tested it myself.

    Is web more stable with it?

    I'm not sure what you mean by more stable, but web exports are possible, which is not currently supported with C#. Rust also does not rely on a runtime like C#, which should give you a smaller export size compared to C#.

  • source
  • parent
  • context
  • [–] 2 points 6 months ago (1 child)

    As a rust-curious dev, what are the benefits to using it in Godot? Does the game run any faster than if it were programmed in CO# or GD script? Is web more stable with it?

  • source
  • view more: ‹ prev next ›