Remix.run Logo
NooneAtAll3 8 hours ago

can it be rewritten to use fixed point arithmetic instead?

ndepoel 43 minutes ago | parent | next [-]

Yes but also no. The problem with fixed point arithmetic is a lack of dynamic range compared to floating point. Floats are great at representing both large numbers with limited precision and small numbers with high precision, but with fixed point you have to make a choice based on which kind of number you're trying to represent. Meaning you need to use a mixture of 8.24, 16.16 and 24.8 fixed point types (and appropriate conversions) depending on the context of the calculations that you're doing.

It's possible to write a game engine with that limitation, but there's no easy natural conversion from Quake's judicious use of floats to a fully fixed-point codebase. You'd have to redesign and rewrite the entire engine from scratch, basically.

klodolph 7 hours ago | parent | prev | next [-]

I want to look at this from a different perspective… a single-precision floating-point multiply is pretty simple, no? 24x24 bit multiply, which is about half as many gates as a 32x32 bit multiply.

Maybe I would prefer to rip out the integer multiplication unit first, before ripping out the FPU.

Narishma 8 hours ago | parent | prev | next [-]

The PS1 doesn't an FPU but got a version of Quake 2, so it's possible. That said, it was somewhat different from the PC version, so it could be argued that it's not the same game.

klodolph 8 hours ago | parent [-]

The PS1 version definitely has its own engine, which is not just a port of the Quake 2 engine to the Playstation, but a new engine.

jasonwatkinspdx 6 hours ago | parent | next [-]

I can't speak on Quake, but I was a level designer on the failed effort to port Unreal to PSX.

My understanding from talking to the coders at the time was that Unreal's software renderer was a huge advantage as a starting point. They were able to reuse a lot of the portal rendering stuff as setup on the R3K cpu, but none of the rasterization. That had to go to the graphics core, which was a post setup 2D engine that in addition to the usual sprites, could do tris and quads.

We had a budget of about 3k polygons post clipping, and having two enemies on screen would burn about half of that. The other huge limit is the texture cache was tiny, so we couldn't do lightmaps. Our lightning was baked in at vertex level and it just was what it was.

There's a bit more info here: https://www.terrygreer.com/unrealpsx.html

I imagine the situation with Quake was comparable. The BSP stuff would carry right over, but I can't imagine they got lightmapping proper working at the time. They'd also need some sort of solution for overdraw, as Quake's PVS was a lot more loose than Unreal's portal clipping.

ndepoel 37 minutes ago | parent | prev [-]

The PS1 version uses a custom engine based on technology built for the game Shadow Master, the previous title by Hammerhead Studios. It was a technical tour de force for the original PlayStation.

rasz 3 hours ago | parent | prev [-]

Sure, but then you need CPU that is twice as fast :). Playstation did it by pushing geometry calculations to GTE.