/r/gameenginedevs

Photograph via snooOG

This subreddit is all about game engines! Talk about methodologies, projects, or ideas for game engines and software engineering. Feel free to post about the projects you're working on or find interesting.

We now have a Discord server!

https://discord.gg/ux5Dj5U

/r/gameenginedevs

11,105 Subscribers

2

Purpose of executing scripts during build time?

So this is one area in programming I'm still unfamiliar with, but I've recently learned that you can apparently have scripts that get executed during build time. I am curious how relevant this is and what sort of things you can achieve by doing it? Why would I want to run script during the build time? I've tried doing some research and what I could gather from it so far is that you can do do code generation/automation.

2 Comments
2024/11/10
04:37 UTC

8

Progress on my Multiplayer FPS in OpenGL

I just wanted to share some progress on my OpenGL Engine/Renderer/Game I've been working on, a couple weeks ago I was trying to figure if I wanted to make my game a single player FPS against AI or a multiplayer but after having a lot of fun playing STRATAT, I decided to make it multiplayer, heres a video of me and my friend doing a 1v1, The player models are beans right now just because I suck at animations but hopefully ill add proper people in later as well as ragdolls maybe, just wanted to share and get some feed back :)

https://www.youtube.com/watch?v=TNkH7IxkP3c

1 Comment
2024/11/09
23:50 UTC

70

I wrote a game engine that features a robust foliage distribution model with performant lighting, on a modest resource budget.

Hello all,

I am based out of Kigali, Rwanda and wrote an engine that is performant with open-world environments on low-end to modest machines. Being from Africa, me and my team are working to deliver rich African inspired biomes and environments to our game, based in a fantasy world. Here's what we have so far, I'm open to any and all feedback to help bolster my skills.

https://preview.redd.it/j57pkjy85pzd1.png?width=1850&format=png&auto=webp&s=c3ad9b280492f5ac3febfeca5fd9b82631c4a17b

5 Comments
2024/11/08
15:33 UTC

4

Voxel tracing and MSAA

Hi there, I'm working on a voxel graphics engine and I'm doing some research for the rendering. I've already implemented a method that creates triangle faces for all the voxel quads, and while it works well I'm a bit disappointed by the time it takes to recreate the mesh when there are changes to the terrain (i.e. blocks are added or removed). While one option is to speed it up (very doable), I'm also considering other options.

One such option is some voxel tracing algorithm, e.g:

  1. Render a big cube for each terrain chunk.
  2. Input a 3D texture containing the actual voxel data in each chunk.
  3. In the fragment shader, use some DDA tracing method to "raytrace" render the mesh.

This seems neat to me, but I'm worried about problems down the line. One problem in particular being that MSAA probably won't work since I need to write depth values in the fragment shader. If I understood things right, the shader will famously only be invoked once per fragment and set a depth value that will then be used by all the samples, so the result will be incorrect. So on to my questions:

  1. I'm not sure how the problem would manifest - is it a problem to begin with?
  2. Is there a way to get MSAA to work in this setup?

I guess I can just do SSAA but the smooth graphics style really benefits from high-level anti-aliasing that is only affordable through MSAA. I'm also skeptical of post-process methods, both for the work and the resulting quality.

7 Comments
2024/11/07
15:07 UTC

10

OpenGL and Multithread Assets Loading

Hello Everyone,

I was wondering how you guys solved the OpenGL calls problem in a Multithreaded application. I am essentially referring to the problem regarding the various initializations of VAO, VBO, Texture, buffers during the loading of the game that must be executed in the same rendering thread (usually the main one). The problem lies in the fact that the loading can last many seconds, if not minutes, during which the main loop is interrupted and so are the window updates and user interactions. The solutions I have identified for this problem are different: 1-Perform the initializations in small phases to be called at each iteration of the loop via a state machine, although it is a simple solution it does not completely solve the problem, especially when the resources to be loaded individually are very large, for example 4k textures or texturearray 2-Perform the asset file loads in a secondary thread where you can then call the opengl functions via a state machine that runs on the main thread. I have used this solution in my engine. 3-Use the OpenGL functions MakeCurrent and ShareList, personally never tried.

How did you solve it, what do you think?

16 Comments
2024/11/05
10:09 UTC

0

Programming Games as if it were Desmos

Recently, I've taken a liking to the (2d) Desmos Graphing Calculator. It makes math fun for me, with all the functions, and global variables that you can't change, but can plug in to each function as you wish, it feels like programming, but different from the programming that I usually do. And there's so much more to Desmos I just haven't seen.

That's when I got the idea-how cool it would be if I could make a game where the visual editor looks and feels just like Desmos! Immutability, hot reloading, you name it.

Would this be practical or a good idea? If it is, should mutability be allowed? If it isn't, how will it be practical to use? If it is, then how do you enforce that Desmos feel? Don't say, "Best practices". C++ programmers use those, and look how they turn out(no offense), with all those Windows vulnerabilities being due to memory unsafety. And I've already decided to give it a Rust backend that's imperative, but the interface that you actually see and use is declarative, so your code has a sort of balance between elegance and speed. Now, keep in mind that I have a lot of time to think it over: I'm developing a game right now, and the final deadline is June of 2025.

What language should the engine use? How would you even program in it? Game devs sometimes have to write long functions. It might look weird to write long functions with such little space to write functions in general. This is also kind of a "Is FP Game dev a good idea" question. Shockingly, not many people seem to have tried it recently on the internet.

5 Comments
2024/11/05
05:24 UTC

25

new update on my engine 🤭

2 Comments
2024/11/04
17:01 UTC

17

What's the best way to get into C++ game engine dev?

Hello, I need to get really good at C++ for university, i was thinking of learning the lunguage while making a game engine, something i always wanted to do. I was thinking 2D for now.

Question is, where do i start? I've seen people using Vulkan for the whole thing with no libraries but other than that im not too sure what my options are.

17 Comments
2024/11/02
17:17 UTC

2

Does there need to be a game executable for the engine?

I'm testing out a new project structure that has the engine as a library and the editor as an executable (this seems to be the typical approach for a game engine) the confusion I'm having with this though is say I finished a game in my editor how would I export it so that I can distribute the game? I haven't been able to find many topics about this, but from what I've gathered so far it seems like I would want to have some sort of game executable which is responsible for just loading assets and scenes that would've been exported from the editor. If this is correct would this game executable be manually created by me or dynamically generated by the editor?

10 Comments
2024/11/01
23:37 UTC

0

Trying to find a dev for my SN fanapp-

Note: SN means sketch nation

Heres the link to my forum: https://sketchfans.flarum.cloud We want to launch an sketch nation fanapp named: "sketch nation: new start". It will feature new genres, a coin and monetizarion sistem, ads to support the devs, and so much more.

3 Comments
2024/11/01
15:16 UTC

8

In need of simple Universal scene descriptor files in ascii format

My engine is in c++, I'm parsing USD files to make meshes, the pixar test kitchen is too simple as it doesn't have materials or textures, but every other sample I find is way way too advanced, usually multiple gigabytes, often in binary format. trying to not make my fledgling USD loader explode in ways I'm not ready to fix yet.

13 Comments
2024/10/30
22:58 UTC

0

Laberinto

Quiero crear un laberinto 3D, utilizando java, Como lo podria hacer

2 Comments
2024/10/29
20:48 UTC

14

First devlog for my engine project

Built in rust, using wgpu. Started out as an engine, but has morphed into a design tool. Thought I’d share what I’ve implemented so far

https://youtu.be/IOSkuQjMMCI?si=GiMbzjaChCbMVTyQ

3 Comments
2024/10/29
20:31 UTC

23

Separating the engine from the game code with preprocessor or static/dynamic library?

So it seems like as you develop your game you also create the tools which eventually become your engine, but the part I don’t understand is when it comes time to distribute or demoing you probably want just the game and not all the extra engine tooling stuff right? So is this engine code with the rest of the games code (in the same executable) and maybe you use the preprocessor or would it be a static/dynamic library? Or is there other methods?

Edit: I also want to ask how does this apply if you were to make a generic game engine lthat you intend to make multiple games with I’m assuming there would be no game code and you essentially have the reverse where the game would be the library either that or like the engine just loads some project files containing all the games assets games

21 Comments
2024/10/29
15:16 UTC

0

Do o3de have a particle system yet

I heard o3de in the latest update got a particle system and I wasn't able to find the component of particle emitter. Do I have to enable a stupid kind of gem for that or o3de just can't make particles not?

11 Comments
2024/10/28
21:02 UTC

51

Trying to build a game in my own engine (C++/OpenGL/GLSL)

24 Comments
2024/10/28
17:06 UTC

57

How is a game engine editor created?

I mean, I know how the UI is created, but what about the "preview" of the compiled game?

Giving a little context: I recently started coding my first 2d game engine in C language. It's quite simple(no physics simulation, advanced rendering or any other silly things like these) because of my inexperience, but I'd love if it had an editor where I could develop and code the game more easily.

I am very confused about how this connection between the game code and the editor code happens, like: do I need to code the engine editor in the same language used to code the game? I don't think C would a good choice for UI, maybe a python or something like this. And: would I have to use the same rendering libraries I use to render the game to render the "game preview" in the editor? And how will the game know the settings set in the editor? Would I need to use an external configuration file, for example .json?

Sum's up: my confusion is about how this "game preview" is coded.

Since now, sorry if its a stupid question and thanks in advance.

40 Comments
2024/10/27
17:55 UTC

4

Matrix confusion

I'm used to working in opengl and am trying to learn direct x. From what I understand they use different conventions for their matrices but have opposite conventions for laying them out in memory which kind of cancels this out so they should be laid out in memory the same. The only problem is this isn't lining up in my directx code for some reason.

My square gets moved over 1 unit in the x direction when I write my matrix like this:

```

    float matrix[4][4] = 
    {
        1.0f, 0.0, 0.0f, 1.0f,
        0.0f, 1.0f, 0.0f, 0.0f,
        0.0f, 0.0f, 1.0f, 0.0f,
        0.0f, 0.0f, 0.0f, 1.0f
    };

```

Here is the hlsl code that actually multiplies the vertex point by the matrix

```

output.position_clip = mul(float4(input.position_local, 1.0), model);

```

This is not expected at all. Shouldn't the translation part of the matrix be at position [3][0]?

When I write it like how I though it should go, the square gets all messed up.

Does anybody have anything to clarify what is going on here? If you need code I can give that but the buffer is getting sent to the gpu correctly so that isn't the problem, I just need some clarifications on the memory layout.

Thanks!

10 Comments
2024/10/27
00:08 UTC

2

Layerd 2d engine opinions

Ok, so i am thinking of building a layered 2d engine for a game i have in mind, basically a 2d engine with n layers stacked for the 3rd dimension. I am not yet sure if this is a good idea and i think there are many problems coming with this approach instead of simply making a 3d engine, i guess pathfinding will be a pita. What are some thoughts on this idea? Has anybody done this before and has some hints at what problems may come up? The idea is to build an Oxygen not included like game but with a top down view and tile manipulation in 3 dimensions.

4 Comments
2024/10/24
09:26 UTC

1

Vulkan not suitable for PC gaming?

The 3D framework The Forge claims that Vulkan is not suitable for PC (READ Windows) gaming anymore. What is the basis of this claim? Why would Vulkan not be suitable?

20 Comments
2024/10/24
08:38 UTC

43

Books, videos and all content to learn and get better at game engine dev

New here, im a web dev, used to c# and java, and almost graduating in information systems, so im a junior but kind of really familiar with dev, algorithms, data structures and all and im thinking of buying the course in pikuma about c++ game engine 2d and 3d graphics that's available in his site, but is there other content (free if possible) available to learn all about game engine dev and c++ ?

33 Comments
2024/10/22
15:48 UTC

2

For a portfolio, how low level should a game engine go?

8 Comments
2024/10/21
06:36 UTC

16

Gudiance on implementing serialization?

I have a goal to try and make my assets persistent so that I don't have to load them every time I run my engine and it seems like the way to achieve this is through serialization(?) which AFAIK is basically putting data about an object into some readable format like a json that can be read from later to reconstruct (deserialize), but I've never actually implemented this so I'm not sure how to go about it haha. Any guidance to even just get a rough idea where to start would be appreciated. Not sure if this is related at all, but recently tried doing type reflection which is pretty scuffed to say the least, but it seems to work and seems like it could help out here?

10 Comments
2024/10/21
03:14 UTC

8

A* Pathfinding Agents Get Stuck to Walls When Turning Around Them

https://preview.redd.it/x5bxvxry10wd1.png?width=556&format=png&auto=webp&s=01a8c1680c61e158a717f0a7d6d2cc9688e11b1e

In this photo, the large man generates a path correctly to the blue haired small man. However, the former is stuck on the wall edge (Cyan tiles are walls here). Using weights and distributing my path would be a nice idea so its not so close to the walls and looks more natural, but for now I need help with having the big guy not get stuck to walls.

Currently, all entities are dynamic and the red cylinder is their collider and the walls (cyan tiles) are static. I am using A Star for pathfinding and box2d for physics.

I thought of three solutions

  1. Mark the tiles adjascent to walls as "unwalkable". This will work for some cases. But its ulitmately a bad idea because if I push him towards that tile, then he is in an "unwalkable" tile and can never pathfind out of it.

  2. A better idea is probably to add some offset, the size of the collider, depending on the corner I am turning around. This will likely fix this problem.

  3. Another idea is to mark npcs as "kinematic". That way collisions won't be registered against the tiles which are static. And since the pathfinder accounts for walls anyways, it will only glaze the walls.

The second one is among the better ideas I think, but I will have to account for 8 cases.

One for each corner, and twice that to cover clockwise and anticlockwise directions

Does anyone have better ideas?

I can explain more if I have been unclear.

Thanks.

4 Comments
2024/10/21
00:19 UTC

0

Engine

I’ve been working on my own 2D game engine called Logic, and it’s designed to make game development faster and easier using Python. You don’t need to install Go anymore, as the engine is now fully written in Python, simplifying the setup even more.

I’ve created a basic API to get started quickly with game development, but I’m looking for help with the following:

  • Optimizing the engine’s performance
  • Adding new features (physics, animation, multiplayer, etc.)
  • Testing and improving the API
  • Helping with documentation and examples

If you’re interested in game development, Python, or just want to contribute to a fun project, I’d love your help! I’m open to suggestions and constructive feedback. If you’ve worked on similar engines or just enjoy tinkering with game dev tech, please feel free to jump in.

GitHub repository: https://github.com/platonpavluk/logic

Thanks in advance to anyone who responds!

12 Comments
2024/10/20
16:23 UTC

6

Graphics api’s for macOS users?

Currently i can only program on macOS. What are my options? I like openGL but it is depreciated, and Metal is not really a good career option? Or I might be wrong?

23 Comments
2024/10/20
09:58 UTC

15

How would I go about structuring a game engine written with Vulkan?

Hello! I have some experience in the field as I have already written a basic engine with OpenGL but when I tried to do the same with Vulkan I regrettably found out I can't structure it the same way as things are way more interconnected than I thought. For example when do I reuse descriptor sets and pipelines, how do I ensure the efficient recording of command buffers for drawing and just generally loading in resources when needed, are way more complicated than in OpenGL so I am wondering if you have any tips how should I approach this and ensure things are scalable, but still relatively simple for the end user.

6 Comments
2024/10/19
11:30 UTC

28

Looking for suggestions on learning Game Engine development

I am transitioning from developing games to developing game engines. I am more invested and passionate in making my own game engine rather than developing/making games.

It first started when I was watching TheCherno's C++ series to improve my C++ skills on a lower level. I liked Cherno's series because he also teaches how C++ works on a lower level.

That is when I stumbled across his Game Engine series and I was hooked. Started to follow the series but along the way, he mostly wrapped third party libraries in his classes. I lost motivation to continue the series and felt like his channel became more of a commercial thing and devlog thing.

I want to explore other series. Upon scrolling this thread, the top three suggestions was Handmade Hero, Kohi, and The Game Engine Programming Series(The one that uses D3D12).

Can Anyone here suggest on what order should I learn them? Or what series to watch? Or pros and cons of watching each? Or any useful information that I didn't ask yet. I want a complete series where by the end of the series, I am able to create and export simple games like Flappy Bird or simple 3D twin stick shooter game using the engine I built.

Any suggestion and information will help. Thanks in advance!!!

21 Comments
2024/10/18
18:30 UTC

4

Hello-Triangle!!!

0 Comments
2024/10/17
05:30 UTC

Back To Top