News for hackers. Stuff that matters.
Re:Show HN: A friend and I spent 6 years making a simulation... by aasasd on Wednesday June 01, 2022 @04:31PM (#31587651)
I thought that by now game engines just have two extra checkboxes to ’build for Mac’ and ‘build for Linux’. Perhaps the signing requirements changed that, though.

Notably also, plenty of games work fine under Wine, but Steam client itself doesn't—on Mac.

Re:Show HN: A friend and I spent 6 years making a simulation... by iliketrains on Wednesday June 01, 2022 @04:54PM (#31587948)
We do use Unity that does lots of heavy lifting for you regarding porting to other platforms.

However, it's not always that easy as checking a box. For example some shader optimizations may be specific to DirectX. File system works differently (no "User/Documents" on Mac). Or issues with native libraries.

Our game does work on Linux Proton though, that was a surprise to us.

Re:Show HN: A friend and I spent 6 years making a simulation... by danielheath on Wednesday June 01, 2022 @08:48PM (#31590015)
Proton with DV9K is - for a few games - faster than native windows. I don't fully understand it, but apparently the process of automatically rewriting shaders from DX to Vulcan can speed things up.
Re:Show HN: A friend and I spent 6 years making a simulation... by sph on Friday June 03, 2022 @04:37AM (#31605753)
I think you mean DXVK.
Re:Show HN: A friend and I spent 6 years making a simulation... by duped on Wednesday June 01, 2022 @05:55PM (#31588651)
It's pretty straightforward to have an abstraction for file systems with "special" file locations, it's been common in app sdks for at least a decade in a half. Unity doesn't have something like that?

Eg you would never use /tmp or %USER%/AppData, but call a function File::getPath(TempDirectory) or something like that.

Re:Show HN: A friend and I spent 6 years making a simulation... by kroltan on Wednesday June 01, 2022 @06:50PM (#31589150)
It does, but I'm guessing it's just one simply understandable example.

C# has the very Windows-centric https://docs.microsoft.com/en-us/dotnet/api/system.environme...

Unity itself has the Application.*Path properties for some more general cross-platform-aware paths. https://docs.unity3d.com/ScriptReference/Application.html

Re:Show HN: A friend and I spent 6 years making a simulation... by BlueTemplar on Wednesday June 01, 2022 @08:41PM (#31589973)
Curious, why targeting DirectX, rather than Vulkan... it's not like you think about releasing on Xbox, do you ?
Re:Show HN: A friend and I spent 6 years making a simulation... by iliketrains on Wednesday June 01, 2022 @09:25PM (#31590244)
I remember writing some GPU instancing optimization that had #ifdef for DirectX 11+, but that code is old. Now I've learned how to go without it.

It's just all those small things that has to be right to make it work cross platform.

Re:Show HN: A friend and I spent 6 years making a simulation... by Operyl on Wednesday June 01, 2022 @04:51PM (#31587922)
It’s not a matter of just having a build, it’s also about being able to support the users who use that build.
Re:Show HN: A friend and I spent 6 years making a simulation... by Sohcahtoa82 on Wednesday June 01, 2022 @05:21PM (#31588312)
Cross-platform languages (and by extension -- engines and frameworks) rarely work exactly as advertised. The "just check a box" rarely holds true except for the simplest of programs.

In the old days, Java would advertise itself as being cross-platform (Write once, run anywhere!), but in practice, rarely worked that way.

Re:Show HN: A friend and I spent 6 years making a simulation... by mst on Thursday June 02, 2022 @04:20AM (#31592636)
The joke of that era was "Write once, debug everywhere!"
Re:Show HN: A friend and I spent 6 years making a simulation... by pvg on Wednesday June 01, 2022 @05:38PM (#31588482)
There are some hugely successful Java games, oddly enough.
Re:Show HN: A friend and I spent 6 years making a simulation... by Operyl on Thursday June 02, 2022 @12:21AM (#31591313)
Even Minecraft, which is written in Java I’ll give you that, uses LWJGL which does have natives that behave in odd ways across platforms.
Re:Show HN: A friend and I spent 6 years making a simulation... by reidjs on Wednesday June 01, 2022 @05:45PM (#31588560)
Minecraft being the obvious example
Re:Show HN: A friend and I spent 6 years making a simulation... by branon on Wednesday June 01, 2022 @07:22PM (#31589407)
RuneScape <3