This is one of the reason why that law will surely be challenged and very likely invalidated by SCOTUS. Trade secret protection is a very fundamental part and if this is forced to be broken by legally compelled speech, then it needs to have very creative interpretations over judicial precedents.
99% of the server code doesn't deserve trade secret protection, and fulfilling the goal of games continuing to work doesn't require releasing the other 1%. They can keep their matchmaking algorithm secret while releasing the code that lets people straightforwardly connect to each other. They can keep most of their code secret.
What a fucked situation where a company that fails who took money from people on the premise of a service existing no longer offers that service, says it's against the first amendment to enable people to continue having access to the product they paid for.
If this only applies to new sales then there is nothing that must be broken. The developers would need to choose technologies where license allows this. Those that don't wouldn't get new sales from game developers.
It's the same as GPL and similar licenses. If you don't want to publish your source that contains trade secrets then don't incorporate GPL licensed code.
There are also already various laws which compel certain types of speech. Consider things like nutrient labels or ingredient lists.
Issues like that are part of why the law is only going to apply to new releases.
If you still choose to license something you can't release later, and it's critical to the game's operation, then that's a deliberate liability and you'll need to replace it.
That sounds like a bad incentive. Lots of games license software like Photon to run game servers. For many games, building something like that is a non-starter.
It's not like it specifically has to be open source. Photon can license their software in a way that allows for free servers that are still tied to the specific game. And then companies can buy that.
And it's not expensive for Photon to do that, so I don't see why they wouldn't add that feature for a modest price or even free. (And that's assuming the license doesn't already allow it.)
Simple: that contract would be illegal. It's that simple. You can't put yourself into a position where you would be violating the law. The licensor would be on the hook for violating the law. This is "you can’t outsource compliance". Either your contract makes sure that you are compliant or a judge would make you both.
so a new law making it required would likely solve the legal issues, and gets the dev team (the only ones thinking about users or doing what's right) get what they wanted from the start?
I doubt it. I don't think another law _reduces_ legal issues. If anything it makes the situation more complicated. The plug is still getting pulled and I don't think this materially changes the outcome. If the company shuts down I'm not sure there is a legal obligation to release the code or refund. What entity would be responsible for that work?
Take I’d for example. They released source code for genre defining extremely popular games and were fine.
And how often is code reused anyway? Every online game seem to either use mostly stock server code that comes with the engine or build anew every time.