Live data from Hacker News

Peredvizhnikov Engine: Lock-free game engine written in C++20

github.com

71–80 of 183 posts

Re: Peredvizhnikov Engine: Lock-free game engine written in C++20

#71

I have an Actor framework which uses a vanilla std::deque for method pointers, and to add messages to the queue, the locking technique is a Benaphore (the original Futex, which uses an atomic and a locking primitive, with the twist that my locking primitive is a combo of spinlock/mutex based on retry count). Nothing special. Benchmarks show that very rarely does the message push function block, and the chance of an O…

My benchmarks show that the price is acceptable Well, except to people who have a hard requirement that there never be this unpredictable, infrequent longer delay you mention.

These people are probably not game developers because frame dips are all over the place on console and PC gaming.

Re: Peredvizhnikov Engine: Lock-free game engine written in C++20

#72
post #20

Earlier quoted context omitted.

> Unless the name is explained somewhere, I'm convinced it's complicated on purpose. Tell me you only speak English without telling me you only speak English.

From the grammar, I would not assume GP is a native english speaker, much less monolingual.

I would love to hear what exactly about the grammar doesn't sound native.

Re: Peredvizhnikov Engine: Lock-free game engine written in C++20

#73

> At the moment, the only supported platform is Linux. Regardless of your feelings on the status quo, there is one thing you must do when building a game engine if you want it to succeed: support Windows .

bullshit, consoles/mobile are bigger markets than PC/Windows PC is just less than 1/3 of the whole picture https://www.data.ai/en/insights/mobile-gaming/2022-gaming-sp...

A bit more than that since Xbox runs Windows too.

Re: Peredvizhnikov Engine: Lock-free game engine written in C++20

#74
post #2

The painting used is Barge Haulers on the Volga - https://en.m.wikipedia.org/wiki/Barge_Haulers_on_the_Volga Can someone please expand on the significance of this achievement to someone used to shooting their foot off in C++ in a predominantly single threaded manner?

Barge hauler 4th from the back appears to be checking his messages.

Re: Peredvizhnikov Engine: Lock-free game engine written in C++20

#75

Earlier quoted context omitted.

> Games are never hard realtime; missing frame deadlines reduces user experience but it doesn't break the game. It depends on whether the game is multi-player and, if so, how it keeps the different players in sync with each other. Games that rely on deterministic gameplay can desync (two players don't see the same world state) and abort if one player's simulation drops a frame while the other doesn't.

That's still just a degradation of user experience and not a fatal fault. Indeed, support for running in desynced mode is written is because they know deadlines can be missed. In hard realtime, deadlines can't be missed. There's no recovery; it's a critical fault and you have to halt or failover to a backup.

> That's still just a degradation of user experience and not a fatal fault.

I don't know how you'd describe a game spontaneously aborting not a "fatal fault". Yes, it's not turning off someone's pacemaker, but within the scope of what a game is able to do, kicking the player back to the matchmaking screen in the middle of a game is about as fatal as it gets.

Re: Peredvizhnikov Engine: Lock-free game engine written in C++20

#76

I have an Actor framework which uses a vanilla std::deque for method pointers, and to add messages to the queue, the locking technique is a Benaphore (the original Futex, which uses an atomic and a locking primitive, with the twist that my locking primitive is a combo of spinlock/mutex based on retry count). Nothing special. Benchmarks show that very rarely does the message push function block, and the chance of an O…

I agree, lock free is cool and all, but often times it is more complex and not every case justifies the increased complexity.

Re: Peredvizhnikov Engine: Lock-free game engine written in C++20

#77
post #29

Earlier quoted context omitted.

how do you deal with msvc's `std::deque`? (or maybe you're not using literal std::dequeue)

What is special about msvc's `std::deque`?

The memory chunks it allocates to store entries are so small that it ends up allocating one chunk for every element for almost every type. The result is a lot of allocation overhead, pointer indirection and various other things that are bad for performance.

Re: Peredvizhnikov Engine: Lock-free game engine written in C++20

#78
post #2

The painting used is Barge Haulers on the Volga - https://en.m.wikipedia.org/wiki/Barge_Haulers_on_the_Volga Can someone please expand on the significance of this achievement to someone used to shooting their foot off in C++ in a predominantly single threaded manner?

Barge hauler 4th from the back appears to be checking his messages.

"Tut tut, those poor Canadian renters..."

Re: Peredvizhnikov Engine: Lock-free game engine written in C++20

#79

Earlier quoted context omitted.

bullshit, consoles/mobile are bigger markets than PC/Windows PC is just less than 1/3 of the whole picture https://www.data.ai/en/insights/mobile-gaming/2022-gaming-sp...

A bit more than that since Xbox runs Windows too.

July console sales:

PS5: 1.2m

Switch: 950k

Xbox: 370k

Xbox accounts for just 17% of total console sales in July

Both Switch and PS5 are FreeBSD based

If we count the whole period of the current gen of each vendors, it only accounts for 13%, it's not big

https://www.vgchartz.com/

Re: Peredvizhnikov Engine: Lock-free game engine written in C++20

#80

I have an Actor framework which uses a vanilla std::deque for method pointers, and to add messages to the queue, the locking technique is a Benaphore (the original Futex, which uses an atomic and a locking primitive, with the twist that my locking primitive is a combo of spinlock/mutex based on retry count). Nothing special. Benchmarks show that very rarely does the message push function block, and the chance of an O…

Aren't lock free data structures more about reducing the impact of contention than throughput under low contention?
Post reply on HN