[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: 1777089426975349.webm (1.33 MB, 960x544)
1.33 MB WEBM
/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: >>108676746
>>
>>108717358
finally a good fucking game
>>
Exclusive fullscreen vs fake fullscreen?
In some thread I've been told exclusive fullscreen is a thing of the past, but I'm not sure it applies well to games due to potential performance loss. Not having to recreate context and managing multiple displays would be much less of a headache though.
>>
>>108717376
AAA games use fake fullscreen
>>
File: destructor2d 720p 4ch 1.mp4 (3.9 MB, 1280x720)
3.9 MB MP4
My AFRICAN game built on custom AFRICAN engine with OpenGL 1.

2D racing & highway driving game with GTA IV physics.
Flatout + BeamNG + GTA IV, but in 2D.
What do you think about it?

Steam page is ready and trailer is on youtube.
Give feedback and show your steam page.

Trailer: https://www.youtube.com/watch?v=KmnpzOYB-bM
Steam page: https://store.steampowered.com/app/4660070/Destructor2D/?utm_source=4ch
>>
>>108717477
>AFRICAN
downvoted
>>
>>108717376
>FSE
are you retarded or something? that hasn't been a thing since like windows 7, that's like asking if you should use dx9
>>
>>108717477
Looks cool. But a planned release date of 2028 is crazy for a smaller game like this. Also you should know that the AI cover image is not very enticing to most people.
>>
>>108715236
>>108716073
>You're thinking about this way too much, just use everything.
I will try to use all social media but I have zero skills, I DON'T HAVE SOCIAL MEDIA. I only use 4chan my whole life.

How to post on reddit when all subreddits require you to have big karma? And if you post your link/game on multiple subreddits they will automatically shadow ban you.

Instagram? What to post there? Screens? Videos? Are there tags on instagram?

Tiktok? How to use it? I never visited tiktok.

Facebook? That's for boomers I think.
>>
File: destructor2d 720p 4ch 2.mp4 (3.69 MB, 1280x720)
3.69 MB MP4
>>108717616
>Looks cool. But a planned release date of 2028 is crazy for a smaller game like this.
I work on it part time despite being unemployed. I am lazy.
I am a true /gedg/ and I am using my own game engine, I make the graphics, I make maps for the game, etc. so it takes decades to finish anything.
>>
>>108717835
What if you had a fataility icon pop up over that T-bone collision as soon as the driver broke his neck?
>>
I can't find anything in the godot documentation about the guarantees of _process and _physics_process? I'm guessing _process is guaranteed to be called once per frame? And _physics_process is guaranteed to be called X number of times per frame in order to give the effect of whatever ticks per second? Does it fudge the timer at all to account for minor timing differences so you're not dropping physics ticks because it was called 0.1 microseconds too early?
>>
>>108717956
personally I'd just disable physics entirely unless I'm making a game that literally relies on physics
>>
>>108717956
kind of shit you would know if you wrote your own game engine
there is no guarantee, you have a delta parameter that tells you how long it's been since the last time it's called, if the engine drops a frame you can tell from the delta parameter and it's up to you to catch everything up to where it should be, we're not doing differential equations here
>>
>>108718071
delta in your physics step is kind of pointless unless you're programmatically changing it at runtime
if you set your godot physics to 60 ticks per second but you're running at 59.9hz, your physics update just isn't even going to be called every other frame
>>
>>108718136
first it's not "useless". physics equations are numerically integrated over delta_t, it's most logical to follow that convention in the engine design.
second "physics isn't called every frame" perfectly demonstrates that you think you are smarter than you really are, physics are interpolated during rendering based on the time difference between the frame is rendered and the time the last physics update happened, this happens behind the scenes, it's how most game engines work, the frame and physics don't sync up or some other absurd notion you seem to have.
Either focus on making your game, or write your own game engine, you aren't going to learn how game engines work by building a game in godo or unity or whatever.
>>
how come gedg hasn't produced a single game yet?
>>
>>108718242
>first it's not "useless". physics equations are numerically integrated over delta_t, it's most logical to follow that convention in the engine design.
if you know your physics are fixed at 60fps you don't need a fucking delta, you're just wasting time on multiplications instead of hardcoding around your fixed timestep
>second "physics isn't called every frame" perfectly demonstrates that you think you are smarter than you really are, physics are interpolated
physics interpolation is a separate feature that has to be explicitly enabled and has huge drawbacks, it's a compromise that most indie games don't need
>>
>>108718285
thank you for sharing your personal opinions
>>
>>108717696
Honestly not entirely sure about Reddit, never used it. What I do know is that Youtube shorts, TikTok, and short form content in general has a MASSIVE reward ratio compared to other things.

However that depends on your audience. If you're making a 4x, I doubt much of your target audience is watching TikTok.
>>108717477
What >>108717616 said, the AI image tarnishes the page a lot. It's a small image, either do some editing on it yourself or even better commission a proper artist for it.
>>
>>108718271
I'm working on it.
>>
>>108718271
>how come gedg hasn't produced a single game yet?
I haven't produced but I already have a steam page. Am I the closest to win /gedg/ race to release a game? >>108717477

>>108718285
>if you know your physics are fixed at 60fps you don't need a fucking delta, you're just wasting time on multiplications instead of hardcoding around your fixed timestep
I also recommend using fixed physics timestep. My game uses it, but not 60Hz but 120Hz. But 60Hz might work for many games.
>>
>>108717616
>Also you should know that the AI cover image is not very enticing to most people.
>>108718353
>What >>108717616 said, the AI image tarnishes the page a lot. It's a small image, either do some editing on it yourself or even better commission a proper artist for it.
I researched (asked AI) and it costs $300-500 to get artist to create you a set of steam capsules. This is pretty big investment for AFRICAN, I would need to sell many copies of the game just to recoup that steam capsule.
So maybe I will try to create capsule on my own? Or do you know how to find cheaper but good artists?
>>
>>108718407
>a set of steam capsule
You don't need a set, you need 1. One image of that size would be less than 100, probably less than 50.
>where
Go on fiver or similar I guess?
>>
>>108718442
>You don't need a set, you need 1. One image of that size would be less than 100, probably less than 50.
Steam requires a whole set of capsules
https://partner.steamgames.com/doc/store/assets

But I could ask the artist to create one big image, then I could cut proper sizes myself and paste the logo.
I doubt I will get anything quality with $50-100. If artist takes $20 per hour, he has 2-5 hours to create it. This is impossible. Maybe if he is Indian he doesn't require $20 per hour. But Indians will use AI.
>>
>>108718271
there was that one guy with a crazy looking game in his own engine, it was a fps with floaty physics and some crazy looking enemies like a huge metal centipede that split into smaller ones it looked pretty good but I dont think he released it
>>
>>108718271
I ain't releasing a flop. At this point I'm tweaking mechanics for more depth and having fun playing it regularly.
>>
File: spritemanager.png (81 KB, 900x606)
81 KB PNG
I solved the sprite manager problem. Now sprite properties are edited on a separate section below, and you can add new properties. All the properties are shared by all sprites, so you don't have to add them separately for each one.

It's a bit awkward to save this as CSV because I need to store information about the fields, I think I'll have to hide them in a header column or something.
>>
>>108718569
Yes there is no way you will get a good capsule for $100.
>>
File: 1763071487838037.png (507 KB, 1070x601)
507 KB PNG
>functionality fully implemented
>now I just have to create content
>>
>>108720965
some people are the luthier, and some the violinist
>>
>>108717376
>potential performance loss
There is none on a modern OS. Exclusive fullscreen is basically pointless these days.
>>
After using modules in never going back. Dealing with headers + cpp sucks monkey cock. My code just feels truly clean now.
>>
File: 1591130461469.jpg (37 KB, 600x600)
37 KB JPG
>>108717477
>utm_source=4ch
>>
File: file.jpg (122 KB, 482x427)
122 KB JPG
>>108720965
time to learn blender and construct an entire mmorpg
>>
>>108721201
Same story we have heard so many times already. Nobody sticks with modules long term, they always go back.
>>
>>108721287
3d modeling should be ez like playdough so people in the community can make good games
>>
>progress
>make a settings parser that produces a nested key value map
>want to use std::optional for error handling when looking up something
>oh look youd need and_then([](auto &){ ... }) for each nested value. disgusting
>whip up a specialized optional for this one case so i can now do sexy shit like
auto display_path = settings["graphics"]["display path"].As<std::wstring>().value_or(L"");
>>
>>108721866
Just use std::expected
>>
>>108721933
that would still have the same issue of not being able use the index operator on them, id still need to use a long and_then lambda chain, something like
auto fa = settings.Find("graphics")
.and_then([](auto &self) { return self->Find("display path"); })
.and_then([](auto &self) { return self->As<std::string>(); })
.value_or(L"");
>>
>>108721985
Do operator overload
>>
>>108721993
doing mixins for an stl type seems a bit overkill, when i can just make my own hyper specialized class in a few lines of code. hell the basic implementation is just
struct Value
{
using Object = string_map<std::string, Value>;
std::variant<std::string, Object> data;

struct Optional
{
Optional(Value *v = nullptr) : ptr(v) {}

template<class K>
auto operator [] (const K &key) -> Optional
{
if(ptr && std::holds_alternative<Object>(ptr->data))
{
auto &obj = std::get<Object>(ptr->data);
if(auto it = obj.find(key); it != obj.end())
return &it->second;
}
return nullptr;
}

template<class T, class... Args>
auto As(Args &&...args) -> std::optional<T>
{
if(ptr && std::holds_alternative<std::string>(ptr->data))
{
auto &str = std::get<std::string>(ptr->data);
if constexpr(std::same_as<T, std::string>)
return str;
// else if other types of T
}

return std::nullopt;
}

template<>
auto As<Object>() -> std::optional<Object> = delete;

private:
Value *ptr;
};

template<class K>
auto operator [] (const K &key) -> Optional
{
return Optional(this)[key];
}
};
>>
>>108718683
age of brass? I thought that guy got bored and quit.
>>
why the fuck is multi-threading so hard

if i want thread for physics i either need to stop main thread for physics tick or i need to copy and manage whole game states between threads
>>
>>108724595
because you aren't properly visualizing what it is you're trying to do
>>
>>108724595
it's not, really
>>
>>108724595
The naive approach to multithreading where you have a thread for each subsystem is dumb because game tasks need to happen sequentially
>>
My productivity has skyrockets ever since I stopped masturbating, but at what cost?
>>
>>108717376
>In some thread I've been told exclusive fullscreen is a thing of the past, but I'm not sure it applies well to games due to potential performance loss
you don't understand, they changed how the compositor works on windows
it's been a really really long time since i read the info so there's probably a bunch of inaccuracies on this but essentially what you understand as exclusive fullscreen isn't really a thing any more, period
that's one of the reasons you can alt tab on a lot more applications on modern versions of windows
it used to be that it bypassed the compositor or at least took a fast path iirc
they did optimize it a fair bit but now everything is going through their modern compositor infrastructure and iirc some part of the dx12 swapchain infrastructure even if you're using things like the exclusive fullscreen vulkan extension
>>
>>108724304
dont think its age of brass its a fps, follow the previous threads path and you'll find it. He was here a month or two ago
>>
>>108724766
>everything is going through their modern compositor infrastructure
? if you're using flip models like you're supposed to, it completely bypasses the compositor as long as your game is the only thing being displayed on that monitor, exactly like FSE used to
in fact, with MPOs, you can even bypass the compositor and get FSE like performance in windows, usually up to 4 or whatever your GPU supports
>>
https://walbourn.github.io/care-and-feeding-of-modern-swap-chains-3/

blog post on fullscreen by the microsoft guy who literally implements this shit
>>
>>108717358
>>
File: 1763296750142302.png (91 KB, 673x326)
91 KB PNG
>>108724807
Kek apparently you don't even get real exclusive fullscreen anymore on modern Windows even if you try.
>>
>>108724782
>>108724807
neat
good to know it was actually inaccurate
though if i thought that then other people probably do too which might be were the idea that it's a thing of the past came from, iirc i heard it in power user circles before i got into graphics development

>>108724834
see that's what i was talking about
>>
>>108724782
Apparently MPO is disabled by default these days because it can cause flickering and other graphical issues with programs that weren't designed to support them, which is most programs.
>>
has anyone here tried the nu engine? the one coded with F#
>>
>>108724888
That guy posted his engine on here and I asked in the mildest way possible what the point in a functional game engine was and he had a 100 post meltdown
>>
>>108724903
wut
isn't the benefits quite clear? what was he ranting about?
>>
>>108724916
>isn't the benefits quite clear?
no thanks why I asked
>what was he ranting about?
nothing coherent, he was going completely insane
>>
>>108724921
that's a shame
I'm thinking making a card game, and did some testing with C#, it gets convoluted really quick cause i want it to be very flexible, so after struggling for awhile i thought FP might help, after all card games are very standard state machines
>>
>>108724595
because no language supports any form of hints whichever data is getting accessed by whom.
>>
Does there bexist a chess boxing game?
>>
>>108725306
arms
>>
>>108717376
exclusive fullscreen is only for dx11, opengl, and older. dx12 and vulkan assume you are using borderless or windowed. vulkan can technically do exclusive fullscreen but you lose hw flip.
>>
>>108717376
Usecase for exclusive fullscreen?
>>
>>108725516
Annoying your user by making him unable to alt-tab properly and flickering for 1-2 seconds when he tries to use his second monitor. All for 0.3fps more on average.
>>
File: 1746146333533615.png (351 KB, 839x768)
351 KB PNG
>import environment from blender into godot
>generates hundreds of materials
>they're all fucked in various ways
>there's no way to mass edit them
>>
>>108724595
Physics are like the one thing that stays on the main thread
>>
>>108724595
>what is a mutex 101
>>
File: 1688012973742415.png (531 KB, 622x767)
531 KB PNG
>>108725693
wtf are you smoking?
the main thread should be paper thin to keep the entire thing responsive.
>>
>>108725884
I thought task system is how we got significant input delays.
>>
>>108725820
You would need a semaphore or a conditional value (which uses a mutex, but it also needs a counter to emulate a semaphore).
since the first render frame needs to wait for the first physics frame, unless you want to update the physics without waiting for the render thread (not ideal).
But there is zero point doing physics on another thread if there is no other work to do on the main thread.
>>108725884
There are lots of good reasons to keep stuff off the main thread, for example there is no reason for physics to be on the main thread if you were making a multiplayer game (because if your main loop stutters, there server isn't going to stop updating the physics).
But for a single player game, it's possible that your FPS is limited by the physics. This would not be the case if you had interpolated physics (which introduces a significant latency issue).
And also, if your main thread is waiting for the physics, you could increase the FPS by doing work on the main thread instead of sleeping (your main thread is doing physics as well as every other physics thread, this is how jolt physics works I believe, and jolt also has a low level thread API you can replace I think).
Making the main thread do work might also save some CPU time, if you want the main thread to wake up as fast as possible, since Sleep/Waiting on a mutex/anything is not very precise at waking up, so instead you could do a spinlock in theory while waiting for other threads to finish work. This spinlock should also process windows events (basically, PeekMessage until the work is done, depending on your API, not sure if this is what people do).
And note that running the physics on another thread will have a subtle latency, and it does not help if you spend most of your time on swap().
>>
>>108726019
>Sleep/Waiting on a mutex/anything is not very precise
Actually it probably is pretty accurate. I am probably mixing it up with the precision of Sleep, which is terrible.
There is latency from both ends, you have latency from the input (the gun shooting at the object should use the most recent event, the physics isn't waiting on the main thread so you just need to wait for it to start a new physics update).
And the latency on the main thread waiting for the physics to finish (due to vsync, if you had a mailbox swapchain like wayland, this would not be an issue, since the physics will never wait for the main thread, and the main thread will always wait for the physics thread since it's just rendering at the highest FPS you could hit, and most of the work is being done by the GPU, but most of your commands are discarded if you are hitting the monitor's max refresh rate, and this also causes your CPU to waste a lot of time which is why only wayland does this and no other OS not even the steamdeck).
>>
>>108726019
i would never use a spinlock on anything outside a single threaded embedded system bare-metal program, and even then one could probably use interrupts (or in conjunction with interrupts) to better effect .
>>
>>108726132
>I am probably mixing it up with the precision of Sleep, which is terrible.
Huh, I just remembered that I use Sleep(1) on the main thread when I disable vsync, because otherwise my game ran too quickly and causes coil whine (and I would have probably removed it once I get a real load working, but the start menu would probably still coil whine unless I drew the game in the background or something).
But that Sleep(1) solution is awful.
I started using eglGetSyncValuesCHROMIUM, and it has some very serious issues (I think nvidia's driver has an issue with getting the frame statistics in certain conditions like first frame/resize, which triggers my EGL debug callback, which works fine overall but very annoying, I think this is mentioned in other places as well).
So this extension just gives me the DXGI frame statistics (it's super simple):
https://github.com/google/angle/blob/main/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp#L1066
And with it, I can use the display time to set my simulation rate of the CPU delta (so every single simulation uses the same number, it doesn't matter much... you probably wouldn't notice it...)
(But I want to try out DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT which angle does not expose, but I can create/use the DX11 device directly)
Anyways, back to the Sleep(1).
I just remembered Angle having a feature called eglPrepareSwapBuffersANGLE, I thought it was only used for doing extra work on the main thread.
But no, I can bring back this awful Sleep(1), and fix it!
Since without eglPrepareSwapBuffersANGLE, I would be delaying the code in some undesirable way.
Since I have not yet figured out how to stop my swap() from taking 0ms consistently and I can see stutter (it does go to 0ms! sometimes... I think my code is just barely working with ducktape hacks... it's only 200LoC but it's a mess. Maybe I just need to use ...FLAG_FRAME_LATENCY_WAITABLE_OBJECT thing? if that doesn't work I might try VK_EXT_present_timing?).
>>
>>108726175
You are right I think I was overcomplicating things for myself and I have already seen realworld projects just use a simple semaphore.
>>
I implemented a thing shitty so that way I have a better grasp on the requirements before I implement it goodly
>>
File: sprite_manager.png (71 KB, 750x390)
71 KB PNG
I "finished" my krita sprite manager plugin. There's a few problems that I don't know how to fix though. Here it is if anyone's interested:
https://sundee.neocities.org/kritaspritemanager/
>>
File: file.png (17 KB, 284x138)
17 KB PNG
>>108717477
Imagine posting your real name on 4chan lol.
You will lose everything the moment Reddit realize you were here
>>
>>108726774
>sundee.neocities.org
sundees nuts
>>
any good books on game ai?
>>
File: 1758260954613184.png (198 KB, 597x680)
198 KB PNG
>>108727386
>>
I'm setting a fixed frame rate of 30 and you can't stop me.
>>
>>108726306
Ah nevermind, eglPrepareSwapBuffersANGLE doesn't work under DX, only Vulkan (and the extension does not appear, I will figure that out later).
>>
>>108727386
I didn't read it, but if you don't mind reading something from 2004, it might be interesting:
Programming game AI by example
Because it's in C++03, there are many assumptions about C++ that are wrong now.
such as "std::vector is slow unless you make every object a pointer", that's not true since C++11 (but since there is virtual classes, it needs to be a pointer, so you need to use std::unique_ptr).
And replace void* with std::any (it's 2x larger, but it's worth it in my opinion).
You can look at the source code here (you don't even really need a book if you are just looking for one feature you want to copy):
https://github.com/wangchen/Programming-Game-AI-by-Example-src
>>
>>108727486
My goal is understanding
>>
>>108727575
the good shit is in the code.
nobody is wasting their time writing a book on a very complex topic that won't satisfy everyone.
like if you just want an AI that's as good as Quake 3 arena, just read the source code.
>GPL
if the AI is playing as a placeholder for a human player, you can launch the AI out-of-process and keep the AI open source, and maybe someone will even contribute to it.
>>
Was wondering why the zones in this old game had so much seemingly pointless geometry, then I realized they're using vertex lighting for everything so they needed some level of vertex density for it to not look jank...
>>
>>108727486
>(it's 2x larger, but it's worth it in my opinion)
it's 8x larger on msvc release... 64 bytes...
I believe you can benefit from Small Buffer Optimization, so normally the 16byte implementation on other compilers would need to malloc the object if it's larger than 8 bytes (you are normally storing a pointer in there, so it's fine).
I think you can substitute std::any with a alternative implementation, or you can use std::variant (you can forward declare all the types as pointers in the variant, so you don't need an cyclic dependency, and the other alternative is to use a Virtual base class and down casting it with dynamic_cast, it is much slower than std::any casting because it's not a simple type check, technically you can do a raw down cast under strict rules like single inheritance and I think it's undefined behavior by the standard but all the compilers support this cast, I think? You can do the same thing in C I believe).
>>
>>108727007
You are a pathetic coward.
>>
>>108727486
>but since there is virtual classes, it needs to be a pointer, so you need to use std::unique_ptr
god you are fucking stupid
stick to lua
>>
I don't even like anime, I mean video games
>>
>>108729728
have you ever ported C++03 code before?
what solution would you have done?
the whole point of unique_ptr is to make the code shorter, no need for new and delete to be scattered around. std::variant takes too much time to implement and puts too much into the headers, so every header change you make to an entity would end up rebuilding every entity source file (unless you use a forward declare a pointer into the variant, I don't see the point however?)
Of course std::unique_ptr isn't robust, it doesn't offer anything for handling weak references, so you might need add some sort of reference count.
I took a peek into the tutorials code because I was curious, and it turns out that there is no weak reference, nothing gets deleted. When an entity dies, it just gets set as dead, or spawning (the raven code, in the soccer game, all the entities are static, you can't kill a soccer player). So it seems it will be a LOT of fun to actually make this code work for anything more complicated than a arena shooter, and requires a lot of refactoring (std::unique_ptr is not enough to fix it).
https://github.com/wangchen/Programming-Game-AI-by-Example-src
>>
>>108726774
Updated this, I found workarounds for all the major problems so it's now complete.
>>
>>108727486
"in C++03, there are many assumptions about C++ that are wrong now" it's still more useful to know how to write C++98 code than it is to know what the new C++26 features are. And not by just a little bit... the vast majority of the code you write is going to be C++98 code or very similar to it with a small improvement, like using auto, and it's just as important to know what the expcetions are than to just assume they are wrong and ignore them, especially for a language like C++ which builds upon it's history rather than replacing it.



[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.