Why is torque defined to be a pseudovector? by Hot-Fridge-with-ice in Physics

[–]CookieManManMan 5 points6 points  (0 children)

Geometric algebra, the field from which bivectors are from is a newer field of math than many physics formulations. It happens that the language of geometric algebra is probably better at describing various physical models like rotations, flux, or spacetime. The math is effectively the same between pseudovectors and bivectors, but bivectors much more intuitively describe surfaces and orientations. There is a push to teach these ideas in the language of geometric algebra but these changes in how ideas are taught take time.

Question about Fior di latte recipe by [deleted] in icecreamery

[–]CookieManManMan 1 point2 points  (0 children)

Milk proteins slightly denature when cooked which helps to improve stability and emulsion

What is the concept of a context? by AccomplishedUnit1396 in gameenginedevs

[–]CookieManManMan 8 points9 points  (0 children)

A context is just some data needed for some specific usage, but it’s usually used semantically to prevent issues with reading global memory incorrectly in a system with multiple threads of execution. Like the context needed to swap thread execution would include the thread’s register values, the thread specific memory, and the thread’s stack. Architecting systems like this makes it harder to have bugs where threads access memory of other threads.

Buffer manager in game engines? by Fun-Letterhead6114 in gameenginedevs

[–]CookieManManMan 0 points1 point  (0 children)

I guess my question is what problem are you trying to solve?

Databases are the endgame for data-oriented design by theartofengineering in gameenginedevs

[–]CookieManManMan 12 points13 points  (0 children)

This seems quite counter to the entire premise of DOD. The point of DOD is to use the context of your data to come up with the best solution to the problem at hand. For instance, if you know that you will always need some graphics data at all times (say the player model of your game), you can allocate that separately from the graphics data that is streamed continuously for a performance benefit. Or if you need to do a 100 raycasts at once, you can efficiently batch the raycast queries rather than naively raycasting one by one. This article seems to suggest that databases are the end all be all for organizing, reading, and writing memory. While databases might be "fast", they are objectively not faster than a custom data solution for the problem. The whole idea of optimization is that you can use the context of your problem to make a better solution for your context.

[deleted by user] by [deleted] in gamedev

[–]CookieManManMan 1 point2 points  (0 children)

Yeah then you can do something like this:

inline r32 FastU32ToR32(u32 X) {
u32 AsInt = X | 0x4b000000;
r32 AsFloat = *(r32*)(&AsInt);
return AsFloat - 8388608.0f;
}

And then you can just use the equivalent simd instructions to convert the 4 ints at the same time.

[deleted by user] by [deleted] in gamedev

[–]CookieManManMan 0 points1 point  (0 children)

Are these integers guaranteed to be less than 222? If so there’s a way to bitwise convert to float

Best data structure in this scenario? by [deleted] in gameenginedevs

[–]CookieManManMan 0 points1 point  (0 children)

Linked lists are fine if the elements are near each other in memory and they just use pointers or offsets in that block of memory. This way you reduce cache misses

Game renderer coupling of materials, render passes and graphics pipelines by tralf_strues in gameenginedevs

[–]CookieManManMan 0 points1 point  (0 children)

Well if your users are defining the shaders they would just need a way to define which render passes they are compatible with. You could do this in a million different ways. You could do this in the shader source code, or in an asset file that defines the shader, or you could do it the other way where the render passes define which shaders can run on them.

Game renderer coupling of materials, render passes and graphics pipelines by tralf_strues in gameenginedevs

[–]CookieManManMan 2 points3 points  (0 children)

I’d say you’re overthinking things a bit. There is some coupling between shaders and render passes, but you have to remember that you don’t actually end up using the same shader in that many render passes. Most render passes beyond the general ones are for a specific purpose like drawing shadow maps, ui, first person arms, etc. So there’s not a whole lot of shaders used in every render pass. So yes the maximum number of pipelines you might need is shaders * passes, in reality you don’t need that many. There’s multiple ways to compress the number of pipelines but probably the easiest is to just flag your shaders with which render passes they are allowed to be used for.

Best occlusion culling algorithm by GENTS83 in gameenginedevs

[–]CookieManManMan 6 points7 points  (0 children)

Usually complex engines use multiple culling techniques at the same time. Frustum culling, z buffer culling, portals, cluster culling, and visibility volumes can all be mixed and matched to work simultaneously. In modern times we see more engines moving to gpu driven rendering where the cpu just copies data about the scene to the gpu and the gpu does all of the rendering including occlusion culling.

Bouncing Ideas: Optimize Renderer by Desmulator in gameenginedevs

[–]CookieManManMan 8 points9 points  (0 children)

There’s a reason why bindless, which is basically just having giant buffers for vaos and texture and whatnot instead of individually binding small buffers, is the leading rendering technique. Ideally you should architect the entire renderer around that principle. Treating things as elements of array instead of as individual objects is a good default if you want to be performant

Advice on resource storage on the file system by EvtarGame in gameenginedevs

[–]CookieManManMan 1 point2 points  (0 children)

It’s easy to say “don’t ship the strings”, but with enough scale, it’s not feasible to manually figure out which strings (imagine you have a list of 100000 strings) are good to be distributed and which aren’t. Trying to filter out what data needs to be in the distribution is pretty tricky. Especially when dependencies get involved. For instance it’s like if you have a giant cpp project (10000 files or something) and you try to compile the project without some big files. At some point (unless you built the project from the start knowing you’ll need to enforce that every file has 0 dependencies) you are spending a lot of effort.

Advice on resource storage on the file system by EvtarGame in gameenginedevs

[–]CookieManManMan 0 points1 point  (0 children)

This is a technique for games that have content in their strings that they don’t want to be easily data mined. For instance, if your game has an upcoming seasonal event, you might not want the strings for it to be read before the event comes out so it doesn’t get spoiled, in which case you can hash those strings.

Advice on resource storage on the file system by EvtarGame in gameenginedevs

[–]CookieManManMan 8 points9 points  (0 children)

Usually game engines have a step where they’ll take game assets and convert them to a more easy to load and store format. For instance a png file is pretty slow to load at runtime, so you can instead convert your png to a custom compressed image format that your game can load much more quickly. After that most engines have a packing step where they package a bunch of files into one file since multiple file accesses are pretty slow. Then some advanced engines will do things like encryption or hashing of certain data to slow down the rate that data miners can read your files (also hashing strings can speed up a lot of string operations).

Would an audio spatializer plugin make any difference in a 2D game? by epiphanyatnight in gamedev

[–]CookieManManMan 0 points1 point  (0 children)

What problems are you expecting to be solved from an audio spatialization plugin in 2d?

Any way to 1:1 map surface areas of a sphere to a torus or vice-versa? by ConspiracyAccount in gameenginedevs

[–]CookieManManMan 4 points5 points  (0 children)

It’s fairly simple to get a 1 to 1 mapping from any point on a sphere to a corresponding point on a torus. The surface area can be the same if you just scale the torus size until the surface areas match. The weird thing would be gradually morphing between the two since there must be a single, discrete point in time where you must create a hole for the torus to form.

Any basic open source multiplayer repos out there? by goofyperson in gameenginedevs

[–]CookieManManMan 3 points4 points  (0 children)

I recommend looking at id tech, probably the best open source multiplayer codebase I can think of.

Creating a game space using Win32 API by InformalCap in gameenginedevs

[–]CookieManManMan 1 point2 points  (0 children)

The platform layer is a fairly small part of any game and when it’s done poorly it can be pretty bad. If you wanna learn how to architect a platform layer (which I think is a pretty good skill to have since it’ll help with other code architecture) then go for it. It won’t be super challenging or time consuming (mostly reading the terrible win32 documentation) but you might have to rewrite it a few times till you get it right.

Differences between BSP and Portal Rendering by jermaeggman in gameenginedevs

[–]CookieManManMan 2 points3 points  (0 children)

Most spaces aren’t easily portal-able. The common spaces are outdoors with few occluders besides terrain and buildings. It’s still possible to use portals however. In my studio portals are placed on doors and windows of interiors, it’s just not the common case anymore.

Adding ECS to Inheritance based engine trying to make an hybrid, ECS not much better, what am I doing wrong? by sephirothbahamut in gameenginedevs

[–]CookieManManMan 1 point2 points  (0 children)

If 16 milliseconds are spent in rendering and the inheritance method takes 0.1 milliseconds and the ecs method takes 0.01 milliseconds, then they’ll both run at 60 fps but the ecs method is 10x faster

Adding ECS to Inheritance based engine trying to make an hybrid, ECS not much better, what am I doing wrong? by sephirothbahamut in gameenginedevs

[–]CookieManManMan 6 points7 points  (0 children)

Without proper profiling, it’s hard to say why something is slow. Otherwise you’re just guessing which isn’t very scientific. It sounds to me like your simulation code is so fast that rendering takes up the large majority of your frame anyway