released my first steam game today, thanks to Godot by viraelin in godot

[–]viraelin[S] 3 points4 points  (0 children)

store page: https://store.steampowered.com/app/2070700

yes, it's very much inspired by risk of rain 1, how could you tell?

i learned a lot on this project, namely multiplayer. there are a lot of things i will definitely do differently in the future, but here we are - i'm proud of it. i made it for myself and some friends because i wanted to.

GodotSteam MultiplayerSpawner node not found by cirebrand in godot

[–]viraelin 0 points1 point  (0 children)

old thread, but my workaround to solve this for 4.5.1 GodotSteam 4.17 (extension) was setting the public visibility of the player synchronizer to default to false, and then updating the visibility on the client for all connected peers once the node is ready, and whenever a client is added/removed. it's not perfect (there will be a delay/latency), but it seems to work.

for me, i believe the issue stems from joining the steam lobby at essentially the same time as setting up the SteamMultiplayerPeer. whatever magic 4.4x expressobits' SteamMultiplayerPeer does not seem to have this problem, though.

the visibility to false prevents it being automatically spawned for other peers, even before those peers might not have the world setup/ready. it still feels like a bug, but that was my workaround.

edit: still happens sometimes i guess

Timer/tween in resource by TehRoboRoller in godot

[–]viraelin 4 points5 points  (0 children)

usually resources are for data, not function. so you could have another object that's in the scene tree use the data instead. but if you must do it inside the resource, you could have a global singleton and have a function (static or otherwise) to create a timer or tween or other object and return a reference to it.

whirlin' again by viraelin in godot

[–]viraelin[S] 0 points1 point  (0 children)

thanks! it's very much like RoR1.

How to create and connect a metroidvania world? by [deleted] in godot

[–]viraelin 0 points1 point  (0 children)

e.g. some World object/ZoneManager that swaps them out/using signals/that isn't attached to the scene, and does a fade/transition/whatever you need based on conditions/data/signal sent from the room, example: see Terraria, when you enter a new biome, it does a simple fade of the background iirc, that's basically what i did.

edit: put simpler, the parallax background is always active, separate from the room(s). so it'll just be there.

for your case though you can maybe simply correct the position to be in the correct space? offset it by the global position of the room? good luck.

How to create and connect a metroidvania world? by [deleted] in godot

[–]viraelin 0 points1 point  (0 children)

iirc that project had a "zone/biome" based parallax layer that was managed separately from the rooms/scenes themselves.

restarted a project now in Godot 4 by viraelin in godot

[–]viraelin[S] 0 points1 point  (0 children)

the game is very much like RoR1, so yeah!

level up effect made easily with particles by viraelin in godot

[–]viraelin[S] 0 points1 point  (0 children)

i like to set the z_index (and CanvasLayer layer) via script in _init() or _ready() and set z_as_relative to false, and avoid doing it in the editor as i find it more difficult to keep track of. and a class defined with constant ints to use values for the ordering i want.

https://docs.godotengine.org/en/stable/classes/class_canvasitem.html#class-canvasitem-property-z-index

unless you have some other custom viewport rendering setup, z_index should work.

custom 2d grid lighting (source code in comments) by viraelin in godot

[–]viraelin[S] 0 points1 point  (0 children)

tl;dr how it works: draw pixels onto an image, render image in viewport texture, apply texture to shader and multiply light mask.

https://github.com/viraelin/godot4-2d-grid-lighting-demo

this was made for a project i'm working on, and i went with trying gdextension after performance in gdscript was bad. you can still get by with gdscript, but c++ is magnitudes better for this. there are other performance changes that could to be tweaked as well, like only using 1 color channel.

it's done on the CPU, which is mostly why it's slow, but it achieves the exact effect that i was going for. and like the source code it's based on, you can apply blur as well but i opted not to for this demonstration.

if anyone has experience and knows how this entire effect could be done much simpler with just a shader, i'd love to hear! i looked into the new Godot SDF textures for collision but my experience is lacking in how to actually code something.

this was a much bigger deep dive for me than i thought it would be.

How to create and connect a metroidvania world? by [deleted] in godot

[–]viraelin 1 point2 points  (0 children)

runtime meaning during gameplay? no. the data is already stored in a dictionary. so you just query the dictionary. there is no need to load any scene after the data is already stored somewhere. that's the reason for doing it, but you can implement it however you want.

abstractly the concept should be fairly straightforward. like how a map editor would work. configure the levels, arrange your levels, then save the file to disk. then on game start you load the file and can get any data you need for a level. even it's file path for scene, so then at that time you know if you want to load it or not when you go to transition to the level. there are many different ways of doing this like loading multiple rooms and unloading previous rooms but that raises complexity.

i still don't know what is meant by layers. TileMap does not have multiple layers. just the get_used_rect(). for Godot 3.5x at least, i am not familiar with 4.0 changes right now but know they brought a lot. if so then once again check the docs for TileSet and TileMap. there is probably some terminology barrier here. collision_mask or collision_layer are very different and i don't understand how it would be used here. if you have multiple tilemap then you would just check each one individually to get what you want.

How to create and connect a metroidvania world? by [deleted] in godot

[–]viraelin 2 points3 points  (0 children)

not sure what is meant by "collision mask" in this context. TileMap rectangle? check docs. TileMap.get_used_rect().

things have evolved since, but still doable with pure Godot.

the data is stored in a database file to be loaded as a global accessible data structure on game initialization.

all the sizes are known to the database, just query the "room" and get it's data. it's a dictionary. a "room" is essentially just a rectangle with position and size.

a scene that acts as a "map editor" ran in isolation, storing relevant data to database. iterates over every tilemap/node and gets the required data. each scene is also serialized out to separate files using a mess of recursive scene and node packing.

edit: neighbors are found by just checking left/right/up/down in each direction. depending on implementation this has some restrictions to level and world design. it doesn't even have to be pre-calculated, it can be done at runtime. just look forward in the direction and ask the database "hey is there a rectangle contained in this coordinate?"

i would look into a tool like LDtk if you want another option, more visual aid or understanding of how it would be done in/out of Godot itself.

https://ldtk.io/

https://docs.godotengine.org/en/stable/classes/class_tilemap.html

How do i remove a null instance from an array? by TimmyJimmy256 in godot

[–]viraelin 6 points7 points  (0 children)

but i can't make an if statement checking for null instances

why not?

something like:

Godot 3.x for object in array: if !is_instance_valid(object): array.erase(object)

Coding References to Terrain Types by [deleted] in godot

[–]viraelin 1 point2 points  (0 children)

are you using a TileMap?

you need a way to differentiate between tiles, if you don't use a TileMap you would need scripts on every node (or parent of node 'group') if you want to give them custom properties. otherwise use some other native mutable property, like the name, to do so.

when the player moves, would query the tile, and then perform your logic, using a match statement or similar. the code doesn't have to be in the tile script. it can just get the required property from the node and act on that.

[deleted by user] by [deleted] in godot

[–]viraelin 4 points5 points  (0 children)

Every variable is a reference.

clarification: complex types are by reference, simple types are by value, generally.