this post was submitted on 20 Jul 2023
11 points (100.0% liked)

Game Development

3485 readers
66 users here now

Welcome to the game development community! This is a place to talk about and post anything related to the field of game development.

Community Wiki

founded 1 year ago
MODERATORS
 

For some time I've been trying to create some rudimentary hack'n'slash game. I didn't want to use ready game engine because I consider it more of an exercise in programming a game than an honest attempt at creating one if that makes sense. So I started with SFML.
Along the way I've recognized the need for loading settings from files(Json library), logging, map editor(ImGUI) etc and it's posing a questions to me for which I struggle to find answers to.

For example let's consider map editor. Currently loading/saving the map to file is done by TileMap class itself but I don't know if it should be. If the map is not as big as render window, should it itself be responsible for centering it or class/function using it should do it? What about scrolling map bigger than render window?

Another example is I have Entity class (player, monster can be entity) which can have Graphics, Physics component etc and it is responsible for rendering itself. But I don't know if it's the right approach. I would like to have logic separate from drawing but Entity essentially merges the two with some extra steps

Add to that is that I would like to painlessly inject debug enabled logging into different parts of this code and I'm afraid I will end up with spaghetti monster for code

What this long windup is leading to is a question. How do I write render independent, reusable game architecture? Where can I read more about this so I can make better decision about what I'm creating.

Now that I've read all of this before submitting it seems to me like what I'm really asking is "how do I make a game engine?". And this was not supposed to be exercise in creating one, at least I didn't think so when I started

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here