[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: RS_Romero.jpg (97 KB, 655x871)
97 KB
97 KB JPG
John Romero 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: https://desuarchive.org/g/thread/107727030/#107727030
>>
File: IvyMen_mbWpSRBZpp.2.webm (3.61 MB, 1008x724)
3.61 MB
3.61 MB WEBM
Working on frustum culling, but my math brain is tarded
>>
Any reason NOT to just dump all your shit into a pool and forget about memory management beyond that if your game isn't realistically going to use more than 500MB of RAM at peak?
>>
>wonder why textures arent rendering correctly in a new shader
>spend two hours debugging
>realize i forgot to actually use the texcoords
maybe i should sleep
>>
>>107815064
hard resource limits are cringe
>>
hey autismos, get in here:
>>107809667
and explain what he is saying, he might be trolling, but just in case he is not
>>
>>107815064
people literally gaslight themselves into thinking malloc is bad then reinvent memory allocation themselves as pools and pretend this is better somehow
>>
>>107815823
A strange phenomenon that mostly C and C++ developers fall victim to
>>
>>107815811
he's saying he did some trivial science experiment
>>
>>107815841
You forgot Rust devs who invent a whole memory management scheme just to bypass the borrow checker.
>>
>>107814540
sovl
>>
>>107815387
I'm not proposing that the game ships with a set limit and crashes beyond that, just that there's no deallocation. You set it at some decent number for your game and if you ever need more, you double the pool size. Just that if you then go back below one of these 512MB increments you don't bother freeing that memory.
>>
>>107816314
No you can't make a game with no deallocation
>>
>>107815863
I remember the first time I saw Rust it was a game programming presentation and it was generating ids to objects in a pool and it made me think "Wtf, just return pointers".
>>
>>107816422
Says who?
>>
>>107816634
Unless it's some puzzle game where nothing on the screen never really changes you'll be allocating more memory every frame for every bullet, enemy, particle effect, sound that needs to appear
and if you're going to say "well that doesn't count I'm using my own memory pool" then congratulations you just rewrote malloc / free for no reason
>>
>>107816657
Anon I just said I'm not deallocating, I didn't say I wouldn't use freelists to avoid having 500k bullets when only 500 are alive (yes it can theoretically still happen, no it will not happen in the real world, ever).
>>
>>107816675
>I didn't say I wouldn't use freelists
Yes, you rewrote malloc / free for no reason
Well done
>>
>wrote some of my own shitty std code
>compiles 70+ files in less than a second
>start writing a project with c++ std
>compiles 3 files with 8 std includes in more than a second
i hate this bloat
>>
File: water.webm (107 KB, 1152x648)
107 KB
107 KB WEBM
>>
>>107815823
Malloc literally has a mutex inside of it.
>>
>>107816697
They're not the same at all. Rolling your own like this is absolutely trivial and guarantees o(1), no fragmentation, etc which malloc absolutely does not.

Yeah if you use mimalloc you might get similar performance in most cases, but then you're using mimalloc.
>>
>>107816697
anything is better than malloc and free, dumb nocoder.
>>
>>107816917
>Rolling your own like this is absolutely trivial
Yeah but if you actually benchmark it there's no real observable difference, you're cargo cult programming
>>
>>107817105
Funny how you bring up benchmarking and cargo culting in one sentence.
>>
>>107817115
Why's it funny?
>>
>>107817131
When you benchmark something and observe the results for yourself you're doing the opposite of cargo cult programming
>>
>>107817137
When you benchmark you create fake results and then you verify that your wrong results that mean nothing are absolutely correct and then you proclaim that your mental retardation is scientific and opposite of being a retarded cargo culting nocoder, but it could be nothing further than that.
Benchmarking is like asking a shit eater if eating shit is wrong, of course he will say it isn't.
>>
https://www.youtube.com/watch?v=IZIc4IFNeGQ
this raytraced audio is so awesome
>>
>>107817162
>When you benchmark you create fake results
what the fuck am i reading
>>
>>107817198
Reality that's hard to accept to cultists of the cargo programming.
>>
>>107817233
So if benchmarks are fake results what are real results?
>>
>>107817253
Real code.
>>
>>107817258
Am I talking to an AI?
>>
>>107817276
It would be very sad if even "AI" turned out to be more intelligent than you.
>>
>>107817282
go back to your containment thread lil bro
>>
>>107816314
this is one of the dumbest things posted on /gedg/ this year
>>
>develop your own game engine
Lmao wut? Just use unity or unreal. How hard is it that?
>Reinventing the wheel
No
>>
>>107816845
>not using precompiled headers
>>
>>107817359
i am
>>
>>107817359
i actually even made a makefile target to generate it so i wont miss any includes
pch:
@echo "#pragma once" > $(PCH_FILE)
@echo "" >> $(PCH_FILE)
@grep -rhoP '#include\s*<[^>]+>' $(SRC_DIR) | \
grep -v '#include <pch.h>' | \
sed 's/#include\s*<\(.*\)>/\#include <\1>/' | \
sort -u >> $(PCH_FILE)
>>
>>107817343
Your own memory pool won't be significantly faster than malloc
>>
>>107817417
what is wrong with someone wanting to write anything on their own? be it for any reason
>>
>>107817509
Nothing, I use my own memory allocators, it's just that peoples reasoning (malloc = bad, avoiding it is good) is completely retarded
>>
>>107817417
If you're using the standard allocator, it will absolutely be faster than malloc. Not faster than mimalloc or others, but standard? Yes.
>>
>>107817417
Except it will, but you don't understand anything and believe that running a function in a hot loop is a valid test so not like it matters what I write.
>>
>>107817580
There you go again inventing imaginary scenarios to argue against
You really should see a mental health professional
>>
>>107815823
>Gaslight
If you use malloc and free you are wasting operations and have to worry about use after free or leaking memory. If you malloc a pool then you just have to manage that pool and free one allocation eliminating memory leaks as a factor. As long as you know how large the pool is you literally cannot lose track of memory.
>>
>>107817612
What you're talking about is an arena, not a pool
>>
>>107817624
You haven't written any games bro you spend all day seething in /dpt/ about malloc
"Benchmark" doesn't mean "run a function a hot loop"
You can switch out your allocator on a full game project and compare the results, doesn't get any more accurate than that
>>
>>107817622
>Arena vs pool
What's the difference? I thought an arena was just a type of pool.
>>
>>107817639
So now you don't even understand what basic words mean? Pajeet hubris is incredible.
>>
>>107817648
A pool is a general purpose allocator, it replaces malloc and free
An arena is a specialized allocator, it only gives you malloc, you can't free things individually
>>
>allocate some memory with malloc
>free it when you're done with it
>don't free it if you aren't done with it
Wow, so difficult.
>>
>>107815387
>>107815823
>>107816657
>>107816697
After thinking about it, I decided to just use mimalloc and forget about it. I wasn't gaining anything from doing >>107815064 and I don't see any reason to bloat my code with stuff I don't need and doesn't benefit me.

Thanks for calling me a retard and making me think about my system more than I would have otherwise. Who said internet arguments aren't productive?
>>
>>107818069
you're welcome
>>
I'm sure malloc is the bottleneck of your engines.
>>
>>107818167
malloc is the bottleneck of my registry dumper
>>
>>107818167
Maybe not, but why not just take 30 minutes (probably way less) to switch to a better allocator? Replacing the standard implementation is what, 1 line of code?
>>
>>107818212
dont waste your time on trivial problems that dont exist
>>
Where the FUCK have racing games gone bros? I feel like a ngga could make a buck selling an indie NFS Underground clone rn.
>>
>>107818426
I assume they just put out the same carslop game every year and that's the entire racing game audience
>>
>>107818426
Is there actually an unoccupied niche in the market? Also aren't real life car models copyrighted?
>>
>>107818232
I'm sure you've done things with less return on investment than taking 10 minutes to switch the default allocator to mimalloc.
>>
>>107814484
Curious. Has a Scratch "game dev" ever harassed /gedg/? If so, did they get laughed out of the general immediately? One would hope.
>>
File: 1551149757988.png (73 KB, 555x416)
73 KB
73 KB PNG
How I look working on my game engine while being unemployed
>>
File: file.png (69 KB, 2106x219)
69 KB
69 KB PNG
randomly remembered this one, good times
actually thought it was further back
https://desuarchive.org/g/thread/104638811/#104663562
>>
>>107818667
what else would you do?
>>
>>107814484
>The Bitcher 3
>>
>>107818715
javascript CRUD applications leveraging AI + jeetcode and trying to get a webdev job would seem like the well adjusted man's choice
>>
>>107818637
we just ignore him
>>
File: best.gif (322 KB, 768x512)
322 KB
322 KB GIF
My top scientists are working on a cure for nodevs, they tell me in 2 more weeks they will have the results for 6-7 of the test trials
>>
im trying sdl gpu, and ive managed to draw multiple meshes with their own transforms all in one indirect draw call,
but multiple things im relying on are "not recommended", so im trying to do things in "proper" way. but doing anything different breaks everything.
im about to just give up and just use opengl.
>>
how hard is it to build a simple car physics engine with suspension, acceleration/braking, and steering?
>>
File: ygg-frog.gif (71 KB, 160x160)
71 KB
71 KB GIF
>>107819850
Trial 1 result: Frog
>>
>>107820108
actually fuck me im retarded.
completely forgot you had to specify how many uniforms/storages/etc a shader expects when constructing them.
>>
video game dev is fun. idk if i'll ever release anything but the dopamine hit of getting something to work finally is kino
>>
>>107818764
I just couldn't live like that.
>>
>>107820108
SDL GPU is a meme. Either use an engine or use a gfx api directly.
>>
>>107820461
It's very easy. I don't understand why midwits get hung up on physics, we have all the fucking formulas, some of them are taught in middleschool, the rest in highschool.
You should be asking yourself why you care about physics so much in a world that can work in any way you want and end result is a fun game that actually runs at a stable 60 tps and not accurate simulation of real world that will end up convoluted, inaccurate anyway, and too slow to be used for a game.
>>
>>107818167
Memory allocation itself might not be a bottleneck but shit memory layout is the difference between your game being playable or not.
Feel free to prove me wrong by using linked lists everywhere. I accept your concession in advance.
>inb4 midwit forgets that allocating big arrays on top on malloc that contain pointer + count + capacity is already a rudimentary optimization that he claims is not faster than just using malloc for each element
>>
>>107820108
Just use Vulkan, stop listening to memes from 2016 about it being incredibly difficult.
https://www.howtovulkan.com/

Or waste time learning a dead and notoriously shit API I guess.
>>
Maybe it's time to stop making this thread
Most of the posts are from some psycho who doesn't even make games looking for a fight
>>
>>107818167
It actually is quite often, especially when using vectors carelessly. In other cases it was an easily removeable 5% of CPU time.
>>
>>107823167
>It actually is quite often
citation needed
>>
Which engine is decent an wont have anyone asking for my dubloons when i sell my game because used it?
>>
>>107823225
you get what you pay for, godot is free but its worse than unity
>>
>>107818212
Bikeshedding

>>107821783
"Malloc vs a my special allocator" is NOT the same comparison as "array vs linked list".

Linked lists have an unpleasant interface, but even if you were to write your own [] operator for linked lists it would still be a bad idea because you know that random access to linked lists is objectively slow, both from a CS perspective and a hardware perspective.

Furthermore, just because something is slower doesn't mean it's a bottleneck.

>>107823225
Godot. Unity sucks balls anyway
>>
>>107823326
>"Malloc vs a my special allocator" is NOT the same comparison as "array vs linked list".
Except it is.
>>
>>107823064
Maybe it's time for you to go back to the orange site where I won't be posting.
>>
>>107814484
How come pretty much every game engine resorts to a scripting language for the gameplay logic?
>>
>>107824367
C++ is an esoteric mess that's difficult to use / you don't have to recompile
>>
>>107824687
How do you prove an unquantifiable statement?
>>
>>107824681
>C++ is an esoteric mess that's difficult to use
Sure the language is a bit messy, but most of game logic is rather simple state changes, so I don't think you actually need a scripting language to get things done.
>>
>>107824702
Go back to your containment thread lil bro
>>
>>107824681
>c++
>difficult to use
lmao even
>>
>>107824733
Nobody said you need it, it's just easier to write dynamically typed scripts than working with a big C++ codebase
>>
>>107824773
>big C++ codebase
make it small then
>>107824734
Or what?
>>
>>107824687
>>107824733
>>107824747
https://youtu.be/7fGB-hjc2Gc
Here's two hours on how shit C++ is.
>>
>>107824734
>lil bro
nta and I don't care about this argument but can I just butt in to say that I HATE this phrase? It's condescending and punchably smug, especially when the user of the phrase is actually YOUNGER than the receiver. Imagine if some 10-year old called YOU "lil bro" even though you're old enough to be his DAD. I'd fucking murder that kid on the spot ngl (and I'm against murder)
>>
>>107824955
Imagine if you spent 2 hours doing something of value instead, really try to, because I'm not going to watch it.
>>
>>107824975
>spent 2 hours doing something of value instead
Like spending 2 hours to decipher C++ error messages?
>>
File: 872.jpg (111 KB, 1200x1200)
111 KB
111 KB JPG
>>107824966
>I'd fucking murder that kid on the spot ngl
>>
>>107824990
No, like learning C++ so you don't have to tell everyone how retarded you are.
>>
Any good asset stores? I ain't got time to make like a 1000 3D models on my own
>>
>>107824955
im not wasting 2 hours on some sperg bitching about being too bad at programming to use a real mans language. ill watch anime instead
>>
File: 1767817619191369.jpg (138 KB, 750x555)
138 KB
138 KB JPG
How do you handle gameplay code? Writing it in C makes testing gameplay and game logic pretty slow and brittle. If you wrote a small interpreter for a dsl that would run in another thread right?
>>
>>107824966
>It's condescending and punchably smug
thats the point genius
I'm twice his age
>>
>>107825282
>If you wrote a small interpreter for a dsl
I tried this and it's a very bad idea
Try write all your code in one language if possible
>>
>>107824367
There are parts of code that make up game content that's supposed to be stored in the data. So you will either have to rely on dlls or script language.
>>
>>107825282
Pretty sure the default for these types of things is just integrating Lua
>>
>>107825455
lua is fucking disgusting. its a sin of a language
>>
Just setup obsidian mcp with Claude so it can take notes on its own now. Then I learned that Blender too has an mcp extension, and there’s also mcps for image generators. Which means I can quickly automate game/engine dev. This gave me an idea to make an mcp for Compressorator/KTX tools library so I can ask Claude (or any LLM) to compress images to ktx2/BC7 and generate mipmaps for them. Furthermore I want to make an ability/command that will have Claude sweep through a gltf file, convert the images to ktx2, and modify the URIs to fit the new images. Something I used to do manually so this would be a life saver and a game changer for asset processing.
>>
>>107825469
Is your DSL gonna be any better?
>>
>>107825577
NTA but every time I read "DSL", instead of thinking of "domain specific language", I think of "dick sucking lips"
>>
File: 1765980066327813.jpg (331 KB, 1399x1080)
331 KB
331 KB JPG
>>107825612
Same, it's very distracting if you're trying to learn domain specific languages, even if it is just for shits and giggles
>>
>>107825577
no, because my game code is in compiled c++ dlls
>>
>>107825282
Haven't had any issues with doing it in C++ so far, but my scope is rather small. Also VS2022 and later can do hot reload for C++
>>
>>107825282
>Writing it in C makes testing gameplay and game logic pretty slow and brittle
Why?
>>
>>107825545
Update: I asked Claude about the mcp idea and it initially made it as a skill which doesn’t work on Claude Desktop chat (only CLI) so I clarified and it did the mcp thing via some python lib called Pydantic. So now I can have Claude compress images which is nice.
>>
>>107814484
What do you guys use to load models. Assimp ?Do you write your own parsers and if so for which file types ?
>>
>>107826294
tinygltf
>>
>>107826294
cgltf
>>
>>107826311
>>107826342
Is gltf the only format people use these days.
>>
>>107826347
I see no reason to use anything else.
>FBX
Proprietary overbloated shit.
>obj
lmao
>>
>>107826347
It’s the modern standard
>>
>>107823225
haxe+heaps
>>
>>107826369
>>107826381
Well that does make my job way easier. Thanks.
>>
>>107825282
integrate cling interpret c at runtime
>>
>>107826294
Rolled my own export script and format. Right now it's like a binary Wavefront obj.
>>
can I post here if I use Unity and am not an engine dev? I don't like agdg, and the /v/ gamedev threads dont happen very often.
>>
>>107826504
As long as you talk about gamedev related stuff nobody will mind.
>>
>>107826504
sure, just be prepared for the hyper autists to complain over your progress
>>
File: output.png (645 KB, 800x800)
645 KB
645 KB PNG
Testing the additive color brushes to create cool looking effects on my drawings. I've also been working on attack animations but it's not good enough to show off right now.
>>
>>107826504
Yeah, what's taking the de/v/ thread maker so long? I need to get off /agdg/.
>>
>>107826504
Sure if you post actual technical stuff. This place isn’t your self deprecating no-dev blog.
>>
>>107826294
I wrote a parser for Wavefront OBJ
>>
>>107826817
Are you actually using a higher bit depth canvas for it or does the addition saturate to 255?
>>
This might be a naive question but if I have a Player whom has some Player.think() running on each frame and I use that to check the pad and do movement and whatnot, if I want some action to create a Bullet or something do I need to implement a message queue of sorts which is common between the scene and its entities?
For example (excuse the psuedo-code);
(Player)
think() {
if(pad.isDown("spacebar") && this.bulletCooldown <= 0)
this.messages.push(new SpawnBulletMessage(...));
}

(Scene)
think() {
foreach (entity in this.entities)
entity.think();

foreach (msg in this.messages)
this.performMessage(msg);
}


With Player.messages and Scene.messages being the same object.
Is this a common paradigm or is there a better way to do what I'm trying to do?



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.