Live data from Hacker News

The journey to Nintendo Switch

factorio.com

91–100 of 169 posts

Re: The journey to Nintendo Switch

#91
post #77
post #76

Earlier quoted context omitted.

Gonna have to wait for someone from the community to come along and profile the game to find that 10 Mb json file of in-app purchase items being parsed in O(n*2).

I love how this still comes up all these years later

I presume the GP is referring to the GTA V fix, which was only 18 months ago [0].. having been ever present in a game that had been out for over 6 years!

I think it'll be referred to for years to come as an example of not only how seemingly simple decisions can come back to haunt you, but also how patient users can be if they really want to play something..

0: https://www.thegamer.com/gta-online-fix-loading-times-offici...

Re: The journey to Nintendo Switch

#92

> Removing all uses of undefined behaviour is probably a fool's errand, as it would require significant changes throughout the code that would take time and come with a performance impact, all for no immediate practical benefit. So I just hunted down the undefined behaviour cases that actually broke determinism. This was easy enough, as we have plenty of tools we use to test determinism. By comparing the game state C…

Whats CRC?

Re: The journey to Nintendo Switch

#93

> Removing all uses of undefined behaviour is probably a fool's errand, as it would require significant changes throughout the code that would take time and come with a performance impact, all for no immediate practical benefit. So I just hunted down the undefined behaviour cases that actually broke determinism. This was easy enough, as we have plenty of tools we use to test determinism. By comparing the game state C…

Whats CRC?

cyclic redundancy check

Re: The journey to Nintendo Switch

#94

> Removing all uses of undefined behaviour is probably a fool's errand, as it would require significant changes throughout the code that would take time and come with a performance impact, all for no immediate practical benefit. So I just hunted down the undefined behaviour cases that actually broke determinism. This was easy enough, as we have plenty of tools we use to test determinism. By comparing the game state C…

Whats CRC?

I'm guessing cyclic redundancy check. You turn the game state in each tick into a number, then play the exact same game on both platforms. If you get the same stream of numbers, you can be pretty sure the game is behaving correctly.

Re: The journey to Nintendo Switch

#95
post #37

> It allowed me to make many Nintendo Switch specific optimizations, and even some optimizations for the PC version Are there significant CPU-specific optimizations that can be made for the Switch / ARMv8 that wouldn't apply to x86-64? I've never really dug into things at that level, I wouldn't know where to begin except for like vector instructions.

Most likely the optimizations are higher level than that (for the most part). With the switch they will be able to target to specific core counts and use a less generic thread/memory synchronization api.

There may be some cases where the fixed ARMv8 instruction set allows them to use instructions that have equivalents on recent x64 processors but not back to their minspec PC.

Re: The journey to Nintendo Switch

#96

Factorio's official requirement for x86 is a dual core 3.0Ghz processor & yet it's able to run on Switch which has a very weak 1Ghz quad core cortex-A57 ARM CPU. How is this possible? I would imagine CPU requirements to be more or less same across any resolution / operating system. This is what makes Nintendo Switch interesting to me. It's CPU is even less powerful than an Raspberry Pi 4. Even midrange android smartp…

The platform variance for x86/x64 CPUs is... way bigger. The actual instructions per-clock could be wildly different and has massive impact on performance than just the clockspeed.

Re: The journey to Nintendo Switch

#97

Factorio's official requirement for x86 is a dual core 3.0Ghz processor & yet it's able to run on Switch which has a very weak 1Ghz quad core cortex-A57 ARM CPU. How is this possible? I would imagine CPU requirements to be more or less same across any resolution / operating system. This is what makes Nintendo Switch interesting to me. It's CPU is even less powerful than an Raspberry Pi 4. Even midrange android smartp…

The Switch CPU isn't actually that terrible. You can run into issues with the number of cores. The main thing you will find is that generally most codebases are full of potential optimizions but they aren't acted on until you find yourself constrained.

Re: The journey to Nintendo Switch

#98
post #47

> "This is the first time we had to make sure the game is deterministic between ARM and x86. We should be fine, C++ is portable, right? Just don't use undefined behavior. Turns out we use quite a lot of undefined behavior..." Hah

Would it occur had they used UBsan on debug builds?

For things that UBsan checks for, yes, but there's a ridiculous amount of things that are surprisingly UB in C(++).

Re: The journey to Nintendo Switch

#99
post #37

> It allowed me to make many Nintendo Switch specific optimizations, and even some optimizations for the PC version Are there significant CPU-specific optimizations that can be made for the Switch / ARMv8 that wouldn't apply to x86-64? I've never really dug into things at that level, I wouldn't know where to begin except for like vector instructions.

CPU wise - although you can optimize specially for the ARM - and it's great to make sure your math is using NEON and that you don't have some pathological slow down because your code assumes more cores you'll still find the lions share of your optimization on CPU benefiting both architectures.

For fun, I'll mention that there is a hardware hash function that you can use. The public A57 documentation has a performance guide available that is applicable to the Switch.

https://developer.arm.com/documentation/uan0015/b/

Re: The journey to Nintendo Switch

#100
post #59

Earlier quoted context omitted.

Depends entirely on what you play. Cyberpunk 2077 in 4K with DLSS and raytracing is exquisite...

... as long as you ignore the places where CDPR didn't actually finish debugging the game and errors abound, from innocent things like a pathing error in a pre-rendered character animation causing them to steamroll through movable objects in a scene to arguable game-breakers like a mission neither being succeed-able or failable because some key internal flag is in the wrong state, with the only solution being to roll…

I've beaten the game and NEVER had any issues like that, other than right after launch. You should consider leaving the faction of people who are irrationally bitter at that game because it is a position that is becoming more comical over time. The game is really quite good now and has been for some time.

> actually finish debugging the game and errors abound

Literally EVERY software developer is guilty of this. I cannot count how many games have come out in this state and there wasn't an ridiculous backlash, just CP2077.

NOTHING comes out bug free nowadays, because we as an industry have this idiotic policy of shipping things ASAP

Post reply on HN