Login
You're viewing the w3c.social public feed.
  • Aug 23, 2025, 6:05 PM

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

    As ebiten doesn't work on my ubuntu anymore, I made the choice to use 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 #roguelike

    A realtime 3D render of of some kind of colorless figuring in the corner of a room with adorned wall.
    💬 2🔄 0⭐ 2

Replies

  • Aug 25, 2025, 2:47 AM

    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

    💬 0🔄 0⭐ 5
  • Aug 25, 2025, 10:14 AM

    very easy fix, map the z, s, q, d button for player move and keep the arrows for the camera.

    I'd like more control over the camera from the code, though. There is some weird thing about it. I'm gonna find what's wrong with it.

    💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 1
  • Aug 30, 2025, 1:23 AM

    I also implemented the collision system in ECS following fatoldyeti.com/posts/roguelike

    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

    a textual visualization of the tiles in the slices of tiles. They don't look how they should.
    a textual depiction of the room surrounded by # walls
    The incriminating code with the correct double loop iterating y first, then x.

```go
func (l *Level) CreateTiles() []Tile {
	gd := NewGameData()
	tiles := make([]Tile, 0, gd.ScreenHeight*gd.ScreenWidth)

	for y := range gd.ScreenHeight {
		for x := range gd.ScreenWidth {
```
    💬 0🔄 0⭐ 0
  • Aug 30, 2025, 1:30 AM

    it highlighted a problem where the display didn't show the logic, which is a code smell to me, and that's something I introduced while adapting to 3D.

    On ebiten, the entities will be drawn every frame based on their location.
    On g3n, I set their position at creation, and then the engine will render them where they are positioned. But the collision would happen on another part.

    I wonder how I can make sure that WYSIWYG without coupling logic too much.

    💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 1
  • 💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 1
  • Jul 27, 2026, 2:47 PM

    I finally made it! Till the end of the tutorial!

    web.archive.org/web/2024111123

    I did the minimum to have the same behavior of the game.

    Now I intend to refactor to remove all the code that used my fake ebiten library to have a minimal diff with the original upstream code.

    And then, I will reorganize the code to more fit my style and g3n handling of game/render loop.

    #golang #gamedev #3d #g3n #ebiten #roguelike #ecs

    A gameplay demo of a rogue-like in 3D with field of view display and some fight interaction with some monsters. No fight animation, just logs showing the action done.
    💬 0🔄 1⭐ 5
  • 💬 0🔄 0⭐ 1
  • Jul 30, 2026, 3:26 AM

    All right, done for the night. That was a productive session.
    Sprinkled with some weird bugs/exceptions.
    I had to hack around at some point to not be stuck in trying to figure out everything.

    Ugly hacks, but I could focus on improving big chunks on the other side.

    For now, 0 loss of feature, but a cleaner design. Me likey!

    💬 0🔄 0⭐ 0
  • Aug 6, 2026, 1:57 AM

    I'm finally gonna start migrating my projects from GitHub to Codeberg.

    I have my own gitea instance for years (and I should update it to forgejo…) for my own private projects. So Codeberg makes complete sense for hosting my open source projects.

    So, roublard is now available at codeberg.org/dolanor/roublard

    My other "big" project is rip.rest . I have some more work to migrate it as I depend on it on a dev project and don't want to disrupt it more.

    #golang #github #codeberg #gamedev #roguelike

    💬 0🔄 0⭐ 3
  • Aug 6, 2026, 2:02 AM

    Anyway, I advanced quite well lately thanks to the holidays.

    Mostly reorganizing the code to be able to start adding more advanced rules and game mechanics.

    I even added a very quirky death animation which is a double spin followed by a face plant. Totally ridiculous, but my kids and I loved it, so, for now, it stays.
    Also, regarding that, goroutines are so great. I just start the animation in a goroutine, and forget about it.

    #golang #gamedev #3d #g3n #roguelike #ecs

    The 3D avatar of the roublard game surrounded by 2 finally dead skeletons in a dark dungeon showing normal maps textured floor and a faraway wall.
    💬 0🔄 0⭐ 2
  • Aug 12, 2026, 10:27 AM

    I've done some good progress in refactoring the codebase, and it is to a point where I feel I want to add some features. So, since the weekend I did:

    - imported a package I created for another game of mine (unpublished) so I can have advanced display of RPG dice roll information.
    - integrated it in the current HUD log
    - added some progress bar in the HUD (gui.Slider) to display health
    - hacked in (30mn) a somewhat minecraft-like ability to create wall when clicked on a tile.

    #golang #gamedev #3d #ecs #g3n #roguelike

    A screenshot of roublard, a 3D rogue like with the player next to a defeated unicorn goblin janitor on a dungeon floor.

The log show details of the dice rolls:
Hit: 15 (1d20) + 1 (strength modifier) + 2 (weapon) = 18 VS AC: 10 (Base) + 7 (Reinforced leather boxer) = 17
Damage: 10 (1d10) + 2 (Lightning) = 12
    💬 0🔄 0⭐ 4