/gedg/ - Game and Engine Development General #240
Frosch !!QxG8tdNNBUC 01/17/25(Fri)09:26:26 | 330 comments | 59 images | 🔒 Locked
The holy book of the Rimjob edition
/gedg/ Wiki: https://igwiki.lyci.de/wiki//gedg/_-_Game_and_Engine_Dev_General
IRC: irc.rizon.net #/g/gedg
Progress Day: https://rentry.org/gedg-jams
/gedg/ Compendium: https://rentry.org/gedg
/agdg/: >>>/vg/agdg
Render bugs: https://renderdoc.org/
Previous: >>103902294
Requesting Help
-Problem Description: Clearly explain your issue, providing context and relevant background information.
-Relevant Code or Content: If applicable, include relevant code, configuration, or content related to your question. Use code tags.
/gedg/ Wiki: https://igwiki.lyci.de/wiki//gedg/_
IRC: irc.rizon.net #/g/gedg
Progress Day: https://rentry.org/gedg-jams
/gedg/ Compendium: https://rentry.org/gedg
/agdg/: >>>/vg/agdg
Render bugs: https://renderdoc.org/
Previous: >>103902294
Requesting Help
-Problem Description: Clearly explain your issue, providing context and relevant background information.
-Relevant Code or Content: If applicable, include relevant code, configuration, or content related to your question. Use code tags.
Frosch !!QxG8tdNNBUC 01/17/25(Fri)09:27:32 No.103929607
>>103928027
>>103927976
>>103928014
>>103928088
>>103928042
atan can be used like this
Notice how this isn't very different than using acos. HOWEVER, acos will only give positive angles. Sometimes this doesn't matter, but I thought I should mention it. I think there are also numerical stability concerns.
You can also make acos more stable numerically by doing something like this
>>103927976
>>103928014
>>103928088
>>103928042
atan can be used like this
atan2(vec_length(vec_cross(a,b)), vec_dot(a,b))
Notice how this isn't very different than using acos. HOWEVER, acos will only give positive angles. Sometimes this doesn't matter, but I thought I should mention it. I think there are also numerical stability concerns.
acos(vec_dot(v1, v2) / (vec_length(v1) * vec_length(v2)))
You can also make acos more stable numerically by doing something like this
acos(vec_dot(v1 / vec_length(v1), v2 / vec_length(v2) ))
= acos(vec_dot(vec_normalize(v1), vec_normalize(v2))
Anonymous 01/17/25(Fri)09:30:39 No.103929640
atan2 is for low-brow animals
Frosch !!QxG8tdNNBUC 01/17/25(Fri)09:30:45 No.103929641
>>103929607
It is also worth noting that many many implementations that I've seen take the acos approach. For example, I doubt I've ever seen a SLERP algorithm that used atan2 over acos.
People seem to vastly prefer vec_dot(v1_unit, v2_unit) = cos(theta) in everything I see.
It is also worth noting that many many implementations that I've seen take the acos approach. For example, I doubt I've ever seen a SLERP algorithm that used atan2 over acos.
People seem to vastly prefer vec_dot(v1_unit, v2_unit) = cos(theta) in everything I see.
Anonymous 01/17/25(Fri)09:34:06 No.103929686
>>103929640
you're just mad because you've never heard of it
you're just mad because you've never heard of it
Anonymous 01/17/25(Fri)09:39:28 No.103929736
Anonymous 01/17/25(Fri)09:39:45 No.103929739
>>103929641
>>103929607
atan2 giving bearing angles are defined from the positive x-axis, going anti-clockwise is "positive" (like in most maths) and conversely going clockwise is negative.
however you do not need to limit yourself to such a convention.
For example you could define your angle operator as angle(a, b) = -angle(b, a)
>>103929607
atan2 giving bearing angles are defined from the positive x-axis, going anti-clockwise is "positive" (like in most maths) and conversely going clockwise is negative.
however you do not need to limit yourself to such a convention.
For example you could define your angle operator as angle(a, b) = -angle(b, a)
Frosch !!QxG8tdNNBUC 01/17/25(Fri)09:46:00 No.103929794
>>103929736
What do you suggest then. You can't normalize a vector without finding its length.
>>103929739
True, its not like atan2 is limiting or anything if you understand how it works. But it does seem widely unnecessary in most scenarios. If you don't care about the orientation of the angle (bearing angle) then there is no point over acos I think. Keep in mind with the atan2 method you are doing an extra operation with the cross product. And I'm assuming (without profiling or any proof so honestly I might be dead wrong here) that in most situations atan2 and acos are comparable in the time it takes the computer to run within an order of magnitude.
What do you suggest then. You can't normalize a vector without finding its length.
>>103929739
True, its not like atan2 is limiting or anything if you understand how it works. But it does seem widely unnecessary in most scenarios. If you don't care about the orientation of the angle (bearing angle) then there is no point over acos I think. Keep in mind with the atan2 method you are doing an extra operation with the cross product. And I'm assuming (without profiling or any proof so honestly I might be dead wrong here) that in most situations atan2 and acos are comparable in the time it takes the computer to run within an order of magnitude.
Anonymous 01/17/25(Fri)09:47:25 No.103929804
Anonymous 01/17/25(Fri)09:48:29 No.103929816
>using atan2 ever
Frosch !!QxG8tdNNBUC 01/17/25(Fri)09:49:20 No.103929826
>>103929804
CAn you show me this method? I'm unfamiliar with it and would like to see it.
>>103929816
Now let's see Paul Allen's acos disassembly.
CAn you show me this method? I'm unfamiliar with it and would like to see it.
>>103929816
Now let's see Paul Allen's acos disassembly.
Anonymous 01/17/25(Fri)09:49:52 No.103929835
>>103929816
the ABSOLUTE state of atan2 niggers
the ABSOLUTE state of atan2 niggers
Anonymous 01/17/25(Fri)09:53:18 No.103929867
What are good resources for learning game development in Java, like the first tutorial that I see on yt uses passive rendering and I don’t like the magic of that. The idea is to learn from scratch
Anonymous 01/17/25(Fri)09:58:48 No.103929919
>>103929826
Not sure I remember how to use code tags.
Like this as seen in angDiffFromVector. The convention is that 0 angle vector is (0, -1).
inline constexpr TYPE getAngle() const {
return std::atan2(y, x) * (180 / M_PI) + 90;
}
constexpr BaseVector2D<TYPE> rotateNegative(const BaseVector2D<TYPE>& v) const {
TYPE cosValue = -v.y;
TYPE sinValue = -v.x;
return BaseVector2D<TYPE>(cosValue * x - sinValue * y, cosValue * y + sinValue * x);
}
constexpr TYPE angDiffFromVector(const BaseVector2D<TYPE>& v) const {
return rotateNegative(v).getAngle();
}
Not sure I remember how to use code tags.
Like this as seen in angDiffFromVector. The convention is that 0 angle vector is (0, -1).
Anonymous 01/17/25(Fri)10:01:53 No.103929944
progress report
finished cpu set pinning
next up is going to be reducing present wait times
finished cpu set pinning
next up is going to be reducing present wait times
Frosch !!QxG8tdNNBUC 01/17/25(Fri)10:02:02 No.103929945
>>103929919
I now understand now what you mean. What you are posting makes sense to me now. I was thinking of something weirdly different.
I now understand now what you mean. What you are posting makes sense to me now. I was thinking of something weirdly different.
Anonymous 01/17/25(Fri)10:05:51 No.103929981
>>103929867
Depends what you mean by "from scratch".
The most popular game framework for Java is LibGDX. It's pretty simple to use.
Depends what you mean by "from scratch".
The most popular game framework for Java is LibGDX. It's pretty simple to use.
Anonymous 01/17/25(Fri)10:28:56 No.103930211
>>103929981
Like without libraries plain old Java apis like awt and swing.
Like without libraries plain old Java apis like awt and swing.
Anonymous 01/17/25(Fri)11:04:29 No.103930543
>>103930211
Are you looking for video or text tutorials?
These seem to use only use awt and swing:
https://youtu.be/6_N8QZ47toY?feature=shared
https://youtu.be/om59cwR7psI?feature=shared
Are you looking for video or text tutorials?
These seem to use only use awt and swing:
https://youtu.be/6_N8QZ47toY?featur
https://youtu.be/om59cwR7psI?featur
Anonymous 01/17/25(Fri)12:22:06 No.103931262
>>103929919
the fuck
the fuck
Anonymous 01/17/25(Fri)12:24:21 No.103931290
>>103930211
A roguelike with your own version of AsciiPanel is brain dead easy then.
A roguelike with your own version of AsciiPanel is brain dead easy then.
Anonymous 01/17/25(Fri)12:26:40 No.103931307
>>103930211
I can share with you a couple of classes you can use to start making a game in java.
I can share with you a couple of classes you can use to start making a game in java.
Anonymous 01/17/25(Fri)12:41:14 No.103931453
>>103929607
>atan2(vec_length(vec_cross(a,b)), vec_dot(a,b)
isn't that more expensive than simply computing arccos of the product?
>atan2(vec_length(vec_cross(a,b)), vec_dot(a,b)
isn't that more expensive than simply computing arccos of the product?
Anonymous 01/17/25(Fri)12:47:08 No.103931521
>>103931307
This should get you going on https://pastebin.com/VcK87dXj study the code and extend it.
This should get you going on https://pastebin.com/VcK87dXj study the code and extend it.
Anonymous 01/17/25(Fri)13:01:28 No.103931672
>>103931453
I just noticed that it's actually the correct solution but you need to remove the vec_length.
I just noticed that it's actually the correct solution but you need to remove the vec_length.
Anonymous 01/17/25(Fri)13:08:09 No.103931728
This seems to work.
const glm::vec3 direction = end - start;
const glm::vec3 normal = glm::normalize(direction);
const glm::vec3 reference(1.0f, 0.0f, 0.0f);
const glm::vec3 axis = glm::normalize(glm::cross(reference, normal));
const float angle = glm::acos(glm::dot(reference, normal));
Anonymous 01/17/25(Fri)13:19:32 No.103931864
>>103931728
>The two-dimensional case is the only non-trivial (i.e. not one-dimensional) case where the rotation matrices group is commutative, so that it does not matter in which order multiple rotations are performed. An alternative convention uses rotating axes,[1] and the above matrices also represent a rotation of the axes clockwise through an angle θ.
i didn't even know this
that's grim
so in 3D the order you apply rotations matter
>The two-dimensional case is the only non-trivial (i.e. not one-dimensional) case where the rotation matrices group is commutative, so that it does not matter in which order multiple rotations are performed. An alternative convention uses rotating axes,[1] and the above matrices also represent a rotation of the axes clockwise through an angle θ.
i didn't even know this
that's grim
so in 3D the order you apply rotations matter
Anonymous 01/17/25(Fri)13:21:56 No.103931897
Are you guys stupid? dot product encodes sin and cross product encodes cos. Stop trying to convert to angles just to plug them back into a trig function
https://iquilezles.org/articles/noacos/
https://iquilezles.org/articles/noa
Anonymous 01/17/25(Fri)13:28:46 No.103931981
>>103931897
the problem was literally determining the angle though, not the sine or the cosine of the angle
the problem was literally determining the angle though, not the sine or the cosine of the angle
Anonymous 01/17/25(Fri)13:35:35 No.103932071
>trigonometry autism and actual programming
I'll take these posts over the usual shitposts, although it's more useful for old/retro machines, there's a GDC talk where a game trig functions were fast on PCs, but actually ended up very slow on consoles, they didn't bother changing it.
I'll take these posts over the usual shitposts, although it's more useful for old/retro machines, there's a GDC talk where a game trig functions were fast on PCs, but actually ended up very slow on consoles, they didn't bother changing it.
Anonymous 01/17/25(Fri)13:37:18 No.103932088
I love refactoring.
Anonymous 01/17/25(Fri)13:38:08 No.103932099
Added a little tile variation.
Frosch !!QxG8tdNNBUC 01/17/25(Fri)13:40:11 No.103932118
>>103931728
>>103931864
>so in 3D the order you apply rotations matter
Yep. Fortunately, rotations in 3D still follow many symmetries. In the matrix representation, for example, they are still orthogonal matrices. In fact all orthogonal matrices represent rotations or reflections depending on the sign of the matrix determinant. When the determinant is +1 you have a rotation (special orthogonal group) and when its -1 you have a reflection.
>>103932071
I am surprised the discussion is still going on. Taking the arcos of the dot product of two unit vectors is a pretty fundamental idea in graphics and computational geometry.
>>103931728
You don't need to calculate the cross-product if you are doing acos anon, axis is unnecessary (unless you are doing something else with axis later in the code).
>>103931864
>so in 3D the order you apply rotations matter
Yep. Fortunately, rotations in 3D still follow many symmetries. In the matrix representation, for example, they are still orthogonal matrices. In fact all orthogonal matrices represent rotations or reflections depending on the sign of the matrix determinant. When the determinant is +1 you have a rotation (special orthogonal group) and when its -1 you have a reflection.
>>103932071
I am surprised the discussion is still going on. Taking the arcos of the dot product of two unit vectors is a pretty fundamental idea in graphics and computational geometry.
>>103931728
You don't need to calculate the cross-product if you are doing acos anon, axis is unnecessary (unless you are doing something else with axis later in the code).
Anonymous 01/17/25(Fri)13:47:43 No.103932193
>>103932099
My two cents
-I think it has too much variation.
-Add variation in hue not light (more yellow or orange).
-It would help if there was not just variation between neighbor tiles but neighbor zones (ill defined amount of tile groups).
My two cents
-I think it has too much variation.
-Add variation in hue not light (more yellow or orange).
-It would help if there was not just variation between neighbor tiles but neighbor zones (ill defined amount of tile groups).
Anonymous 01/17/25(Fri)13:54:22 No.103932276
Can your homegrown engine output graphics that are at least on par with the graphics that you see in Chilla's Art games?
Anonymous 01/17/25(Fri)14:00:25 No.103932349
>>103932276
Not really. Are these translated by the way?
Not really. Are these translated by the way?
Anonymous 01/17/25(Fri)14:04:43 No.103932412
>>103932349
I was thinking about their older games to be fair, they had worse graphics
>are these translated
I think so
I was thinking about their older games to be fair, they had worse graphics
>are these translated
I think so
Anonymous 01/17/25(Fri)14:11:24 No.103932505
>microshart compiler makes atan2 3 times slower for floats
I always used it for doubles so I never noticed.
I always used it for doubles so I never noticed.
Anonymous 01/17/25(Fri)14:12:59 No.103932525
>>103932276
dont think many engines can beat ue5 asset flips in graphics fidelity
dont think many engines can beat ue5 asset flips in graphics fidelity
Anonymous 01/17/25(Fri)14:20:30 No.103932611
Give me ONE reason why you don't use Unreal. You are in dev hell otherwise
Anonymous 01/17/25(Fri)14:23:11 No.103932643
>>103932611
Last time I used it there was little to no documentation for UE C++ APIs
Last time I used it there was little to no documentation for UE C++ APIs
Anonymous 01/17/25(Fri)14:28:19 No.103932693
>>103932193
Thank you. For now, I am just constructing my systems, not really creating a final product. What I am working on is exactly what you are suggesting.
The land will be divided into specific 'regions', each with unique landscaping rules and tile coloring, and there will be more color-mixing options.
And translucent and weaving water.
Thank you. For now, I am just constructing my systems, not really creating a final product. What I am working on is exactly what you are suggesting.
The land will be divided into specific 'regions', each with unique landscaping rules and tile coloring, and there will be more color-mixing options.
And translucent and weaving water.
Anonymous 01/17/25(Fri)14:53:02 No.103932928
>>103931981
Yea and what are you going to use the angle for? Because there's essentially no use for an angle in game programming, you're just going to turn it into a vector again
Yea and what are you going to use the angle for? Because there's essentially no use for an angle in game programming, you're just going to turn it into a vector again
Anonymous 01/17/25(Fri)15:14:08 No.103933158
>>103929599
pozzed or underhandedly based?
pozzed or underhandedly based?
Anonymous 01/17/25(Fri)16:03:04 No.103933679
Fuck it, I'm just installing Unity and making my game there
Anonymous 01/17/25(Fri)16:25:18 No.103933900
>>103933158
You can literally use "it".
You can literally use "it".
Anonymous 01/17/25(Fri)16:27:36 No.103933927
>>103933900
how do you translate "it" to languages that only have gendered pronouns?
how do you translate "it" to languages that only have gendered pronouns?
Anonymous 01/17/25(Fri)16:30:34 No.103933955
Anonymous 01/17/25(Fri)16:59:39 No.103934225
>>103933900
People are not things.
People are not things.
Anonymous 01/17/25(Fri)17:23:16 No.103934483
Anonymous 01/17/25(Fri)17:24:37 No.103934503
sucks to be able to speak only 0.7 languages burgerkeks
Anonymous 01/17/25(Fri)18:10:47 No.103935019
someone posted a link to an article about model outlines a few threads back, can someone post it again?
i cant find it
i cant find it
Anonymous 01/17/25(Fri)18:25:51 No.103935204
Anonymous 01/17/25(Fri)18:42:21 No.103935428
>>103933900
you literally can't.
you literally can't.
Anonymous 01/17/25(Fri)18:52:10 No.103935547
>>103935019
Dunno if it's the one you're thinking of, but I saw this on the orange website recently
https://bgolus.medium.com/the-quest-for-very-wide-outlines-ba82ed442cd9
Dunno if it's the one you're thinking of, but I saw this on the orange website recently
https://bgolus.medium.com/the-quest
Anonymous 01/17/25(Fri)19:07:39 No.103935685
>>103935428
*it* said
*it* said
Anonymous 01/17/25(Fri)19:31:42 No.103935982
>>103932643
Just read the source code.
Just read the source code.
Anonymous 01/17/25(Fri)19:32:11 No.103935991
>>>103880409
PROLOG GAMING PROGRESS UPDATE: I learned how to expose C apis to SWI-Prolog, now I am writing enough bindings so the Raylib hello world example can be built in prolog.
PROLOG GAMING PROGRESS UPDATE: I learned how to expose C apis to SWI-Prolog, now I am writing enough bindings so the Raylib hello world example can be built in prolog.
Anonymous 01/17/25(Fri)19:41:03 No.103936097
Anonymous 01/17/25(Fri)19:43:10 No.103936123
>>103936097
SOVL
SOVL
Anonymous 01/17/25(Fri)19:56:34 No.103936274
I was watching this level design video: https://youtu.be/urTYEBBQbY4 and it got me curious: How would someone without the unreal (unity probably has something similar too) tools, let's say someone developing their own 3D engine, achieve something like that? Would they need to develop all the similar tooling from scratch (well, based of the engine they're making I suppose) or can they mostly skirt around that by using other tools? Like making an entire level on blender or something? I'm genuinely curious, sorry if I sound retarded.
Anonymous 01/17/25(Fri)20:02:08 No.103936326
>>103936274
I think this video gives you a good idea of what it's like to design levels without a prebuilt engine. He's not designing levels but the workflow is very similar https://www.youtube.com/watch?v=rbu7Zu5X1zI
You'll see basically he edits code and then he has a viewer to see what the output looks like, so he can modify code and see its effect quickly by refreshing
I think this video gives you a good idea of what it's like to design levels without a prebuilt engine. He's not designing levels but the workflow is very similar https://www.youtube.com/watch?v=rbu
You'll see basically he edits code and then he has a viewer to see what the output looks like, so he can modify code and see its effect quickly by refreshing
Anonymous 01/17/25(Fri)20:02:31 No.103936332
>>103936274
Tradtionally many gamedevs just made their levels in their 3D modelling program, but in my experience the workflow feels pretty terrible
There aren't really any good generic 3D level editors out there, I made my own for my engine and just making something where you can place, rotate and scale 3D objects isn't that difficult
Tradtionally many gamedevs just made their levels in their 3D modelling program, but in my experience the workflow feels pretty terrible
There aren't really any good generic 3D level editors out there, I made my own for my engine and just making something where you can place, rotate and scale 3D objects isn't that difficult
Anonymous 01/17/25(Fri)20:07:47 No.103936374
>>103936097
looks better than real sonic
looks better than real sonic
Anonymous 01/17/25(Fri)20:14:06 No.103936451
Anonymous 01/18/25(Sat)00:08:48 No.103939062
>>103936097
Reminds me of the good old days.
Reminds me of the good old days.
Anonymous 01/18/25(Sat)00:08:57 No.103939067
What do you guys think of this code?
https://pastebin.com/rq8TSTSd
https://pastebin.com/rq8TSTSd
Anonymous 01/18/25(Sat)00:55:16 No.103939474
- status bar
- something to help visualize the players cardinal direction
- preview on build mode object
- something to help visualize the players cardinal direction
- preview on build mode object
Anonymous 01/18/25(Sat)01:59:03 No.103939887
Anonymous 01/18/25(Sat)03:38:52 No.103940524
>>103939474
That's kind of cute. What are you cooking there, doc?
That's kind of cute. What are you cooking there, doc?
Anonymous 01/18/25(Sat)03:45:30 No.103940559
>>103933158
based. A lot of similar books use 'she' for these exact cases.
based. A lot of similar books use 'she' for these exact cases.
Anonymous 01/18/25(Sat)03:51:33 No.103940611
>>103940524
ygg engine does everything, mostly
ygg engine does everything, mostly
Anonymous 01/18/25(Sat)04:09:00 No.103940693
What game design books can you guys actually personally recommend?
Anonymous 01/18/25(Sat)04:12:58 No.103940711
>>103940693
the only books I recommend are game programming patterns and game engine architecture
the only books I recommend are game programming patterns and game engine architecture
Anonymous 01/18/25(Sat)04:22:49 No.103940759
Day 3
Rendering gun's model onto screen now. Right now it's just a cube but when I install blender i'll make some guns, enemies and bullet particle
Changed lighting and UI a bit and fixed some more framerate issues.
>>103921343
When stamina runs out (below 20) movement speed is slowed and you can't jump
Rendering gun's model onto screen now. Right now it's just a cube but when I install blender i'll make some guns, enemies and bullet particle
Changed lighting and UI a bit and fixed some more framerate issues.
>>103921343
When stamina runs out (below 20) movement speed is slowed and you can't jump
Anonymous 01/18/25(Sat)05:01:21 No.103940992
Anonymous 01/18/25(Sat)05:45:35 No.103941250
Anonymous 01/18/25(Sat)05:49:09 No.103941277
So I have a transform struct with position, rotation and scale members. I noticed that I calculate the model matrix even when the transform hasn't changed which feels wasteful. A solution would be to turn the struct into a class, have a dirty flag member and control the the operations, but I don't know how to feel about this. Any suggestions?
Anonymous 01/18/25(Sat)05:49:22 No.103941278
>>103940992
kek
kek
Anonymous 01/18/25(Sat)05:51:12 No.103941291
>>103941277
That's a standard way to do it
That's a standard way to do it
Anonymous 01/18/25(Sat)06:20:19 No.103941509
C++
GLuint buffer_index;
auto result = buffer_indices.try_emplace(texture_name, buffer_index);
if (!result.second)
return false;
glCreateTextures(GL_TEXTURE_2D, 1, &(*result.first).second); // WTF
Anonymous 01/18/25(Sat)06:25:04 No.103941551
>>103940992
have Sec(x)
have Sec(x)
Anonymous 01/18/25(Sat)06:25:22 No.103941558
Anonymous 01/18/25(Sat)06:26:31 No.103941570
>>103941277
generally no, bool flags are considered one of the worst architecture design anti-patterns for numerous reasons, they are bad for your cache, they are bad for complexity, every additional flag is exponentially more state complexity, other reasons you can google it yourself
generally no, bool flags are considered one of the worst architecture design anti-patterns for numerous reasons, they are bad for your cache, they are bad for complexity, every additional flag is exponentially more state complexity, other reasons you can google it yourself
Anonymous 01/18/25(Sat)06:27:15 No.103941580
>>103932611
If I've got to live with the tech I've got, I'd rather live with tech I created and know how best to use it over someone else's giant fragile clusterfuck.
If I've got to live with the tech I've got, I'd rather live with tech I created and know how best to use it over someone else's giant fragile clusterfuck.
Anonymous 01/18/25(Sat)06:28:52 No.103941591
>>103941570
many game engines do this you idiot, it's faster than calculating it every time
many game engines do this you idiot, it's faster than calculating it every time
Anonymous 01/18/25(Sat)06:30:57 No.103941609
Anonymous 01/18/25(Sat)06:32:40 No.103941624
>>103941509
lemme fix that for you
lemme fix that for you
auto [it, result] = buffer_indices.try_emplace(texture_name, buffer_index);
if(!result)
return false;
glCreateTextures(GL_TEXTURE_2D, 1, &it->second);
Anonymous 01/18/25(Sat)06:33:42 No.103941634
>>103941624
das it mane
das it mane
Anonymous 01/18/25(Sat)06:35:08 No.103941645
>>103941634
im glad i could help, anon
im glad i could help, anon
Anonymous 01/18/25(Sat)06:39:00 No.103941685
>>103941591
im not saying to calculate it every frame, i'm saying that adding a bool flag to a class is considered bad practice in general i didn't just pull it out of my ass look it up yourself
im not saying to calculate it every frame, i'm saying that adding a bool flag to a class is considered bad practice in general i didn't just pull it out of my ass look it up yourself
Anonymous 01/18/25(Sat)06:40:20 No.103941698
>>103941685
It's good practice because it means you don't have to calculate it every frame because you know when it's been modified or not
It's good practice because it means you don't have to calculate it every frame because you know when it's been modified or not
Anonymous 01/18/25(Sat)06:55:03 No.103941794
if I wanted to make something that runs the same on every machine (ie no floating point compiler differences) wat programming language or framework makes sense to use. i also desire internet connectivity / server networking etc. THANK YOU
Anonymous 01/18/25(Sat)06:57:51 No.103941807
>>103941685
no it isn't shut the fuck up if you don't know what you are talking about
no it isn't shut the fuck up if you don't know what you are talking about
Anonymous 01/18/25(Sat)07:34:49 No.103942086
>>103941794
Richard Russell's BBCSDL
Richard Russell's BBCSDL
Anonymous 01/18/25(Sat)07:53:03 No.103942227
Working on a graphics framework for DirectX. Not a full game engine, it's just meant to reduce the verbosity of managing DirectX objects and initializing things. Each DirectX object (shaders, cbuffers, textures/views, etc.) each have a class whose constructors handle most of the initialization. Each class has getters to the underlying DX objects so the dev can drop out of the framework and handle things manually whenever they want. It does have some helpers for games, like Camera classes and an application runner which calculates the time delta in the update loop for you.
It avoids allocations when possible, but sometimes it has to allocate (allocating a buffer to read the shader bytecode into, for example). In such classes, the dev can provide an STL allocator so they can control how memory is allocated for all allocations in the library. When no allocator is provided, it just uses std::allocator.
Picrel is the code for a rotating triangle a hundred lines or so of C++, minus the shaders themselves (which are dead simple)
It avoids allocations when possible, but sometimes it has to allocate (allocating a buffer to read the shader bytecode into, for example). In such classes, the dev can provide an STL allocator so they can control how memory is allocated for all allocations in the library. When no allocator is provided, it just uses std::allocator.
Picrel is the code for a rotating triangle a hundred lines or so of C++, minus the shaders themselves (which are dead simple)
Anonymous 01/18/25(Sat)07:56:53 No.103942254
Anonymous 01/18/25(Sat)07:59:03 No.103942274
>>103936097
Holy Based.
Holy Based.
Anonymous 01/18/25(Sat)08:02:44 No.103942305
Anonymous 01/18/25(Sat)08:36:07 No.103942518
>>103942227
nice to see a fellow dx enjoyer
nice to see a fellow dx enjoyer
Anonymous 01/18/25(Sat)09:11:33 No.103942747
Should I post here if I'm making a game by piecing systems together? I'll probably reuse code in the future but I'm not making what most people would call an engine
Anonymous 01/18/25(Sat)09:37:14 No.103942949
>yonger cousin was always hopelessly addicted to videogames since childhood
>would pee his pants instead of getting up to piss, played like 12 hours a day
>somehow convinced uncle to let him study a 4 year game dev course at a community college a few towns over
>also gets uncle to buy him a 2.5k gaming laptop
>ff to now, 5th or 6th semester
>can't draw 2D, 3D skills are absolutely garbage
>can't program to save his life
>still spends 14 hours a day playing videogames but away from home so his parents can't bug him
>only plays AAA games, never played anything that's not AAA or non FPS (still likes train sim games like any good asian boy)
>never heard of any indie game ever, never heard of any game from before 2010
>never heard of mass effect, stardew valley, prototype, final fantasy, dragon quest, monster hunter
Everyone in the family is worried. We thought he was doing well at univ until we saw his projects that he made with 2 other students it's... Bad
>would pee his pants instead of getting up to piss, played like 12 hours a day
>somehow convinced uncle to let him study a 4 year game dev course at a community college a few towns over
>also gets uncle to buy him a 2.5k gaming laptop
>ff to now, 5th or 6th semester
>can't draw 2D, 3D skills are absolutely garbage
>can't program to save his life
>still spends 14 hours a day playing videogames but away from home so his parents can't bug him
>only plays AAA games, never played anything that's not AAA or non FPS (still likes train sim games like any good asian boy)
>never heard of any indie game ever, never heard of any game from before 2010
>never heard of mass effect, stardew valley, prototype, final fantasy, dragon quest, monster hunter
Everyone in the family is worried. We thought he was doing well at univ until we saw his projects that he made with 2 other students it's... Bad
Anonymous 01/18/25(Sat)09:42:30 No.103942977
>>103942949
Does he at least have a portfolio, CV, and a résumé? And also, I am assuming there's still saving him from that stint?
Does he at least have a portfolio, CV, and a résumé? And also, I am assuming there's still saving him from that stint?
Anonymous 01/18/25(Sat)09:47:45 No.103943020
>>103942949
the only thing that can save him are bad consequences without any support from others
the only thing that can save him are bad consequences without any support from others
Anonymous 01/18/25(Sat)09:49:00 No.103943037
>>103942977
No, he hasn't done any game dev outside of coursework in the 3 years. He hasn't ever made a single sprite or 3D model outside of coursework i think
He made a 2D platformer with static sprites (non animated i mean) in 4th sem, and recently he made a 3D demo which i highly suspect was just a pre installed lighting example in unreal
He doesn't have a resume or portfolio
No, he hasn't done any game dev outside of coursework in the 3 years. He hasn't ever made a single sprite or 3D model outside of coursework i think
He made a 2D platformer with static sprites (non animated i mean) in 4th sem, and recently he made a 3D demo which i highly suspect was just a pre installed lighting example in unreal
He doesn't have a resume or portfolio
Anonymous 01/18/25(Sat)09:51:21 No.103943059
guess it's time i start doing some text rendering from scratch again
Anonymous 01/18/25(Sat)10:03:13 No.103943177
>>103941685
>adding a bool flag to a class is considered bad practice in general
Gonna need a source on that one. I suspect you've misunderstood whatever advice you read.
>look it up yourself
All I could find was this one random blog post:
https://www.sebastiansylvan.com/post/2014-04-27-flags-are-a-code-smell/
There are tons of articles saying you shouldn't have boolean flags as function arguments, but that's a separate issue.
Main points I see in this article are
>we have significantly more possible states than legal states
Well yeah, nearly all classes are going to have some kind of internal invariant on their fields. Document it and check it where relevant. This is what asserts are for.
>it’s very easy to accidentally end up in an illegal state by forgetting to check a flag in one of the many branches
This is maybe partly legit but also partly a skill issue. Nothing will save you from forgetting to check the precondition at the start of the method. If many methods share the same tricky precondition, then it might be worth factoring out that check.
>As you add more flags the set of possible states explodes
Technically true, but not relevant. Most of the flags will be orthogonal. Even full MCDC test coverage won't require O(2^N) tests unless the code is really pathological.
Even if all of the above points were valid, they don't apply in this case. The class in question here is going to have only one flag, which is fully encapsulated and can't be set or checked from outside the class. In fact there is only one method that checks the flag (the method to get the transformation matrix), and there will be absolutely no change in its observable input/output behavior when the flag is introduced (only a change in performance).
>>103941570
>they are bad for your cache
Anon, we are talking about storing an entire fucking matrix, 24 bytes at the bare minimum, maybe up to 128 depending on what anon is doing. 1 byte for the flag isn't going to make a difference.
>adding a bool flag to a class is considered bad practice in general
Gonna need a source on that one. I suspect you've misunderstood whatever advice you read.
>look it up yourself
All I could find was this one random blog post:
https://www.sebastiansylvan.com/pos
There are tons of articles saying you shouldn't have boolean flags as function arguments, but that's a separate issue.
Main points I see in this article are
>we have significantly more possible states than legal states
Well yeah, nearly all classes are going to have some kind of internal invariant on their fields. Document it and check it where relevant. This is what asserts are for.
>it’s very easy to accidentally end up in an illegal state by forgetting to check a flag in one of the many branches
This is maybe partly legit but also partly a skill issue. Nothing will save you from forgetting to check the precondition at the start of the method. If many methods share the same tricky precondition, then it might be worth factoring out that check.
>As you add more flags the set of possible states explodes
Technically true, but not relevant. Most of the flags will be orthogonal. Even full MCDC test coverage won't require O(2^N) tests unless the code is really pathological.
Even if all of the above points were valid, they don't apply in this case. The class in question here is going to have only one flag, which is fully encapsulated and can't be set or checked from outside the class. In fact there is only one method that checks the flag (the method to get the transformation matrix), and there will be absolutely no change in its observable input/output behavior when the flag is introduced (only a change in performance).
>>103941570
>they are bad for your cache
Anon, we are talking about storing an entire fucking matrix, 24 bytes at the bare minimum, maybe up to 128 depending on what anon is doing. 1 byte for the flag isn't going to make a difference.
Anonymous 01/18/25(Sat)10:48:23 No.103943600
>his classes have zero padding
surely not
surely not
Anonymous 01/18/25(Sat)11:05:15 No.103943774
>>103940611
Is this a gamemaker like?
Is this a gamemaker like?
Anonymous 01/18/25(Sat)12:28:30 No.103944677
>>103943774
It shares a lot of the same objectives. The idea is that a given player (client) can login to public or privately hosted servers and they will get unique experiences created by others. Movement type, combat, dialog, quests, minigames, etc are all mutable for the server admin. I will provide some default setups I hand craft for those who want a sort of vanilla experience.
It shares a lot of the same objectives. The idea is that a given player (client) can login to public or privately hosted servers and they will get unique experiences created by others. Movement type, combat, dialog, quests, minigames, etc are all mutable for the server admin. I will provide some default setups I hand craft for those who want a sort of vanilla experience.
Anonymous 01/18/25(Sat)12:40:32 No.103944808
>>103929816
yeah you can run this 50 times while waiting on a single cache line to read from RAM.
yeah you can run this 50 times while waiting on a single cache line to read from RAM.
Anonymous 01/18/25(Sat)12:50:49 No.103944919
Fixed a lot of bugs related to AI. Initially I wanted to add knockdowns but I was restrained by the bugs. Stalker source code gave me many ideas that sits well with stealth games. For example, rather that directly accessing the world, npcs have a memory with the data of enemies and noises around them. When they see something this is just accessing a memory which may be obsolete by now. For noises this is specially useful, running may generate noise but they don't give npcs access to where an enemy is at the present moment.
Tomorrow I'll add knockdowns and possibly guns. Then I want to add graphics
Tomorrow I'll add knockdowns and possibly guns. Then I want to add graphics
Anonymous 01/18/25(Sat)12:51:49 No.103944930
>>103944919
The visuals shouldn't look more complex than this.
The visuals shouldn't look more complex than this.
Anonymous 01/18/25(Sat)13:05:33 No.103945090
>>103944930
excellent crappy soulful dragon garbage quest graphics
excellent crappy soulful dragon garbage quest graphics
Anonymous 01/18/25(Sat)13:22:57 No.103945273
Anonymous 01/18/25(Sat)13:28:23 No.103945354
>>103929599
QUESTION FOR EVERYONE:
First of all, I like progress here, just please for the love of God, make your game so it runs on Linux.
> Question:
I'm interested in how VCMI, OpenMW and similar projects are legal in US and EU, not counting ioquake3 and darkplaces, since Quake was released under GPL license some time after it was published (year later I think).
Sure, they don't distribute art for VCMI (Heroes of Might & Magic 3 engine) like sounds, music, sprites, animations, DEF files etc. But what's Ubisoft stance on that? Can they prevent it?
Ubishit is a terrible company, I was wondering if there are some legal restrictions why they can't sue VCMI team. I browsed, but I couldn't find the real answer to this, aka 'can Ubisoft sue them'?
QUESTION FOR EVERYONE:
First of all, I like progress here, just please for the love of God, make your game so it runs on Linux.
> Question:
I'm interested in how VCMI, OpenMW and similar projects are legal in US and EU, not counting ioquake3 and darkplaces, since Quake was released under GPL license some time after it was published (year later I think).
Sure, they don't distribute art for VCMI (Heroes of Might & Magic 3 engine) like sounds, music, sprites, animations, DEF files etc. But what's Ubisoft stance on that? Can they prevent it?
Ubishit is a terrible company, I was wondering if there are some legal restrictions why they can't sue VCMI team. I browsed, but I couldn't find the real answer to this, aka 'can Ubisoft sue them'?
Anonymous 01/18/25(Sat)13:34:00 No.103945441
>>103945354
good god what a cringe post fuck off
good god what a cringe post fuck off
Anonymous 01/18/25(Sat)13:38:28 No.103945504
Anonymous 01/18/25(Sat)13:38:34 No.103945506
>>103945354
As long as you are not copying the original source code line by line then it's perfectly legal.
Ubisoft likely doesn't care since you still need to purchase the actual game from them to play it.
As long as you are not copying the original source code line by line then it's perfectly legal.
Ubisoft likely doesn't care since you still need to purchase the actual game from them to play it.
Anonymous 01/18/25(Sat)13:45:23 No.103945573
im gonna lose my mind trying to setup freetype compiling with premake
Anonymous 01/18/25(Sat)13:50:30 No.103945628
Anonymous 01/18/25(Sat)13:55:37 No.103945682
>>103929599
This is probably the most retarded question asked on here, but I'd love some insights. I wanna make a game engine but I only know lua, I'd like to learn either C or CPP. Yes, down the line I have use cases for both (ie: cpp for employment and C for tackling on making a simple dos-like operating system.) So I was wondering what way would be more beneficial, C with SDL2 or CPP with openGL
This is probably the most retarded question asked on here, but I'd love some insights. I wanna make a game engine but I only know lua, I'd like to learn either C or CPP. Yes, down the line I have use cases for both (ie: cpp for employment and C for tackling on making a simple dos-like operating system.) So I was wondering what way would be more beneficial, C with SDL2 or CPP with openGL
Anonymous 01/18/25(Sat)14:08:34 No.103945809
>>103945682
Just learn C, then learn C++
Just learn C, then learn C++
Anonymous 01/18/25(Sat)14:09:53 No.103945826
>>103945682
>or CPP with openGL
You will need some way to handle input, window, audio, fonts, etc. So you need SDL2 or similar anyway.
>or CPP with openGL
You will need some way to handle input, window, audio, fonts, etc. So you need SDL2 or similar anyway.
Anonymous 01/18/25(Sat)14:10:30 No.103945834
>>103945826
bro your native window implementation?
bro your native window implementation?
Anonymous 01/18/25(Sat)14:14:39 No.103945876
>>103945506
Thanks Anon.
>>103945682
If you use C language with Raylib, you'll learn a lot about C in general, and you'll have something finished at the end of the day.
Raylib is like saner little brother of SDL2, when you learn C, it won't make C++ easier, I think it'll make it harder, but oh well...
Thanks Anon.
>>103945682
If you use C language with Raylib, you'll learn a lot about C in general, and you'll have something finished at the end of the day.
Raylib is like saner little brother of SDL2, when you learn C, it won't make C++ easier, I think it'll make it harder, but oh well...
Anonymous 01/18/25(Sat)14:19:47 No.103945922
Is there some kind of userland equivalent of CPU interrupts? I want to ask the OS to wait for some number of milliseconds and then have the OS call some function I have in the engine with the thread's context
Anonymous 01/18/25(Sat)14:31:06 No.103946064
>>103945922
Is this your first day of programming? Heard of ChatGPT? We used to call it "Google."
Is this your first day of programming? Heard of ChatGPT? We used to call it "Google."
Anonymous 01/18/25(Sat)14:31:28 No.103946070
https://www.youtube.com/watch?v=anGdYJu_eH4
Anonymous 01/18/25(Sat)14:33:52 No.103946090
>>103946064
But I want to hear it from a human being, not a search engine.
But I want to hear it from a human being, not a search engine.
Anonymous 01/18/25(Sat)14:34:29 No.103946096
>>103946064
What makes you think I didn't search for it before, I didn't find anything. Are you saying that it doesn't exist after all?
What makes you think I didn't search for it before, I didn't find anything. Are you saying that it doesn't exist after all?
Anonymous 01/18/25(Sat)14:46:52 No.103946249
>>103946070
I'm reading this thread, and the dev claims (this used to be 5 years ago, so maybe things changed) that with 10k it only needed 200MB, and this was made in java. Impressive https://old.reddit.com/r/songsofsyx/comments/dirkmw/crowd_control/
I'm reading this thread, and the dev claims (this used to be 5 years ago, so maybe things changed) that with 10k it only needed 200MB, and this was made in java. Impressive https://old.reddit.com/r/songsofsyx
Anonymous 01/18/25(Sat)14:48:18 No.103946266
>>103946064
i like you
i like you
Anonymous 01/18/25(Sat)14:55:26 No.103946348
Anyone here working with a custom DSL for their engine?
I'm making an RPG and working on abillities. Stuff like elements and status effects is easy to implement with some normalisation, but I'd like a way to easily implement a handful of one-off abillities.
I'm making an RPG and working on abillities. Stuff like elements and status effects is easy to implement with some normalisation, but I'd like a way to easily implement a handful of one-off abillities.
Anonymous 01/18/25(Sat)15:00:51 No.103946405
>>103946266
Are you an asshole nodev too?
Are you an asshole nodev too?
Anonymous 01/18/25(Sat)15:01:02 No.103946408
Anonymous 01/18/25(Sat)15:03:27 No.103946430
>>103946405
im an asshole, but im not a nodev
im an asshole, but im not a nodev
Anonymous 01/18/25(Sat)15:22:22 No.103946581
>>103946096
Read Chapter 4 of Game Engine Architecture. If this is indicative of your usual ability to search, you might want to search for resources on how to search better. Because googling "programming wait milliseconds" instantly informs you of the existence of a syscall called "sleep" and from there you should be able to get to linux API docs for nanosleep or a stackoverflow post where someone has already explained the implementation of that system call far better than an original response you will receive asking here.
Read Chapter 4 of Game Engine Architecture. If this is indicative of your usual ability to search, you might want to search for resources on how to search better. Because googling "programming wait milliseconds" instantly informs you of the existence of a syscall called "sleep" and from there you should be able to get to linux API docs for nanosleep or a stackoverflow post where someone has already explained the implementation of that system call far better than an original response you will receive asking here.
Anonymous 01/18/25(Sat)15:27:23 No.103946616
>>103929599
What the fuck kind of Waldorf School name is "Tynan?"
What the fuck kind of Waldorf School name is "Tynan?"
Anonymous 01/18/25(Sat)15:31:52 No.103946656
I need to fix my UI aesthetics, I don't like any of them at all but I can't hold up progress because of it either
Anonymous 01/18/25(Sat)15:38:37 No.103946711
>>103945922
>Is there some kind of userland equivalent of CPU interrupts?
Signals, on unix
>I want to ask the OS to wait for some number of milliseconds and then have the OS call some function I have in the engine with the thread's context
Don't use signals for that. You're extremely limited in what you can do in a signal handler context. For example, it's not safe to allocate memory (might deadlock) if you're running inside a signal handler. About the only thing you can really do is set a flag of some kind for your main loop to check next time it runs.
Instead, you should set a timeout when you query the OS for input events in your main loop. E.g. use SDL_WaitEventTimeout instead of SDL_WaitEvent. When you have a timer pending, set the timeout such that it will wake up at the point when you want the timer to go off, if no events arrive by then.
>Is there some kind of userland equivalent of CPU interrupts?
Signals, on unix
>I want to ask the OS to wait for some number of milliseconds and then have the OS call some function I have in the engine with the thread's context
Don't use signals for that. You're extremely limited in what you can do in a signal handler context. For example, it's not safe to allocate memory (might deadlock) if you're running inside a signal handler. About the only thing you can really do is set a flag of some kind for your main loop to check next time it runs.
Instead, you should set a timeout when you query the OS for input events in your main loop. E.g. use SDL_WaitEventTimeout instead of SDL_WaitEvent. When you have a timer pending, set the timeout such that it will wake up at the point when you want the timer to go off, if no events arrive by then.
Anonymous 01/18/25(Sat)15:49:04 No.103946808
>>103946348
I think most people just use Lua for that kind of thing. Might be fun to build your own simple scripting language, though. Helps if you've taken a compilers class or otherwise know how to build a decent parser and AST, and you can write either an interpreter or a compiler to C++ or whatever you've used to implement the engine.
Another option might be to build a little Lisp/Racket library you can use to generate C++ code for these abilities, and hook that up to your build system so it has no run-time overhead.
I think most people just use Lua for that kind of thing. Might be fun to build your own simple scripting language, though. Helps if you've taken a compilers class or otherwise know how to build a decent parser and AST, and you can write either an interpreter or a compiler to C++ or whatever you've used to implement the engine.
Another option might be to build a little Lisp/Racket library you can use to generate C++ code for these abilities, and hook that up to your build system so it has no run-time overhead.
Anonymous 01/18/25(Sat)15:49:05 No.103946809
>>103942747
Yes
Yes
Anonymous 01/18/25(Sat)15:49:20 No.103946813
>>103946581
You didn't get it, I need the OS to interrupt the normal execution flow of my thread and put the thread execution into some other function. That is, I want the OS to interrupt the execution of some function X in some thread A on a timeout and move cpu's instruction pointer to the start of some other function Y in that thread A
>>103946711
I wasn't planning on using that for input events, you're right though
You didn't get it, I need the OS to interrupt the normal execution flow of my thread and put the thread execution into some other function. That is, I want the OS to interrupt the execution of some function X in some thread A on a timeout and move cpu's instruction pointer to the start of some other function Y in that thread A
>>103946711
I wasn't planning on using that for input events, you're right though
Anonymous 01/18/25(Sat)15:49:44 No.103946819
>>103946656
I've been wondering about this for a while myself.
Actually, I've been wondering about creating UI elements using extremely high poly models in blender with simple single-color materials and then just taking a screenshot of them in appropriate lighting
I've been wondering about this for a while myself.
Actually, I've been wondering about creating UI elements using extremely high poly models in blender with simple single-color materials and then just taking a screenshot of them in appropriate lighting
Anonymous 01/18/25(Sat)15:53:20 No.103946850
>>103942949
Damn. Reminds me of 2006-2007, I was going to NYU and 2 of my roommates played World of Warcraft every waking hour (not with each other, it was just a coincidence they were in the same dorm room). One of the guys broke up with his gf because she was taking too much of his time from WoW. The other failed all his classes and had to retake them. Not a cheap school to do that at either, guy was probably out 50k in 2007 dollars over that.
Damn. Reminds me of 2006-2007, I was going to NYU and 2 of my roommates played World of Warcraft every waking hour (not with each other, it was just a coincidence they were in the same dorm room). One of the guys broke up with his gf because she was taking too much of his time from WoW. The other failed all his classes and had to retake them. Not a cheap school to do that at either, guy was probably out 50k in 2007 dollars over that.
Anonymous 01/18/25(Sat)15:53:59 No.103946857
>>103943037
That’s fine with me, one less competitor
That’s fine with me, one less competitor
Anonymous 01/18/25(Sat)15:57:19 No.103946901
>>103944930
Zelda II vibes
Zelda II vibes
Anonymous 01/18/25(Sat)15:58:39 No.103946914
What program should I use if I want to make a higurashi quality like visual novel?
Anonymous 01/18/25(Sat)15:58:49 No.103946919
>>103945354
My game ran on Linux but after reading this I put an explicit check in the code to close the program if it detects the user is on Linux
My game ran on Linux but after reading this I put an explicit check in the code to close the program if it detects the user is on Linux
Anonymous 01/18/25(Sat)16:00:51 No.103946945
>>103946064
Real ones used to call it altavista
Real ones used to call it altavista
Anonymous 01/18/25(Sat)16:01:41 No.103946954
Anonymous 01/18/25(Sat)16:02:18 No.103946963
>>103946408
DSL is not dial-up
DSL is not dial-up
Anonymous 01/18/25(Sat)16:04:13 No.103946982
>>103946348
Well I am working on Prolog bindings for Raylib. With prolog you can make your own DSLs and macros
Well I am working on Prolog bindings for Raylib. With prolog you can make your own DSLs and macros
Anonymous 01/18/25(Sat)16:04:35 No.103946986
Anonymous 01/18/25(Sat)16:05:27 No.103946997
>>103946819
!remindme 1 day
!remindme 1 day
Anonymous 01/18/25(Sat)16:06:05 No.103947012
>>103946986
Damn I walked into that one
Damn I walked into that one
Anonymous 01/18/25(Sat)16:08:13 No.103947026
Anonymous 01/18/25(Sat)16:08:59 No.103947032
>>103946997
hello rEddi`t
hello rEddi`t
Anonymous 01/18/25(Sat)16:09:14 No.103947036
>>103946348
why not lua?
why not lua?
Anonymous 01/18/25(Sat)16:11:00 No.103947056
Any recommendations on books on code organization, software engineering or programming patterns in procedural (or more generally anything that is not OOP) languages?
For example I know C pretty ok and feel comfortable reading it at least, but I have no fucking clue how to organize a midsize to large codebase in something like C, Odin, or Zig well. When it comes to creating codebases of nontrivial size all I know is classes and shit. Work and university has poisened my mind.
I want out of OOP.
For example I know C pretty ok and feel comfortable reading it at least, but I have no fucking clue how to organize a midsize to large codebase in something like C, Odin, or Zig well. When it comes to creating codebases of nontrivial size all I know is classes and shit. Work and university has poisened my mind.
I want out of OOP.
Anonymous 01/18/25(Sat)16:13:38 No.103947076
>>103946919
Thank you for your contribution to humanity, your decision shall be remembered and respected.
>>103947056
Simply either write smaller project, or keep everything local (no global variables and unity builds).
Thank you for your contribution to humanity, your decision shall be remembered and respected.
>>103947056
Simply either write smaller project, or keep everything local (no global variables and unity builds).
Anonymous 01/18/25(Sat)16:28:31 No.103947229
Anonymous 01/18/25(Sat)16:32:00 No.103947263
>>103947056
Try programming in prolog, it will change how you think https://youtu.be/G_eYTctGZw8?si=ItHIAM8J7V2XLM0g
Try programming in prolog, it will change how you think https://youtu.be/G_eYTctGZw8?si=ItH
Anonymous 01/18/25(Sat)16:37:59 No.103947313
>>103947056
Functional core, imperative shell.
Organize things by lifetime, write everything twice and only abstract the third time around.
Functional core, imperative shell.
Organize things by lifetime, write everything twice and only abstract the third time around.
Anonymous 01/18/25(Sat)16:38:58 No.103947322
>>103947229
Based, I'm slightly optimizing loading time.
It needs 1 second for parsing 1097 game scripts and loading 1793 game PNG images (which are merged into 1 texture on the GPU), with GLFW and OpenGL/AL initialization and stuff...
Maybe it's not that bad, because when I pass '-Ofast' flag, it does everything in 0.641276s, but it needs 3 fucking seconds to compile, which is kinda bad to wait on... Screenshot is '-O1'.
Based, I'm slightly optimizing loading time.
It needs 1 second for parsing 1097 game scripts and loading 1793 game PNG images (which are merged into 1 texture on the GPU), with GLFW and OpenGL/AL initialization and stuff...
Maybe it's not that bad, because when I pass '-Ofast' flag, it does everything in 0.641276s, but it needs 3 fucking seconds to compile, which is kinda bad to wait on... Screenshot is '-O1'.
Anonymous 01/18/25(Sat)16:48:12 No.103947413
>>103947322
>It needs 1 second for parsing 1097 game scripts and loading 1793 game PNG images (which are merged into 1 texture on the GPU)
How much of that is the scripts vs the images? Basically I'm wondering how much you would save if you pre-built the texture atlas at compile time instead of assembling it at startup. (Or if you cached it on first run, which IIRC is how Factorio does it)
>It needs 1 second for parsing 1097 game scripts and loading 1793 game PNG images (which are merged into 1 texture on the GPU)
How much of that is the scripts vs the images? Basically I'm wondering how much you would save if you pre-built the texture atlas at compile time instead of assembling it at startup. (Or if you cached it on first run, which IIRC is how Factorio does it)
Anonymous 01/18/25(Sat)16:48:49 No.103947419
>>103945354
>make your game so it runs on Linux
I'm also making the game on a fucking X220 that can't even run Blender.
>make your game so it runs on Linux
I'm also making the game on a fucking X220 that can't even run Blender.
Frosch !!QxG8tdNNBUC 01/18/25(Sat)16:57:18 No.103947485
>>103945354
>>103947229
>>103947419
Also make sure your builds act as malware when you compile for Windows. It's the only way they are going to learn ...
>>103947229
>>103947419
Also make sure your builds act as malware when you compile for Windows. It's the only way they are going to learn ...
Anonymous 01/18/25(Sat)17:02:33 No.103947532
>>103947263
the fuck is this used for
the fuck is this used for
Anonymous 01/18/25(Sat)17:04:12 No.103947548
>>103947532
Professional Games Programming
Professional Games Programming
Anonymous 01/18/25(Sat)17:06:54 No.103947565
>>103947548
oh I see so silky smooth 24 fps ghosting smeared TAA running at ai upscaled 2k taking 250 Gigs of disk space and always online so your data is continually stolen?
oh I see so silky smooth 24 fps ghosting smeared TAA running at ai upscaled 2k taking 250 Gigs of disk space and always online so your data is continually stolen?
Anonymous 01/18/25(Sat)17:07:22 No.103947570
font atlas generation is working
my pants are full of jizz
my pants are full of jizz
Anonymous 01/18/25(Sat)17:11:34 No.103947599
>>103947570
anon...
anon...
Anonymous 01/18/25(Sat)17:12:08 No.103947603
>>103947570
forgot to mention that those 2 things arent related
forgot to mention that those 2 things arent related
Anonymous 01/18/25(Sat)17:12:24 No.103947607
>>103947565
No it’s programming in the language of pure first order logic, no typing bullshit, no OOP, just pure reasoning
No it’s programming in the language of pure first order logic, no typing bullshit, no OOP, just pure reasoning
Anonymous 01/18/25(Sat)17:56:27 No.103948086
>>103947548
post proof
post proof
Anonymous 01/18/25(Sat)17:57:18 No.103948097
>>103947413
> Or if you cached it on first run, which IIRC is how Factorio does it.
This is actually a very good idea, merged sprite sheet is around 17 MiB, 4096x4096 texture.
Loading PNG images takes 80-90% of time of script * image, so that is likely solution, "caching".
It does create problems with dynamically loading game data tho, which is what I want to have...
Adding completely new item to the game is just placing 1 PNG file in folder and writing:
>>103947419
>>103947485
Kings. (:
> Or if you cached it on first run, which IIRC is how Factorio does it.
This is actually a very good idea, merged sprite sheet is around 17 MiB, 4096x4096 texture.
Loading PNG images takes 80-90% of time of script * image, so that is likely solution, "caching".
It does create problems with dynamically loading game data tho, which is what I want to have...
Adding completely new item to the game is just placing 1 PNG file in folder and writing:
(my_sword)
name = "My Ultra-Mega Sword"
slot = main_hand
frames = 1 # animation frames per second
rarity = 3 # how rare is the item
effect = (increase_offence_by_3, increment_conjuration, increment_knowledge)
>>103947419
>>103947485
Kings. (:
Anonymous 01/18/25(Sat)18:00:55 No.103948128
>>103948097
>Loading PNG images takes 80-90% of time
dont tell me you're making the texture every time you run the game
>Loading PNG images takes 80-90% of time
dont tell me you're making the texture every time you run the game
Anonymous 01/18/25(Sat)18:07:51 No.103948212
If you care about loading times don't load PNGs, use a raw format
Anonymous 01/18/25(Sat)19:14:57 No.103948893
>>103948128
> Don't tell me you're making the texture every time you run the game.
Depends how exactly you mean.
I load ~1800 small PNG images when the game is ran and merge them into 1 texture.
Why? Because I can easily extend the game content that way, or replace artwork...
It would allow for easier "modding" of the game, which doesn't exist yet but whatever...
>>103948212
I also care about the size, I fit almost entire HoM&M3 artwork into 17.8 MiB.
Some animation frames are missing, maybe an item or two, but I really care about size.
Including sounds for the game, I want to make it below 30 MiB in total, for everything.
Why? I don't know, it's kinda fun to fit 1 GiB game into 30 MiB, I'm not a real programmer.
> Don't tell me you're making the texture every time you run the game.
Depends how exactly you mean.
I load ~1800 small PNG images when the game is ran and merge them into 1 texture.
Why? Because I can easily extend the game content that way, or replace artwork...
It would allow for easier "modding" of the game, which doesn't exist yet but whatever...
>>103948212
I also care about the size, I fit almost entire HoM&M3 artwork into 17.8 MiB.
Some animation frames are missing, maybe an item or two, but I really care about size.
Including sounds for the game, I want to make it below 30 MiB in total, for everything.
Why? I don't know, it's kinda fun to fit 1 GiB game into 30 MiB, I'm not a real programmer.
Anonymous 01/18/25(Sat)19:18:28 No.103948923
>>103948893
>I load ~1800 small PNG images when the game is ran and merge them into 1 texture.
that's a waste of resources, make a system that detects changes in the directory of the PNGs and regenerates the texture when it needs to
then you can save the texture as one big png and load it directly on startup when no changes are detected
and voila, a 90% decrease in loading times
>I load ~1800 small PNG images when the game is ran and merge them into 1 texture.
that's a waste of resources, make a system that detects changes in the directory of the PNGs and regenerates the texture when it needs to
then you can save the texture as one big png and load it directly on startup when no changes are detected
and voila, a 90% decrease in loading times
Anonymous 01/18/25(Sat)19:24:43 No.103948982
>>103948923
I'd have to use fstat-like functions (which invoke system calls all over the place, I dealt with them in x86_64 assembly), and to keep a record of that data in a text file...
For a reference, image related, with '-Ofast' it loads everything in 0.665 seconds approximately, 1097 scripts and 1793 images. And all that content fits in 17.8 MiB (compressed ofcourse!).
--
I'll keep in mind what you (and other Anon, if not the same guy) said, because someone on slower PC might run this game, and see lazy bullshit I wrote.
> make a system that detects changes in the directory
Note physically taken in my notebook, thanks, wouldn't think of it myself after struct horrors of FASM I had to deal with for using 'fstat', in C it's fine.
I'd have to use fstat-like functions (which invoke system calls all over the place, I dealt with them in x86_64 assembly), and to keep a record of that data in a text file...
For a reference, image related, with '-Ofast' it loads everything in 0.665 seconds approximately, 1097 scripts and 1793 images. And all that content fits in 17.8 MiB (compressed ofcourse!).
--
I'll keep in mind what you (and other Anon, if not the same guy) said, because someone on slower PC might run this game, and see lazy bullshit I wrote.
> make a system that detects changes in the directory
Note physically taken in my notebook, thanks, wouldn't think of it myself after struct horrors of FASM I had to deal with for using 'fstat', in C it's fine.
Anonymous 01/18/25(Sat)19:27:58 No.103949013
>>103948982
every game should have a two phase resource load system, first phase performs pre-processing on resources (combines all your PNGs into one), second phase loads them for use in the game
first phase only needs to be run when resources change
every game should have a two phase resource load system, first phase performs pre-processing on resources (combines all your PNGs into one), second phase loads them for use in the game
first phase only needs to be run when resources change
Anonymous 01/18/25(Sat)19:38:15 No.103949106
>>103948097
>It does create problems with dynamically loading game data tho, which is what I want to have...
Yeah, IIRC that's one of the reasons the Factorio devs went with the dynamic caching approach, instead of pre-generating the big texture and shipping it with the game.
>>103948982
>I'd have to use fstat-like functions (which invoke system calls all over the place, I dealt with them in x86_64 assembly)
Wat? Are you actually writing your game entirely in assembly? You mentioned -O1 vs -Ofast which I assumed were C compiler flags.
Anyway, idk how glibc does it, but in asm `stat` should only be a single system call
>and to keep a record of that data in a text file...
Just hash together the mtimes of everything in the image directory and the mtime of the directory itself. Then store the hash in a file, or even just try to load `cache-<hash value>.png` and see if it exists or not.
Modifying one of the files will change that file's mtime, and adding, removing, or renaming any files will change the mtime of the directory. You don't even need to sort the readdir results by name - the ordering isn't specified, but it's usually based on some on-disk structure and will therefore be stable across runs. (And if it's not stable, no big deal, you just end up regenerating the cache an extra time when it's not really necessary.)
>It does create problems with dynamically loading game data tho, which is what I want to have...
Yeah, IIRC that's one of the reasons the Factorio devs went with the dynamic caching approach, instead of pre-generating the big texture and shipping it with the game.
>>103948982
>I'd have to use fstat-like functions (which invoke system calls all over the place, I dealt with them in x86_64 assembly)
Wat? Are you actually writing your game entirely in assembly? You mentioned -O1 vs -Ofast which I assumed were C compiler flags.
Anyway, idk how glibc does it, but in asm `stat` should only be a single system call
>and to keep a record of that data in a text file...
Just hash together the mtimes of everything in the image directory and the mtime of the directory itself. Then store the hash in a file, or even just try to load `cache-<hash value>.png` and see if it exists or not.
Modifying one of the files will change that file's mtime, and adding, removing, or renaming any files will change the mtime of the directory. You don't even need to sort the readdir results by name - the ordering isn't specified, but it's usually based on some on-disk structure and will therefore be stable across runs. (And if it's not stable, no big deal, you just end up regenerating the cache an extra time when it's not really necessary.)
Anonymous 01/18/25(Sat)19:51:30 No.103949214
>>103949106
> Are you actually writing your game entirely in assembly?
No no man, I wrote other projects in assembly, this game is 100% C, not including INI-like files for game entity data (script that I mentioned being parsed).
>>103949013
I'm also noting this, I thought about it, but I want to finish more important gameplay things first, like actually commenting out written battle system and checking how well it works.
--
Again, thanks a lot for advices, I appreciate it because I'm spending more time on other "sub-systems". Good night Anon.
PS: I'd write a game in assembly if IA32e had better mnemonics.
> Are you actually writing your game entirely in assembly?
No no man, I wrote other projects in assembly, this game is 100% C, not including INI-like files for game entity data (script that I mentioned being parsed).
>>103949013
I'm also noting this, I thought about it, but I want to finish more important gameplay things first, like actually commenting out written battle system and checking how well it works.
--
Again, thanks a lot for advices, I appreciate it because I'm spending more time on other "sub-systems". Good night Anon.
PS: I'd write a game in assembly if IA32e had better mnemonics.
Anonymous 01/18/25(Sat)21:21:11 No.103950082
opinion about godot? I'm starting to program and I'm using Godot because is easy, the entire internet says is a good engine but I want to know 4chan opinion
Anonymous 01/18/25(Sat)21:28:17 No.103950146
>>103950082
It's an underbaked engine, Unity is better
It's an underbaked engine, Unity is better
Anonymous 01/18/25(Sat)21:53:46 No.103950365
>>103950082
It’s a great engine. If I wasn’t making my own engine then I would use godot. The best part is that it is very fast and GDScript is one of the best languages
It’s a great engine. If I wasn’t making my own engine then I would use godot. The best part is that it is very fast and GDScript is one of the best languages
Anonymous 01/18/25(Sat)21:59:30 No.103950416
>>103950365
>The best part is that it is very fast and GDScript is one of the best languages
You blew your cover
>The best part is that it is very fast and GDScript is one of the best languages
You blew your cover
Anonymous 01/18/25(Sat)22:03:38 No.103950451
>>103950082
It's pretty capable
It's pretty capable
Anonymous 01/18/25(Sat)22:03:44 No.103950454
If you write your game in say C++ with SDL or something like that, would you say that you "wrote a game engine"?
There is a difference between writing a game without a larger engine like godot, unity, unreal, etc. and writing a game engine which you can then use to make a variety of games. What would you call it?
There is a difference between writing a game without a larger engine like godot, unity, unreal, etc. and writing a game engine which you can then use to make a variety of games. What would you call it?
Anonymous 01/18/25(Sat)22:04:23 No.103950461
>>103950454
the term "game engine" has become pretty muddy
the term "game engine" has become pretty muddy
Anonymous 01/18/25(Sat)22:13:14 No.103950539
>>103950082
Godot is very comfy for solodev, and if you're new to programming GDScript is similar to Python - meaning it is one of the easier languages to pick up on.
Unity is good and has a billion resources out there for you to find any solution to a particular issue you're having.
Unreal you can guarantee will be heavily supported into the future and has some of the best engine tech in the industry. But you being new to programming (and assuming dev) you will not be utilizing anything that Unreal truly offers.
Try them all out.
3D?
UE5 > Unity > Godot
2D?
Godot > Unity > UE5 (don't do this in UE5)
Don't want to ever think about licenses and royalties?
Godot >>>>>> UE5 > Unity
Godot is very comfy for solodev, and if you're new to programming GDScript is similar to Python - meaning it is one of the easier languages to pick up on.
Unity is good and has a billion resources out there for you to find any solution to a particular issue you're having.
Unreal you can guarantee will be heavily supported into the future and has some of the best engine tech in the industry. But you being new to programming (and assuming dev) you will not be utilizing anything that Unreal truly offers.
Try them all out.
3D?
UE5 > Unity > Godot
2D?
Godot > Unity > UE5 (don't do this in UE5)
Don't want to ever think about licenses and royalties?
Godot >>>>>> UE5 > Unity
Anonymous 01/18/25(Sat)22:13:15 No.103950540
>>103950454
anon, SDL is an OS abstraction, a framework, it doesn't handle animations by itself, nor map files, nor GUIs, nor cutscenes, or anything high level that's normally found in an engine.
Even Raylib is more advanced than SDL because it comes with a GLTF file loader
SDL is like Love2D, Pygame, Allegro and other "framework", it's no different than using a sound library or an image loading library, you only get barebone primitives, it's up to you make something out of them, and nothing's stopping you from going lower for certain things.
anon, SDL is an OS abstraction, a framework, it doesn't handle animations by itself, nor map files, nor GUIs, nor cutscenes, or anything high level that's normally found in an engine.
Even Raylib is more advanced than SDL because it comes with a GLTF file loader
SDL is like Love2D, Pygame, Allegro and other "framework", it's no different than using a sound library or an image loading library, you only get barebone primitives, it's up to you make something out of them, and nothing's stopping you from going lower for certain things.
Anonymous 01/18/25(Sat)22:35:43 No.103950717
>>103950416
GDScript is 10x better than C#. GDScript’s only flaw is that it isn’t Python
GDScript is 10x better than C#. GDScript’s only flaw is that it isn’t Python
Anonymous 01/18/25(Sat)22:40:30 No.103950742
>>103950082
It's not hyper optimized, but it's good for what it is.
It's not hyper optimized, but it's good for what it is.
Anonymous 01/18/25(Sat)22:44:50 No.103950791
>>103950717
GDScript is slow, Python is also slow
GDScript is slow, Python is also slow
Anonymous 01/18/25(Sat)22:46:28 No.103950809
>>103929599
Is that book any good?
Also, I'm going to try running Anarchy Arcade's Hammer in Linux. It's not going to work, is it?
Is that book any good?
Also, I'm going to try running Anarchy Arcade's Hammer in Linux. It's not going to work, is it?
Anonymous 01/19/25(Sun)00:12:41 No.103951538
>>103933158
>>103933900
"He" has been used this way since forever. It shouldn't need to be explained away like this.
>>103933900
"He" has been used this way since forever. It shouldn't need to be explained away like this.
Anonymous 01/19/25(Sun)00:13:23 No.103951542
>>103951538
It's time that "we" fought back.
It's time that "we" fought back.
Anonymous 01/19/25(Sun)00:16:09 No.103951568
>>103950540
That's a great answer to a question nobody asked.
That's a great answer to a question nobody asked.
Anonymous 01/19/25(Sun)02:07:22 No.103952426
>>103942747
Anon isn't that what engine dev is all about?
Anon isn't that what engine dev is all about?
Anonymous 01/19/25(Sun)02:08:11 No.103952431
>>103952426
engine devs can't into making games.
engine devs can't into making games.
Anonymous 01/19/25(Sun)02:16:26 No.103952476
>>103947056
Look at projects on GitHub to see how they structure their projects and read the code.
Look at projects on GitHub to see how they structure their projects and read the code.
Anonymous 01/19/25(Sun)02:17:44 No.103952488
>>103950454
A game engine is a collection of reusable code that can be used to make video games.
A game engine is a collection of reusable code that can be used to make video games.
Anonymous 01/19/25(Sun)02:20:43 No.103952509
>>103952488
that's a framework
that's a framework
Anonymous 01/19/25(Sun)02:28:14 No.103952556
>>103947056
Who is she?
Who is she?
Anonymous 01/19/25(Sun)02:34:19 No.103952580
>>103952556
Answering myself. Korean fighting game Battle Queen.
Answering myself. Korean fighting game Battle Queen.
Anonymous 01/19/25(Sun)02:34:26 No.103952582
>>103952509
No, a framework by itself is not enough to make video games. An engine is more than that. It should provide ALL the code that you need to make a game. And you can modify it further when you need to, but fundamentally if you have an engine all you need on top of that is content and possibly scripting.
No, a framework by itself is not enough to make video games. An engine is more than that. It should provide ALL the code that you need to make a game. And you can modify it further when you need to, but fundamentally if you have an engine all you need on top of that is content and possibly scripting.
Anonymous 01/19/25(Sun)02:38:10 No.103952595
Anonymous 01/19/25(Sun)02:38:42 No.103952599
>>103952582
go back to the vg general already
go back to the vg general already
Anonymous 01/19/25(Sun)02:47:30 No.103952632
>>103952595
>>103952599
Look at the Dark Engine. Do you think LGS had to add any extra shit when making Thief 2? No, the code was all in place, it was just a matter of content and little scripts. When you have a tailored in-house engine the engine should be doing everything you need already.
>>103952599
Look at the Dark Engine. Do you think LGS had to add any extra shit when making Thief 2? No, the code was all in place, it was just a matter of content and little scripts. When you have a tailored in-house engine the engine should be doing everything you need already.
Anonymous 01/19/25(Sun)02:49:06 No.103952645
>>103952632
Ok now look at Unity
Ok now look at Unity
Anonymous 01/19/25(Sun)03:11:32 No.103952766
>>103952645
I don't give a fuck what slop devs are doing.
I don't give a fuck what slop devs are doing.
Anonymous 01/19/25(Sun)03:12:33 No.103952773
>>103952766
You're retarded
You're retarded
Anonymous 01/19/25(Sun)03:27:01 No.103952842
>>103947056
what's the issue exactly? Just use structs instead of classes and use inheritance
what's the issue exactly? Just use structs instead of classes and use inheritance
Anonymous 01/19/25(Sun)03:47:55 No.103952961
>>103952773
Slop dev identified, kill yourself.
Slop dev identified, kill yourself.
Anonymous 01/19/25(Sun)03:49:50 No.103952974
>>103952509
an engine are the systems that your game runs on
if you make tetris, you already made an engine
an engine are the systems that your game runs on
if you make tetris, you already made an engine
Anonymous 01/19/25(Sun)04:05:06 No.103953067
>>103952961
>>103952974
An engine is a reusable code base
It differs from a framework in that it provides an architecture for your game, but you still have to write code ontop of it to make the actual game
>>103952974
An engine is a reusable code base
It differs from a framework in that it provides an architecture for your game, but you still have to write code ontop of it to make the actual game
Anonymous 01/19/25(Sun)04:06:06 No.103953072
>>103946954
Yes, nodevs back to /v/.
Yes, nodevs back to /v/.
Anonymous 01/19/25(Sun)04:12:35 No.103953112
What do you guys think of better enums?
Anonymous 01/19/25(Sun)05:00:35 No.103953408
>>103950791
Skill issue
Skill issue
Anonymous 01/19/25(Sun)05:01:11 No.103953409
>>103953408
Language issue
Language issue
Anonymous 01/19/25(Sun)05:06:35 No.103953453
Anonymous 01/19/25(Sun)05:07:52 No.103953463
>retards talking about slow languages when they never wrote anything that would actually show results of the speed difference
Anonymous 01/19/25(Sun)05:12:50 No.103953486
>>103950791
All relies on optimization. You can write code in C all you want but if your code is shit then you might as well be writing in python
All relies on optimization. You can write code in C all you want but if your code is shit then you might as well be writing in python
Anonymous 01/19/25(Sun)05:17:48 No.103953507
>>103953486
Not really, shit C code still runs much better than good Python code
Not really, shit C code still runs much better than good Python code
Anonymous 01/19/25(Sun)05:23:22 No.103953537
Yesterday I was thinking ways to implement hierarchical pathfinding. The simplest implementation would be to store the bottom and right side of each sector, in two bits, whether the border is open or not, which can be detected by walking from corner to corner until you find a non obstacle tile. The approach is both fast and lightweight but the obstacle might exist in the middle of a sector, then what?
A second approach would be to compute a path from the center of a sector to each border and store if such a path exists, which would take more time to build, though only rarely you'd need to update the table anyway and changes would be focalized.I read some articles where the idea of portals are used, for each sector you store where exactly the connection exits. This would require one bit per tile, so if each border is composed of 10 tiles, it would require 20 bits or so, and much more time but overall it gets amortized. Last but not least, I wonder how one would efficiently store information from border to border within a sector.
A second approach would be to compute a path from the center of a sector to each border and store if such a path exists, which would take more time to build, though only rarely you'd need to update the table anyway and changes would be focalized.I read some articles where the idea of portals are used, for each sector you store where exactly the connection exits. This would require one bit per tile, so if each border is composed of 10 tiles, it would require 20 bits or so, and much more time but overall it gets amortized. Last but not least, I wonder how one would efficiently store information from border to border within a sector.
Anonymous 01/19/25(Sun)05:25:48 No.103953548
>>103953537
Someone posted an article on how Factorio does it in the last thread which is pretty good
I take the sectors and I do flood fills to find the sub-sectors then build connections between the sub-sectors, but this isn't done in real time and Factorio's method is faster
Someone posted an article on how Factorio does it in the last thread which is pretty good
I take the sectors and I do flood fills to find the sub-sectors then build connections between the sub-sectors, but this isn't done in real time and Factorio's method is faster
Anonymous 01/19/25(Sun)05:35:20 No.103953610
>>103953548
I read the article, their approach is interesting. They compute some some "abstract nodes" but use this information for the heuristic of the old one:
> So what we end up with is this: We have two pathfinders, called the base pathfinder, which finds the actual path, and the abstract pathfinder, which provides the heuristic function for the base pathfinder. Whenever the base pathfinder creates a new base node, it calls the abstract pathfinder to get the estimate on the distance to the goal. The abstract pathfinder works backwards – it starts at the goal of the search, and works its way toward the start, jumping from one chunk’s component to another. Once the abstract search finds the chunk and the component in which the new base node is created, it uses the distance from the start of the abstract search (which, again, is the goal position of the overall search) to calculate the estimated distance from the new base node to the overall goal.
>Running an entire pathfinder for every single base node would, however, be anything but fast, even if the abstract pathfinder leaps from one chunk to the next. Instead we use what’s called Reverse Resumable A*. Reverse means simply it goes from goal to start, as I already said. Resumable means that after it finds the chunk the base pathfinder is interested in, we keep all its nodes in memory. The next time the base pathfinder creates a new node and needs to know its distance estimate, we simply look at the abstract nodes we kept from the previous search, with a good chance the required abstract node will still be there (after all, one abstract node covers a large part of a chunk, often the entire chunk).
I wonder if this is faster than computing first the sectors, then subsector pathing.
I read the article, their approach is interesting. They compute some some "abstract nodes" but use this information for the heuristic of the old one:
> So what we end up with is this: We have two pathfinders, called the base pathfinder, which finds the actual path, and the abstract pathfinder, which provides the heuristic function for the base pathfinder. Whenever the base pathfinder creates a new base node, it calls the abstract pathfinder to get the estimate on the distance to the goal. The abstract pathfinder works backwards – it starts at the goal of the search, and works its way toward the start, jumping from one chunk’s component to another. Once the abstract search finds the chunk and the component in which the new base node is created, it uses the distance from the start of the abstract search (which, again, is the goal position of the overall search) to calculate the estimated distance from the new base node to the overall goal.
>Running an entire pathfinder for every single base node would, however, be anything but fast, even if the abstract pathfinder leaps from one chunk to the next. Instead we use what’s called Reverse Resumable A*. Reverse means simply it goes from goal to start, as I already said. Resumable means that after it finds the chunk the base pathfinder is interested in, we keep all its nodes in memory. The next time the base pathfinder creates a new node and needs to know its distance estimate, we simply look at the abstract nodes we kept from the previous search, with a good chance the required abstract node will still be there (after all, one abstract node covers a large part of a chunk, often the entire chunk).
I wonder if this is faster than computing first the sectors, then subsector pathing.
Anonymous 01/19/25(Sun)05:38:28 No.103953628
Anonymous 01/19/25(Sun)05:40:01 No.103953638
>>103953610
>I wonder if this is faster than computing first the sectors, then subsector pathing.
It depends
In Factorio, you can change the map, you can build structures on it, you can replace and remove water. So nothing is fixed and the pathfinding has to be fully dynamic. For a dynamic approach, this is faster
If your map has static elements then you can do some precomputation, calculate all the subsectors and their connections at compile time
>I wonder if this is faster than computing first the sectors, then subsector pathing.
It depends
In Factorio, you can change the map, you can build structures on it, you can replace and remove water. So nothing is fixed and the pathfinding has to be fully dynamic. For a dynamic approach, this is faster
If your map has static elements then you can do some precomputation, calculate all the subsectors and their connections at compile time
Anonymous 01/19/25(Sun)08:16:53 No.103954610
Anonymous 01/19/25(Sun)10:49:41 No.103955861
Glory to the Glasgow Haskell Compiler.
Anonymous 01/19/25(Sun)10:50:02 No.103955866
progress report:
finished initial multithreaded rendering and have gained 25% more performance just like that
ill add a bit more before taking a deserved break
finished initial multithreaded rendering and have gained 25% more performance just like that
ill add a bit more before taking a deserved break
Anonymous 01/19/25(Sun)11:09:51 No.103956004
I'm starting my project to modify my game framework to run in the web browser on WebAssembly. It shouldn't be that hard, r-right?
Anonymous 01/19/25(Sun)11:16:27 No.103956069
>>103929640
yeah, cool kids are already at atan3 with atan4 coming out next month. Get on my level gramps.
yeah, cool kids are already at atan3 with atan4 coming out next month. Get on my level gramps.
Frosch !!QxG8tdNNBUC 01/19/25(Sun)11:42:18 No.103956317
I saw this in another thread
https://youtu.be/j1aEU1okCAQ?si=-Yg2HH8OHf4sW6Ii
Never forget that Sony robbed us of the Lisp renaissance.
https://youtu.be/j1aEU1okCAQ?si=-Yg
Never forget that Sony robbed us of the Lisp renaissance.
Anonymous 01/19/25(Sun)11:47:56 No.103956369
>>103935991
SUCCESS!
SUCCESS!
Anonymous 01/19/25(Sun)11:49:39 No.103956384
>>103945922
On Windows, you can use window messages, mutexes shared between processes and a bunch of other things.
On Linux, the usual way to do this is doing a blocking read on a file descriptor
On Windows, you can use window messages, mutexes shared between processes and a bunch of other things.
On Linux, the usual way to do this is doing a blocking read on a file descriptor
Anonymous 01/19/25(Sun)12:10:08 No.103956560
Which books to read for game engine design and for implementing lighting that doesn't look like shit (unironically)?
Frosch !!QxG8tdNNBUC 01/19/25(Sun)12:29:05 No.103956752
Anonymous 01/19/25(Sun)12:46:04 No.103956965
Sup lads.
Haven't been here in a couple months or so (I'm not sure how many) because I went down a sonic autism rabbithole recently and experienced a fuck ton of adventure-era sonic media and watched movie 3. In the midst of this, I, in an act of infinite wisdom, scrapped a lot of my existing project ideas (such as a potential city sim, a potential fps, and a potential life sim) and kept musing about the idea of a 3D sonic fangame.
Now, I've decided that that would take too long for a fangame (I've estimated it to take 2 years to make based on my spec), so I'm considering making a distinct "sonic-like" indie game instead.
Picrel was my gameplay ideas from when I was going to make said fangame if you're curious.
I'm also going to try brainstorming some of the ideas I scrapped, now that the high from sonic movie 3 has worn off.
Haven't been here in a couple months or so (I'm not sure how many) because I went down a sonic autism rabbithole recently and experienced a fuck ton of adventure-era sonic media and watched movie 3. In the midst of this, I, in an act of infinite wisdom, scrapped a lot of my existing project ideas (such as a potential city sim, a potential fps, and a potential life sim) and kept musing about the idea of a 3D sonic fangame.
Now, I've decided that that would take too long for a fangame (I've estimated it to take 2 years to make based on my spec), so I'm considering making a distinct "sonic-like" indie game instead.
Picrel was my gameplay ideas from when I was going to make said fangame if you're curious.
I'm also going to try brainstorming some of the ideas I scrapped, now that the high from sonic movie 3 has worn off.
Anonymous 01/19/25(Sun)12:50:17 No.103957022
inline constexpr std::uint8_t fastSaturateIntToChar(int val) {
constexpr std::uint32_t mask1 = (~255) ^ (1 << 31);
return ~(((val & mask1) ? 0 : ~val) | ((val < 0) ? 255 : 0)); // 5250u with benchmark overhead
// return ((val & mask1) ? 255 : val) & ((val < 0) ? 0 : 255); // 6790u with benchmark overhead
}
I have absolutely no idea why the first variant is faster (and the other is as fast as the naive approach), but here it is.
Anonymous 01/19/25(Sun)13:07:01 No.103957238
>>103956752
Thanks! It's motivating to know some people will find it interesting.
Thanks! It's motivating to know some people will find it interesting.
Anonymous 01/19/25(Sun)13:07:01 No.103957239
>>103956369
I can't believe in what I'm looking... Keep it up Anon.
>>103956560
Read Doom 3 or Tesseract source code, not a book.
I can't believe in what I'm looking... Keep it up Anon.
>>103956560
Read Doom 3 or Tesseract source code, not a book.
Anonymous 01/19/25(Sun)13:08:10 No.103957250
>>103957238
Dude, literally the same second...
Dude, literally the same second...
Anonymous 01/19/25(Sun)13:11:26 No.103957292
>>103957239
>>103957250
>>103956752
Awesome, I'm glad more people see the value! Now that I've got raylib's hello world example working, it's just a matter of expanding the bindings to the rest of the library. Then I'll port more of raylib's examples to prolog. Off to the races now!
>>103957250
>>103956752
Awesome, I'm glad more people see the value! Now that I've got raylib's hello world example working, it's just a matter of expanding the bindings to the rest of the library. Then I'll port more of raylib's examples to prolog. Off to the races now!
Anonymous 01/19/25(Sun)14:25:33 No.103958243
>>103929599
General questions:
-- What are some things you'd like to see in indie games, regarding content and mechanics?
-- Do you consider a game being open source and modifiable good or bad, and why?
-- Are there some old games (any genre) that were never replicated again, mechanics-wise?
-- Is there incentive for you to sell your game on Itch or Steam, and do you think it'll sell?
General questions:
-- What are some things you'd like to see in indie games, regarding content and mechanics?
-- Do you consider a game being open source and modifiable good or bad, and why?
-- Are there some old games (any genre) that were never replicated again, mechanics-wise?
-- Is there incentive for you to sell your game on Itch or Steam, and do you think it'll sell?
Anonymous 01/19/25(Sun)14:26:10 No.103958248
Anonymous 01/19/25(Sun)14:43:20 No.103958420
>>103929599
>spend years engine hopping and jumping from project to project
>finally start making excellent progress in Unreal on my 3D beat em up with blueprints
>been going good for around 3 months now
>actually feel a sense of accomplishment for once
>decide it's time to rewrite most of it in C++ for the questionable performance gain
>now I've been stuck for weeks trying to rewrite some of the most simple systems let alone the complex ones
>starting to feel that urge to start engine hopping again
I'm never going to finish anything. Learning all these Unrealisms and macros is making my brain hurt. I just want to have fun programming a game that doesn't require digging through forum posts for hours trying to figure out how undocumented bullshit works. Then even after all this some asshole will just call my game unreal slop.
>spend years engine hopping and jumping from project to project
>finally start making excellent progress in Unreal on my 3D beat em up with blueprints
>been going good for around 3 months now
>actually feel a sense of accomplishment for once
>decide it's time to rewrite most of it in C++ for the questionable performance gain
>now I've been stuck for weeks trying to rewrite some of the most simple systems let alone the complex ones
>starting to feel that urge to start engine hopping again
I'm never going to finish anything. Learning all these Unrealisms and macros is making my brain hurt. I just want to have fun programming a game that doesn't require digging through forum posts for hours trying to figure out how undocumented bullshit works. Then even after all this some asshole will just call my game unreal slop.
Anonymous 01/19/25(Sun)14:49:39 No.103958499
>>103958420
When was the last time you had fun programming, as in writing actual programs, in static, compiled and linked programming language?
When was the last time you had fun programming, as in writing actual programs, in static, compiled and linked programming language?
Anonymous 01/19/25(Sun)14:55:03 No.103958556
>>103958420
>>decide it's time to rewrite most of it in C++ for the questionable performance gain
With few caveats, I have vowed to never rewrite something that already works. Here is screenshot from a piece by Peter Norvig, who has been very influential to my own formation https://www.norvig.com/Lisp-retro.html
>>decide it's time to rewrite most of it in C++ for the questionable performance gain
With few caveats, I have vowed to never rewrite something that already works. Here is screenshot from a piece by Peter Norvig, who has been very influential to my own formation https://www.norvig.com/Lisp-retro.h
Anonymous 01/19/25(Sun)14:56:28 No.103958578
>>103957022
How do these variants perform?
Also, what kind of input values are you using for benchmarking? It might be worth measuring once with sequential inputs and again with random inputs to see the effect of branch prediction
How do these variants perform?
inline constexpr std::uint8_t fastSaturateIntToChar_Naive(int val) {
return val < 0 ? 0 : val > 255 ? 255 : val;
}
inline constexpr std::uint8_t fastSaturateIntToChar_NoBranch1(intval) {
uint8_t too_big = val > 255;
uint8_t ones_if_too_big = too_big * 255;
uint8_t too_small = val < 0;
return ((uint8_t)val * !too_small) | ones_if_too_big;
}
inline constexpr std::uint8_t fastSaturateIntToChar_NoBranch2(intval) {
int neg_if_too_small = val;
uint8_t zeros_if_too_small = ~(uint8_t)(neg_if_too_small >> 31);
int neg_if_too_big = (int)((unsigned int)255 - (unsigned int)val);
uint8_t ones_if_too_big = (uint8_t)(neg_if_too_big >> 31);
return (uint8_t)val & zeros_if_too_small | ones_if_too_big;
}
inline constexpr std::uint8_t fastSaturateIntToChar_Naive2(int val) {
// From https://stackoverflow.com/a/46876282
if (val < 0) val = 0;
if (val > 255) val = 255;
return val;
}
Also, what kind of input values are you using for benchmarking? It might be worth measuring once with sequential inputs and again with random inputs to see the effect of branch prediction
Anonymous 01/19/25(Sun)14:57:03 No.103958586
>ask ai for some advice on coding problem
>the answer is actually exactly what i wanted
it's over, programmers confirmed deprecated
>the answer is actually exactly what i wanted
it's over, programmers confirmed deprecated
Anonymous 01/19/25(Sun)15:16:49 No.103958816
>>103958586
It answered about your JavaScript "problem", the one which billion jeets solved before you, which you could find on fucking SOverflow as well.
Ask it to write something semi-trivial in Ada or F90 and have fun looking through compilation errors, I tried it, it was so miserable to see AI do it.
I'm talking about literally placing C++ comments in Ada and F90 code, or thing that tries to be one, because there's little open source data for those 2.
Go to /twg/ for doom-posting, this isn't the place for that. Cheers fag.
It answered about your JavaScript "problem", the one which billion jeets solved before you, which you could find on fucking SOverflow as well.
Ask it to write something semi-trivial in Ada or F90 and have fun looking through compilation errors, I tried it, it was so miserable to see AI do it.
I'm talking about literally placing C++ comments in Ada and F90 code, or thing that tries to be one, because there's little open source data for those 2.
Go to /twg/ for doom-posting, this isn't the place for that. Cheers fag.
Anonymous 01/19/25(Sun)15:22:56 No.103958877
I'm gonna be the very best
Enginedev there ever was
Enginedev there ever was
Anonymous 01/19/25(Sun)15:24:58 No.103958897
>>103958816
it answered a c++ template problem but do keep seething :3
it answered a c++ template problem but do keep seething :3
Anonymous 01/19/25(Sun)15:28:19 No.103958929
Can't decide whether to do a
>3D fighting game
>3D platformer
>TPS
>life sim
>jrpg-like rpg
>morrow-like rpg
>mouse based crpg
>city sim
>fps
This is the problem when I have so many basic ideas.
I get overloaded and can't choose; I get decision paralysis.
>3D fighting game
>3D platformer
>TPS
>life sim
>jrpg-like rpg
>morrow-like rpg
>mouse based crpg
>city sim
>fps
This is the problem when I have so many basic ideas.
I get overloaded and can't choose; I get decision paralysis.
Anonymous 01/19/25(Sun)15:28:24 No.103958931
>>103958586
over half of the shit i ask the ai for is horribly wrong
over half of the shit i ask the ai for is horribly wrong
Anonymous 01/19/25(Sun)15:30:21 No.103958949
>>103958897
There are multiple reasons why you don't want to use templates in C++, but I'll leave that up to you, if you don't know why, learn it.
There are multiple reasons why you don't want to use templates in C++, but I'll leave that up to you, if you don't know why, learn it.
Anonymous 01/19/25(Sun)15:31:39 No.103958964
>>103958949
lmao, you are so fucking mad right now
lmao, you are so fucking mad right now
Anonymous 01/19/25(Sun)15:36:39 No.103959018
Your game needs more cowbox
Anonymous 01/19/25(Sun)15:37:59 No.103959035
>>103958949
retard take
retard take
Anonymous 01/19/25(Sun)15:38:27 No.103959039
>>103959018
l2cubemap
l2cubemap
Anonymous 01/19/25(Sun)15:39:00 No.103959047
>>103959018
i have a spinning uv cube, does that count as a cow with cool fur?
i have a spinning uv cube, does that count as a cow with cool fur?
Anonymous 01/19/25(Sun)15:39:39 No.103959056
>>103958964
To be honest, I was waiting for you to rage so I can post this image, but I ended up raging...
To be honest, I was waiting for you to rage so I can post this image, but I ended up raging...
Anonymous 01/19/25(Sun)15:40:59 No.103959071
>>103959039
there are very few good cubemaps available in the format I use (DDS). I have to manually build my own from old CS:S community resources
there are very few good cubemaps available in the format I use (DDS). I have to manually build my own from old CS:S community resources
Anonymous 01/19/25(Sun)15:42:16 No.103959083
>>103959071
>there are very few good cubemaps available in the format I use (jpeg).
this is what you sound like right now
>there are very few good cubemaps available in the format I use (jpeg).
this is what you sound like right now
Anonymous 01/19/25(Sun)15:42:19 No.103959084
>>103958929
decision paralysis just means none of the above, it isn't real just an illusion
decision paralysis just means none of the above, it isn't real just an illusion
Anonymous 01/19/25(Sun)15:43:15 No.103959092
>export gltf from blender
>load in game
>no textures
>load in game
>no textures
Anonymous 01/19/25(Sun)15:43:31 No.103959100
Anonymous 01/19/25(Sun)15:45:38 No.103959121
>add spdlog
>it only flushes after program exit even when i call flush()
>check github
>other people also have this problem
I thought spdlog was mature and stable?
>it only flushes after program exit even when i call flush()
>check github
>other people also have this problem
I thought spdlog was mature and stable?
Anonymous 01/19/25(Sun)15:46:58 No.103959133
>>103959083
what do u mean anon
what do u mean anon
Anonymous 01/19/25(Sun)15:47:46 No.103959143
>>103959083
I wish the government would release more rare Pepes in .gif format...
I wish the government would release more rare Pepes in .gif format...
Anonymous 01/19/25(Sun)15:48:32 No.103959150
>>103959092
glTF either encodes textures as raw base64 data in the file, or as URLs to images. Check your export settings in blender, and inspect your gltf file to see if it has a long buffer of base64 data or if it just has something like `file://path/to/texture.png`
glTF either encodes textures as raw base64 data in the file, or as URLs to images. Check your export settings in blender, and inspect your gltf file to see if it has a long buffer of base64 data or if it just has something like `file://path/to/texture.png`
Anonymous 01/19/25(Sun)15:48:36 No.103959151
>>103959100
what you want aint always what you need, usually you start with something you don't want to figure out what you really need
https://blog.crisp.se/2016/01/25/henrikkniberg/making-sense-of-mvp
what you want aint always what you need, usually you start with something you don't want to figure out what you really need
https://blog.crisp.se/2016/01/25/he
Anonymous 01/19/25(Sun)15:48:53 No.103959154
>>103958578
Ok, so I changed the setup a few times and weird shit was happening, like explicitly casting float to int instead of automatically to uint in a single benchmark was giving a good result but affected some other separate benchmark functions negatively in a deterministic way, wtf.
Randomized data worked best for naive approaches, then std::clamp, then no branch1.
Executing several times per single randomized data point with added constant offsets is best for naive, then variants of my solution, then std::clamp and no branch 1 and 2 (and same as my commented out variant).
Naive 1 remains as the best option overall except for very specific cases it seems.
Ok, so I changed the setup a few times and weird shit was happening, like explicitly casting float to int instead of automatically to uint in a single benchmark was giving a good result but affected some other separate benchmark functions negatively in a deterministic way, wtf.
Randomized data worked best for naive approaches, then std::clamp, then no branch1.
Executing several times per single randomized data point with added constant offsets is best for naive, then variants of my solution, then std::clamp and no branch 1 and 2 (and same as my commented out variant).
Naive 1 remains as the best option overall except for very specific cases it seems.
Anonymous 01/19/25(Sun)15:50:09 No.103959166
>>103959151
But I WANT to design/plan out a game before I start development on it.
I don't want to blindly develop a game not knowing what I want/need to make
But I WANT to design/plan out a game before I start development on it.
I don't want to blindly develop a game not knowing what I want/need to make
Anonymous 01/19/25(Sun)15:51:04 No.103959176
>>103959133
this might sound crazy anon but you can convert any image format to any other image format and there's in fact a command line tool specifically provided to do exactly that for dds and most image editors support it either directly or through plugins
this might sound crazy anon but you can convert any image format to any other image format and there's in fact a command line tool specifically provided to do exactly that for dds and most image editors support it either directly or through plugins
Anonymous 01/19/25(Sun)15:55:48 No.103959226
>>103959166
you can't, and i can say that you can't because you already admitted that you can't
you can't, and i can say that you can't because you already admitted that you can't
Anonymous 01/19/25(Sun)15:56:17 No.103959228
>>103959176
Yes I know that's why I said I have to manually build my own
Yes I know that's why I said I have to manually build my own
Anonymous 01/19/25(Sun)16:00:48 No.103959286
>>103957022
try this insane thing
try this insane thing
return !!(x & ~0xFF) * (((-(x >> 8)) | (x << 24)) >> 8) + !(x & ~0xFF) * x;
Anonymous 01/19/25(Sun)16:03:54 No.103959325
Would it make sense to make a simpler game to test the engine your "real" game will use, and release that "test game" first?
Ala how Virtua Racing was initially made by Sega as a tech/engine demo for the Model 1 and it became its own thing released before Virtua Fighter
Ala how Virtua Racing was initially made by Sega as a tech/engine demo for the Model 1 and it became its own thing released before Virtua Fighter
Anonymous 01/19/25(Sun)16:08:24 No.103959384
>>103959325
thats what i have planned on doing
thats what i have planned on doing
Anonymous 01/19/25(Sun)16:11:07 No.103959415
>>103959286
This C++ code converts an unsigned 32-bit integer to a signed 32-bit integer, but only if the original value is greater than 255. If the original value is between 0 and 255 (inclusive), it leaves the value unchanged.
This C++ code converts an unsigned 32-bit integer to a signed 32-bit integer, but only if the original value is greater than 255. If the original value is between 0 and 255 (inclusive), it leaves the value unchanged.
Anonymous 01/19/25(Sun)16:18:02 No.103959502
c# bros... dont tell the other langs about our embarrassing gc times please )': (6% of the frame budget at 120 fps)
with vsync enabled, do you guys set deltaTime to be exactly 1 / monitorHz if you can assume the game is hitting vblank? the FPS jitter is probably becuase of the operating system or whatever. the way its measured is just with a timer between frames.
with vsync enabled, do you guys set deltaTime to be exactly 1 / monitorHz if you can assume the game is hitting vblank? the FPS jitter is probably becuase of the operating system or whatever. the way its measured is just with a timer between frames.
Anonymous 01/19/25(Sun)16:34:46 No.103959697
>>103959502
you do know you can use arrays/pools and other memory management techniques to avoid triggering the GC at all in any language, right?
are you being retarded and making thousands of objects per frame for no reason?
>c#
can't wait to use dynspy on it for the free laugh and code :)
you do know you can use arrays/pools and other memory management techniques to avoid triggering the GC at all in any language, right?
are you being retarded and making thousands of objects per frame for no reason?
>c#
can't wait to use dynspy on it for the free laugh and code :)
Anonymous 01/19/25(Sun)16:36:01 No.103959715
>>103959502
no i don't do that, I poll inputs at 1000hz but I only update the game state at 60hz and the renderer is completely detached from the update rate, I just let it pump out frames as fast as it can by interpolating the game state between ticks.
no i don't do that, I poll inputs at 1000hz but I only update the game state at 60hz and the renderer is completely detached from the update rate, I just let it pump out frames as fast as it can by interpolating the game state between ticks.
Anonymous 01/19/25(Sun)16:36:29 No.103959721
>>103959286
Nice, it's slightly better than mine in both cases.
Nice, it's slightly better than mine in both cases.
Anonymous 01/19/25(Sun)16:44:18 No.103959811
>>103959415
are you sure, all my tests are passing
>>103959721
ha thats mental. how fast is it compared to the others?
are you sure, all my tests are passing
>>103959721
ha thats mental. how fast is it compared to the others?
Anonymous 01/19/25(Sun)16:47:38 No.103959844
>>103959715
why interpolate and not just render the latest state? to reduce felt jitter? how do you store the state?
why interpolate and not just render the latest state? to reduce felt jitter? how do you store the state?
Anonymous 01/19/25(Sun)16:57:05 No.103959950
>>103959502
Very pretty and sovlful
Very pretty and sovlful
Anonymous 01/19/25(Sun)17:09:08 No.103960057
>>103959844
If you do exponential smoothing with deltaTime equal to refresh rate then you have to use power functions to restore frame rate independence. If your deltaTime is independent of refresh rate then you can use linear interpolation. It's just stored like normal data I don't know what you mean.
If you do exponential smoothing with deltaTime equal to refresh rate then you have to use power functions to restore frame rate independence. If your deltaTime is independent of refresh rate then you can use linear interpolation. It's just stored like normal data I don't know what you mean.
Anonymous 01/19/25(Sun)17:09:39 No.103960064
Anonymous 01/19/25(Sun)17:11:14 No.103960078
>>103959811
It's mid tier for randomizer data, and in the great tier for corelated data.
I found the original test and I was transforming random numbers inside of the loop which might be throwing off branch prediction. In this case it actually beats the otherwise top tier naive function by 10%, but mine cuts it down by another 10.
It's mid tier for randomizer data, and in the great tier for corelated data.
I found the original test and I was transforming random numbers inside of the loop which might be throwing off branch prediction. In this case it actually beats the otherwise top tier naive function by 10%, but mine cuts it down by another 10.
Anonymous 01/19/25(Sun)17:32:40 No.103960290
>>103960057
would this cost you an extra frame of input lag then? but the jitter error would be very small im imagining. very cool
>>103960064
i wait for blanking, but still just because of os shit or whatever even if you hit the blank your timer used to measure time between frames is not gonna be exactly 1/monitorHz, even tough thats what the timings between blanks actually is. i think with modern apis dx12 or vulkan you can get timestamps when something was shown on monitor, giving an exact measurement between blanks to be used for deltaTime. im not even sure if these micro jitters are perceptible anyhow...
would this cost you an extra frame of input lag then? but the jitter error would be very small im imagining. very cool
>>103960064
i wait for blanking, but still just because of os shit or whatever even if you hit the blank your timer used to measure time between frames is not gonna be exactly 1/monitorHz, even tough thats what the timings between blanks actually is. i think with modern apis dx12 or vulkan you can get timestamps when something was shown on monitor, giving an exact measurement between blanks to be used for deltaTime. im not even sure if these micro jitters are perceptible anyhow...
Anonymous 01/19/25(Sun)17:41:19 No.103960396
>>103958816
solved - that means memorized in hindi?
solved - that means memorized in hindi?
Anonymous 01/19/25(Sun)17:42:47 No.103960413
Anonymous 01/19/25(Sun)18:03:36 No.103960615
>>103959502
>with vsync enabled, do you guys set deltaTime to be exactly 1 / monitorHz if you can assume the game is hitting vblank?
There's a really good talk from one of the Talos Principle devs on frame pacing. IIRC they wound up doing something like this, with some heuristics to drop to 1/2 the vblank rate if the machine is overloaded. But they were also working on getting APIs standardized that would allow you to do some better thing.
>with vsync enabled, do you guys set deltaTime to be exactly 1 / monitorHz if you can assume the game is hitting vblank?
There's a really good talk from one of the Talos Principle devs on frame pacing. IIRC they wound up doing something like this, with some heuristics to drop to 1/2 the vblank rate if the machine is overloaded. But they were also working on getting APIs standardized that would allow you to do some better thing.
Anonymous 01/19/25(Sun)18:03:51 No.103960618
>>103959715
nigger wants his gpu to die faster
nigger wants his gpu to die faster
Frosch !!QxG8tdNNBUC 01/19/25(Sun)18:14:22 No.103960734
>>103959121
>spdlog
All you need is 40 lines of code brother
Here is some code taken from ... somewhere.
>spdlog
All you need is 40 lines of code brother
Here is some code taken from ... somewhere.
typedef enum
{
LOG_TRACE,
LOG_DEBUG,
LOG_INFO,
LOG_WARN,
LOG_ERROR,
LOG_FATAL
} LoggerType;
#define LOGGER_CHARACTER_COUNT 2048
#define ANSI_COLOR_RESET "\x1b[0m"
#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
#define ANSI_COLOR_YELLOW "\x1b[33m"
#define ANSI_COLOR_BLUE "\x1b[34m"
#define ANSI_COLOR_MAGENTA "\x1b[35m"
#define ANSI_COLOR_CYAN "\x1b[36m"
static char loggerBuffer[LOGGER_CHARACTER_COUNT];
static const char* loggerNames[] =
{
"TRACE", "DEBUG", "INFO",
"WARN", "ERROR", "FATAL"
};
static const char* loggerColors[] =
{
ANSI_COLOR_BLUE, ANSI_COLOR_CYAN, ANSI_COLOR_GREEN,
ANSI_COLOR_YELLOW, ANSI_COLOR_MAGENTA, ANSI_COLOR_RED
};
void Log(LoggerType t, const char* format, ...)
{
va_list args;
va_start(args, format);
vsnprintf(loggerBuffer, LOGGER_CHARACTER_COUNT, format, args);
va_end(args);
printf("%s[%s]: %s%s\n", loggerColors[t], loggerNames[t], loggerBuffer, ANSI_COLOR_RESET);
}
Anonymous 01/19/25(Sun)18:29:36 No.103960896
>>103958586
>Ask AI to help solve linking problem
>None of the answers are correct/work
>Search google/read stackoverflow
>Same thing
>Dig through documentation
>Success
I think we're fine.
>Ask AI to help solve linking problem
>None of the answers are correct/work
>Search google/read stackoverflow
>Same thing
>Dig through documentation
>Success
I think we're fine.
Anonymous 01/19/25(Sun)18:40:12 No.103960995
without tonemapping / with tonemapping
anyone building their game for HDR monitors? whats the workflow like?
anyone building their game for HDR monitors? whats the workflow like?
Anonymous 01/19/25(Sun)18:44:45 No.103961036
>>103960995
anon you don't just check the aces box and call it a day, you're supposed to design your textures and lighting around it
anon you don't just check the aces box and call it a day, you're supposed to design your textures and lighting around it
Anonymous 01/19/25(Sun)18:46:00 No.103961044
>>103960995
what's an HDR monitor? is that 64 bit color or something?
what's an HDR monitor? is that 64 bit color or something?
Anonymous 01/19/25(Sun)18:49:36 No.103961078
>>103961044
local dimming, mainly OLED and to a lesser extent miniLED
other displays that claim to support HDR are full of shit
local dimming, mainly OLED and to a lesser extent miniLED
other displays that claim to support HDR are full of shit
Anonymous 01/19/25(Sun)18:53:08 No.103961111
>>103960995
It looks washed out. Can you crank up exposure?
It looks washed out. Can you crank up exposure?
Anonymous 01/19/25(Sun)19:04:18 No.103961196
>>103961036
its not aces, what does that mean though? is there a guide somewhere?
its not aces, what does that mean though? is there a guide somewhere?
Anonymous 01/19/25(Sun)19:08:00 No.103961232
>>103960995
I looked into it and I realized there wasn't much point considering hardly anyone has a HDR monitor (except mac users)
I looked into it and I realized there wasn't much point considering hardly anyone has a HDR monitor (except mac users)
Anonymous 01/19/25(Sun)19:14:39 No.103961289
im making my own hash map in c++ for the first time, i hope it works out
Anonymous 01/19/25(Sun)19:17:46 No.103961326
>>103961289
dont bother trying, its impossible
dont bother trying, its impossible
Frosch !!QxG8tdNNBUC 01/19/25(Sun)19:21:18 No.103961354
Anonymous 01/19/25(Sun)19:23:54 No.103961383
Alright I got a window/event loop up and running and converted one of the DirectX9 SDK examples to C/said window framework
What issues will I have to deal with to actually have DX9 as an option alongside OpenGL 2.1
What issues will I have to deal with to actually have DX9 as an option alongside OpenGL 2.1
Anonymous 01/19/25(Sun)19:24:03 No.103961384
>>103961326
now i want to do it even more
we be using concepts
>>103961354
sorry that i like using namespaces and RAII
now i want to do it even more
we be using concepts
>>103961354
sorry that i like using namespaces and RAII
Anonymous 01/19/25(Sun)19:33:57 No.103961470
Work in progress, refactoring script parser...
Anonymous 01/19/25(Sun)19:35:25 No.103961478
>>103961470
i wish i could read that
i wish i could read that
Anonymous 01/19/25(Sun)19:42:57 No.103961533
>>103961478
Here it is...
Here it is...
Frosch !!QxG8tdNNBUC 01/19/25(Sun)19:49:38 No.103961596
>>103961384
Namespaces are good. RAII on the other hand ...
Namespaces are good. RAII on the other hand ...
Anonymous 01/19/25(Sun)19:58:38 No.103961671
Realistically speaking, I want to make a (specifically 3D) game and have it out by mid-late 2026 or early 2027.
I wonder what kinds of 3D games would be less time consuming to make (and thus would be ready by that time).
Arcadey style games perhaps? Such as Virtua Racing, Star Fox, Tekken, etc?
I wonder what kinds of 3D games would be less time consuming to make (and thus would be ready by that time).
Arcadey style games perhaps? Such as Virtua Racing, Star Fox, Tekken, etc?
Anonymous 01/19/25(Sun)20:00:28 No.103961686
>>103961671
If your only requirement is "3D" then you can just make any shitty game with low production value in Unity
If your only requirement is "3D" then you can just make any shitty game with low production value in Unity
Anonymous 01/19/25(Sun)20:01:53 No.103961707
>>103961686
Obviously that's not my only requirement, no way I want to make something that's ass
Obviously that's not my only requirement, no way I want to make something that's ass
Anonymous 01/19/25(Sun)20:03:42 No.103961726
>>103961707
If you only have a year then you're going to make something that's ass unless you're a very experienced dev
If you only have a year then you're going to make something that's ass unless you're a very experienced dev
Anonymous 01/19/25(Sun)20:04:14 No.103961732
>>103961726
OK, how about 2 years then?
OK, how about 2 years then?
Anonymous 01/19/25(Sun)20:19:50 No.103961871
I played fortnite 14 hours instead of working on my engine
Anonymous 01/19/25(Sun)20:21:08 No.103961882
>>103961871
its not like you would have gotten anything done, right?
its not like you would have gotten anything done, right?
Anonymous 01/19/25(Sun)20:56:23 No.103962245
Anonymous 01/19/25(Sun)21:05:37 No.103962341
>>103961732
ass
ass
Anonymous 01/19/25(Sun)23:49:12 No.103963647
>>103961882
I was finishing up skeletal animations
I was finishing up skeletal animations
Anonymous 01/20/25(Mon)00:03:12 No.103963745
>>103947056
>on code organization, software engineering
practice and fucking up a few times your projects.
>on code organization, software engineering
practice and fucking up a few times your projects.