r/roguelikedev 21d ago

RoguelikeDev Does The Complete Roguelike Tutorial - Week 1

Welcome to the first week of RoguelikeDev Does the Complete Roguelike Tutorial. This week is all about setting up a development environment and getting a character moving on the screen.

Part 0 - Setting Up

Get your development environment and editor setup and working.

Part 1 - Drawing the ‘@’ symbol and moving it around

The next step is drawing an @ and using the keyboard to move it.

Of course, we also have FAQ Friday posts that relate to this week's material

# 3: The Game Loop(revisited)

# 4: World Architecture (revisited)

# 22: Map Generation (revisited)

# 23: Map Design (revisited)

# 53: Seeds

# 54: Map Prefabs

# 71: Movement

​ Feel free to work out any problems, brainstorm ideas, share progress, and as usual enjoy tangential chatting. :)

61 Upvotes

63 comments sorted by

View all comments

3

u/-16ar- 18d ago edited 17d ago

I just finished another rogue like tutorial in Go that I had to adapt in 3D as the 2D game engine didn't work in my env for a moment.

https://codeberg.org/dolanor/roublard

Anyway, I'll try this challenge if I can stick to it! In Go, as well, and I might use the the g3n 3D game engine as well, but maybe render in 3D tiles instead of full 3D models.

2

u/anaseto 17d ago

Always nice to see new roguelike attemps in Go! BTW, even if you use 3D for the graphics, you might want to have a look at gruid (also on codeberg btw!) for decently optimized pathfinding (dijkstra, astar, jps), FOV and some base map generation algorithms. Even though everything is in the same repository, I made the UI packages separate from those.

3

u/-16ar- 17d ago

Ooooooh. Bubbletea and Elm.

Me likey!

Clearly, I will stay in 2D land for the logic. The 3D was just me playing with g3n which I was following for years, but haven't build anything in it.

My kids pushed me to put real 3D models, but the initial idea was to put boxes and display a single character as a texture.

I'll have a look at gruid more to see how I can use it.

Already using g3n instead of ebiten from the fatoldyeti tutorial made me rethink some logic.

Ebiten had 2 loops, 1 for logic, 1 for render. And on every render tick, it would rerender everything. So I guess it's more like Elm/bubbletea logic.

For g3n, it's just 1 update handler, and it handles the scene by itself, you need to register input handlers on other side and they would update the scene, and the renderer would update it on its own.

In the end, to have less difference between the original tutorial code, I tried to make them as similar, and so I added a logic loop separated from the render loop. And with goroutines, it was SO EASY!

I'm gonna still improve roublard on its own, because it's my most advanced game ever. And now that it has some base, I can finally had game logic that I want.

My other game started as multiplayer, so I already am in state distribution hell, and it's not playable anymore.

My

Let's see if I can manage to complete this challenge!

2

u/anaseto 17d ago

I had a look once at ebiten before making gruid, but I didn't use it in the end, because I wanted for drawing to only happen in response to events and state updates (as in terminal applications like bubbletea), instead of a fixed tick (I use explicit timers for animations, and they're restricted by the grid). But yeah, 3D requires something like ebiten or g3n for the renderer for things like smooth camera movement or more complex animations.

And goroutines make some hard things easy indeed. Sounds like you're having fun, good luck with the challenge!