WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!
-
@pie_flavor said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
That's not Minecraft being coded badly. That's a regular game, which the community has made mods for. Forge is a proper modding API, and you almost never need to monkeypatch (and when you do, there's even APIs for that). And Microsoft is working on a modding API, yes. Meanwhile, I was talking about server-side mods; first Bukkit, now Sponge. Great APIs which do not involve you interfacing in any way with the base code.
Good to know they've finally improved.
@pie_flavor said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
You can if you have a good garbage collector.
Not really. Reference semantics preclude many optimizations. Not to mention how wasteful it is to pass pointer-sized objects by reference.
@pie_flavor said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
But you have completely missed the point.
The point is I hate Minecraft and need a reason to.
-
@gąska said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
The point is I hate Minecraft and need a reason to.
And now your reasons are invalid. Why do you hate Minecraft?
-
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
it looks like some kind of fucked up C++ replica language.
Yeah, that's called "Java".
-
@tsaukpaetra said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
it looks like some kind of fucked up C++ replica language.
Yeah, that's called "Java".
When I wrote that I thought we were talking about XCOM 2 modding. But yeah, Minecraft modding requires reverse engineering.
Dwarf Fortress modding also requires reverse engineering, but there are some things in the executables to make it easier, like a call to
SDL_GetNumJoysticks
in the game loop that DFHack replaces with its logic and (recently) an exported symbol with pointers to various important global variables and their names.
-
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@tsaukpaetra said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
it looks like some kind of fucked up C++ replica language.
Yeah, that's called "Java".
When I wrote that I thought we were talking about XCOM 2 modding.
Huh, I guess I context switched to the wrong thread?
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
a call to
SDL_GetNumJoysticks
in the game loopDoes the number of joysticks normally change per fuck such that such a call is needed like that? Wow...
-
@tsaukpaetra said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
a call to
SDL_GetNumJoysticks
in the game loopDoes the number of joysticks normally change per fuck such that such a call is needed like that? Wow...
It's just poor man's event listening.
-
@tsaukpaetra said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
Does the number of joysticks normally change per fuck such that such a call is needed like that? Wow...
DFHack does its logic in that function: https://github.com/DFHack/dfhack/blob/7b3efeafc9d8a8b6856a826755473236321958dc/library/Hooks-windows.cpp#L605-L610
If there's no DFHack installed, Dwarf Fortress calls an inexpensive function every game tick.
-
In actual XCOM 2 news, I whooped Ben's ass on the Daily Challenge, 24,800 to 23,600.
-
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
pointlessly calls an
inexpensiveuseless in this context function every game tick.Call me a pre-optimizationalist, but I try to avoid doing things if I don't have to. I don't care how inexpensive the function is; unless you're designing against timing attacks, retrieving a mostly-static value from memory is almost always better than running logic to dynamically determine that static value every loop!
-
@ben_lubar wait, Dwarf Fortress purposely added pointless function call so that DFHack can inject itself? That's so ass-backwards.
-
@gąska said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar wait, Dwarf Fortress purposely added pointless function call so that DFHack can inject itself? That's so ass-backwards.
Why? It's not like Tarn Adams is going to release the source code or make it easier to reverse engineer the game in a way that lets someone else develop their own clone. He makes nearly all his money from donations!
-
@tsaukpaetra said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
pointlessly calls an
inexpensiveuseless in this context function every game tick.Call me a pre-optimizationalist, but I try to avoid doing things if I don't have to. I don't care how inexpensive the function is; unless you're designing against timing attacks, retrieving a mostly-static value from memory is almost always better than running logic to dynamically determine that static value every loop!
What makes you think
SDL_NumJoysticks
doesn't cache the value?
-
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@tsaukpaetra said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
pointlessly calls an
inexpensiveuseless in this context function every game tick.Call me a pre-optimizationalist, but I try to avoid doing things if I don't have to. I don't care how inexpensive the function is; unless you're designing against timing attacks, retrieving a mostly-static value from memory is almost always better than running logic to dynamically determine that static value every loop!
What makes you think
SDL_NumJoysticks
doesn't cache the value?What makes you think it would?
-
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@gąska said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar wait, Dwarf Fortress purposely added pointless function call so that DFHack can inject itself? That's so ass-backwards.
Why? It's not like Tarn Adams is going to release the source code or make it easier to reverse engineer the game in a way that lets someone else develop their own clone. He makes nearly all his money from donations!
Now I'm confused. Is or isn't GetNumJoysticks() call's only purpose to provide injection point?
-
@tsaukpaetra said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@tsaukpaetra said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
pointlessly calls an
inexpensiveuseless in this context function every game tick.Call me a pre-optimizationalist, but I try to avoid doing things if I don't have to. I don't care how inexpensive the function is; unless you're designing against timing attacks, retrieving a mostly-static value from memory is almost always better than running logic to dynamically determine that static value every loop!
What makes you think
SDL_NumJoysticks
doesn't cache the value?What makes you think it would?
I was bored so I dug through SDL source code to see for myself. Depending on platform, it either returns global counter or traverses a linked list of all joysticks. In case of PSP, it just returns 1. I didn't know there's SDL for PSP.
-
@gąska said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
I didn't know there's SDL for PSP
Oh, as in Playstation Portable? Yeah! Pretty neat, yeah? :)
-
@tsaukpaetra I mean, don't PSP developers have some Sony branded SDK?
-
@gąska said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@gąska said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar wait, Dwarf Fortress purposely added pointless function call so that DFHack can inject itself? That's so ass-backwards.
Why? It's not like Tarn Adams is going to release the source code or make it easier to reverse engineer the game in a way that lets someone else develop their own clone. He makes nearly all his money from donations!
Now I'm confused. Is or isn't GetNumJoysticks() call's only purpose to provide injection point?
Tarn is okay with DFHack existing because it requires the game to function. He just doesn't want someone to get his source code and make their own Dwarf Fortress game unconnected to his work.
-
@ben_lubar you still haven't answered my question. Providing an entry point for foreign code to plug into is fine. Hijacking random function when the game doesn't have designated one is fine too. I'm asking whether the call to GetNumJoysticks() was added for the sole purpose of providing entry point for DFHack, or is it used for something else and the author of DFHack used it because it just happened to be in a convenient place.
-
@gąska said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@tsaukpaetra I mean, don't PSP developers have some Sony branded SDK?
Sure, but why not make it easier for other apps that already use SDL to be ported to the PSP?
-
@gąska said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar you still haven't answered my question. Providing an entry point for foreign code to plug into is fine. Hijacking random function when the game doesn't have designated one is fine too. I'm asking whether the call to GetNumJoysticks() was added for the sole purpose of providing entry point for DFHack, or is it used for something else and the author of DFHack used it because it just happened to be in a convenient place.
I'm pretty sure it was added specifically for DFHack to hook into. libgraphics is open source (you can find the source code in the
g_src
directory of the Linux version of Dwarf Fortress, and I wrote my own implementation of some of it for df-ai'shooks.cpp
file) and I think it was written by someone other than Tarn specifically to make DF work with DFHack without having to run DFHack as a debugger.
-
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@gąska said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar you still haven't answered my question. Providing an entry point for foreign code to plug into is fine. Hijacking random function when the game doesn't have designated one is fine too. I'm asking whether the call to GetNumJoysticks() was added for the sole purpose of providing entry point for DFHack, or is it used for something else and the author of DFHack used it because it just happened to be in a convenient place.
I'm pretty sure it was added specifically for DFHack to hook into. libgraphics is open source (you can find the source code in the
g_src
directory of the Linux version of Dwarf Fortress, and I wrote my own implementation of some of it for df-ai'shooks.cpp
file) and I think it was written by someone other than Tarn specifically to make DF work with DFHack without having to run DFHack as a debugger.So instead of providing a null-op function call to hook, on to, two libraries (or more?) were pointlessly altered so that mods would work? Am I interpreting that correctly? If so,
-
@tsaukpaetra said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@gąska said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar you still haven't answered my question. Providing an entry point for foreign code to plug into is fine. Hijacking random function when the game doesn't have designated one is fine too. I'm asking whether the call to GetNumJoysticks() was added for the sole purpose of providing entry point for DFHack, or is it used for something else and the author of DFHack used it because it just happened to be in a convenient place.
I'm pretty sure it was added specifically for DFHack to hook into. libgraphics is open source (you can find the source code in the
g_src
directory of the Linux version of Dwarf Fortress, and I wrote my own implementation of some of it for df-ai'shooks.cpp
file) and I think it was written by someone other than Tarn specifically to make DF work with DFHack without having to run DFHack as a debugger.So instead of providing a null-op function call to hook, on to, two libraries (or more?) were pointlessly altered so that mods would work? Am I interpreting that correctly? If so,
Would you prefer that Dwarf Fortress come with libDFHackStubFunctionsThatGetCalledForNoReason.dll? or SDL.dll which gets replaced by DFHack?
The same is true for Mac and Linux. You can't LD_PRELOAD a statically linked function, so it would need to be a pointless shared object.
-
@ben_lubar the correct way is to dynamically check at runtime if there's a plugin library to load, and if there is, load it, extract callback functions from it and call them in appropriate places. No dummy libraries, no pointless function calls, no ugly hacks, and easily extensible to multiple plugins.
-
Jesus Christ this conversation is boring, talk about vidya games.
-
@blakeyrat said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
Jesus Christ this conversation is boring, talk about vidya games.
We have to keep it up near the top of topic lists somehow, and he's not releasing videos for a bit, so lack of new stuff inevitably leads to other new stuff to take its place until the old new stuff returns to rerail the topic.
-
@blakeyrat said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
Jesus Christ this conversation is boring, talk about vidya games.
We are. About Dwarf Fortress.
-
@pie_flavor said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
Ah, another person who never updates their opinions. I myself wouldn't, for example, forever hate Java due to it once upon a time interpreting bytecodes instead of JIT compiling.
@gąska said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
Does Java support complex stack objects yet? Because you cannot have decent performance when every single object has to live on the heap and be garbage collected.
See? Updating your reasons to hate Java. You're doing it right.
-
@gąska said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@ben_lubar the correct way is to dynamically check at runtime if there's a plugin library to load, and if there is, load it, extract callback functions from it and call them in appropriate places. No dummy libraries, no pointless function calls, no ugly hacks, and easily extensible to multiple plugins.
Yes, but this is the Dwarfiest way to do it.
To understand Dwarf Fortress development practices, you must first understand Dwarf Fortress.
Understanding that the guy is not and never has been a professional software engineer is also critical. It took HOW THE FUCK LONG after the mainstreaming of x64 client OSes (that'll be the release date of Windows Vista) to get a 64bit version of a game with long known 32bit barrier issues?
He's a simulation designer first, game designer second, software engineer distant third.
-
@weng said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
He's a simulation designer first, game designer second, software engineer distant third.
And not good at any of them.
He's a UI designer, BTW, 43274632452462463264th.
-
@tsaukpaetra said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
and he's not releasing videos for a bit
To be clear, there are still videos scheduled to be released on Monday, Wednesday, and Friday this week. I'm just not able to make new videos until Coco is back in Minnesota.
-
https://www.youtube.com/watch?v=CKT6WzsHWnA&list=PLEvDAIFuHC36fs0Ewb7P3t6MKfmvagCXI
Episode 6: Operation Steely Saga
Appearing: @Luhmann, Brad Morgan, @Yamikuronue, @obeselymorbid, @Adynathos, @Nagesh
-
@tsaukpaetra said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
Does the number of joysticks normally change per fuck such that such a call is needed like that? Wow...
I've heard people talking about this on the SDL mailing list. People can plug in or remove a joystick at any time, and if you're not aware of it, it will cause problems. I think this got updated at some point so it will give you an event notification, but the polling in the main loop probably dates to a point when that wasn't the case.
-
@masonwheeler What still pisses me off is people (mostly game developers, but frequently apps like Discord) don't realize that sound cards are also hot-swappable, and have been since the USB HID stuff was sorted out in like 1998.
If I unplug my headset, and your app says something like "no sound card found" instead of just swiftly and cleanly switching audio output to the new default sound device, you're on my shitlist.
In fact, you might as well just assume every piece of hardware is hot-swappable, because I can't really think of any that aren't at this point. Even video cards come on external adaptors now.
-
@blakeyrat said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
What still pisses me off is people (mostly game developers, but frequently apps like Discord) don't realize that sound cards are also hot-swappable, and have been since the USB HID stuff was sorted out in like 1998.
As an amateur game developer, my reaction to this is a massive , not at "people not realizing sound cards are hot swappable" but at sound cards being a relevant thing at all. I don't interact with sound cards; I interact with a SDL API that interacts with a Windows API that knows what the current sound device is and routes sound to it. When someone removes or plugs in a sound device, that's buried beneath several layers of abstraction that should have handled it transparently with zero interaction on the game developer's part.
-
@masonwheeler Considering SDL is open source, have you actually tested that it works? Or are you just blindly trusting its unmaintained wiki documentation to tell the truth?
-
@blakeyrat said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
@masonwheeler Considering SDL is open source, have you actually tested that it works? Or are you just blindly trusting its unmaintained wiki documentation to tell the truth?
That's the SDL Maintainer's job.
-
@masonwheeler said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
I interact with a SDL API that interacts with a Windows API that knows what the current sound device is and routes sound to it
Unfortunately, those abstraction layers are sometimes poorly designed and do things like that. And because 95% of developers don't give a shit when a user reports a problem like that, those layers have no incentive to fix it.
-
@blakeyrat said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
In fact, you might as well just assume every piece of hardware is hot-swappable, because I can't really think of any that aren't at this point. Even video cards come on external adaptors now.
My previous PC had a video card that sometimes crashed (a voltage problem, I believe). Only triggered on high load, and windows would recover without reboot after 1 or 2 seconds. I ran into only one game that both triggered the crash and recovered from it, and several others which triggered the crash and died with it.
-
@pleegwat considering how much work it is to reinitialize GPU, I'm surprised that there's even one game that does it right.
-
https://www.youtube.com/watch?v=7iBl7fvcolE&list=PLEvDAIFuHC36fs0Ewb7P3t6MKfmvagCXI
Episode 7: Operation Brooding Summer
Appearing: @Grunnen, @Salamander, @reverendryan, @locallunatic, lethosor, @Erufael, @Rhywden
-
By the way, here's a countdown to @blakeyrat being rescued: https://what.thedailywtf.com/uploads/discourse-project.html?2017-12-29T18:00:00Z
-
XCOM 2: Worse than Failure: episode 8 – 29:07
— Ben LubarEpisode 8: Operation Dripping Vengeance
Appearing: @Dragnslcr, @Adynathos, @PleegWat, @Boner, @pydsigner, Jane Bailey, @julmu, @blakeyrat
Important: This is the last episode for a while as I am unable to record with a dog in my house. (See garden thread for photos.)
-
Figured there was another episode coming up when I got a mention notification into an invalid link.
-
@pleegwat said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
Figured there was another episode coming up when I got a mention notification into an invalid link.
Yeah, I accidentally posted it a few minutes early and the YouTube embed doesn't work if I do that.
-
XCOM 2\XComGame\Localization\INT\SoundSpeechStrategyCouncil.INT
starts with these lines: (redacted to avoid spoilers)[NoID_JBailey_20151016_AdventIsNotTaking AkEvent] SpokenText="[redacted]" [NoID_JBailey_20151016_TheAliensContinue AkEvent] SpokenText="[redacted]"
@Yamikuronue did you work on XCOM 2?
-
Should I install this?
-
4-byte XCOM 2 mod:
-
@ben_lubar said in WTDWTF gets murdered by aliens and it's all Ben Lubar's fault!:
4-byte XCOM 2 mod:
use the words luke..... use the words.....</obiwan>
-
@accalia I imagine the original name of the... thing... was not Julian Lam.