@SonnyBonds@mastodon.gamedev.place avatar

SonnyBonds

@[email protected]

PROGRAMMING / MUSIC / GAMES

C++, music and silly games as Sonny Bonds

Life as Anders

Owner/founder of Kilohearts

Former Meqon, AGEIA and Power Challenge

Somehow can't stay away from build systems.

he/him 🇸🇪

#cpp #audio #programming #gamedev

This profile is from a federated server and may be incomplete. View on remote instance

demofox , to random
@demofox@mastodon.gamedev.place avatar

I asked my son "if you flip a coin 3 times, is it more likely to get 3 heads in a row, or head, tails, tails?"
He thought for a second and thought "they are equally likely aren't they?"
Oh damn... he is so much smarter than I was.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@demofox Now do the Monty Hall thing 😄

pervognsen , to random
@pervognsen@mastodon.social avatar

This came up in another thread today but I figure I'd throw a brief comment to the timeline. The concept of "grace periods" where you separate the logical and physical deletion of resources is something you see in RCU, EBR, QSBR, etc, but it's just as useful in single-threaded code where you only have pseudo-concurrency through subroutine calls. Like the age-old pattern of deferring deletion until the end of the game loop, or autorelease pools in Objective C which get drained by the run loop.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@pervognsen What would you say the big upsides of e.g. "slot arenas" are compared to classic allocation of objects? Memory locality is obviously one, although I'm thinking that mostly affects operations that involve sequential iteration over objects?

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@pervognsen Can you have generations in an arena with different object sizes? I'm thinking an old generation value should never end up in the middle of a new object, if that makes sense.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@pervognsen Got it, just wanted to double check if there was some trick I hadn't thought about.

My most recent foray into it was mostly for a different reason; having clonable arenas so a full state can be synced between threads or stored for undo etc etc. But that means the arena location isn't static and needs to be passed around together with references and I never came up with a satisfactory way of doing that.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@pervognsen Uh, Mastodon scrapped my reply. That's a first.

Anyway, in my case I think it just was a bad fit for the structure I initially did. I've since reworked it a bit so it may make more sense, but that also made it more trivially copyable with "normal" mechanisms so it ironically also became less of a issue.

pervognsen , (edited ) to random
@pervognsen@mastodon.social avatar

It looks a bit funny but Rc<Arc<T>> seems like a reasonable choice in a lot of cases. Specifically, you have locally shared ownership of a remotely shared resource instead of directly sharing ownership of the remote resource (which comes with contention issues). Most of the time you probably wouldn't literally have Rc<Arc<T>> but Rc<LocalStruct> where LocalStruct (transitively) has an Arc<T>. But same thing really.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@pervognsen I've been thinking about this a bit in C++ but at that point I thought of it as some multilevel RC thing and for some reason it felt like it wouldn't work easily. But just wrapping an Arc in a Rc (or corresponding types) is a good and clear way of thinking about it!

(I did however try switching all shared_ptr for a nonatomic version and saw no apparent improvements on perf so I stopped thinking too much about it.)

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@pervognsen Well unless I'm misunderstanding, it only needs one indirection for accessing the data and one for accessing the refcount since it stores both pointers (which may be a problem in itself by all means). But yes when doing both it needs to dereference two independent pointers.

There are of course other implementations than shared_ptr though, and std doesn't even have a non-atomic one. Was just thinking conceptually about the nesting.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@pervognsen We (Kilohearts) actually use it a lot for UI parts. It's a "retained" UI (not IM) and we chose to use shared_ptr for all UI structure, in the somewhat hated "use shared_ptr for everything" way. I know it's pretty frowned upon, but it's just pretty much a predictable GC, and I think it actually works really well. That part very rarely causes problems.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@artificialmind @pervognsen We (ab)use weak_ptrs quite a lot for some event listener management and stuff so we don''t use make_shared for a lot of stuff. (We have a macro for Reasons for our UI components and it doesn't do make_shared.) It probably doesn't make a difference as the structures are neither huge nor allocated/deallocated a lot, but feels conceptually right.

For some other things that are more blobs of data and stuff we do use make_shared though. More of a vibes based policy. :)

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@pervognsen @artificialmind Yes I totally see what you mean. Conceptually it's not really a 1:1 match, especially since the resources aren't really shared but has a pretty strict ownership hierarchy. The thing I like about it is that the refcount gives you lifetime extension. As long as you hold a ref you know it's valid, and can avoid rugpulling stuff like a component removing itself while it's processing an event etc etc without deferred freeing.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@pervognsen @artificialmind Yeah there probably are better ways. I've messed a bit with arenas lately just prototyping things but haven't quite internalized how to work with it in a way that I really like.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@pervognsen @artificialmind Yes absolutely. I think a complicating (but not disqualifying) factor in our case is that we're making plugins and don't really have control over the "main loop". There's rather multiple entry points from both host and system. It's of course still possible to do it, autorelease-style or otherwise, but it makes it a little bit more annoying.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@pervognsen Haha it helps to know it's about audio. :D

BartWronski , to random
@BartWronski@mastodon.gamedev.place avatar

If you use Mastodon on desktop (as opposed to mobile), I cannot praise highly enough Phanpy https://phanpy.social/
It really cleans up my timeline, handles replies very nicely, and allows for a great "refresh" (view updates) experience.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@BartWronski I'm not actually using it, but it works fine on mobile too. Actually writing from that now because I clicked your kink and was apparently already logged in. :)

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@xoofx @aras @BartWronski Also having to "open" a post to favorite it felt a bit cumbersome. Even for reply actually. I realize it makes the UI cleaner but not sure I like it.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@pervognsen @xoofx @aras @BartWronski Yeah on desktop that probably works, but even so my lazy scrolling is touch/mouse based and doing it with keypresses would be ergonomically very different.

grumpygamer , to random
@grumpygamer@mastodon.gamedev.place avatar

After 6 months, I've had to resubscribe to Adobe PS. I work with too many people who send me PS files and there is no alternative that can open and save them reliability. It sad how many "helper" apps Adobe installs and how often they try to connect to the internet. I block them all, but it's scary. I have to unblock them every 30 days. Please do not suggest alternatives unless you know for a fact they load and save .psd files seamlessly. Do not suggest GIMP or I block you.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@grumpygamer I uninstalled it the other because even though I have a subscription from work I don't really use it.

I wasn't logged in, and had to log in to be able to uninstall. 🤯 Had to download a separate uninstall program to get rid of it without logging in.

pervognsen , to random
@pervognsen@mastodon.social avatar

The Brothers Lionheart is isekai.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@pervognsen @zeux I read Mio to my oldest daughter a while back and I never want to say Miramis again.

SonnyBonds , to random
@SonnyBonds@mastodon.gamedev.place avatar

Anyone running any nice shell on Windows that's not Powershell or regular cmd?

  • Tried nushell but didn't quite feel it.
  • I guess I could run any linux shell through WSL, but it has its whole own environment and I'm not sure I want that.
  • There are a few bash variants (git-bash, msys, etc etc) but it feels a bit boring. :D

Not sure what I'm looking for, just random suggestions!

SonnyBonds OP ,
@SonnyBonds@mastodon.gamedev.place avatar

@BartWronski Ah, I think I've tried at some point but not totally sure. Will check it out!

Possibly msys could work as well, seems fish and other shells work in there. Feels a bit like a big environment though.

SonnyBonds OP ,
@SonnyBonds@mastodon.gamedev.place avatar

@BartWronski @lesley I've run clink before but don't really remember how I felt about it. Will try it out.

I don't really have any specific requirements it's more of a "I wonder if there's a better world out there I don't know of" thing.

SonnyBonds OP ,
@SonnyBonds@mastodon.gamedev.place avatar

@BartWronski @lesley Theoretically powershell is really powerful, but I just can't get used to it and it always feels pretty slow somehow.

SonnyBonds OP ,
@SonnyBonds@mastodon.gamedev.place avatar

@BartWronski I ended up running clink again, and it feels nice.

Running starship for some extra prompt customization on one computer as well, haven't quite decided if I like that or not but I haven't uninstalled it at least.

pervognsen , to random
@pervognsen@mastodon.social avatar

Finally got so fed up with Windows that I installed Arch on my laptop (without the help of archinstall so it was a good learning experience). Gotta say, KDE Plasma 6 has blown me away. A few annoying defaults I had to change (e.g. floating panels as a default) but such a great experience coming from Windows 11: https://kde.org/announcements/megarelease/6/

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@wolfpld @pervognsen We recently switched from MSVC to VS Code as well. I do miss some quality of life stuff, but the general stability of things feels a lot better.

Still got Windows & macOS as the target platforms though so I don't feel like running a too different environment from users at work. Maybe at home though.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@wolfpld @pervognsen The file browser is actually what currently has me the most annoyed in Windows. Something happened in a Windows 11 update that made the "address bar" really janky and it drives me up the wall.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@wolfpld @pervognsen Yes agree on the intellisense (although it's not always fantastic in VS either).

The QoL stuff I miss is mostly related to debugging.

  • Loading core dumps is a bit of a hassle compared to the drag/drop in MSVC.
  • Breaks for asserts etc often end up deep in the runtime instead of at the assert, and I haven't been able to config JMC out of that.
  • The lldb debugger backend is pretty unstable and hangs often (on macOS at least). The ms backend is stable though.
SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@wolfpld @pervognsen Yeah I run clangd now as well and it works mostly well. I've had some issues but it might just as well be just my config of it.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@wolfpld @pervognsen Out of curiosity, do you run any non-linux plugins in Reaper? Does that work well? LinVst or something else?

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@wolfpld @pervognsen
Cool I might check that out as well then.

No modern ASIO driver for an actual audio interface hijacks the system audio as far as I know. Not sure about asio4all etc but running WASAPI is possibly a better bet there anyway.

BartWronski , to random
@BartWronski@mastodon.gamedev.place avatar

Shingles review: 0/10.
What I did not even imagine is how insanely painful it is (nerve pain). It's not as bad as the appendix inflammation before its removal, but it's getting close.
I have been on immunosuppressants for the last ~8 months for an autoimmune disease, and, ironically, was telling my wife, "I am surprised that I did not even get a cold, despite a crazy lifestyle," just a week ago.
Don't jinx. 😅

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@BartWronski Urgh sorry to hear that. Hope it gets better soon!

SonnyBonds , to random
@SonnyBonds@mastodon.gamedev.place avatar

Potentially inflammatory question, but what's the best browser if I were to switch from Chrome? Firefox?

Haven't really deciding on switching just looking what's out there.

SonnyBonds OP ,
@SonnyBonds@mastodon.gamedev.place avatar

@BartWronski Running it right now for a bit to try it out. It's a browser, I guess. I realize I have very few requirements really. :)

grumpygamer , to random
@grumpygamer@mastodon.gamedev.place avatar

For the dev of my new game I've ditched Slack in favor of Discord for the dev team. One advantage of Discord is that most devs have a Discord account so I am not asking them to sign up for something new. So far, it's a big win. Slack has turned into a mess.

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@grumpygamer I think Slack works well enough to at least not change for our existing team, but something I really miss is the same type of message replies as in Discord. The Slack threads are so cumbersome.

demofox , to random
@demofox@mastodon.gamedev.place avatar

Hey @nickappleton , let's say I have a signal with certain frequency characteristics (maybe high frequency noise). If I average that with a time shifted signal that has the same frequency characteristics (or maybe even is the same signal) is there anything that can be said about the resulting frequency characteristics as this happens many times?

SonnyBonds ,
@SonnyBonds@mastodon.gamedev.place avatar

@BartWronski @demofox @nickappleton When I got into audio I picked up my signal processing books (<10 years later), and it was such a weird experience. They had my notes in them and supposedly I'd passed the courses, but it was like I was paging through someone else's books. Apart from the broad concepts I remembered nothing about the details.

And honestly the broad concepts is mostly what's been useful, but there's been some "wait I think I have this in my brain somewhere already" moments.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • tech
  • kbinEarth
  • testing
  • interstellar
  • wanderlust
  • All magazines