/gedg/ - Game and Engine Development General #237
Anonymous 01/08/25(Wed)12:31:55 | 318 comments | 60 images | 🔒 Locked
quake-3-code
/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
Render bugs: https://renderdoc.org/
Previous: >>103768113

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.
Anonymous 01/08/25(Wed)13:16:06 No.103813941
Untitled
I'm researching visibility algorithms, post your resources https://ncase.me/sight-and-light/
Anonymous 01/08/25(Wed)13:21:21 No.103814013
Untitled
>>103813941
Oh and this one too https://www.redblobgames.com/articles/visibility/
Anonymous 01/08/25(Wed)14:04:56 No.103814670
space hulk dos
How much linear algebra and calculus do I have to learn before I can comfortably make a simple raycasting "engine"? Or more accurately, display a 2D grid as a raycasting view? I hope to one day make a web accessible version of the DOS version of Space Hulk.
Anonymous 01/08/25(Wed)14:21:58 No.103814917
>>103814670
Depends on how detailed you want it to be, you can get away with some smoke and mirrors https://youtu.be/WDACES3lQeA?feature=shared&t=641
Anonymous 01/08/25(Wed)14:47:31 No.103815214
>>103814670
There's usually videos and articles on that, you don't need to know linear algebra or calculus. Just copy.
Anonymous 01/08/25(Wed)14:53:20 No.103815307
>>103814013
good website
Anonymous 01/08/25(Wed)16:11:45 No.103816390
41j0a7DO+3L._UF894,1000_QL80_
Good album to dev https://www.youtube.com/watch?v=-E0YTvT5dNQ&list=OLAK5uy_n1g4K11FyfYLaBHFyHlR83o0lm0ZY9EB8
Frosch !!QxG8tdNNBUC 01/08/25(Wed)16:28:38 No.103816592
Organized the different scenes into different files. Code is looking better now. I like my main file nice a light.

https://codeberg.org/FroggyGreen/space-case-3D
Anonymous 01/08/25(Wed)17:06:03 No.103817104
next demo day when? we haven't had one in a little while and I'm itching to find motivation to work on my shit
Frosch !!QxG8tdNNBUC 01/08/25(Wed)17:12:29 No.103817197
>>103816592
Added ship states. Ship input was coupled to inner update simulation loop. Which was something that needed to be cleaned up. Now you can just change a state in the struct whenever (such as when processing input like with the player ship and in the future when making enemy ai decisions) and then update that ship in the general update loop for all game objects.

>>103817104
/agdg/ has them every two months so a little under two months before that happens
https://itch.io/jam/agdg-demo-day-61

As for /gedg/ progress day we haven't had one in a while. I'm thinking of scheduling one for the /gedg/ second anniversary.
Anonymous 01/08/25(Wed)17:16:16 No.103817253
>>103817197
I fucked up, I meant progress days. I don't participate in agdg demo days
Anonymous 01/08/25(Wed)17:34:14 No.103817492
file
>>103816592
>nice a light
is this one of those "a soon shit" moments?
Frosch !!QxG8tdNNBUC 01/08/25(Wed)17:40:50 No.103817596
>>103817492
It's one of those "my keyboard is fucked and I have to press down hard on my keys on top of having clumsy fingers" moments.
Anonymous 01/08/25(Wed)17:41:56 No.103817612
>>103817596
its 170 lines, that's not light
Frosch !!QxG8tdNNBUC 01/08/25(Wed)17:55:37 No.103817784
>>103817612
There are about ~3000 lines of code in total and before my first commit, I had well over 1000 lines in that single file.

>170 lines isn't light
Really? Seems pretty light for me since it contains all the scene switch cases. Having a dedicated file for that seems a bit overkill.
Anonymous 01/08/25(Wed)19:19:26 No.103818720
>>103812723
The future looks like forth, but infix.
Anonymous 01/08/25(Wed)19:33:02 No.103818850
>>103817612
>>103817784
I have a solution to make it lighter
// main.c
#include "main_implementation.c"
Anonymous 01/08/25(Wed)19:55:15 No.103819125
>>103817784
i'd put all that code above main function into a game.h/cpp file
Anonymous 01/08/25(Wed)20:16:48 No.103819372
>>103816592
>the amount of times youve rewritten essentially the same switch statements on main.c
I will admit, the resulting main function does look clean and I will not tell you to use polymorphism or other encapsulating OOP crap. But your other functions with the same case labels could be converted to a table so that you don't have to multiply the amount of typing (or copypasting) every time you want to add a case.

I'd do this by abstracting such logic into a table, like so:
|SCENE_  |DrawApp     |UpdateApp     |
|--------+------------+--------------|
|PRETITLE|DrawPretitle|UpdatePretitle|
|TITLE |DrawTitle |UpdateTitle |


If we were to arrange all the function pointers in an array, the code to call any one of these functions in the table would be as follows:
enum Scene { SCENE_PRETITLE=0, SCENE_TITLE, SCENE_CNT };
enum AppAction { DRAW, UPDATE, AA_COUNT };

void AppDo(int scene, int action) {
(fptrs[scene * AA_COUNT + action])();
}

// Your main fn would becme
AppDo(SCENE_PRETITLE, DRAW);


Modify as needed, anon.
Frosch !!QxG8tdNNBUC 01/08/25(Wed)20:34:30 No.103819603
>>103819372
True. Table >> Branching after all.
Frosch !!QxG8tdNNBUC 01/08/25(Wed)22:03:25 No.103820373
>>103819372
Excellent suggestion. Managed to trim code from the main file. The scene system is much better now and will scale nicely as more scenes are added.
Anonymous 01/09/25(Thu)00:18:30 No.103821380
I'm testing some different tilemap rendering techniques and I want to try rendering entirely in a fragment shader, meaning the map data will be in a large texture with a single channel.
>pass tile size, map size, map texture, tile atlas etc to fragment shader
>for every map texel in viewport, draw sdf square to a canvas
i couldn't find a single example of this being done but that's probably only because google sucks nowadays.
has any anon tried this before? i'm curious about the drawbacks, whether its "cumbersome api" or whatever
Anonymous 01/09/25(Thu)00:25:51 No.103821416
>>103821380
I can't think of any drawbacks
Anonymous 01/09/25(Thu)00:42:53 No.103821515
>>103821416
Me neither, in fact the more I think about it the more I like it. Can do some soft metaball effect on the tiles, zooming out won't require some lod / metatile / avg color distribution, with multiple layers the "main" layer could be used as a mask to prevent overdraw on the background
Anonymous 01/09/25(Thu)02:39:05 No.103822210
Forgive me for not lurking the thread before asking my noob question that I am sure has been discussed to death here.

I am just starting to learn godot, and the design philosophy where everything is a node in a tree is really annoying to me, and I don't really like it. But it is really easy to use, and probably the only way I could feasibility make a prototype at my skill level. Do people here recommend godot or is frowned upon as a shitty toy engine.
Anonymous 01/09/25(Thu)02:43:08 No.103822230
>>103822210
Godot isn't worse than any other engine. You should use what's good for you and not for some anonymous retards from internet.
Anonymous 01/09/25(Thu)02:48:21 No.103822261
>>103822210
Godot is worse than Unity and you should just use Unity because it doesn't have the annoying "everything is a node" structure
Anonymous 01/09/25(Thu)02:55:52 No.103822302
>>103822261
I hate unity, for no real reason. You are right that I should at least check it out before making a decision.
One petty reason that I already don't like it, is it looks like you launch it through some shitty bloated "unityhub" package. I realize that this is not a big deal, but I autistically hate programs like this for some reason.
Anonymous 01/09/25(Thu)03:20:54 No.103822447
>>103822302
There's also GameGamer or Unreal
Anonymous 01/09/25(Thu)03:24:09 No.103822472
>>103822447
*GameMaker
Anonymous 01/09/25(Thu)05:26:23 No.103823212
>>103819372
>"I will not tell you to use polymorphism or other encapsulating OOP crap"
>Proceeds to badly and unsafely reinvent OOP crap
Anonymous 01/09/25(Thu)06:17:00 No.103823473
>>103816592
>>103819372
eww, that convinced me to c++ even more
Anonymous 01/09/25(Thu)06:31:07 No.103823540
>>103822230
>>103822261
The duality of /g/
Anonymous 01/09/25(Thu)06:40:11 No.103823599
>>103820373
Thanks, I stole this idea from the book "Thinking Forth". I recommend giving it a flick sometime.

>>103823212
Elaborate. My method does not hide amy data from the programmer.
Anonymous 01/09/25(Thu)06:43:52 No.103823620
>>103823599
"function pointers in an array" is exactly what OOP is and you don't get extra points for doing it yourself
Anonymous 01/09/25(Thu)06:51:46 No.103823664
>>103823620
>OOP is when there's a vtable
Anonymous 01/09/25(Thu)06:53:24 No.103823675
>>103823664
That's definitely a possible implementation of dynamic dispatch. Anyway, you are reinventing it, which I guess it's ok because there is no other way to do it in C. But that's exactly what OOP crap is.
Anonymous 01/09/25(Thu)07:02:07 No.103823725
>>103823620
To clear things up, what I mean by "crappy OOP" is its overruse of encapsulation, to the point where belief about their guarantees about their functionality working as intended approaches zero. If my method falls under someone's definition of OOP, cool.
The other merit about my method, other than being an intuitive way for abstracting a mapping of two discrete combinations of variables, is that it's trivial to extend, given that the data you're abstracting over still is best represented in a grid like form.
As for the unsafety concerns, maybe replace argument types to enums instead of plain int for the type safety factor. Or switch to ada or something.

>t. a cnile using his tools he's handed
Anonymous 01/09/25(Thu)07:03:36 No.103823739
>>103823664
pretty much
Anonymous 01/09/25(Thu)07:04:27 No.103823741
>>103823725
Wait until you hear about C++ and inheritance
Anonymous 01/09/25(Thu)07:06:16 No.103823755
serialization
I've been thinking in a serialization scheme that is independent of versions. If I bump the version, I can still maintain the struct used before, load old data, and call a function to update the struct to a new version. That way I could update old data by going from version to version function. Maybe slow for really old version stuff, but easier to maintain.
>Serialization:
>Game structs to Version specific struct
>VStruct to file
>Deserialization:
>file to version specific struct
>If version not current version, call update() until you reach current version.
Anonymous 01/09/25(Thu)07:18:08 No.103823819
versions
>>103823755
Reading the saved data it's about choosing the correct data struct for that version and upgrading until it can produce current game data
Anonymous 01/09/25(Thu)07:20:27 No.103823832
>>103823819
A possible function for v0.9 to v1.0
public static SectorMap Deserialize(string name)
{
var data1 = ToV_0_10_0(this);
var data2 = ToV_1_0_0(data1);
return data2.Deserialize(name);
}
Anonymous 01/09/25(Thu)07:21:44 No.103823843
Shadowcast
>>103813941
https://journal.stuffwithstuff.com/2015/09/07/what-the-hero-sees/

Couldn't bother doing it properly like in the link, so I tried to improvise my own using polar coordinates.
>make a 360 float array
>get a blocking object's "leftmost and rightmost" points as angular value
>save object's furthest distance in the array in very cell between the two angular value
>when checking if something is blocking by it, just check if the polar distance is closer than what's stored in the array
It made for a very low-quality 2D shadowmap.
I wanted to use it to speed up Line-of-Sight checks between armies, but in practice the amount of time where the closest targets were actually obstructed compared to already being in the same plaza/street was not a case that happened often enough to justify the overhead.

Maybe I will give it another try later, with a better method instead of YOLOing the concept.
Frosch !!QxG8tdNNBUC 01/09/25(Thu)08:41:30 No.103824350
>>103823599
>I recommend giving it a flick sometime.
I will. Thanks.

>>103823620
>>103823675
>>103823725
>>103823741
Personally, I don't mind certain aspects of OO. Dynamic dispatch is fine for me if I have a switch statement but most of the results are so long that I have to put them in functions. What I dislike about OO is when you add inheritance and mix it with dynamic dispatch. I also dislike C++ templates, RAII, etc.

I have to wonder if there are advantages to doing things this way compared to a C++ vtable. After all, there is full transparency in how the table is structured compared to a C++ vtable which is handed to the compiler. I'm not sure it there is, I'm no professional when it comes to optimization, but its just a thought.
Anonymous 01/09/25(Thu)08:50:39 No.103824432
>>103824350
>I have to wonder if there are advantages to doing things this way compared to a C++ vtable.
You can set per-object vtables instead of per-class
You can modify them at runtime
Anonymous 01/09/25(Thu)09:26:37 No.103824730
does it matter what distro you use to gamedev?
Anonymous 01/09/25(Thu)09:29:13 No.103824751
>>103824730
no, only the terminal based editor
Anonymous 01/09/25(Thu)09:29:20 No.103824753
does it matter what distro you use to gamedev? could you do everything on debian stable?
Anonymous 01/09/25(Thu)09:31:26 No.103824768
Anonymous 01/09/25(Thu)09:31:55 No.103824771
>>103824753
serious game developers use windows
Anonymous 01/09/25(Thu)09:34:33 No.103824792
>>103824771
Bait but also true, if only because most of your players will be on windows and it's better to test your shit on something that's close to customers' hardware.
Anonymous 01/09/25(Thu)09:35:44 No.103824800
>>103823755
I built something like this based on CBOR (though it should work with any self-describing format). But I specifically wanted to avoid keeping around old versions of the structs, so my upgrade() operation instead works on the CBOR representation (which is made up of lists/maps/primitives, similar to JSON).

Serialize:
>write version number
>serialize struct into the file
Deserialize:
>if the version number matches, deserialize the file directly into the struct
>otherwise:
>>deserialize the file to a generic CBOR value
>>in a loop, check the current version number and apply its upgrade operation, which edits the CBOR and increases the version
>>once the version matches the current version, convert the CBOR value into the struct
Anonymous 01/09/25(Thu)09:35:56 No.103824802
>>103824792
the entire gamedev ecosystem is on windows
Anonymous 01/09/25(Thu)09:53:54 No.103824973
>>103824753
If you're to build for linux then yes use debian stable.
Meanwhile that doesn't imply that you need to develop on debian stable. Personally I use docker to build my game on debian stable while I develop on debian SID.

Worry about making the game before you worry on how you will ship it.
Anonymous 01/09/25(Thu)09:56:43 No.103825007
>>103824973
>Personally I use docker to build my game on debian stable while I develop on debian SID.
how dystopian
Anonymous 01/09/25(Thu)09:58:05 No.103825023
game
>>103824753
That's what I'm doing myself.
Anonymous 01/09/25(Thu)09:59:20 No.103825036
i had such a good idea for a game which i came up with right before falling asleep
now i dont remember what it was
it was probably for the best...
Anonymous 01/09/25(Thu)10:06:28 No.103825113
How can I do this https://www.deadnode.org/sw/bin2h/ from the linux command line?
Anonymous 01/09/25(Thu)10:07:51 No.103825127
file
>>103825113
do you not have internet?
Anonymous 01/09/25(Thu)10:08:58 No.103825137
>>103825127
i hate that i clicked on the screenshot, fuck windows
Anonymous 01/09/25(Thu)10:09:12 No.103825141
>>103825127
I need something to include in the source code as a const, then read at runtime. Answers on the internet so far are useless.
Anonymous 01/09/25(Thu)10:20:02 No.103825253
>>103825007
and by "on debian stable" I mean by using a debian stable image.
How different would go about doing this? Don't tell me to use a virtual machine.
Anonymous 01/09/25(Thu)10:21:34 No.103825272
>>103825253
Normal people just use windows
Anonymous 01/09/25(Thu)10:23:22 No.103825286
>>103825272
We're on /g/. We're not normal people.
Anonymous 01/09/25(Thu)10:31:08 No.103825363
Haven't touched my project in months. Gonna give it a red hot go this weekend.
Anonymous 01/09/25(Thu)10:41:13 No.103825453
>>103825141
Alright, found the answer. xxd -i
Anonymous 01/09/25(Thu)10:43:05 No.103825467
1710335661406301
>>103825363
Your project has been missing you, anon.
Anonymous 01/09/25(Thu)10:57:54 No.103825644
>>103825453
>xxd -i
Cool, I hadn't heard of this

In C23 you can use #embed "file.bin", which expands to roughly the same thing:
https://stackoverflow.com/questions/74621610/what-is-the-purpose-of-the-new-c23-embed-directive

There are also some tricks you can do with objcopy to get the same effect but without going through the C compiler. Might be useful if your embedded data is many megabytes and the C compiler has performance issues when handling million+-element array initializers. Though I would hope that #embed uses a more efficient representation than the xxd -i version
Anonymous 01/09/25(Thu)11:37:37 No.103826034
/gedg/ do you have ugly hackjobs in your code just to make some things just work that would otherwise break or be impossible to implement otherwise?
i know i have one, so far only one
Anonymous 01/09/25(Thu)11:39:54 No.103826061
>>103826034
Depends on how you define it, I have this code to wrap words in a message box. I don't like it that much but it does the job
var i = 0;
var l = -1;
while (i < message.Length)
{
if (message[i] == ' ') l = i;
var pos = text.FindCharacterPos((uint)i++);
if (pos.X >= w && l != -1)
{
message = message.Remove(l, 1).Insert(l, "\n");
text.DisplayedString = message;
l = -1;
}
}
Anonymous 01/09/25(Thu)11:41:06 No.103826077
1713969476262366
>>103826034
hahaha I would never do that! haha
Anonymous 01/09/25(Thu)11:46:47 No.103826128
Project Management
>>103826034
All my multi-threading pretty much just YOLO through thread safety guidelines unless it's crash-critical.
And my physics engine flip-flop on its third-dimension awareness depending on the situation.
Anonymous 01/09/25(Thu)11:49:34 No.103826164
>>103826061
not really a hack, just something ugly

>>103826077
i think you are lying

>>103826128
damn anon, you are playing with fire. what are you doing?
Anonymous 01/09/25(Thu)12:12:59 No.103826420
1715180331854535
>>103826164
>i think you are lying
Fine! My worse hackjob would be how I find which wall should be painted. It works by first getting which tile is under the cursor and then walk backward toward the camera until it finds a wall. It works for now but if I'm to change the walls height or the camera angle then this system will break.
Anonymous 01/09/25(Thu)12:19:59 No.103826518
>>103826420
thats janky, im cant visualize it, but maybe a better kind of ray casting could work?
Anonymous 01/09/25(Thu)12:23:32 No.103826562
game
State of the art.
Anonymous 01/09/25(Thu)12:24:18 No.103826570
>>103826518
Yeah I'm thinking of the same ray casting I do to find which tile is under cursor but instead to check for an intersection with a wall.
Anonymous 01/09/25(Thu)12:27:59 No.103826617
>>103826570
without knowing anything about your project, id say go with ray casting to pick the right polygon / mesh / segment would likely be the way to go about it. but then again that might require a lot of reworking to get that set up
Anonymous 01/09/25(Thu)12:35:57 No.103826681
>>103826617
I'm the simslike dev and no it won't be much work. I just have to take time to do it.
Anonymous 01/09/25(Thu)12:39:06 No.103826723
>>103826681
oh you are him, ive helped you or nudged you in the right direction a few times in the past
Anonymous 01/09/25(Thu)12:42:17 No.103826759
>>103826034
It's all hackjobs for the sake of style consistency.
>>103826061
Funny, mine looks pretty much the same even though I do realize it's O(n^2)
Anonymous 01/09/25(Thu)12:43:16 No.103826768
1715761884654233
>>103826723
Thank you for that
Anonymous 01/09/25(Thu)12:46:01 No.103826802
>>103826759
that sounds like a nightmare

>>103826768
im always glad when i can help a fellow dev
Anonymous 01/09/25(Thu)12:47:29 No.103826815
>>103826759
I updated it to handle some edge cases.
int i = -1, s = -1;
while (i++ < message.Length - 1)
{
if (message[i] == ' ')
{
s = i;
continue;
}
var pos = text.FindCharacterPos((uint)i);
if (!(pos.X >= w - text.Position.X - 20)) continue;
if (s == -1) s = i;
if (message[s] == ' ') message = message.Remove(s, 1);
message = message.Insert(s, "\n");
text.DisplayedString = message;
s = -1;
}
Anonymous 01/09/25(Thu)12:51:37 No.103826853
>>103823843
>brute force instead of using the minimum number of calculations
ngmi
Anonymous 01/09/25(Thu)12:55:46 No.103826890
>>103826164
>damn anon, you are playing with fire. what are you doing?
An RTS.
Strategy games' gameplay is *mostly* flat so I'm only handling 3D where it's actually needed. Rotation only handle Pivot-axis, AI assume building/wall to be impassable obstacles, pathfinding doesn't take verticality into account nor can handle multiple floors, etc.
As for multi-threading, it's mostly because it's often inconsequential as long as the frame-rate is good. Soldier A picking Target B as the closest one, despite Target C being updated afterward that frame and ending up a bit closer than B isn't really a blatant error. Soldier#314's exact killer being random (tied to the order in which colliders are multi-thread-processed) when taking multiple source of damages in the same frame isn't a major bug either. Stuff like this.

It keep things simpler and help the thing run a bit faster.
The drawback is that combats have low reproducibility despite a near total lack of "voluntary" RNG. Not to the point of changing who win, but which soldiers survived and with how much health can vary significantly.
Which mean replays will be complicated, and I can forget about lockstep - and probably forget about any form of multiplayer that isn't couch-coop.
Anonymous 01/09/25(Thu)13:00:41 No.103826935
>>103826890
i see, is thread contention or access to shared data really that big of an overhead?
Anonymous 01/09/25(Thu)13:20:43 No.103827129
>>103826890
Are you the anon making that DWARF game on /vst/?
Anonymous 01/09/25(Thu)13:27:25 No.103827197
I wonder how the guy behind Elin managed to put such an amount of content in so little time. Did he port most of the stuff he had from Elona?
Anonymous 01/09/25(Thu)13:28:27 No.103827214
Anonymous 01/09/25(Thu)13:35:13 No.103827292
>>103826890
>Soldier A picking Target B as the closest one, despite Target C being updated afterward that frame and ending up a bit closer than B isn't really a blatant error. Soldier#314's exact killer being random (tied to the order in which colliders are multi-thread-processed) when taking multiple source of damages in the same frame isn't a major bug either.
This kind of thing is actually way more dangerous than it seems (assuming you're talking about C/C++). Data races are undefined behavior in C, which enables a bunch of optimizations around hoisting and coalescing of memory ops. I hope you're using volatile and have a clear idea about size/alignment and what sorts of operations are implicitly atomic on your target platform(s).

Doing this with any hope of correctness seems like more trouble than it's worth desu. I'd rather use relaxed atomics - at least those have defined semantics, so the compiler can't arbitrarily decide to fuck you
Anonymous 01/09/25(Thu)13:43:07 No.103827359
>>103827292
nta, but i agree, atomics or even fast locks would be very helpful id imagine. for my high contention small tasks i some times just spin locks
Anonymous 01/09/25(Thu)13:44:34 No.103827370
>>103813308
>syntax coloring is not enough, you must italicize types and function identifiers!
Anonymous 01/09/25(Thu)14:19:49 No.103827721
465748537_3889537017959461_1633816740113572579_n
Is there anything wrong about starting with Raylib if I've never programmed graphics before?
Everything else, OpenGL, SDL, etc... feel like a huge chore.
Anonymous 01/09/25(Thu)14:21:45 No.103827741
>>103827721
do what you want and can handle...
i-i-i mean, start with vulkan
Anonymous 01/09/25(Thu)14:23:36 No.103827764
>>103827721
raylib is complete trash
Anonymous 01/09/25(Thu)14:26:23 No.103827785
>>103822261
>use Unity because it doesn't have the annoying "everything is a node" structure
lol
Anonymous 01/09/25(Thu)14:29:37 No.103827802
>>103827721
This is a good Misato picture, right
Anonymous 01/09/25(Thu)14:33:21 No.103827844
>>103827802
every misato picture is a good picture
Anonymous 01/09/25(Thu)14:34:27 No.103827852
file
man, i wish i knew why dynamic rendering doesnt clear the swapchain image
Anonymous 01/09/25(Thu)14:39:05 No.103827889
>>103826034
I'm duplicating any relevant state between UI and game logci layers because I didn't want to use structures from the UI framework in my other code and that's the next best method of sharing data in things that were very much not designed for gamedev. So whenever you take damage for example, this triggers an event that broadcast the whole player object to the HP bar component so it can rerender.

I also load every UI element and a crapton of data on game start, which currently takes 4ms. I could swap things to on-demand, but it's not render blocking I haven't bothered with it yet.
Anonymous 01/09/25(Thu)14:42:44 No.103827935
Battle
>>103826935
>>103827292
Sadly I'm a filthy Unity user AND it's the first project where I use multi-threading for more than one random feature, so most of my optimization process is along the lines of "does it run faster without exploding if I rewrite it dirtier? if yes: keep the code that way".
>assuming you're talking about C/C++
Hard to say, honestly. It's C#, but using Unity's "Burst" compiler designed specifically for multi-threading & vectorization, which add restrictions that force you to code more like in C++. And they provide a whole bunch of data structure specifically made for it that handle parallelism... so not sure how it work under the hood.

>>103827129
No, I'm the one doing a pseudo Total War with anime schoolgirls.
Any link to that Dwarf RTS? The only other Anon-made strategy games currently in development that I'm aware of right now are Hyper Coven and that one with hyenas.
Anonymous 01/09/25(Thu)15:19:23 No.103828343
file
>>103827852
ok, i was just being retarded and had default load op set to load
i wasted like 2 hours on this...
Anonymous 01/09/25(Thu)15:23:43 No.103828396
Anonymous 01/09/25(Thu)15:34:22 No.103828512
>drawing triangles: level beginner
>>103828343
>drawing triangles: level advanced
>>103827935
Anonymous 01/09/25(Thu)15:37:01 No.103828550
>>103828512
drawing triangles fucking rules
Anonymous 01/09/25(Thu)15:52:02 No.103828723
how do i make video game
Anonymous 01/09/25(Thu)15:53:44 No.103828743
>>103828723
Step 1: install game making tool
Step 2: press random buttons
Step 3: read error message
Step 4: google error message's solution
Step 5: apply correction
Repeat 2-5 until you are satisfied with your game.
Anonymous 01/09/25(Thu)15:54:51 No.103828761
Anonymous 01/09/25(Thu)15:55:17 No.103828769
>>103828761
das crazy
Anonymous 01/09/25(Thu)15:56:40 No.103828780
>>103828723
learn how to draw triangles.
Anonymous 01/09/25(Thu)16:08:42 No.103828912
Anonymous 01/09/25(Thu)16:35:57 No.103829255
>>103816390
next time remove all the garbage after &
Anonymous 01/09/25(Thu)16:36:51 No.103829265
1735588181377016
Im using Ultralight for my engine's UI solution but am not sure if I should do CPU and GPU renderer. Also what is a good way to program the relationship between the platform and renderer (SDL) and ultralight platform?
Anonymous 01/09/25(Thu)16:41:05 No.103829327
>>103818720
What would it look like?
Frosch !!QxG8tdNNBUC 01/09/25(Thu)17:01:36 No.103829604
>>103827741
>do what you want
WHAT?!
>start with Vulkan
That's what I thought you said ...
Anonymous 01/09/25(Thu)17:08:23 No.103829697
>>103822210
>I am just starting to learn godot, and the design philosophy where everything is a node in a tree is really annoying to me, and I don't really like it.
Been using Godot for a while and this also annoys me, but I think it is mainly a problem with GDScript. It lacks things like interfaces and traits, so the only options are:
>shove behavior into nodes
>ducktyping
>inheritance
Until GDScript gets improved, if ever, you just have to pick the lesser of the evils.
Anonymous 01/09/25(Thu)17:13:33 No.103829757
>>103827721
If you’re truly a man you will start with Vulkan. Otherwise just start with OpenGL. Raylib is useless.
Anonymous 01/09/25(Thu)17:16:38 No.103829790
>>103829757
What if I'm but a boy
Anonymous 01/09/25(Thu)17:17:45 No.103829805
>>103827721
dont listen to them, if you want to see shit on screen fast then use raylib or any other framework
you WILL get discouraged sooner than later if you dont get anything drawing fast, especially if you're new to this
Anonymous 01/09/25(Thu)17:19:40 No.103829828
>>103829790
are you a cute boy?
Anonymous 01/09/25(Thu)17:40:28 No.103830051
>>103829828
Do you think a boy would post that Misato pic?
I'm a big manly dude. But still a boy.
Anonymous 01/09/25(Thu)17:44:14 No.103830090
IMG_6719
Man this resource binding stuff is the one concept in Vulkan I can’t fully wrap my head around because there’s multiple ways to do it and mind you I skipped OpenGL so the structure of a proper renderer is foreign to me. Tutorials/guides for anything that’s not ye olde descriptor pool + descriptor layout + descriptor set combination pretty much don’t exist. Seems I’m going to end up doing the most basic implementation of push descriptors possible and hopefully that carries me far enough.
Anonymous 01/09/25(Thu)17:50:59 No.103830170
>>103829805
Thanks anon. I will leave it for later. Honestly I think graphics programming is a little too much fo me.
Anonymous 01/09/25(Thu)17:53:16 No.103830197
>>103829697
I am finding myself making global "manager" scripts for everything. I just don't like the objects themselves being in charge of the logic, it feels gross to me. Maybe i just have to get used to it.
Anonymous 01/09/25(Thu)17:58:16 No.103830257
Fractal 04
>>103828550
Drawing non-triangles can be fun too. Even if it's rarely as useful.
Anonymous 01/09/25(Thu)18:06:13 No.103830358
Is godot the best version of godot or are any of the forks better/comparable?
Anonymous 01/09/25(Thu)18:10:10 No.103830395
1719788831504375
I wanted to do something like this for my game but it turns out this isn't valid syntax in C++. I'm digging around a bit and all I'm seeing are solutions that require like 20 lines of macros and templates. Surely there's an easy way to make an array the size of an enum and then initialize structs at a given enum value in C++ right?
Anonymous 01/09/25(Thu)18:11:53 No.103830403
>>103830358
There is no actual fork that hasn't been left behind in the dust, sadly.
Anonymous 01/09/25(Thu)18:16:52 No.103830448
Descriptor-Sets
>>103830090
Shrimple
Anonymous 01/09/25(Thu)18:18:36 No.103830469
>>103830358
>>103830403
Redot is still active. Not sure if anything is different apart from themes
Frosch !!QxG8tdNNBUC 01/09/25(Thu)18:39:57 No.103830675
2025-01-09_16:10:24
Text field code repurposed. Need to do more advanced UI stuff next.
Anonymous 01/09/25(Thu)18:54:06 No.103830818
>>103826034
if it's the only way to make things work is it really an ugly hackjob?
Anonymous 01/09/25(Thu)18:55:43 No.103830836
>>103830403
Why are there forks anyway? Just because of that one schizo? His "book" is a fun read but I didn't think anyone took it seriously.
Anonymous 01/09/25(Thu)18:58:26 No.103830858
>>103827721
Raylib works.
People trying to get you into vulkan are trolling.
Anonymous 01/09/25(Thu)18:58:30 No.103830860
>>103830090
Graphics programming beginners just jumping into Vulkan and hoping things work out is so fucking retarded, you are exactly the kind of person who should not be using Vulkan
Anonymous 01/09/25(Thu)18:59:27 No.103830874
>>103830395
People usually use JSON or Lua for that
Anonymous 01/09/25(Thu)19:00:15 No.103830891
>>103830836
>Why are there forks anyway?
The dev tweeted something woke apparently so that means it needed to be forked (obviously they went nowhere with it)
Anonymous 01/09/25(Thu)19:04:59 No.103830954
>>103830358
I heard that sneedot is pretty good.
Anonymous 01/09/25(Thu)19:08:58 No.103830984
>>103830448
I’m not using descriptor pools they are gay
Anonymous 01/09/25(Thu)19:42:22 No.103831373
>>103827721
cute_framework is better than raylib and sets you up to use sdl gpu if you eventually feel like doing that
Anonymous 01/09/25(Thu)19:42:56 No.103831382
>>103830984
There's probably descriptoestrogens in your pools, you have to change GPUs to get rid of those.
Anonymous 01/09/25(Thu)20:57:47 No.103831984
>>103830257
I've seen that effect in VRchat
Anonymous 01/09/25(Thu)20:59:47 No.103832013
AAAAAAAAAAAAAAA
>pixel format U16
>fragment shader, usampler2D
>texels always 0
graphics programming is niggerlicious
Anonymous 01/09/25(Thu)21:17:15 No.103832200
generic he says
Why is 3.5 so retarded? why am I so retarded to assume it knows wtf I gave it? Why is it so retarded to assume I want to start my project from scratch?
Anonymous 01/09/25(Thu)21:22:01 No.103832248
I got filtered by quaternions
Anonymous 01/09/25(Thu)21:22:31 No.103832255
>>103832200
you're not using it right. if you don't know how to make something, you can't instruct ai properly, sorry to say
Anonymous 01/09/25(Thu)22:07:58 No.103832650
>>103832200
Isn't there a thread for AI retards?
Anonymous 01/09/25(Thu)22:47:52 No.103833006
collision
Turns out collision detection with sliding is really fucking easy. Why is everyone writing entire files of this shit when it can be done in 10 lines?
Anonymous 01/09/25(Thu)22:52:10 No.103833044
>>103833006
sweet summer child, your character does not handle arbitrary terrain
Anonymous 01/09/25(Thu)22:53:46 No.103833056
Hahahaha you faggots can't design worth a shit. I deer you to simulate car physics correctly.
I deer you to simulate biology correctly.
Anonymous 01/09/25(Thu)22:59:28 No.103833097
>>103826562
That's cool, Anon. I hope I can do that some day. What language are you using?
Anonymous 01/09/25(Thu)23:00:17 No.103833104
>>103833006
what language is this that makes you program like it's 1995
Anonymous 01/09/25(Thu)23:06:21 No.103833152
>>103823843
>adds 10 sources of light
>fps tanks
Anonymous 01/09/25(Thu)23:15:24 No.103833228
Meme
>>103828723

Pay someone on fiverr to make a game for you.
Anonymous 01/09/25(Thu)23:25:11 No.103833297
camera_test
>>103832248
You don't necessarily need to understand quaternions. Just know that they represent a rotation, and that they work like magic.
Anonymous 01/09/25(Thu)23:36:08 No.103833392
>>103830257
damn, nice fractals. how are you drawing them?
Anonymous 01/09/25(Thu)23:48:19 No.103833475
>>103830818
First time you write something it's okay if it's shit, you can always rewrite and make it better.

Then rewrite never comes, long live the Just Werks code.
Anonymous 01/09/25(Thu)23:54:51 No.103833522
>>103826034
about 1h into my source I went /we
Anonymous 01/09/25(Thu)23:59:45 No.103833559
>>103827721
I keep getting filtered by openGL over and over and over again. Raylib is all I can do.
Anonymous 01/10/25(Fri)00:30:12 No.103833769
Is making game engine a "solved" field? So what people do here is just stitching together libraries made by other people?
Anonymous 01/10/25(Fri)00:30:48 No.103833773
Anonymous 01/10/25(Fri)00:33:06 No.103833787
where do i begin on making my own game engine? i have some basic programming skills but ive never built a large project and im currently trying to learn SDL.

sorry for being an annoying faggot.
Frosch !!QxG8tdNNBUC 01/10/25(Fri)00:43:21 No.103833853
>>103833787
Read books and study projects. Maybe the compendium/wiki in the OP can help you along. And if you come across something you like on your journey feel free to share it.
Anonymous 01/10/25(Fri)01:31:02 No.103834117
>>103833787
https://lazyfoo.net/

Once you're done with it, it's a matter of organizing your project and learning new algorithms for your game.
Anonymous 01/10/25(Fri)01:41:40 No.103834182
Anonymous 01/10/25(Fri)02:01:11 No.103834284
>>103831984
God, I miss when VRChat allowed you to could do cool shit in public.
Anonymous 01/10/25(Fri)03:00:50 No.103834671
>>103833787
>first large project
>game engine
Sounds like a bad idea to me. I think this is an "if you have to ask, you aren't ready" situation.
Anonymous 01/10/25(Fri)03:20:51 No.103834780
Fractal 03
>>103833392
Raymarching, with Unity's new(ish) "full screen pass renderer feature" system that allow to make fullscreen shaders more cleanly than just slapping a polygon in front of the camera. Normally it's intended for post-processing effects, but since you have access to the z-buffer it's perfect to insert geometry drawn via raymarching.
Anonymous 01/10/25(Fri)03:53:24 No.103834964
>>103834780
you wouldnt happen to have a link describing how its done?
Anonymous 01/10/25(Fri)04:26:21 No.103835156
csg
>>103834964
Quick intro from Coding Adventure: https://www.youtube.com/watch?v=Cp5WWtMoeKg
The website I got most of my formula/optimization/etc: https://iquilezles.org/articles/distfunctions/

The TLDR is that it's like a very dumb version of raytracing: instead of just asking the shape where your ray intersect it and be able to draw that pixel immediately, you instead ask how far you are - then you move a little further and ask again how far you are, and repeat until the shape say you are pretty much glued to it.
There are two reason as to why this method even exist:
1) Some shapes (like fractals) simply don't have a formula for "where does this ray intersect you?" but do have a formula for "how far is this point from you?", so they can only be drawn with raymarching.
2) Distance functions can be simply added/subtracted between two objects, and give you a new shape that's actually the addition/subtraction of its component (pic related). Can be used to render blobs, liquids, organics, or destructible stuff.
Anonymous 01/10/25(Fri)05:53:19 No.103835651
>>103827721
SDL_GPU my brotha
Anonymous 01/10/25(Fri)07:34:59 No.103836242
hmm
>>103813308
What's that color scheme? Looks good
Anonymous 01/10/25(Fri)07:40:56 No.103836281
>>103834780
Lol this stupid character model and the way it walks. This demo can only have been made by either a coomer dude coder bro or a "gay as fuck" transbian (also a coomer)
Anonymous 01/10/25(Fri)07:45:35 No.103836316
>>103813308
Current compilers and CPUs make that code obsolete.
Anonymous 01/10/25(Fri)07:54:19 No.103836371
>>103832248
Unironically the best resource I've found for understanding quaternions is this giant flamewar: https://github.com/KhronosGroup/glTF/issues/1515
Anonymous 01/10/25(Fri)08:08:04 No.103836439
>>103836371
Bookmarked. Thanks
Anonymous 01/10/25(Fri)08:09:52 No.103836453
>>103832248
Also this https://marctenbosch.com/quaternions/
Anonymous 01/10/25(Fri)08:13:00 No.103836468
You don't need to understand quaternions to use them
Anonymous 01/10/25(Fri)08:19:20 No.103836513
1722463457584438
I don't know what's even is a quaternion. I just use rotation and translation matrices.
Anonymous 01/10/25(Fri)09:04:11 No.103836804
Eri
>>103836281
>and the way it walks
It's a model for porn games, it walk in a porn-y way.
I need to replace it with something lower-poly but I have been pushing back all assets & art-style consideration to after the game reach a "playable alpha demo" stage on the technical side.

>This demo can only have been made by either a coomer dude coder bro
My guidelines are old 80s-90s anime and old french stuff like Le Petit Spirou. I still have some margin.
I still need to see if I can make a convincing "torn clothes" shader to indicate damages visually, since healthbars would be ugly as hell anyway.
Anonymous 01/10/25(Fri)09:08:55 No.103836850
>>103836513
i think of it as a magical point on a 4 axis grid
Anonymous 01/10/25(Fri)09:59:51 No.103837405
>>103829265
How's ultralight? I wanted to use it but I like to export my games to web and I felt like a web ui solution wouldn't work with that.
Anonymous 01/10/25(Fri)10:08:52 No.103837482
>>103836513
you can rotate and scale a 2d plane by multiplying it by a vector
since [1,0] * v = v you can imagine you're doing it by dragging the [1,0] point to v coordinates while keeping axes perpendicular and the grid as squares
if you keep v as unit (of length 1) vector then every position [1,0] (ie v) can be forms a circle around [0,0], these vs will only rotate, not scale
notably, this can't flip the axes (ie. x goes left while y remains up) to do that you need to rotate the plane in third dimensions around x or y
in fact, the previous rotation in third dimension was just a rotation around an invisible z

quaternions are the same but a dimension higher
you can drag [1,0,0] around to some v, but this only allows you to specify the pitch and yaw, not roll
so you also rotate it in the 4th dimension around the invisible axis that sits at [0,0,0]
Anonymous 01/10/25(Fri)10:14:02 No.103837530
>>103837482
That's not a helpful explaination
Anonymous 01/10/25(Fri)10:23:18 No.103837633
>>103836281
arent you a faggot
Anonymous 01/10/25(Fri)10:32:47 No.103837719
>>103837530
you know how some games have puzzles where you have to put yourself somewhere in a room or rotate some object that looks like a mess from most perspectives to a certain position and angle to complete a 2d image or shape made out of a mess of 3d objects
quaternions are doing that but for 3d to 4d
Anonymous 01/10/25(Fri)10:59:43 No.103837950
>>103833787
>where do i begin on making my own game engine?
It's better to start by making a game (without using an existing engine). That forces you to write your own version of a bunch of "engine" components, like rendering, graphics, etc, but simplified because they're all specialized to the needs of your project instead of trying to handle every conceivable case. If you then make a second game, you can make those parts more generic and reusable.
Anonymous 01/10/25(Fri)11:01:59 No.103837975
>>103836513
It's equivalent to a rotation matrix (wikipedia has formulas for converting back and forth), but you can interpolate quaternions in a way that actually looks good
Anonymous 01/10/25(Fri)11:16:25 No.103838107
>>103836804
where did you get the models?
Anonymous 01/10/25(Fri)11:34:47 No.103838316
>>103838107
It's standard asset store stuff: https://assetstore.unity.com/packages/3d/characters/humanoids/humans/eri-82607
Anonymous 01/10/25(Fri)11:45:52 No.103838441
>>103837530
you're dragging the unit vector around (at w=0) to rotate and stretch 3D space
that doesn't give you all rotations you can think of so you do add a 4th dimension component
in the end it has to w=0 for all your points otherwise parts of your pre-rotation 3D space have fucked off into the 4th dimension
Anonymous 01/10/25(Fri)11:47:13 No.103838449
>>103829255
After what.
Anonymous 01/10/25(Fri)11:50:54 No.103838500
1000_F_284763499_kl4ofxR0TPMJ95HbCmOeSstl0lT7JAft
>>103833097
>That's cool, Anon. I hope I can do that some day.
Y-you too!
>What language are you using?
C# + SFML.Net, this is the first project I use it in a long time.
Anonymous 01/10/25(Fri)11:53:06 No.103838524
>>103833787
I learnt a lot by reading the source code of I project I used a long time ago. Another way is to read the source code of small games that are open source, like those of ludum dare or the ones released for demo days that include them.
Anonymous 01/10/25(Fri)11:58:57 No.103838600
Revisiting The Fast Inverse Square Root - Is It Still Useful hllmn.net
>>103836316
It depends https://hllmn.net/blog/2023-04-20_rsqrt/
Anonymous 01/10/25(Fri)12:11:35 No.103838718
>>103838600
Remind me of that N64 programmer currently going down the deep end with optimizations, and spending massive amount of autism on finding the fastest possible algo for sin/cos on that specific hardware:
https://www.youtube.com/watch?v=xFKFoGiGlXQ
Anonymous 01/10/25(Fri)12:38:08 No.103839004
>>103838718
as autistic as it is, i gotta say its impressive
Anonymous 01/10/25(Fri)12:57:58 No.103839204
>>103833769
There is still a lot of room for both improvement and simplification.
Anonymous 01/10/25(Fri)13:36:23 No.103839571
leveldata
Yesterday I implemented a binary serialization scheme. There was only one problem, with every little change I have to adjust how to interpret the data, or avoid changing the order of items and tiles declaration. Fixing things is virtually impossible too, and right now I need to make a lot of changes to the tutorial area. So I implemented a basic text scheme to avoid such issues.
Anonymous 01/10/25(Fri)13:56:11 No.103839807
>>103813941
pretty sure shadow mapping works in 2d, just make the walls and sprites have a invisible wall in the 3rd axis and make the light slightly above the ground.
but you probably want some 3d dimension on the walls so that you can see the shadows on the walls.
I'm sure in unity or whatever engine you choose has the ability to toggle if a shadow is emitted, and you can just add an invisible shadow emitter, you could probably get your game running in like a day.
Anonymous 01/10/25(Fri)14:08:32 No.103839950
>leaving an empty default: at end of switch is an MSVC compile error
i hate microsoft so fucking much
Anonymous 01/10/25(Fri)14:09:29 No.103839959
I noticed the OP doesn't have a link for "I'm retarded where do I start"

What is the simplest and fastest way to get a playable demo that'll give feel good brain chemicals and won't make me feel like I wasted a bunch of time before abandoning the hobby forever?
Anonymous 01/10/25(Fri)14:11:42 No.103839984
>>103839807
*oh but if you don't want to use 3d objects for walls (it's nice to be able to rotate the camera, but 3d walls can hide monsters or items, even if it's a short wall, so you also now need a outline or something).
One way to draw fake shadows on 2D walls is to use a normal map, but to make it work with shadow mapping you probably need to insert an invisible wall through the center of the wall (you probably need a tile sprite sheet that "fits" to surrounding tiles, along with the normal maps, and based on the tile orientation, you know where the occluder through the center will be).
Anonymous 01/10/25(Fri)14:16:20 No.103840040
>>103839959
https://lazyfoo.net/tutorials/SDL/
Anonymous 01/10/25(Fri)14:24:04 No.103840153
1710888647446122
>2024+2-1
>industry-wide, the most important issue to solve is raytracing, and not the STILL way-too-expensive current implementations of transparency/quad overdraw
Anonymous 01/10/25(Fri)14:25:00 No.103840161
>>103839959
/vg/agdg
no you wont get good advice, good advice on the internet does not exist, it's just where you go to flex your game dev skill with screenshots because you are too shy to post on X or anywhere else.
Anonymous 01/10/25(Fri)14:30:08 No.103840212
>>103840161
you're projecting, i have no game dev skills
Anonymous 01/10/25(Fri)14:34:58 No.103840267
>>103840212
you can draw a picture of your imaginary game in paint and you are going to be 10x further ahead than anyone on this thread/agdg, because even though people might post functional games, they don't have soul.
Anonymous 01/10/25(Fri)14:39:21 No.103840314
>>103840161
Is X even worth posting on it now that 99% of all bots have been removed and half of what's was left moved to some other place because Ol' Musky can't stop flip flopping between anti-brown racism and anti-white racism?
Anonymous 01/10/25(Fri)14:44:20 No.103840365
>>103840153
Raytracing is the past.
Gaussian Splatting is the future.
https://gsplat.tech/hilltop-small-church/
Anonymous 01/10/25(Fri)14:47:21 No.103840400
>>103840153
>he isnt using meshlets and hzb
Anonymous 01/10/25(Fri)14:51:03 No.103840442
>>103840314
only if people actually see it.
there are a million different ways to grow a community, obviously the goal is for people to become die hard fans and join your discord or forum or IRC / whatever, but they need to have a way to find out about you, if nobody is liking or sharing your tweet, and you are about to finish the game, that's miserable.
Anonymous 01/10/25(Fri)14:55:34 No.103840488
>>103840153
The current post-WBOIT and post-Nanite reality seems kind of fine to me? What kind of stuff do you want to render?
Anonymous 01/10/25(Fri)14:57:00 No.103840502
>>103840365
my pc almost exploded when i opened that
Anonymous 01/10/25(Fri)15:02:48 No.103840598
>>103840502
It's time to upgrade from your trusty 970, Anon.
Anonymous 01/10/25(Fri)15:03:41 No.103840612
>>103840598
i actually do have a 970, but havent used it in a while
im running a 1660 ti
Anonymous 01/10/25(Fri)15:08:32 No.103840670
>Have unicode for î and ĵ but no z hat
>Have unicode for ŷ and ẑ but no x hat
What fucking retards set these standards?
Anonymous 01/10/25(Fri)15:18:27 No.103840785
I'm thinking of abandoning windows and macos and targeting linux only. Less headache and windows will die in around 5 years anyway.
Anonymous 01/10/25(Fri)15:21:20 No.103840816
>>103840785
what is stopping you from supporting all of them?
Anonymous 01/10/25(Fri)15:22:52 No.103840833
>>103840785
Boy, you couldn't be more wrong.
Anonymous 01/10/25(Fri)15:33:31 No.103840932
file
i now have yaml shader configs working
i would have writen my own parser but im really not in the mood, maybe some other time
Anonymous 01/10/25(Fri)15:40:34 No.103841034
1735010803176762
I shouldn't have sprinkled OpenGL code everywhere in my codebase. it's such a mess!
Anonymous 01/10/25(Fri)15:44:16 No.103841082
Hot reload
#!/bin/bash
trap 'pkill -9 game' SIGINT
[[ "$1" == "-d" ]] && dump_bin=1
dump() {
if [ "$dump_bin" == "1" ]; then
llvm-objdump -M intel --no-show-raw-insn --symbolize-operands -CDSg game > game.asm
main=$(ag --numbers " <main>:" game.asm | cut -f1 -d:)
((main+=25))
vscodium -r -g game.asm:$main
fi
}
./compile.sh
[[ $? -ne 0 ]] && exit 1
dump &
./game &
while inotifywait -r -e modify -e create -e move *.cpp *.h; do
pkill -9 game
./compile.sh
[[ $? -ne 0 ]] && continue
dump &
./game &
done
Anonymous 01/10/25(Fri)15:47:01 No.103841113
>>103840785
based
target BSD though
Anonymous 01/10/25(Fri)15:58:58 No.103841243
In c# you can work with pointers, but making them work with the standard collection requires some work
public ref Entity UnsafeRef(EID id)
{
if (id.AsInt >= _entities.Count) throw new IndexOutOfRangeException();
if (_entities[id.AsInt].ID != id) throw new Exception("ID out of sync: " + id.AsInt);
return ref CollectionsMarshal.AsSpan(_entities)[id.AsInt];
}
Anonymous 01/10/25(Fri)16:13:14 No.103841420
im almost at the point where i need to implement a font system, thank God that i already wrote a shitty one once
Anonymous 01/10/25(Fri)16:40:09 No.103841670
>>103814013
yeah thats a top tier website for midwits
i use it
Anonymous 01/10/25(Fri)16:57:17 No.103841851
>c# again
>debug memory
>seems like somewhere new instances of enumerator of points are being invoked
>they come from the set used to hold points that player have visited
>turns out joining two sets instantiates enumerators, whereas simple add inside a foreach loop doesn't.
Christ, why can't they just add an specialized overload.
Anonymous 01/10/25(Fri)17:08:09 No.103842003
how can you make a cube with a different texture on every face? wouldn't every face have to be separate, bumping the cube from 8 vertices up to 24 vertices?
Anonymous 01/10/25(Fri)17:09:13 No.103842014
How the fuck does gourad shading and texture filtering work?
Anonymous 01/10/25(Fri)17:12:11 No.103842045
>>103842003
Don't you need that for normals anyways?
Anonymous 01/10/25(Fri)17:12:50 No.103842058
>>103842003
I mean, you could write a shader that looks at each face's normal and selects a different texture to sample based on that. But if you mean like a general solution then yeah, duplicating vertices is the most straight forward method.
Anonymous 01/10/25(Fri)17:15:13 No.103842089
>>103842003
easiest solution is having a big texture atlas
you could also use a texture array and add an index to the texture in the vertex data for each vertex
Anonymous 01/10/25(Fri)17:19:05 No.103842150
>>103813308
is C# a meme today?
Anonymous 01/10/25(Fri)17:20:07 No.103842167
>>103842150
Microsoft Java is what it is
Anonymous 01/10/25(Fri)17:21:13 No.103842180
>>103842150
C# was *always* a meme.
But so is anything than isn't assembly, so at some point you have to pick a language and roll with it.
Anonymous 01/10/25(Fri)17:21:33 No.103842187
>>103842089
>you could also use a texture array and add an index to the texture in the vertex data for each vertex
but if the vertex is shared by 3 faces then they'd all have the same texture index
Anonymous 01/10/25(Fri)17:25:02 No.103842232
>>103842187
if you're instancing the triangles, then you can put the index in the instance buffer
Anonymous 01/10/25(Fri)17:46:33 No.103842490
1734129592475018
>meshes?
>haha, no, my entire scene is made up of hardware instanced triangles for maximum performance
Anonymous 01/10/25(Fri)17:50:36 No.103842534
Anonymous 01/10/25(Fri)17:52:05 No.103842554
>>103842490
>my entire scene is made up of hardware instanced triangles
name 1 flaw
Anonymous 01/10/25(Fri)18:09:33 No.103842741
>>103842180
quit the larping, kid
Anonymous 01/10/25(Fri)18:32:01 No.103842982
>>103842150
Pajeetsharp is for codemonkeys.
Use a decent language
Anonymous 01/10/25(Fri)18:35:29 No.103843007
>>103840153
Raytracing a shit. Spend a kilowatt getting exact geometric intersections, which then get blurred away by post-denoising (costing you an extra kilowatt).

>>103840365
Gaussian splatting a shit. Overdraw and blurring up the ass, for no gain. People assume that because it's reasonable to fit Gaussians to images, it's a good rendering primitive. And you can't just convert the Gaussians to something more sensible without quality loss out the ass.

>>103840400
Meshlets a shit. Futile attempt to keep hardware raster tradition alive, in a bloated ass, complex, slow pipeline.

>>103840488
WBOIT a shit. Loses all plausibility as soon as the camera moves.

Any other takers?
Anonymous 01/10/25(Fri)18:35:33 No.103843008
What do you guys use to monitor GPU usage on Windows? I'm just getting started with 3D so all I've got is task manager and hwinfo, but they're giving me very conflicting results.
According to windows a simple JS->webGL scene eats 50% of my 3090ti, while the same scene in Godot native is just 9%. Meanwhile hwinfo gives the JS code 40W power draw while godot gets 55W. FPS counter doesn't help because the browser caps at your refresh rate.
Anonymous 01/10/25(Fri)18:43:01 No.103843079
>>103843008
>What do you guys use to monitor GPU usage on Windows
Fan's decibels.
Anonymous 01/10/25(Fri)18:48:34 No.103843132
>>103843008
Coil whine.
Anonymous 01/10/25(Fri)18:51:32 No.103843173
>>103843008
What's with these all idiots trying to monitor their CPU / GPU usage lately?
Measure your FPS
Anonymous 01/10/25(Fri)18:57:24 No.103843247
1706284358885914
>>103843007
No. You win the argument. Congratulations.
Anonymous 01/10/25(Fri)19:00:14 No.103843272
>>103843008
Task Manager is almost always wrong, so don't look at there.
Anonymous 01/10/25(Fri)19:16:18 No.103843504
>>103843173
Browsers cap your FPS at monitor refresh rate, so you've got no idea wether your hitting 200 or 1000 FPS. Since I've got high-end hardware the game could just silently run while it would choke old entry level machines. And I can hardly get away with demanding $500 GPUs for an indie game.
So I'd like to figure out if my approach is feasable without needing to build the entire thing or buying shitty devices just for testing.
Anonymous 01/10/25(Fri)19:17:05 No.103843517
>>103843504
>Browsers
found your problem
Anonymous 01/10/25(Fri)19:40:39 No.103843851
>>103843173
fps is shit, frame time is where it's at
Anonymous 01/10/25(Fri)19:42:36 No.103843875
>>103843851
thats what fps measures
Anonymous 01/10/25(Fri)19:51:51 No.103844023
>>103843875
no it doesnt, fps measures the count of frames per second, its in the name
you can only calculate an average frame time from fps, which isnt as precise as just logging frame time
Anonymous 01/10/25(Fri)19:54:27 No.103844055
>>103844023
So you prefer to look at 1000 frame times instead of the average
Anonymous 01/10/25(Fri)19:56:34 No.103844080
>>103844055
no, you mental midget
if you get 10 FPS, then you dont know if each took 100ms or if one took 900ms and the other 9 took combined 100ms
and you're retarded if you dont limit your fps
Anonymous 01/10/25(Fri)19:57:06 No.103844088
>>103843008
look under the debugger tab in Godot as your game runs. They offer a visual profiler and a bunch of performance monitor graphs for free. Don't know much about your JS setup but I'm sure you can get similar metrics to show with some library.
Anonymous 01/10/25(Fri)19:59:20 No.103844120
>>103844080
>if you get 10 FPS, then you dont know if each took 100ms or if one took 900ms and the other 9 took combined 100ms
Yes you do because it's going to recover from the spike and go back to the average frame time
Anonymous 01/10/25(Fri)20:00:13 No.103844134
images
t-this time i'll make a good track for my dark forest levels THIS TIME

https://vocaroo.com/1hBxRfuW4XlA
Anonymous 01/10/25(Fri)20:06:09 No.103844223
>>103843504
No? How do people chug your PC with super GIFs then?
Anonymous 01/10/25(Fri)20:09:36 No.103844290
>>103844134
Not sure about a dark forest but it's not bad.
At this point you could go for diablo vibes.
Anonymous 01/10/25(Fri)20:11:08 No.103844324
>>103844223
Nta, but gifs are irrelevant to the conversation. The gif format has a maximum framerate of 100fps but all browsers only support gif playback up to 50fps.
Anonymous 01/10/25(Fri)20:23:40 No.103844558
Untitled
>>103844290
>>103844223
>Not sure about a dark forest
Anonymous 01/10/25(Fri)20:23:50 No.103844560
>>103844120
i see its pointless to argue with you, you dont even understand what of the quote you quoted means
at least take this from this convo: one is linear, one is not
Anonymous 01/10/25(Fri)20:53:44 No.103844943
>>103841082
That's a restarter, not a hot reloader.
Anonymous 01/10/25(Fri)21:07:16 No.103845114
>>103844560
I get the feeling you've never actually ran a game with an FPS counter
Anonymous 01/10/25(Fri)21:08:26 No.103845126
>>103839571
>with every little change I have to adjust how to interpret the data, or avoid changing the order of items and tiles declaration
I had a similar problem: I wanted to be able to add new item types without invalidating existing savegames. My solution was to include in each save file a table of item names (strings), and anywhere the save data would normally contain an item ID, instead store an index into the file's item-name table. Then when loading the save, look up the item ID for each name, and remap all the indices to their corresponding item IDs.
Anonymous 01/10/25(Fri)21:11:20 No.103845155
vid
feels good, its 3AM and i again spent 3 hours debugging trivial shit
at least i have this rendering now (again)
Anonymous 01/10/25(Fri)21:52:32 No.103845670
>circle-circle collisions: 952ms
>square-square collisions: 1474ms
How is this possible? Circle uses sqrt
Anonymous 01/10/25(Fri)21:53:57 No.103845686
>>103845670
sqrt is slow
but you don't need to use sqrt to do circle-circle collisions
Anonymous 01/11/25(Sat)00:20:15 No.103847389
>>103840670
Theyre called combining characters google lookup combining characters more for more information
Anonymous 01/11/25(Sat)01:26:28 No.103847899
>>103813308
"what the fuck"

>when your genius gets noticed by senpai
Anonymous 01/11/25(Sat)01:30:34 No.103847945
>>103827370
Actually a great idea if it doesn't mess with spacing.
Anonymous 01/11/25(Sat)04:00:45 No.103849154
>>103845670
>Circle uses sqrt
You need to urgently realize most comparison involving a sqrt can be done way faster by squaring everything.
Anonymous 01/11/25(Sat)05:43:06 No.103849747
render
>>103842150
Don't know what you mean by meme (popular or joke?) but it is what I use myself. The combination of a general purpose language that receives many updates every year and top notch IDE support makes it unbeatable.
However, I understand that most people around here are more concerned with the gpu aspect of programming than the cpu, and they don't get as much mileage from a general purpose language.
Anonymous 01/11/25(Sat)05:51:01 No.103849818
ugly but it works
>>103845126
Game saves is no concern for me because a version bump is going to be a rare event and as you say I can simply include a table of old ids -> new ids, or even copying the old enum in the process. Because I'm working in the tutorial area while adding new tiles at the same time, I'm invalidating what I already had all the time.
I'd also argue that for static game data, this open process simplifies modding and making translations.
Anonymous 01/11/25(Sat)06:11:51 No.103849953
I'm thinking on how to make an entity ID that holds both the index and generation of the entity. I wonder if 4 bytes is enough. I could spend 11 bits in the index portion, meaning 2048 concurrent entities, which I think is enough. Then I have 21 bits for the gen portion, up to 2_097_152 max entities dead or alive may exist. If we count easy to kill monsters, 2kk should be more than enough right?
Anonymous 01/11/25(Sat)06:25:57 No.103850060
>>103849953
2k concurrent entities seems okay, although that depend if it include shit like level triggers, consumables, doors, lights or destructible crates - in which case it might get tight fast.
I'm not sure what you mean by "generation" of the entity tho.
Anonymous 01/11/25(Sat)06:26:40 No.103850067
>>103849818
??= is ugly, but c++ could use this syntax sugar
Anonymous 01/11/25(Sat)06:29:15 No.103850089
>>103849953
>2048 concurrent entities
Is that a joke? Use 8 bits
Anonymous 01/11/25(Sat)06:29:40 No.103850093
>>103849953
I thought the generation part was mainly to catch bugs where you still have a reference to an entity that no longer exists. If you clean up stale references promptly (e.g. by the end of the frame), then you don't need a huge number of bits there
Anonymous 01/11/25(Sat)07:37:09 No.103850573
>>103845155
Are you making your own 3D engine?
Anonymous 01/11/25(Sat)07:50:43 No.103850651
Anonymous 01/11/25(Sat)07:55:22 No.103850682
>>103850060
For me an entity is an intelligent being, either controlled by the player or AI, so I think it should be enough.
>>103850093
>If you clean up stale references promptly (e.g. by the end of the frame), then you don't need a huge number of bits there
But that's a big If. Imagine this, an npc that has in its memory who its friends are by storing the pointer. After one of them dies, the pointer may or may not point to garbage or the wrong entity. To fix that, as you suggest, it would be a matter of iterating every entity's ai data to replace this information.
But I think in this scenario it would be much better to do lazily, store the ID and be forced to ask whenever the AI updates if the entity still exists or not.
Anonymous 01/11/25(Sat)07:59:38 No.103850717
>>103850682
why would your handle system only apply to one specifc type of entity instead of everything?
Anonymous 01/11/25(Sat)08:03:22 No.103850750
>>103850717
It doesn't, this is just one usecase that I'm thinking, or the AI follow behavior where you store the entity id target and update the path every now and then as long as the entity is still alive and within view.
Anonymous 01/11/25(Sat)08:04:18 No.103850761
>>103850750
object references will apply to much more than just NPCs so 2000 of them won't be enough
Anonymous 01/11/25(Sat)08:10:48 No.103850816
>>103850717
>>103850761
Wait you are talking about my definition of what an entity is. I think that tiles, creatures, and items are so different that they deserve their own category. If I need something different and concrete I can always use events, general purpose objects that get updated and rendered every frame. Tiles don't need ID, their are identified by their positions, and items are only distinguished by their type.
Anonymous 01/11/25(Sat)08:36:23 No.103851062
>>103814670
Anon, just use WebGl. To support older machines render at lower resolutions (half, third, etc) without smoothing. You could also render the GUI at higher resolution in another canvas.
Anonymous 01/11/25(Sat)08:43:39 No.103851122
>>103813308
Will I get review-bombed if I use AI to localize my game to Chinese?
Anonymous 01/11/25(Sat)09:25:43 No.103851503
1734736101128953m
>>103813308
What's that theme in the op? Some monokai derivative?
Anonymous 01/11/25(Sat)09:35:41 No.103851608
>>103851503
i think its monokai night but im not sure because i customized mine to not have same color for function names and types
Anonymous 01/11/25(Sat)09:43:12 No.103851665
pimpl and compiling just the implementation file or derived classes?
im leaning more to pimpl but im interested what you guys think
C++ btw
Anonymous 01/11/25(Sat)11:00:23 No.103852619
>>103850682
>To fix that, as you suggest, it would be a matter of iterating every entity's ai data to replace this information
If the "friends" relation is bidirectional, the entity being destroyed can remove itself from all its friends' friend lists on its way out.

Or, just do the scan. For the number of entities you're talking about, it should be pretty cheap. If you scan 256 entities per frame, you're guaranteed that a stale reference won't survive more than 8 (= 2048 / 256) frames. Then if you guarantee that an ID's generation number will only be incremented at most once per frame, you only need 3 bits of generation number.
Anonymous 01/11/25(Sat)11:23:33 No.103852932
>>103852619
But then, whenever I add a reference I must make sure I'm deleting it. With the ID it's much harder as first I need to ask the engine if there exists an entity attached to it. It is like using optionals.
Anonymous 01/11/25(Sat)11:29:34 No.103853014
1697231155625367
>>103836850
>i think of it as a magical point on a 4 axis grid
I read magical point as magical girl.
Anonymous 01/11/25(Sat)13:25:42 No.103854658
>>103853014
you need to go outside more
Anonymous 01/11/25(Sat)13:33:46 No.103854783
Anonymous 01/11/25(Sat)13:34:36 No.103854800
sneak
Added npcs and detection. If you use control + direction you can peek around corners.
Anonymous 01/11/25(Sat)14:08:59 No.103855291
>>103854800
the LoS updating looks way too snappy to me
probably because of the tile resolution?
Anonymous 01/11/25(Sat)14:18:38 No.103855441
>>103855291
>too snappy
What do you mean.
Anonymous 01/11/25(Sat)14:45:08 No.103855801
>>103855441
Anon want some lerp in his soup.
Anonymous 01/11/25(Sat)14:50:04 No.103855869
>>103855291
As a roguelike player, there is nothing wrong with it.
Anonymous 01/11/25(Sat)14:55:46 No.103855949
le_progress
Water looks all kinds of ass, but at least there is water. I've spent the last few days fine-tuning the land generator. It's still not where I want it to be, but its certainly better than it was a week ago.
Anonymous 01/11/25(Sat)15:01:55 No.103856020
Anonymous 01/11/25(Sat)15:45:59 No.103856442
i want to kill myself
i just now found out that make has -j flag
Anonymous 01/11/25(Sat)17:00:19 No.103857255
Bump with dev storytime
I am using uvloop(asyncio) for my game server. Sometimes for I/O tasks I threads, and for CPU heavy tasks I want off my asyncio loop I move those to a forked process. I was reading docs for multiprocessing, and a cursory interweb search it looks like Windows cannot fork processes? Is this still true for the current Windows releases? It's not an issue, I will "spawn" per documentation if the server host is Windows.
Anonymous 01/11/25(Sat)17:13:03 No.103857370
Anonymous 01/11/25(Sat)17:15:34 No.103857395
>>103814670
Just read a few things on mode 7 and implement
Anonymous 01/11/25(Sat)17:17:40 No.103857411
>>103856442
i wanted to kill myself after i couldnt compile anything for two weeks because -j without any number hung my pc
Anonymous 01/11/25(Sat)18:05:40 No.103857833
file
my depth buffer is so fucking gay right now
Anonymous 01/11/25(Sat)18:09:47 No.103857876
>>103857411
Yeah, `make -j` doesn't really make sense for medium-large projects in the current year. `make -j$(nproc)` is where it's at. Or else use Ninja, which defaults to -j$(nproc)

>>103857255
Apparently it can be done but it's not simple nor well supported:
https://stackoverflow.com/questions/985281/what-is-the-closest-thing-windows-has-to-fork/985525#985525
Why do you need a forked process, though, instead of just spawning a thread?
Anonymous 01/11/25(Sat)18:29:12 No.103858075
>>103857876
Spawning a new process is fine for me, it just has added initialization cost but is not significant in my design by any means. I forgot about WSL actually, thanks anon. I'll keep it in mind for any docs I put out for Windows game server hosts.
Anonymous 01/11/25(Sat)18:29:14 No.103858076
qbert
Learning Odin and making arcade ripoffs. Whee.
Anonymous 01/11/25(Sat)20:00:00 No.103859024
>>103858075
Actually turns out Windows is a bit annoying, I'll have to do something to share the memory between spawned processes I think.