7 ms·
Anybody who did PS1 dev back in the day will have had to do some crazy hacking stuff to get performance or memory. The first project [1] I worked on I had a C
by louthy 4y ago
Anybody who did PS1 dev back in the day will have had to do some crazy hacking stuff to get performance or memory. The first project [1] I worked on I had a C version of my graphics engine and animation system, and in parallel I'd have a MIPS assembly version which was super optimised (the C version was effectively a reference).
I made the whole engine and animation system fit in 4K so it would fit into the instruction cache of the CPU. The whole frame update cycle wouldn't need to touch main memory (for the code).
Also, because loading from main memory was slow (4 cycles) and the chip was RISC (1 operation per cycle), you'd need 3 NOPs after the Load-op for the register to be loaded. The C compiler (if I remember right) never really filled those 3 NOPs with useful stuff. So, I'd do hand written concurrency (in MIPS assembly) by loading other stuff I'd need into those NOPs - this was particularly effective when working with 3 dimensional vectors or 4 dimensional matrices.
Trying to keep super-optimised hand-written concurrency in assembly, in my head, was a challenge and not something I'd recommend! Still, the engine had more throughput than Sony claimed of their machine. Every bit of performance gained would mean an edge over the other games.
Then the game was canned by Eidos. Pretty devastating for my first industry job :/
[1] https://www.unseen64.net/2020/11/16/lunatik-pure-entertainment-cancelled/ https://www.unseen64.net/2020/11/16/lunatik-pure-entertainme...
- smcl 4y ago> I made the whole engine and animation system fit in 4K so it would fit into the instruction cache of the CPU That's an impressive feat. The screenshots in the linked article look pretty nice particularly for the a PSX-era game, it has a good futuristic, but dirty industrial cityscape thing going on. Did you manage to utilise any of the tech in another project, or was the whole thing just completely binned?
- louthy 4y ago> Did you manage to utilise any of the tech in another project, or was the whole thing just completely binned? At that time we used to bin everything and start again (from the engine point of view at least). Usually it was so complex and hacked together by the end that there wasn't a generalised system to extract. We'd obviously take what we learned into the next title, but less so the code. PS2 was probably the first time I remember reusing engines.
- Psyladine 4y agoIt sounds like Gavin went beyond that, cutting into Sony's forbidden library space; it helps that he was a lisp head and didn't respect the existing C prefabs. I don't remember if it was the blog or the extended video but he also got into some of the close to the metal choices they made, like sharing variables and rolling dice on the compiler each build to fit with only a few kb spare in the whole cd space.
- louthy 4y ago> It sounds like Gavin went beyond that, cutting into Sony's forbidden library space Sure, this wasn't an exhaustive list of every trick we had to do, it's just another war story. This is the one that I remember the most vividly, but there were myriad tricks to bend the system to do what it didn't want to do :)
- Thaxll 4y agoIt looks like G-police.
- ffhhj 4y agoAlso reminds me of X-Com.
- birracerveza 4y agoOh wow. Why did it get canned? The tech demo looks amazing. EDIT: nvm it's in the post
- louthy 4y agoI wrote a comment below the article with background of what happened: https://www.unseen64.net/2020/11/16/lunatik-pure-entertainment-cancelled/#comment-377406 https://www.unseen64.net/2020/11/16/lunatik-pure-entertainme...
- gambiting 4y agoIt says on the website: "But ultimately the project failed because the original concept (3D Defender) was next to impossible to do really well. We tried many different gameplay mechanisms to make it work, and none were working"
- nsxwolf 4y agoI bet it was a lot more fun as-is than a lot of early trash on the PS1 that did get released.
- pjmlp 4y agoThanks for sharing the experience. This is effectively what younger generations that praise C don't get, the kind of tricks that most game developer had to do 20 - 30 years ago in home computers and game consoles, given the bad quality of C compilers in regards to code generation.
- deleted 4y ago[deleted]
- mikeryan 4y agoMy first “tech job” was supporting DOS games at EA in the late 90s. Post windows 95 they still had some bargain flight sims that seemed popular. I can’t remember the exact numbers but one of the sims checked for sufficient RAM. I think you needed 16MB but there was a bug where if you had more than like 512 it would think you didn’t have enough (pre-internet so no real patches). The “fix” was a “boot disk” (on a floppy) that would create a RAM drive to partition off some of your RAM getting your available total under 512. RAM had just started to get “cheap” enough that some folks had 1GB and we were able to use the RAM drive (which worked like a physical HD) to install the game and play it from RAM instead of the old slow spinning disks. But yeah memory hacks in those days were rampant. Side note the most common problem for the PS support queue was PlayStations not reading disks properly. The fix was to turn the machine on its side or even upside down to get the CD closer to the laser.
- rawoke083600 4y ago> Post windows 95 they still had some bargain flight sims that seemed popular. The golden era of flight/space sim ! I miss my wing commander(s) (don't you dare mention/reply Star-Citizen !) I think I played/broken through 2 crappy-cheap joysticks via the whole series. That perfect point in time (when you were young enough not to pay taxes, but old enough to get a soundblaster-card-kit with free wingcommander games)
- mikeryan 4y agoIIRC this particular issue was with one of the Jane’s Combat Simulator games. ;-)
- rawoke083600 4y agojanes !! Damn that bring back memories
- nomel 4y agoSomeone needs to port these to the Quest 2. VR, for flight sims, is pretty awesome, assuming you can stomach it.
- JohnBooty 4y agoAh! I remember looking forward to that one. Based on the press coverage it seemed like a "modern" of Sinistar, a favorite of mine.
- moonchrome 4y ago>Then the game was canned by Eidos. I've seen this pattern so many times in my time doing development (although I haven't done game development professionally), and why I tell people to avoid early development optimization. Trying to get things working correct and fast at the same time is an insane ammount of work, by the time you're done the requirements probably changed or the project flops, you'd be better off just getting something to satisfy minimum requirements first then make it fast.
- louthy 4y agoTo a certain extent I agree with you. But when the game doesn't even fit in the RAM of a development system (4mb), never mind the 2mb of a real Playstation, or movement is 5 frames a second rather than 30/60 it's still very hard to get gameplay aspects right. And when the graphics engine, level editors, etc. don't even exist yet, you're not making any game! In the 10 years I was in the industry (pre the era of off the shelf engines) I never saw a single title in a playable state until the last 6 months of the project, and sometimes later. My era was PS1, PS2, Dreamcast, original Xbox, Gamecube. I left as the PS3 was in its pre-release period. I think for most games the dynamics are quite well known, and so it's less problematic if it's started later. But, in this case none of the dynamics of the game were worked out at any point, so it was doomed to fail. On Lunatik I wasn't responsible for the game dynamics, I had one job: make the engine, and make it as fast as humanly possible so that the game and level designers can make a decent game. So, it's not either or, but it does take time to have the initial version that the team can work with (my C reference engine mentioned before). One final point is that it's less about early optimisation and more about poor management, short timescales, and the balance of cash given to a team when signing with a publisher. When the money runs out, then you're in the lap of the publisher gods - it can go either way for many different reasons, some of which might have nothing to do with the game. I suspect it's more professional now (and with better tooling), back then it was still pretty much a cottage industry: quite a large cottage industry, sure, but still pretty amateurish in terms of project management and planning. There wasn't a title I worked on that didn't overrun.
- Melatonic 4y ago
- AdmiralAsshat 4y agoThe video certainly looks impressive for 1997! ...but I can also see why it might have been relegated to tech demo. Even just watching someone else play it, it seems like you guys weren't totally sure yet how to do full 3D movement in-flight in a way that felt fluid. When the ship moved up or down, it reminds me of someone holding the space-bar in e.g. Doom/Quake with NoClip mode turned on. It also seems like the player might get rather frustrated that they can't hit an enemy ship that is five feet in front of them because the player ship is not exactly at the same elevation as the enemy ship.
- louthy 4y ago> they can't hit an enemy ship that is five feet in front of them because the player ship is not exactly at the same elevation as the enemy ship And that in a nutshell was everything that was wrong. How to make Defender in 3D when you can't line up with the ships in three dimensions. For a slower game it would have been less of an issue, but at the pace we wanted it didn't work.
- AdmiralAsshat 4y agoDid you guys ever do a post-mortem on how you might have solved that problem, or even how other games solved that problem? If this was 1997, this would've been around the same time as Star Fox 64, and while that game was mostly on-rails (like Panzer Dragoon), it did have the "all range mode" maps where your movement was fully 3D. I played that game quite frequently as a child, and I don't remember ever feeling like I was having trouble hitting the enemy ships. Maybe the game had a very generous auto-target/fudge factor turned on so that the player felt like their aim was more accurate than it truly was?
- louthy 4y agoThere were plenty of pre-mortems! :D Obviously we all knew of things like Star Fox 64 which is still really just a 2D game in many ways (following a fixed route), the idea was to not be on a fixed route and be free roaming. We tried putting the player and all NPCs on a height-map - so effectively your vertical movement was based on a height map, which meant everything was vertically aligned - it was the closest it got to being decent (not sure why it didn't make it to the demo). It did allow rapid movement, less concern about targeting, and avoidance of low buildings, etc. (which allowed some of the Defender pace). However watching your bullets going up n down along a height map was weird. But even then the free roaming nature of the levels meant that there wasn't ever an urgency to get to a place and do a thing. Each level would have targets to get to within a certain time, but then it was going away from shoot-'em up into capture-the-flag. Really it was misguided from the start. By the time we'd tried lots of different options we'd run out of cash. I was 21 at the time, and it was pretty much my first software engineering job (I did do some educational software before that, but nothing at this level). So I wasn't perhaps as reflective then as I am now - and I left the company not long after.
- djmips 4y agoHey louthy, do you still have the source code for that PS1 engine? Maybe put it on Github for all of use to gawk at and/or use in some fun PS1 hacking around.
- louthy 4y agoPossibly, I have some old CDs lying about. Chances of them loading up is slim after 25 years, but I'll have dig!
- djmips 4y agoThanks for considering it. That would be awesome!
- louthy 4y agoSo the CDs I have were the PC & PSX versions for an E3 demo (well the PC one was marked E3 demo, so I assume the PSX one was too - as they were together). The PSX version is actually playable on RetroArch, so I've uploaded it to github [1]. I have also found some floppy disks marked 'work backup 1..n' alongside the Psy-Q PSX drivers. I've ordered a USB floppy drive 'cos I don't have one any more. They may (if they still read!) have the source on. [1] https://github.com/louthy/lunatik-psx https://github.com/louthy/lunatik-psx
- djmips 4y agoWow! nice.