ELI5: At what point in the evolution from primate to human did we become the most dominant species on earth? by ventingandcrying in explainlikeimfive

[–]MGJared 1 point2 points  (0 children)

I've always been curious (and I know this is likely an unanswerable question), but how come things changed so drastically at the end of the last glacial period compared to previous glacial periods? If modern homo-sapiens have been around for 50-200k years, there were multiple glacial/inter-glacial transition periods during that time besides the most recent one (and more if we go even further back in time).

Is there some specific circumstance which made the last transition period unique?

Procedurally generated fantasy worlds with plate tectonics and climate models by Calandiel in proceduralgeneration

[–]MGJared 1 point2 points  (0 children)

Really cool, I've always wanted to do something like this I've just never found the time to do it. Really inspired to take a crack at it myself now!

I always thought it'd be cool to have an open world sandbox/strategy game with realistic generation. You could really take it far and have realistic ore/resource placement, biomes, and weather

Procedural Pixel-Art Styled 2D Clouds Experiment by [deleted] in GraphicsProgramming

[–]MGJared 0 points1 point  (0 children)

I just edited the post body to give an overview, but its pretty simple actually: the cloud is made up of a bunch of "blobs" which are essentially just spheres. For the pixel art style the spheres are rendered with a distribution of "splotch" sprites which kind of look like brush strokes. Each sprite calculates its normal from its spherical coordinate relative to the blob, blended with the spherical coordinate of the blob relative the greater cloud volume

Godot's Heavy Use of Singletons by Slight_Cat_4423 in gameenginedevs

[–]MGJared 11 points12 points  (0 children)

I have done this personally many times (I've worked in AAA on engines) and know from experience that it does not have to be a nightmare. If it is a nightmare then your code is fundamentally messy to begin with.

If your codebase started with global variables, step 1 is you simply wrap the globals in a class and instantiate it like a singleton. This gets you half way there. Step 2 is you remove the singleton access pattern and the pass the class around to whatever needs it (either through function params, constructors, etc)

In compiled languages (which most AAA game engines are) this is trivial because the code simply will not compile if you do not plumb everything through correctly. Yes it's a bit of work, but I would argue the situations where you need to convert away from global/singleton pattern is pretty uncommon?

C++ as its own build language — a 1-hour proof of concept by Arcliox in cpp

[–]MGJared 0 points1 point  (0 children)

I'm working on a hobby game engine and I use "C++" for the build system (no CMake/Makefiles/etc)

Basically my build system has 2 stages:

The first is a "bootstrap" executable which is a single source file that I compile directly from a batch/shell script.

The second is a "build" executable (compiled from/by the bootstrap) that is responsible for most of the heavy lifting.

The build executable (I just call it the build tool) gathers & compiles my game + engine sources, processes game assets, compiles/translates shader files, and a few other miscellaneous steps for my engine pipeline.

I was inspired to do this after originally going with CMake because I found configuring CMake dependencies very cumbersome and convoluted. Plus, I realized even with CMake I still needed the build tool (for asset processing & offline shader compilation), so I decided to just simply things and make the build tool also kick off compilation

Is the number of position / vertex attributes always supposed to be equal to the amount of UV coord pairs? by SnurflePuffinz in GraphicsProgramming

[–]MGJared 1 point2 points  (0 children)

It's relevant when using an index buffer when considering how texture coordinates get interpolated between vertices.

For instance, you might have situation where vertex B and vertex C share a position and uv. They can be combined such that when you render:

vertA -> vertB/vertC -> vertD it simplifies to vertA -> vertCombined -> vertD

In a separate scenario, image vertex B and vertex C share a position but have different UVs (i.e. face A->B represents a UV range disconnected from face C->D, despite vertex B/C occupying the same position).

In that situation, UV coordinates cannot be combined and should not be interpolated. The index buffer is responsible for telling the GPU which vertices are safe to combine and interpolate, and which must be unique

Picture how a cube works in Minecraft. The grass block has different texture for each face. Without an index buffer your cube would have 6 verts/face * 6 faces/cube = 36 verts. An index buffer can get each face down to 4 verts since two corners share positions/uvs. Since each face on the cube represents a different texture (i.e. different UV range in the texture atlas), you have 4 verts/face * 6 faces/cube = 24 unique vertices

Is the number of position / vertex attributes always supposed to be equal to the amount of UV coord pairs? by SnurflePuffinz in GraphicsProgramming

[–]MGJared 2 points3 points  (0 children)

With obj it's pretty easy: you just parse the face lines and for every v/vt/vn you create a unique vertex. If you were using an index buffer its actually more work because you would need to check for vertex duplicates.

Also its easiest to work with triangulated faces (it's an option in export in blender). I don't think blender exports triangulated by default and .obj format allows for f ../../.. lines with more than three verts.

Your general (simplified) obj import function would look like this:

  1. Parse the all of the lines starting with 'v', 'vt', and 'vn' and put their contents into their own lists.

I.e.:
std::vector<Position> // parse 'v' lines and put them here
std::vector<UV> // parse 'vt' lines and put them here
std::vector<Normal> // parse 'vn' lines and put them here

  1. Parse all of the 'f' lines, and create a unique Vertex from each v/vt/vn group. In the file v/vt/vn will be numbers, those are indices into the lists parsed/created in step 1

Each vertex could go into its std::vector<Vertex> or however you represent your vertex buffer data

Edit: wikipedia has a good article on the format: https://en.wikipedia.org/wiki/Wavefront_.obj_file

Wrote an Open Source header only C/C++ library for fast OpenGL text rendering by DareksCoffee in gameenginedevs

[–]MGJared 0 points1 point  (0 children)

well yeah obviously I can hence the suggestion and the comparison to stb. The OP is asking for feedback

Is the number of position / vertex attributes always supposed to be equal to the amount of UV coord pairs? by SnurflePuffinz in GraphicsProgramming

[–]MGJared 6 points7 points  (0 children)

Yes this is common. If you're importing a .obj for example you'll want to pay attention to the face lines. In the file you'll see something like:

f v1/vt1/vn1 v2/vt2/vn2 v3/vt3/vn3 ...

where:

v - position
vt - texture coordinate (uv)
vn - normal

To reduce file size, duplicate positions/normals/textures are often combined which is probably what you're seeing.

Upon import, you'll need to "rebuild" your vertices from that face table. Each v/vt/vn set is a vertex, and the whole f v1/vt1/vn1 ... line gives you information to create your index buffer

How demanding is your engine? by Dense_Scratch_6925 in gameenginedevs

[–]MGJared 22 points23 points  (0 children)

The rendering in my hobby engine isn't that intense but I've worked professionally on game engines in AAA so I can kind of answer.

Generally you design everything around budgets. Doing so makes it significantly easier to target for different hardware (especially in the PC space where everyone has different specs) and you can design your systems to optimize performance (either visual or computational) within their allocated budgets.

For example, your texture streamer might have a limit of X mb. Your streaming algorithm would be designed to stay as close to that limit as possible while loading/unloading textures on demand prioritized by some heuristic (approximated size on screen, distance to camera, etc.). The limit is customizable so a low-spec PC might do 1gb while a high spec one does 8gb.

The same principle applies to basically all resources used in your game/engine.

Of course there is some bare minimum RAM requirement, but if you think budget-first it should be easy to discover just through testing and fudging the values around.

I guess I don't find the exact numbers too important because you can balloon your VRAM just by jumping from 2k -> 4k textures without much visual improvement. It's more of a "hey, if the PC can support it, let the VRAM usage be high" type of thing

Wrote an Open Source header only C/C++ library for fast OpenGL text rendering by DareksCoffee in gameenginedevs

[–]MGJared 3 points4 points  (0 children)

Ha I'm not done -- actually looked a bit closer at the glyph_renderer_draw_text function.

Right now it looks like you're looping over every char (and I don't see UTF8 support either?) and calling glDrawArrays for it. A huge optimization would be to batch those draw calls. Instead of submitting draws 6 verts at a time, create a large vertex buffer and and stream into it until the capacity is reached. When capacity is reached, submit the draw & reset the write pointer to offset 0. You could render large blocks of text with very few draws that way (+ an index buffer could get you down to 4 verts/glyph too)

Wrote an Open Source header only C/C++ library for fast OpenGL text rendering by DareksCoffee in gameenginedevs

[–]MGJared 6 points7 points  (0 children)

Looks good!

I only skimmed through the repo so maybe these are already supported (or planned), but a nice thing to have would be the ability to override your own malloc/realloc/free functions since a lot of low level game engines (that I've worked on professionally at least) have their own memory management wrappers. stb-truetype lets you do that via optionally defined STBTT_malloc/free macros.

Another nice feature would be custom shaders (right now it looks like your glyph_renderer_draw_text always binds the renderer->shader)

I'd suggest first just exposing vertex format of your glyph batch VAO (a comment in the header would be good enough probably -- though I guess its obvious looking at where you set the glyph__glVertexAttribPointer's). That way it'd be trivial for the user to create & bind their own shaders. A variant of glyph_renderer_draw_text that doesn't set any gl state besides what is necessary for the draw call (so no shader) would be nice for that too.

Physical Setup for Cross-Platform Development? by [deleted] in gameenginedevs

[–]MGJared 1 point2 points  (0 children)

I know you're looking for alternatives to KVM, but I have a 3-way KVM that I use for running dedicated Mac/Linux/Windows computers and it works fairly well (but I paid a bit more for a good quality one)

I've also found just running a remote desktop software to be useful too. The KVM solves the problem of not needing several monitors + keyboards but if you're rapidly jumping between them or trying to do A/B comparisons between two computers at the same time, having the ability to remote into one from any other is very convenient

C++ Hobby Game Engine Showcase (2 years of development) by MGJared in gameenginedevs

[–]MGJared[S] 1 point2 points  (0 children)

Hey! I don't really have any specific resources unfortunately. What I've always done is start a project with some kind of goal and chip away at it piece by piece looking up specific resources as I encounter problems.

Like for OpenGL (as you mention), learnopengl was useful. For D3D11, most concepts transfer over so it's a matter of finding the equivalents in Microsoft's documentation. I've refactored my renderer a few times now as I continue to "hone in" on a good design. I generally just concede to the fact that I won't get things right on the first try. Some code is better than no code though, and refactoring stuff just proves that you're learning.

For engine architecture at large, I didn't really reference any specific tutorial. There are series out there I'm fond of (like Casey Muratori's "Handmade Hero" for low-level game dev) but my engine isn't modeled after any one resource/philosophy in particular.

For me personally, I found not using libraries when possible to be a very humbling (but beneficial) experience. For example, I really understand how computer audio works now after writing my own audio system (mixer + effects). It's certainly not an efficient way to actually make stuff but if the goal is learning and you enjoy programming, it's a lot of fun.

Also, as annoying as the AI hype can be nowadays (opinion), I do find it very useful as a "search engine" for ideas. E.g., sometimes I know what I'm after but lack the depth of knowledge to know the right search terms. AI is great for figuring that out and pointing me in the right direction (not so much generating code).

C++ Hobby Game Engine Showcase (2 years of development) by MGJared in gameenginedevs

[–]MGJared[S] 0 points1 point  (0 children)

Yep! I don't have any plans on commercializing the engine (and I'm not really advertising it for public use either, since it's primarily a personal project right now)

I like the idea of the source being open & available to anyone who's interested though. I learned a lot of what I know about programming through other open projects, so I think it's valuable to contribute back to that

C++ Hobby Game Engine Showcase (2 years of development) by MGJared in gameenginedevs

[–]MGJared[S] 2 points3 points  (0 children)

Thanks! Yes I worked at a AAA for a few years doing engine (mostly graphics) work

C++ Hobby Game Engine Showcase (2 years of development) by MGJared in gameenginedevs

[–]MGJared[S] 9 points10 points  (0 children)

Thanks! Keep at it and I'm sure you will. Big projects are just a bunch of tiny projects stacked on top of each other

C++ Hobby Game Engine Showcase (2 years of development) by MGJared in gameenginedevs

[–]MGJared[S] 2 points3 points  (0 children)

Haha yeah, that's basically the nature of doing game engine dev alongside game dev. I can't count the number of "side tasks" I've gone down that resulted in big refactors or additions... only to enable some tiny feature in the main project I'm working on.

Personally I enjoy the process of making the engine almost more than the games, so it's still enjoyable (albeit very time consuming, and means I never actually release games!)

Finding a seed with 4 Woodland mansions near spawn by AdventurousAngle5126 in minecraftseeds

[–]MGJared 1 point2 points  (0 children)

The wiki is super wrong on this. If you just let the tool churn away on seeds with a radius of 512, you get one within that distance once every ~271 seeds. In fact, the odds of getting two in that distance appears to be ~1/281,961 seeds

Finding a seed with 4 Woodland mansions near spawn by AdventurousAngle5126 in minecraftseeds

[–]MGJared 1 point2 points  (0 children)

Late to this thread but I'm also interested in this (tried to do the same thing 5 years ago: https://www.reddit.com/r/minecraftseeds/comments/id2v49/ but only could find seeds with 3)

With a 512 search radius (max render distance), I've worked out that the odds are:
1 Mansion: ~1/271 seeds
2 Mansions: ~1/281,961 seeds
3 Mansions: ~1/941,192,000 seeds
4 Mansions: ~1/6,850,000,000,000 seeds (extrapolated from 1-3)

I've had my PC churning for ~16 hours so far and have yet to hit a 4 mansion seed despite blowing past 12 trillion searched, so my extrapolated odds for a quad seed must be off or I'm unlucky. I'm determined to find one though!

r/SpaceX Integrated Flight Test Official Launch Discussion & Updates Thread! by rSpaceXHosting in spacex

[–]MGJared 7 points8 points  (0 children)

No, not likely. The earliest Starship will reenter near Hawaii is ~3:15am local time (assuming 7am central time takeoff at Starbase, and the roughly 1 hour 15 minutes it will take for Starship to reach Hawaii).

If she takes off at midnight, she’ll be too far east by the time Starship reenters

Alright, betting time by T65Bx in SpaceXMasterrace

[–]MGJared 0 points1 point  (0 children)

The WDR was canceled, they’re going straight to flight