The Technical Difficulty In Porting a PS3 Game To the PS4
An anonymous reader writes "The Last of Us was one of the last major projects for the PlayStation 3. The code optimization done by development studio Naughty Dog was a real technical achievement — making graphics look modern and impressive on a 7-year-old piece of hardware. Now, they're in the process of porting it to the much more capable PS4, which will end up being a technical accomplishment in its own right. Creative director Neil Druckmann said, 'Just getting an image onscreen, even an inferior one with the shadows broken, lighting broken and with it crashing every 30 seconds that took a long time. These engineers are some of the best in the industry and they optimized the game so much for the PS3's SPUs specifically. It was optimized on a binary level, but after shifting those things over [to PS4] you have to go back to the high level, make sure the [game] systems are intact, and optimize it again. I can't describe how difficult a task that is. And once it's running well, you're running the [versions] side by side to make sure you didn't screw something up in the process, like physics being slightly off, which throws the game off, or lighting being shifted and all of a sudden it's a drastically different look. That's not 'improved' any more; that's different. We want to stay faithful while being better.'"
You realize the PS3's hardware WAS exotic right? That's exactly why it's hard! Write code optimized for multiple SPE units, and see how well you can get it to run on x86.
The PS4 is x86, the PS3... not so much.
Anything assembler-level optimized for the cell architecture would be absolute hell to port.
Mainly because the PS3 was a radically different architecture, and when the company had to do assembler-level optimisations to get the game working well, and now they're trying to recode those optimisations for x86, while ensuring the shaders, physics, lighting etc all work perfectly, it's an impressive project.
I don't know about that. Sometimes there is an inherent trade-off between being machine-friendly and human-maintainer-friendly. Tuning for machine performance sometimes gets in the way of high-level abstractions that make porting to a different architecture easier.
Reminds me a bit of the Story of Mel:
http://www.cs.utah.edu/~elb/fo...
Table-ized A.I.
How are the games obsolete? I bought a PS3 in September and have over 20 games on disk along with a bunch of digital ones and I love it.
That's easy! I wouldn't try to run SPE units code on x86 but x86 code on x86. The "optimization" shouldn't have affected the Game or it's portability and that's why it's their own damn fault.
Optimized PS3 code is not what you think it is. Its not taking some general C code and rewriting it a bit to be friendlier to the underlying CPU architecture or rewriting it completely in assembly. The PS3's Cell processor is, in simplified terms, a general purpose CPU and six special purpose coprocessors. So optimization is really figuring out how to pull major pieces of code out of the general purpose and move it to the appropriate specialized coprocessor, and then add the control code necessary to coordinate the two. Or to put it even more simply, optimizing for the PS3's cell processor is really an exercise in parallelizing code 7 ways.
Mainly because the PS3 was a radically different architecture, and when the company had to do assembler-level optimisations to get the game working well, and now they're trying to recode those optimisations for x86, while ensuring the shaders, physics, lighting etc all work perfectly, it's an impressive project.
Its not about assembly code, this mischaracterizes the problem.
Optimizing for the PS3's Cell architecture is not simply rewriting some critical code in assembly. Its more of a parallel processing effort. To greatly simplify things the Cell has a general purpose CPU and six specialized coprocessors. The trick to Cell optimization is moving code from the CPU to the coprocessors and keeping those coprocessors as busy as possible. Now add the complication that the coprocessors are not interchangeable.
Assembly has little to do with it. Its architecting the code to keep 7 parallel processors going, whether the underlying code that implements this software architecture is C or assembly doesn't matter a whole lot.
You realize the PS3's hardware WAS exotic right? That's exactly why it's hard! Write code optimized for multiple SPE units, and see how well you can get it to run on x86.
There's actually some validity to the GP's post.
Ideally, you would write the game portably, knowing that you will need to potentially take it to market on a lot of platforms, if it ends up being a popular title, and so as a result, you'd have a minimal porting set that could just be compiled and run, with additional optimizations on top of that tuned for the platform on which it's going to run.
Although not done a lot recently, the implementation of the original libc had C versions for all the code contained therein, and then had hand optimized assembly versions that would replace the C versions on a specific platform.
The intent was to be able to get it up and running on a new platform fairly quickly by having a small *required* assembly language footprint in the context switch, bootstrap, and CRT0 code, and then optimize the C code to assembly on a platform specific basis once you wer up and running self-hosted on the platform. This also gave you the opportunity to check assembly optimizations in user space first, without breaking everything by trying something that wouldn't work because of some mistake, and ending up with a lot of work to back the changes out (this was back in the RCS/SCCS days, where source code control systems weren't as capable as they are today).
It makes sense to do the same thing for games; minimally, the complaints they had about shaders should have been totally workaroundable, given that Direct X doesn't allow indefinite termination shaders, and requires the code to be fully unrolled compared to, say OpenGL, where there's no guarantee that a shader terminates (one of the reasons a game can crash a Mac or Linux using OpenGL, but can't crash Windows, using the OpenGL compatibility layer -- if it won't unroll, then it's discarded by DirectX).
In any case, it does show that there were at least some corners cut, and just because the host library is similar, you shouldn't expect the hand tuned code to be at all similar, especially going from a Cell architecture PS/3 (essentially, a data flow processor) to Von Neumann architecture on an AMD processor on the PS/4. It's obvious that all the hand tuned pieces would need to be rewritten, just as if you were porting to Windows or XBox or some other platform that wasn't also Cell-based. You'd think if they had planned ahead for ports to other platforms other than the PS/3, that that planning would be directly applicable to geting the code running on the PS/4 as well.
Seem to me like there's some pretty good advantage in doing games for x86 and Windows .. (but maybe not as strong if you optimise at this level.)
He exageratted.
But over in Nintendo camp supposedly it's bye bye for all online multiplayer gaming for the Wii and DS now.
(Well, that have happened on PC too, but it's still due to vendor lock-in at least :))
Sorry, but *yawn*.
Had they followed the practice, they would have a version of the source code that runs correctly (but slowly) that they could optimize for different target platforms.
Well, if they were EA games meant to be played online, many of the servers are already offline.
Failed to keep up with the latest yearly sports release? TS.
The main problem with this argument is that The Last of Us was PS3 exclusive, and it was PS3 exclusive from the start, so there's no need to write the code for portability(which inherently means the game will run worse, because you can't use platform specific optimisations). It was only when the PS4 came out the development team considered possibly porting the game, and even then it was never a guaranteed thing. The discussion of whether the game game SHOULD have been ported to other platforms is a different argument altogether. It was only because the game was tuned directly for the PS3 platform that allowed the game to look and play as well as it did.
That the PS4 has the same or greater number of cpus as the cell had cpu+spu, plus the ability to use compute units on the GPU as 'simplified' SPUs, it becomes much more difficult to understand how these guys had significant trouble re-optimizing their code for the PS4's architecture. Now mind you there ARE places they could've been having stalls (since the AMD jaguar cores share resources per pair(like bulldozer, correct?)), but most of the places where such issues would come into play should be optimizable into OpenCL datapaths and thus offload enough threads from the cpu for it to be acting like a 'native' quad core, with some number of Cell-like processing streams to hand the less general purpose computations.
While programming and game programming are difficult, and can in some cases compare to rocket science, this really isn't one of them. This is more about identifying the right resource or tool for the job and utilizing it in the most efficient manner possible.
Having gotten looks at plenty of 'production' game source code, mostly open sourced, I am sure plenty of you know how much more akin to the OpenSSL library's code than say 'an idealized, portable, and properly documented codebase'.
Alternatively they're really good programmers who got explicitly told "make this run like shit off a shovel and don't worry about portability - this will only ever be on PS3". You can say "but we should really write portable code", but if SMT still tell you to ignore portability then you're left with either doing what you're told or quitting.
Yeah, I had a sig once; I got bored of it.
Well, I'm not so sure about that. They designed their game for the horribly quirky PS3, which means that they'd either end up wasting much of the console's power or they'd twist the code until their video game works like a streaming application - which is the only thing the Cell can do efficiently. Since portability was not an issue (they knew the game was a PS3 exclusive) they decided to go with a PS3-specific design in order to get the most out of the hardware, thus making their game more appealing and thus more profitable.
They could decide between "write this platform-specific program in a suboptimal way so that it's easier to port to another platform" or "heavily optimize for the sole target platform in order to increase market success". I don't think the latter was an invalid choice. If anything, this story illustrates just how bad an idea it was to put a Cell in a game console.
USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
I expect the main difficulty in porting from PS3 to PS4 is the effort of converting all those programs between two broadly similar but different in the detail systems. The GPU shaders too were written for NVidia processors and now have to be converted / rewritten. And working through all the hacks, shortcuts and bad assumptions that come from dealing with code which has been crunched out to work on one specific platform and not another.
So it's mostly drudgery. I expect virtually all of the assets and much of the higher level code is reusable.
What about all the indie bundles / small games?
Surely you can find a shitload of platformers, shoot 'em ups, puzzle games, physics games, space development games and so on to fill your time with?
No... You're not talking about some code that's designed to be portable, you're talking about code that was targeting exactly one piece of hardware, and trying to make the output look better on that exactly one piece of hardware than anyone else developing for that same exact one piece of hardware. Because of this, games for consoles have an insane level of optimisation for that one piece of hardware. More so in this case, you're talking about a piece of hardware that had one of the most exotic CPUs in decades. Porting from that to x86 is a huge challenge.
If you wrote 50MB of assembly code without writing any development/not optimized/debug versions, good luck trying to develop anything substantial with that. AFAIK, most other game studios (Guerrilla, Insomniac) have already been able to ship games on x64 hardware. If you do dig into the details, Insomniac is another large supplier and user of SPU tech.
Why didn't Sony make the PS4 hardware more like that of the PS3? Then less effort would be needed to ensure PS3 games are portable to the newer system.
How are the games obsolete? I bought a PS3 in September and have over 20 games on disk along with a bunch of digital ones and I love it.
Not only that but if you have PS1 games you can still play them on your PS3, but with the exception of a few PS1 games you probably won't. Unfortunately only the first FAT PS3's played PS1, PS2 and of course PS3 games, however if you compare graphics on a decent large HDTV most PS1 games are fairly grainy even with smoothing on, the PS2 (FAT only) is quite reasonable and many games are very playable.
It is unfortunate but as time goes by the only way to play older PS1, PS2 and eventually PS3 games is to run them in an emulator. This does not only apply to PlayStation games but all games that ran on a different architecture.
At the moment I have no intention of purchasing a PS4 since there are not many games I see for it that makes it a compelling purchase for me. Backwards compatibility would have made for a compelling reason since I have many PS3 games I am still interested in purchasing as well as ones I am currently playing and since I like RPG's and Action Adventure I have enough for 100's of hours of game-play before I even consider getting a PS4.
There ain't no such thing as proprietary standards only proprietary formats. Standards are by definition open.
Last consoles I owned was Atari 2600 & original Nintendo.
I've been a PC gamer since.
Plating Ghostbusters & Chuck Yeager's Flight Simulator with joystick on a Tandy 1000 EX was fun, and all the free games in basic that came in the old magazine "Home and Office Computing" which became Family Computing (http://en.wikipedia.org/wiki/Family_Computing)
Anyhow I've never been a fan of consoles and while that might make me in the minority I still wished they'd ported to PC.
Someone posted the entire last of us game with no commentary and all the cutscenes a perfect play through I enjoyed like a movie.
I did same for Beyond Two Souls, entire game posted as a movie in HD with zero commentary. 8 hours 41 minutes straight through.
http://youtu.be/9qolJTsmmWA
"making graphics look modern and impressive on a 7-year-old piece of hardware" - for me, graphics have looked as good as they've ever needed to be since, ooh, Metroid Prime? This is kind of detailing exactly why modern games suck, I don't care if Call of Duty 87 looks 63% more realistic than the previous one, they're not interesting to play
and brains and talent and resources... for a fucking video game. I wonder if people a hundred years from now will laugh at us or hate us for the squandered resources?
Mostly random stuff.
Keep in mind that Naughty Dog was and is a studio that does Sony exclusives. There was no reason for them to worry about portability, which is exactly why their games were always leading edge in performance. That studio, above all others, knew how to use every last resource that the PS3 offered.
It's not an identical core, it's only of the same generation. And there's only one to the PS3's three.
Obviously, I meant to the 360's three. But if I don't issue a correction, surely some wag will pounce. Here, I'll add in an actual link to a real comparison of the architectures. Or you know, This old thing. The 360's PPC cores have twice as many LSUs, integer and fp cores as the PPC core in the PS3 — two of each instead of one. That's right, each PPC core in the 360 can do twice as much math as the PPC core in Cell. That's because you were meant to do all your heavy lifting in the cell cores.
"You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
It happened on the Wii and DS for exactly the same reason it happened on PC, namely that Nintendo Wi-Fi Connection was implemented on top of GameSpy. And it's not like Sony is immune: see DNAS error -103 on any PS2 game. The only long-term sustainable solution is to let players run their own private servers.
What about all the indie bundles / small games?
Years ago it was like pulling teeth for an indie developer to get a devkit out of a console maker. Only very recently did PlayStation open up to smaller developers with things like Pub Fund.
I just noticed something else goofy about your comment.
There's absolutely nothing weird on PowerPC being used on videogames. Sony made things complicated for developers by tacking 6 specialized coprocessors inside its chip - what, for programmers used to have just one (MMX, 3DNow!, etc), was clearly a new level of computing.
Actually, they were already used to having two asymmetric coprocessors, since floating point is handled by a coprocessor on traditional x86, while integer and fp math are both handled by separate units inside modern processor cores.
"You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
Afaict console game series can be divided into two main categories.
1: Those funded/published by a big publisher who is independent of the console vendors. EA, Take 2, Activision etc. These games may have a timed exclusive but if they sell well they will most likely end up on multiple platforms.
2: Those funded/published by a console vendor, these are highly unlikely to end up on any platform not controlled by that console vendor.
Afaict this one falls into the latter category.
note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
Uhm, you mean, finally a game that actually makes use of the hardware you bought.. It's the biggest problem with PC's, because there is a new GPU every quarter (even though consumers don't buy them only once a few years), and the incredible ammount of different configurations, there is no incentive to even to TRY to optimize and actually use the hardware.. That's the beauty of buying a console, you know the games will still look ok/good/great by the end of the lifetime and you won't have to upgrade it, but with a PC you're glad if you're 2 year old PC can actually run the latest games on a level that looks like the console-version, or finally be able to run that 4 year old PC-game at a level that was shown in gameplay-previews due to the developers using triple SLI GPU's that weren't even on the market at the time..
That runs on an IBM PS/3 :). I have one of those, it costs $10K, the case is made of depleted uranium, hard disk drives are gigantic and the bus is MCA Express (but you won't find cards except for 1TB RAM expansions and gigabit Token Ring)
Sadly a $500 PC is faster.
Another solution would be to use a PS2 with the hack to run games of a HDD (you can rip legit games I think), that would help with the concern of optical drive dying and discs getting damaged at least.
PS2 is hard to emulate, might be doable at last with an extremely powerful GPU with hundreds GB/s of memory bandwith like Radeon R9 290 or future mid-range ones when they get memory on silicon interposer.. PS2 has that eDRAM with crazy bandwith, and crazy fillrate to use it.
Emulating PS3 might be doable in a future where we have "many-core" CPUs made of "tiles" each with their own extremely fast local storage like the SPEs. Even then there's difficulty in the PS3 running at 3.2GHz which is almost the max clock for a chip (well we can do 4GHz to 5GHz at best) so I wonder about managing to respect some timings in some cases.
Wow.. Crysis came out in 2007 and I gave up on being able to run it! I did get a nice 65 watt graphics card at some point, but had to run at 800x600 or 1024x768 to get high detail and anti-aliasing, game looking bad IMO without those.. and whatever I did the framerate tanked in fire fights. So I figured I was CPU limited even though I had a recent one I thought it was nice enough. Mobo/CPU still haven't died on me and I see no reason to upgrade
The amount of ignorance in this post is incredible.
BLAZE ON ANONYMOUS COWARD.
Isn't the PS3 running an IBM P6 ppc chip?
Subversion of spatial scale luxury decoration ideas.