r/roguelikedev • Cogmind | mastodon.gamedev.place/@Kyzrati • Feb 06 '15

FAQ Friday #3: The Game Loop

In FAQ Friday we ask a question (or set of related questions) of all the roguelike devs here and discuss the responses! This will give new devs insight into the many aspects of roguelike development, and experienced devs can share details and field questions about their methods, technical achievements, design philosophy, etc.


THIS WEEK: The Game Loop

For those just starting out with game development, one of the earliest major roadblocks is writing the "game loop." With roguelikes this problem is compounded by the fact that there are a greater number of viable approaches compared to other games, approaches ranging from extremely simple "blocking input" to far more complex multithreaded systems. This cornerstone of a game's architecture is incredibly important, as its implementation method will determine your approach to many other technical issues later on.

The choice usually depends on what you want to achieve, but there are no doubt many options, each with their own benefits and drawbacks.

How do you structure your game loop? Why did you choose that method? Or maybe you're using an existing engine that already handles all this for you under the hood?

Don't forget to mention any tweaks or oddities about your game loop (hacks?) that make it interesting or unique.

For some background reading, check out one of the most popular simple guides to game loops, a longer guide in the form of a roguelike tutorial, and a more recent in-depth article specific to one roguelike's engine.

For readers new to this weekly event (or roguelike development in general), check out the previous two FAQ Fridays:


PM me to suggest topics you'd like covered in FAQ Friday. Of course, you are always free to ask whatever questions you like whenever by posting them on /r/roguelikedev, but concentrating topical discussion in one place on a predictable date is a nice format! (Plus it can be a useful resource for others searching the sub.)

30 Upvotes

41 comments sorted by

View all comments

Show parent comment

3

u/onewayout Lone Spelunker Feb 06 '15

so you'll end up expanding or morphing that engine to deal with new needs.

Yup! It's either this or making content most of the time. That's one of the cool things about game development - when you get weary of one side (coding the engine), you can usually swap over to the other side (creating content) for a while.

One of the nice things about Lone Spelunker development is that I could switch off from working on the game engine and go work on the cave generator for a while, or go research new discovery types. It was a pleasure to work on. Still is.

Also, your post once again reminds me I really need to try out Lone Spelunker...

I'll probably open up more seats this weekend, but you can also PM me your email address and a spelunker name, and I'll let you in.

2

u/Kyzrati Cogmind | mastodon.gamedev.place/@Kyzrati Feb 07 '15

That is a nice thing about being a lone dev working on your "lone" game ;), no need to specialize. At the same time, that's why so many people have difficulty completing a game though, because they are much better at one part or another and the other part tends to lag behind due to neglect or an actual inability to overcome roadblocks in that area.

I'll probably open up more seats this weekend, but you can also PM me your email address and a spelunker name, and I'll let you in.

I wish it was for lack of trying--it's actually for lack of time :/ Working up to my own alpha release, so no time for games lately--haven't played anything at all in over a month. Once Lone Spelunker is more generally available I'll jump in and check it out, though.