← Home ← Back to /g/

Thread 105992556

159 posts 68 images /g/
Anonymous No.105992556 >>105995636 >>105996499 >>106018282 >>106019561
/gedg/ - Game and Engine Development General #292 Deleted Garbage File
Deleted the Garbage File 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
Graphics Debugger: https://renderdoc.org/

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.

Previous: >>105943307
Anonymous No.105992835 >>106033549
THREAD THEME:
https://www.youtube.com/watch?v=YJVmu6yttiw
Anonymous No.105993119 >>105994453 >>105996144 >>106004202
>>105963073
Progress:
- Computing multi-stage projectile tick and travel rates server side vs the local client animation and that timing is in place, still in progress. I precompute the sum time of the animation/frames in each stage and cache that, during the spell cast I add the travel time based on spell speed to that.
- A* pathfinder is now bidirectional so I can identify impossible paths quicker. I have other flags for adding randomness or inefficiency to paths so its not always the same predictable pattern, which I will probably have NPCs use.
Anonymous No.105993349
>>105984205
It's pretty fun to make random shapes and throw boosters on them in different configurations to see how they spin around.

>>105984427
I don't want to pay for that.
Anonymous No.105993482 >>106028055
Why the heck is that even a thing?
Anonymous No.105993886
>use C
>try to look up anything
>C++ shit
I'm gonna go crazy.
Anonymous No.105994453 >>105994655
>>105993119
Is ygg pronounced like yeah-gee-gee or yuh-gee-gee or is it just like the word young?
Anonymous No.105994655 >>105994672 >>105994699
>>105994453
Phonetically "igg" from the Yggdrasil (World Tree) from Norse myth
Anonymous No.105994672 >>105994699
>>105994655
But I also say why-gee-gee in my head constantly, so yeah
Anonymous No.105994699 >>105994731
>>105994655
>>105994672
Whats it supposed to be
Anonymous No.105994731 >>105994734
>>105994699
"igg engine" is the cannon and official way to say it
Anonymous No.105994734 >>105994804
>>105994731
I mean the game
Anonymous No.105994798
i will not use smart pointers
Anonymous No.105994804 >>105994878
>>105994734
Ah, I misread. A multiplayer sandbox with either a "build your own" adventure or player other templates. The primary vanilla game server will be like an RPG with an adventures guild, shops, etc. But we have a fully destructible world so there is a minecraft-ish experience, and maybe you toggle a feature like "enable zombies at night", etc- giving you your own experience between everything you can set. Or maybe you build a roguelike dungeon server and host that. Clients will connect and experience "your creation". The game server is authoritative, but even that is intended to be a toggle (saves us some CPU cycles on security checks) in case it was just you and friends playing.
Anonymous No.105994878
>>105994804
In my head I don't see why a player can't even have a "shop keeper" experience, or a "habbo hotel" clone. I have some really fun ideas for ygg engine opening demo that I don't want to spoil.
Anonymous No.105995227 >>105995946
Does anyone know where to find prebuilt binaries that have all the debug features enabled?
http://angleproject.org/
Anonymous No.105995636 >>105995717 >>105996144
>>105992556 (OP)
where's grok 4 in the OP? why are ai seethers trying to sabotage solodevs?
Anonymous No.105995717 >>105997028 >>105997052
>>105995636
I baked the bread and I removed the garbage that was added
Anonymous No.105995946
>>105995227
You don't need those debug features, just enable the debug context and enable the debug callback, and enable address sanitizer if you have not already.
You would only compile Angle yourself with asserts or whatever if you were trying to diagnose a problem inside of angle.
If you aren't crashing (with Angle or native GL or GL ES) or you aren't getting debug callbacks, whatever angle "debug features" offer isn't going to debug whatever issue you have, it's time to use debugging tools like RenderDoc or Nvidia Nsight and inspect your data or look at what your code does different than a working opengl example.
Anonymous No.105996144
>>105993119
looks nice

>>105995636
fuck off shitbrain
Anonymous No.105996246 >>105997060
anyone using odin here? I trying to come with a speed up the cloth example from last thread one way was to do instancing with raylib but that requires the data to be in some kind of continuous array is it possible to get one from the SOA or is that just compiler magic and the data isn't actually laid out in one continuous chunk? i.e. in the example below there is no way to access cloth.points.pos as a continuous array right? I guess data pointer+offset will have to do...
Point :: struct {
pos: rl.Vector2,
prevPos: rl.Vector2,
initPos: rl.Vector2,
isPinned: bool,
isSelected: bool,
}

Stick :: struct {
p0: int, // index
p1: int,
isTeared: bool
}

Cloth :: struct {
points: #soa[dynamic]Point,
sticks: #soa[dynamic]Stick,
}
Anonymous No.105996499 >>105996503
>>105992556 (OP)
Started a basic Vulkan tutorial, I haven't done much coding recently at all and never really got too into graphics programming so this will be an experience, first impressions are that people weren't lying about it being a lot of code but I can see the potential in it.
Anonymous No.105996503
>>105996499
grok 4 heavy works well for boilerplate bs
t. pogeet !!b2oSUmilA2N No.105997028 >>105997060 >>105998283
>>105995717
>there is no way to access cloth.points.pos as a continuous array right?
why?
#soa directive tells the compiler to allocate the data with a slightly different layout but apart from that, its just your regular array. Its perfect for doing ECS stuff.
Also, there are a few things I'd like to point out.
if you are looking for performance, ditch dynamic arrays. They will do implicit allocations and depending on the usage, it can be slow. Calling make() and delete() on []Point and []Stick arrays is very straightforward.
A reason why cloth.points.pos might not be working is that in the cloth sim example, they used an array of pointers for each of points and sticks while calling new() for every individual element allocation and appending that with dynamic's implicit allocator. Depending on how the OS ends up allocating these points, there will a hit on performance due to cache misses.
You are using the direct struct type themselves as arrays so you'll have to do cloth.points[0].pos to access the pos element at that particular index, after prior memory allocation with make(), of course.
If I understood what you are trying to do correctly, here is a sample code
Cloth :: struct {
points : #soa []Point,
stick : #soa []Stick,
}

cloth : Cloth
cloth.points = make(#soa[]Point, width * height) // allocate cloth's WIDTH * HEIGHT number of Point types in soa
cloth.sticks = make(#soa[]Stick, width * height)

// you can access and assign the values to points like you would with normal arrays
cloth.points[0].pos = {10, 10}

// you can also access the elements of structs as if the elements were arrays
fmt.println(cloth.points.pos[0]) // prints [10, 10]

// but don't try to assign values the latter way, there is an llvm backend issue with this syntax
cloth.points.pos[0] = {10, 10} // avoid. doesn't always work. bug.
t. pogeet !!b2oSUmilA2N No.105997052
>>105995717
based saar
t. pogeet !!b2oSUmilA2N No.105997060
>>105996246
>>105997028
I focked up. Here.
Anonymous No.105998283 >>105998293 >>105998900
>>105997028
soa works already its not much faster (1400 vs 1800fps on my pc) since drawing the sticks was the main bottleneck so I wanted a way to get a slice from the soa which I have figured out. You need to do view := cloth.points[:len(cloth.points)] and then you have your normal array which you can pass to opengl for instanced rendering without trying to use pointer + stride.
Anyway I saw the blog post allocating everything I don't get why he did it suppose he likes to have stick adjusting the points directly I guess. I didn't bother with that. https://pastebin.com/6fb7sXpD
Anonymous No.105998293 >>105998900
>>105998283
>have your normal array
*slice
t. pogeet !!b2oSUmilA2N No.105998900
>>105998283
>>105998293
>its not much faster
that's to be expected considering there isn't much going on in the simulation to make the performance different highly significant.
Slices are cool. I always rely on them when parsing. Under the hood, its just a pointer and length.
https://github.com/odin-lang/Odin/blob/master/base/runtime/core.odin#L400
Its very convenient to snatch a chunk from an array and pass it around like without any hassle while the language implicitly takes care of bounds checking for you. A good QoL improvement over C's array/pointer shit.
Anonymous No.106000243 >>106000707 >>106001007
how do you guys sort your render items? by material, pipeline state, model, or something else, and in what order?
im debating about ordering by pipeline state, then model, and then material. since each model can have multiple materials
Anonymous No.106000707 >>106001437
>>106000243
by shader program, everything else is moot I think
Anonymous No.106001007 >>106001437
>>106000243
randomly opaque followed by unsorted transparent followed by 2D directly in the color buffer
Anonymous No.106001164 >>106001235 >>106001331 >>106001438 >>106002114 >>106002199 >>106021263 >>106026139
Reading through "Hello triangle" from learnopengl dot com

holy shit what is this shit, should this really be this fucking hard?
I'm fucking going insane. I barely understood a thing. Ended up with 200 lines of boilerplate and not knowing if I should move on.
Anonymous No.106001235
>>106001164
try raylib
Anonymous No.106001331
>>106001164
You should be familiar with a game engine plus the asset pipeline and c++ before going into learnopengl
Anonymous No.106001437 >>106001453
>>106000707
>>106001007
dont you guys use multiple meshes, materials, shaders, or passes?
Anonymous No.106001438
>>106001164
Try Vulkan kek
Anonymous No.106001453 >>106001486
>>106001437
Yes but I'm not even sure if it's worth sorting by mesh and material, that's advice from the 2000s, would it even make a difference in current year? Test it and find out
Anonymous No.106001486 >>106001503 >>106002569
>>106001453
so you just rebind everything for each draw call?
Anonymous No.106001503 >>106001595
>>106001486
My current renderer sorts by shader program, mesh and material but I don't think the latter two actually matter that much from the tests I've done
Anonymous No.106001520 >>106001546 >>106001569 >>106028076
No shaders, no OpenGL, No Vulkan, No Metal. Where does this lead me to?
Anonymous No.106001546
>>106001520
directx7
Anonymous No.106001569
>>106001520
glide
Anonymous No.106001595
>>106001503
it might be worth it for larger scenes, ill have to stress test it at some point, i do think it at least saves on entries in the descriptor heaps
Anonymous No.106001611
Anything but writing to the framebuffer directly is the wrong answer btw.
(But I forgot about DirectX though, Gabe's fault we are stuck with it)
Anonymous No.106002114 >>106002321
>>106001164
why don't you just ask about which parts you don't understand here
Anonymous No.106002199
>>106001164
>200 lines scares me
Anonymous No.106002321
>>106002114
Almost everything.
But thanks for asking. For now I'm reading other stuff, trying to reinforce my C++, in which I feel comfortable but maybe it is still a good idea to red more into.
I'll try to watch a video tutorial on the contents of "Hello triangle" to see if I can grasp it a little better, if not, i'll start making questions here.
Anonymous No.106002504
I got the three light types going. I love Shader Storage Buffer objects. Still lots to do.
Anonymous No.106002569 >>106002651
>>106001486
probably just material (shader + textures), mesh usually don't repeat unless its a 'multi-mesh' system with a single draw call for shit like foliage.
really you should make 3 systems, one by single shader bind, other by single texture bind and other by binding again and again and let us know the results
Anonymous No.106002651 >>106003228
>>106002569
idk the terminology, but by multi-mesh do you mean a single mesh like for example a house that has one set of textures for wall and another set of textures for doors, forcing you to split the rendering of it up into 2 draw calls, one for each set of textures?
Anonymous No.106003072 >>106003216 >>106003285 >>106011806
>want to make my game in Jai
>no Jai
>think about doing it in Odin
>but feels like I'm just doing it in the meantime and then have to port once Jai releases (unless it sucks)
Anonymous No.106003216 >>106003237
>>106003072
the chances of Jai sucking are almost zero
Anonymous No.106003228 >>106006420
>>106002651
no, i mean multiple copies of a single mesh but each having a different transform, an example is grass quads, all have the same shader and mesh, but with different transforms
Anonymous No.106003237 >>106003288 >>106003774
>>106003216
Yeah, I know, but the chances of it coming out in 2025 are about the same.

Surely it's close enough that he can push an open beta at least?
Anonymous No.106003285 >>106003774
>>106003072
There is nothing special about Jai, you might aswell use Odin
Anonymous No.106003288 >>106003759 >>106007138
>>106003237
>Surely it's close enough that he can push an open beta at least?
It's been close enough for that for over 5 years but he doesn't want just anyone to use his super special programming language
Anonymous No.106003759 >>106003779 >>106007138
>>106003288
Wrong, people do get to use it. He just isn't releasing it publicly until Sokoban is out which is really soon.
t. pogeet !!b2oSUmilA2N No.106003774 >>106003791
>>106003285
yes.
Apart from its comptime and insanely fast compile time, there is nothing special about Jai.
Its funny but allowing instruction to run at compile time like they're part a scripting language itself surprisingly worked well for Jai.
But honestly, Odin is good enough.
I wanted something that is not C++/Rust/Zig slop for gamedev and Odin is just perfect.
even if Jai comes out, I don't think I'll bother now. I'd rather fork Odin and work on it myself and chill.
>>106003237
2 more weeks saar
Anonymous No.106003779 >>106007138
>>106003759
He has no reason not to release it publicly except his own elitism
Anonymous No.106003791 >>106004546
>>106003774
I don't really see the point in the comptime shit
Like yeah it's nice, but it's not that useful
Anonymous No.106004202 >>106004546
>>105993119
Showing the path randomizing/shuffling, which now the RNG can be seeded as well
t. pogeet !!b2oSUmilA2N No.106004546 >>106004567
>>106003791
Jai's meta programming is very flexible.
Its not just simple pre-processor shit like in C that is very limiting. Its like an entire scripting language with no restrictions that executes during compilation.
luckily, GingerBill is working on introducing something as flexible as that into Odin but its still in design phase. We'll eventually see something like that in Odin and I don't mind if Odin takes a second or two more than Jai would to compile my code so I probably won't be missing anything.

>>106004202
peak saar
Anonymous No.106004567 >>106005901
>>106004546
I know what Jai metaprogramming is, I just don't see the point
t. pogeet !!b2oSUmilA2N No.106005901
>>106004567
I can make use of it.
I do some reflections on types at runtime during startup that can be done at compile time and reduce a little overhead.
And if meta programming is as flexible as Jai, I can generate cache friendly strcuts and not rely on dynamically allocation a memory chunk somewhere in the next continent of ram. A retard like me would go very far with this over-engineering friendly features.
Anonymous No.106006420
>>106003228
thats just instancing
Anonymous No.106006683
I can make a game engine in vulkan but Im too retarded to make a website
Anonymous No.106007138
>>106003288
>>106003759
>>106003779
>only allow a few people into the beta because you don't want random webshitters etc. in it
>let fucking randy in
Anonymous No.106007260 >>106007388 >>106007548 >>106009740 >>106019325
Polymorphism in C. How is it?
Anonymous No.106007388 >>106007598
>>106007260
its stupid
Anonymous No.106007548
>>106007260
That's a tagged union, hardly polymorphism.
I will say, I really hate the typedefs.
Anonymous No.106007598
>>106007388
this
Anonymous No.106009609
Bump
Anonymous No.106009740 >>106010122
>>106007260
i dont like/understand this C retardation of having to say typedef and name the struct twice
Anonymous No.106009768 >>106010002
mfw my blender-like is already at 1.2k locs
Anonymous No.106010002 >>106010118 >>106010717
>>106009768
Blender like huh? I've been kind of wanting to make a 3D modeler and would be interested to see your progress.
Anonymous No.106010118
>>106010002
See
>>105960216
>>105977961
Anonymous No.106010122
>>106009740
for some reason "struct S" is the typename instead of just "S" so they need to typedef it
classic pure c retardation
Anonymous No.106010194 >>106010262 >>106016268
Does anyone have experience with "affine" transformation matrices? I have been trying to implement it into a game engine that does not have a base implementation of it and it has been a brutal experience. Main goal is to support skewing behavior.
Anonymous No.106010262 >>106016268
>>106010194
You aren't being very specific, but I'd suggest looking at cglm for implementations
Anonymous No.106010676
>maps are declares as map[keytype]valuetype in Odin
>example: map[u16]quaternion128
Psychotic, mentally ill.
Anonymous No.106010717 >>106010727 >>106010775 >>106016268
>>105977961
manual face normal flipping
camera ortho/perspective transitions
extrude region still create inner faces sometimes

>>106010002
Anonymous No.106010727
>>106010717
oh, and vertex transforms are cancelable now, with right click
Anonymous No.106010775 >>106010872
>>106010717
Very nice. What kind of mesh structure are you using?
Anonymous No.106010872 >>106011405 >>106011814
>>106010775
not sure what you mean but here are the strucs

std::list vertexSelection;
std::list edgeSelection;
std::list quadSelection;

struct MeshEditable {
Β¦ std::list vertices;
Β¦ std::list edges;
Β¦ //std::list triangles;
Β¦ std::list quads;
};

struct Vertex {
Β¦ Vector3 position;
Β¦ Vertex* newCopy;
Β¦ void* newEdge;
Β¦ Vector3 previous;
Β¦ std::list edges;
Β¦ std::list quads;
Β¦ bool shouldDelete = false;
Β¦ bool selected = false;
};

struct Edge3 {
Β¦ Vertex* p0;
Β¦ Vertex* p1;
Β¦ Edge3* newCopy;
Β¦ std::list quads;
Β¦ bool regionInner = false;
Β¦ bool shouldDelete = false;
Β¦ bool selected = false;
};

struct Quad3 {
Β¦ Vertex* p0;
Β¦ Vertex* p1;
Β¦ Vertex* p2;
Β¦ Vertex* p3;
Β¦ std::list edges;
Β¦ bool shouldDelete = false;
Β¦ bool selected = false;
Β¦ Vector3* triangulated[4];


ill probably need to redo Quad3 into Face. when i began i wasn't sure if i should do faces with multiple triangles or just quads and tris, but now im considering just having Ngons with a vertex count where algorithms that reuire a quad just check this count to see if its 4
Anonymous No.106011405 >>106016268
>>106010872
>not using n-gons
Anonymous No.106011806
>>106003072
c3
Anonymous No.106011814 >>106011950
>>106010872
I just meant like winged edge, half edge, quad edge, etc.
Anonymous No.106011950 >>106012573
>>106011814
i need to look up the standard solutions, im just brute forcing things, but there are probably smart efficient algorithms and structures already that i should be aware about =/
Anonymous No.106012272 >>106012377 >>106012423
For a game to be released on Steam, what do players want in terms of quality? Would it be wiser to release ones first game (solo dev) despite non-optimal graphics and a small scope? Are free demos required or even clever? Do people even play demos? What about the pricing? How do you determine that without going too high or too low?
Anonymous No.106012285
he fell for the zoomer meme
Anonymous No.106012377 >>106012525
>>106012272
Doesn’t matter how much content your game has. It’s all about presentation and quality.
Anonymous No.106012423 >>106012525
>>106012272
If you want a no-shit answer to this question the truth is nobody will play your first game on Steam, it will be completely swamped and forgotten by the thousands of other games released every day
Anonymous No.106012525 >>106012545
>>106012423
That's sad, I hope at least some will play it and have fun. But I suspect as much, especially since I don't have any marketing.

>>106012377
It won't have much content, I'm sure. Had to scope down a lot because it's unfeasable to do something big alone without selling ones soul.
I'll try to polish it then as much as I can.
Anonymous No.106012545 >>106012580
>>106012525
Marketing won't help either
Anonymous No.106012573
>>106011950
Lol yeah, it'll definitely help when it comes to traversing the mesh and performing common operations...
Still, there's definitely something to be said for just going for it first, leads to better understanding than being handed the solution right off the bat.
Anonymous No.106012580 >>106012665
>>106012545
I don't think it's quite as bleak as you put it. That's a bad attitude to have lol.
Realism is useful, but realism also goes beyond self sabotage and doomerism. Any amount of increased exposure increases the chances of getting more traction. I have released other stuff besides games and this is a logical and real phenomenon, which is why proper marketing is important if you want to gather a good audience.
But I appreciate your thoughts on that matter.
Anonymous No.106012665
>>106012580
Realism is understanding that game developer is very popular and very easy to get into right now, so you need to put in a lot of work to pop off. 5 to 10 years
Anonymous No.106013480 >>106013982 >>106014059
I'm making progress in my Godot game, but i'ts quickly turning into spaghetti code and lack of order. I come from webshit so the nodes and setting variables on the editor makes me feel lost when tracking specific functionalities. Any good resources on architectural patterns for Godot or making games? Like for example i was expecting pooling every bullet on the game in a single "pool node", but apparently i have to make one for each kind of bullet scene and it rubs me out in the wrong way.
btw the pattern is just a test on the pooling stuff, some guy on the /vg/agdg/ got offended by the pattern for some reason.
Anonymous No.106013982 >>106015240
>>106013480
Why do you have to manually pool things? You'd think a game engine would do this for you
Anonymous No.106014059 >>106015240
>>106013480
juan said you shouldn't pool cause instantiation is quick and there is some form of pooling internally already, so you should probably benchmark
gdscript is slow though, so even with pooling you may get shit performance just updating the instances
having multiple pools for different types of things is fine
Anonymous No.106014476 >>106014490 >>106014537 >>106016268 >>106018157
I don't think learnopengl.com is as good as everyone says.
It has lots of grammar mistakes like it could use a better usage of commas or periods. It doesn't really explain all functions or lines of code shown.
It shows lines of code without explaining where in the rest of the code they're supposed to be ALL THE TIME, and so on...

Anyone has a better resource?
Anonymous No.106014490 >>106014498
>>106014476
>It has lots of grammar mistakes like it could use a better usage of commas or periods
nigger are you serious
Anonymous No.106014498 >>106014503
>>106014490
>are you serious
Yes.
I might have explained myself poorly, as english is not my first language. But still, I've read many books and resources in english without a problem. This is harder to read.
Anonymous No.106014503 >>106014513
>>106014498
well ok, learnopengl is the best resource you're going to get, it doesn't get easier
Anonymous No.106014513 >>106014519 >>106014537
>>106014503
Hopefully it's just me.
The content is very dense. That's probably just it.
Anonymous No.106014519 >>106014550
>>106014513
If you have any questions about OpenGL you can ask here
Anonymous No.106014537 >>106014550
>>106014476
I agree, not a fan of that site. I found vulkan-tutorial.com far better written but of course vulkan is more complicated and tedious.

>>106014513
>The content is very dense. That's probably just it.
Nah, it's just shit.
Anonymous No.106014550
>>106014519
Thanks anon I'm new to this general but I'll be around. Right now I'm not even sure what questions I have, just trying my best to understand "Hello Triangle".

>>106014537
Thanks anon but, I will try to stick to opengl for now.
Anonymous No.106015240 >>106015360
I just realized how making the "core" gameplay is the relatively fastest part, everything else takes a lot of time, the main menu, the scoring systems, the pause menu, settings menu, customization, difficulty settings, etc. even making a pong takes its time due to that
>>106013982
I saw a video of a guy talking about pooling and how that improves Godot performance, so I assumed it was necessary specially on a danmaku i'm planing to run on web browsers.
>>106014059
Nice thanks, yea I'm happy with 60 fps, so I'll do my best to keep it and checking with benchmarking
Anonymous No.106015360
>>106015240
make sure to use the godot profiling tools to see how long it spends on your scripts
Anonymous No.106015961 >>106016012
Highly recommend Pikamu’s 3d graphics course to get started.
Anonymous No.106016012
>>106015961
>paying $100 to learn to make a software renderer
Why not just do this for free? https://github.com/ssloy/tinyrenderer/wiki

Or just figure it out on your own. SDL can write a pixel to the screen easy enough, simply elaborate on that.
t. pogeet !!b2oSUmilA2N No.106016268
>>106010194
>skewing behavior
da fack iz dhat sapposed to bee, saar? did you mean shearing behaviour?
"affine" transformation simply means performing transformations relative to a point(rotation, scaling, transformation) or a line(reflection, shearing or skew) respectively.
as shown in >>106010262 picrel, by introducing a third row of [0 0 1] into your preferred form of calculation (either (row vector * matrix) or (matrix * column vector)) for dealing with homogeneous coordinates, you can perform 2D affine transformations with ease.
>>106010717
peak
>>106011405
n-gons are not good for parformance saar
>>106014476
>learnopengl.com
>people usually get filtered by math or C skill issue
>anon gets filtered by engrish
>complains about website's narrative not being to his preference and leaves a bad revies
>requests for better resources as if its a web novel
um... saar... its not THAT bad
Anonymous No.106018157
>>106014476
>I don't think learnopengl.com is as good as everyone says.
It's the best. That doesn't necessarily mean it's great, or even good.
Anonymous No.106018274
the best way to use learnopengl.com is just to go to the 2D game section
Anonymous No.106018282 >>106018432 >>106018455 >>106019432 >>106019658 >>106020449 >>106020476
>>105992556 (OP)
Is it wrong to use AI generated placeholder textures in the prototype stage?
Anonymous No.106018432
>>106018282
wrong according to who
Anonymous No.106018455
>>106018282
no, its a prototype
Anonymous No.106019325
>>106007260
I do similar things, the definitions are usually okay but using it is not always pleasant
Anonymous No.106019432
>>106018282
As long as you switch them out for non-placeholder AI generated textures before release.
Anonymous No.106019561 >>106020287
>>105992556 (OP)
I have special array for objects likely to be static to speed up Y-sorting
Anonymous No.106019658
>>106018282
no rules
only tools
Anonymous No.106020287 >>106020434
>>106019561
>Optimising for an 80s game
Based
Anonymous No.106020434
>>106020287
An 80’ game would have 1/5 of that resolution, be written in 6502 assembly, and would easily fit in 32k of ram graphics included.

OP is just a lowkey wanker losing his time
Anonymous No.106020449
>>106018282
nah im doing that rn. im not planning to sell my game anyway. Also is way faster than having to look for the specific sprites like bullets on those free websites when the quality is more often than not inferior to the ones made with chatgpt
Anonymous No.106020476
>>106018282
yes. just scribble a picture if you need a placeholder. the danger of AI is that you might trick yourself into thinking it's "good enough", whereas your users/customers will absolutely not think that.
Anonymous No.106021263
>>106001164
>opengl hello triangle 200 lines of boilerplate
If you want something super simple, SDL has SDL_RenderGeometry API which works pretty similarly. It's simple to setup and use, and you can take that and image how would the same functionality look in OpenGL
https://wiki.libsdl.org/SDL3/SDL_RenderGeometry

>takes texture, list of vertices and optionally list of indices
>vertex is destination position, source position (uv), and color
>if no index list then chunk of 3 vertices make a triangle and it draws those triangles
>if has index list then chunk of 3 indices make those triangle, vertices are obtained by array lookup in vertex list
>(note: index list pretty much always consumes less memory since vertices are often repeated in multiple triangles)
>fragment sharer runs on each pixel in each triangle. in fragment shader:
>data (dst coord, src coord, color) for fragment (think pixel) is interpolated from the three vertices of triangle
>if texture was set sample pixel at source position, else use white
>blend the pixel with color
>blend the pixel to framebuffer at destination position

Notable downside from OpenGL is lack of projection matrix that would run on each vertex, so you could reuse const model vertices/indices and just modify projection matrix to make it appear elsewhere, rotated, scaled, ...
So you need to copy the model each time and apply projection on each vertex on CPU with this.

when you want to do this in OpenGL, the additional work is
>writing a vertex and fragment shaders, compiling them
>allocating buffer objects for your vertices and indices, this is shared memory with GPU
>setting up your projection matrix, unlike in SDL_RenderGeometry for OpenGL it also needs to count with the device coordinate system and screen resolution, but careful when you draw to texture since it uses different coordinate system! confusing
>binding shader program, buffer objects, activating shader parameters, binding data for them, and calling the shader
Anonymous No.106022100 >>106022371 >>106022393 >>106031886
Is there something I can do to fix this? If I drop a rigidbody on my head just right it pushes me through the world. Using godot 4.5 with Jolt Physics. Any ideas would be great
Anonymous No.106022371 >>106022430
>>106022100
try disabling collision between the player and that rigidbody cube.
Anonymous No.106022393 >>106022430
>>106022100
try increasing your player mass or make the ground thic
Anonymous No.106022430
>>106022371
I disable collision with the player when I have the object held. If I disable it always the player could just walk through props.
>>106022393
I'll mess around with this, I actually have no idea what my players mass is which now that I think about it is a problem regardless if it fixes this.
Anonymous No.106024826
My "optimised" algorithm performs worse than the naive algorithm in most cases.
Anonymous No.106024953
Anonymous No.106026139 >>106026514 >>106027102
>>106001164
Hey guys it's me again

One friend of mine told me "lmao why are you learning OpenGL? Why would you do that?"
It really got me questioning myself.
So yeah, honest question, why are we doing this?
Shouldn't I just grab Raylib, if I want to go "low level", or even something like Godot, instead nowadays?
Again, it is honest questions, I'd rather hear your perspectives instead of going to an LLM to ask these questions.
Anonymous No.106026514
>>106026139
Raylib is made to mimic the old OpenGL API, so it's not really "low level" as far as graphics programming is concerned.
OpenGL is pretty good for learning because there are a million resources available for it and it's not too hard. Only go for Vulkan if you have time to burn on it and accept (1) many things are a complete pain to do initially and (2) you'll have to look at other people's sepples code to figure some things out.

IMO, both BGFX and SDL3 are much comfier to use, but they are harder if you aren't familiar with another API.
Anonymous No.106026746 >>106030467
>try to understand ECS
>get pages of CS bullshit thrown at me as soon as I step beyond the "it's just entities, components, and systems"
>realize it's just a 3D matrix
>everything suddenly makes sense
Anonymous No.106027102 >>106027974
>>106026139
If you don’t already have an answer to that question then you shouldn’t be learning OpenGL
Anonymous No.106027974
>>106027102
I don't want to sound stupid.
I have an answer to that question, but I also don't really know.
Anonymous No.106028055 >>106028298
>>105993482
what are you confused about?
visual studio trying to bingsearch your string?
Anonymous No.106028076
>>106001520
VoxelSpace on the CPU + Wolfenstein block rendering
Anonymous No.106028298
>>106028055
I've never seen string concatenation like this before and this syntax is dumb because I can imagine forgetting a comma can fuck you over quite often.
Anonymous No.106030374
bump
Anonymous No.106030467 >>106030488
>>106026746
I thought ECS was more like an array you could add indefinitely to.
Anonymous No.106030488
>>106030467
It's a 2D database
Anonymous No.106031886
>>106022100
just raycast and check if it hits the player then mask it?
Anonymous No.106033549 >>106035169
>>105992835
Fuck you nigga, real theme incoming:
https://youtu.be/bcxnbfRYM-g
Anonymous No.106035169
>>106033549
no fuck you. This is the real theme
https://www.youtube.com/watch?v=HM1Zb3xmvMc&t=65s
Anonymous No.106035824 >>106036244 >>106039532
I'm tempted to learn how to many something for phones (Android since that's what I have). Few anons mentioned they shipped mobile games.
Some pointer for what technologies I should use? Do you use some existing game engine? What language and graphical API? Can you emulate stuff on PC? Any interesting book/course for starters to get familiar with the platform?
I never did anything for android, but briefly know there is android studio, the platform has some C APIs and there is also Java and Kotlin. Already have an few years of experience with C++ and OpenGLES 2, so that should not be an issue.
t. pogeet !!b2oSUmilA2N No.106036244 >>106036364
>>106035824
>I never did anything for android
then you definitely should not do any game right away. Stick to a game engine.
Unity and Godot have the best support for Android platform among the major game engines. Unreal bloats the shit out of the game by default. Making it not generate a bloated apk is a huge pain not worth bother unless there is a strong reason to use unreal.
>Some pointer for what technologies I should use
First, understand how to use android studio. There are plenty of tutorials on youtube and official getting started examples which are good enough imo. Create a few projects and figure out how to deal with Activities and Fragments. Its important to understand their life life cycles when writing android application. Java or Kotlin are your language of choice here so ditch Java. Even google is trying its best to do that.
As for graphics API, go for Vulkan if possible. OpenGL ES 2 will also work but remember that it'll also be limiting.
You need to deal with android NDK shit and dynamic or statically linking C++ code while building with gradle or cmake for this(there are other ways to package an apk as well). Your C++ code has to be called by Java/Kotlin code from within the activity at appropriate times or else your app will crash. All's simple if you only render to the screen. Complexity hits hard if you need to do anything more, like copy text from clipboard and shit like that.
Anonymous No.106036364
>>106036244
I think I'll try Godot, it was on my todo list anyway.
>understand how to use android studio.
Ok I'll ask: I imagined that I would use Andriod Studio when developing some regular apps IDE-less game-engine-as-library; but how does it work when Unity or Godot is invoved since they both have their own IDE? so what's the relation to Android Studio when developing some game?
>OpenGL ES 2 will be limiting
I saw GLES3 added plenty of features like compute and tessellation shaders and instancing, so that sounds interesting.
>C++ and Java/Kotlin interop
sounds like a bit of a mess. honestly I shouldn't have an issue picking up Kotlin or C# or anything else. Heck I'll probably also try to make some regular app to learn things, and it'll be in Kotlin for sure.
Anonymous No.106037644 >>106038115 >>106039779
I gave up. I could not stop my engine from throwing an exception so I just wrapped it in a try/catch block.
Anonymous No.106038115 >>106038723
>>106037644
imagine not just throwing and just not handling it
Anonymous No.106038723
>>106038115
Then my games crashes due to an unhandled exception...
Anonymous No.106039532
>>106035824
if you want to support android and apple, you can make a web game (OR just make it native and a web game with unity or godot or whatever, but C++ emscripten works on the web).
emulating a phone should be as simple as going into chrome or firefox dev tools and emulating a phone.
then when you want to switch to in-game-purchase, you could package your application as a electron app and I'm sure there are examples on how to get in game purchases working inside of electron.
The big downside with using C++ with emscritpen, is that you are missing out on detailed crash reports, and wasm / webGL performance / latency hit (it would be a lot more noticeable playing an FPS game with a keyboard+mouse). And also you can't use multithreadding / accurate timers on Wasm if you host the game on free sites like github pages or itch.io (due to cross origin isolation something, it would work if you hosted your own website with a special option, or use electron). But as long as you aren't making something in 3D (Please use unity), it's really hard to make a 2D game run below 60fps (even with wasm/10 year old PC/phone) without doing something terribly wrong (software rendering / really bad code).
But I have heard a lot of people curse android studio and the difficulty setting it up, BUT I have not seen the build steps needed to get an electron project uploaded on android. Getting emscripten working is not easy (probably just as difficult as android studio), hopefully electron "just works".
Anonymous No.106039779 >>106039972
>>106037644
this reminds me of mingw with all it's issues with debugging.
thank god visual studio community edition is free, I remember back in 2010 when you had to pay for it, that's why I started with mingw in the first place.
so many tutorials that have try{}catch(std::exception){}, especially BOOST examples!
Just don't catch it!
your debugger will tell you what happens (but not on mingw without some hack, like setting gdb to catch all C++ exceptions, which wont work if you don't try/catch and won't work with assert, it's better to set it to catch abort).
And my main reason for dumping mingw (since everything I mentioned has a workaround, except this) is the lack of address sanitizer.
Address sanitizer is a godly tool and it really makes you think how useless a debugger is without runtime checks. You would think "running with a debugger" means it's checking to make sure your code is bug free, like if you access invalid memory, but nope. It does nothing (MSVC does enable /RTC on the default Debug Project which is like a shitty version of address sanitizer / more like undefined behavior sanitizer, asan does black magic and only allows you to access "valid" memory, plus a cool report).
Anonymous No.106039972
>>106039779
And also, if you have a truely terrible bug where you have no idea what could have possibly caused the issue AND it's reproducible.
You can use windows time travel debugger, you need to use windbg preview (windows store) and you could step backwards through your code, but I think there was a detailed tutorial out there that shows examples of scripting, where I think you could add a timestamp or whatever every time a certain address or something was modified (the scripting is terrible, I think it was in powershell or basic...).
Technically Visual Studios has Time travel debugging, but only for the premium version (you need to pay like $500 a year).
It does tend to produce a 100 mb large file after a few minutes, but I am personally surprised by how fast it runs, but my application was not particularly heavy.
Anonymous No.106040297 >>106040929
write a script to ensure my structs has the correct layout for polymorphism /interfaces or use C++ ?
Anonymous No.106040929
>>106040297
vtables