I also implemented the collision system in ECS following https://www.fatoldyeti.com/posts/roguelike4/

But some places I could go through walls, and sometimes I was blocked by some invisible blocks.
I couldn't see the pattern and the tiles seemed to be at the right places. So I decided to debug it the classical way: `printf` to the rescue!

`.` are the floor and `#` are the walls. They should be all around, but clearly, they aren't. There is a pattern to figure out, but it eluded me until I counted it.

For performance reason, all the tiles were added in a slice, instead of slices of slices.
I added them one after another in a double loop.

Basically, I inverted x and y, and so it was creating a slice of column first then rows. But I was displaying them and computing them by rows first and column next.

Pretty basic error, but the debug print made it all clear very fast.

#golang #g3n #roublard #3d #RogueLike

I hacked on roublard since, I added some kind of "torch" light to the character, and made the whole environment dark with no ambient light.
It changes the mood!

#golang #g3n #roublard

IT'S ALIVE!

Now I can move the character.

It was way more adaptation as ebiten is more immediate mode and g3n is more retained, but I kind of like it as it is. I don't have a render loop, it is handled by the 3D engine.
I just use the update loop to update the position based on KeyPress events.

Problem is, now it interacts with the camera control as well, so I get to move my character and change the camera settings as well.

#golang #gamedev #3d #g3n

Been following Fat Old Yeti/Idiot Coder tutorial on how to create a rogue-like in Go:
https://www.fatoldyeti.com/posts/roguelike-tutorial-0/

As ebiten doesn't work on my ubuntu anymore, I made the choice to use http://g3n.rocks as I wanted to play with it for so long.

I'm still at step 2, but adapting g3n to just do 2D work without knowing g3n that much and being rusty in OpenGL made it a little bit more complex.

I just want to make g3n be abstracted and render in 3D some really 2D game mechanics. It's a little bit challenging as some loops are not at the same place (adding tiles to a 3D scene doesn't make you recalculate their position in the render loop, so you need to account for them only once).

And having my children challenge me along the way: "hey, can you make the wall nicer?", "can you add a 3D model instead".

So I dug into how to load a material with Displacement map, normal map, etc.

I'm having fun and I'm pretty proud about the result after a few hours of tinkering.

#golang #3d #g3n #ebiten #blender3d

Finally I'm finished with gosnake, release time! 🕺

GoSnake v1.0 🐍

* Windows: https://zenithsal.cloudmillgames.com/assets/releases/gosnake/gosnake-v1.0-win64.zip
* Linux: https://zenithsal.cloudmillgames.com/assets/releases/gosnake/gosnake-v1.0-linux.zip

Learned a lot about Go from this. The code is horrendous due to my experimentation and I should really have followed a style guide, but hey .. it-works-on-my-PC (™️) 🎆

#golang #g3n