5 ms·
Admittedly way less thorough/cool than the YouTube video, but we created a limited pre-emptive multi-tasking system on the original Playstation to run our physi
by sokoloff 7y ago
Admittedly way less thorough/cool than the YouTube video, but we created a limited pre-emptive multi-tasking system on the original Playstation to run our physics engine at a constant frequency. Sony US and Sony Japan said it couldn't be done.
We eventually figured out how to use the vertical blank interrupt to save all the registers, modify the return addres to return from the interrupt to our physics code, then our physics code would run (not in the interrupt context), then restore the registers and longjmp back to the main game code which had been originally interrupted by the vertical blank interrupt.
This wasn't general-purpose pre-emption and had only fixed divisors of the screen refresh rate available, but was enough to get our physics engine to run close to isochronously.
Side note: our game was comparatively terrible and I remember being in awe of what the Crash Bandicoot team accomplished in gameplay and graphics.
- someperson 7y agoWhich game was this?
- sokoloff 7y agoNASCAR Racing - https://en.wikipedia.org/wiki/NASCAR_Racing_(video_game) https://en.wikipedia.org/wiki/NASCAR_Racing_(video_game) Even as the tech lead on the product, I have to agree with the critical commentary in the PSX section of that page. Our company's stock in trade was realism and it hurt us with the mainstream gamers on the PC side, but was even more severely limiting on the console audience. (We also didn't crush it on the execution side on the PSX port.)
- ploek 7y agoOh wow! For reasons unbeknownst to me, my father had that game for the PC. It was one of two games in our household at the time (The other being "Mario Is Missing!" https://en.wikipedia.org/wiki/Mario_Is_Missing! https://en.wikipedia.org/wiki/Mario_Is_Missing!). I played that quite a bit, but I think I spent most time painting the car, because I wasn't any good at the actual racing.
- sokoloff 7y agoYeah, you have described the essence of the problem. The game was quite realistic, enough that rookie Cup drivers would use the product to get familiar with tracks they'd not yet raced on, but that level of realism made it not so fun for the casual gamer. (It turns out that racing cars at the top professional level is actually hard and not something you pick up in 15 minutes.) We would go to NASCAR events, weigh and measure car components, talk to the crews/drivers, and most of us even got the first level of competition license (typically 3 full days of classroom and on-track instruction and then 3-6 more days of individual mostly track time) so we understood what driving a racing car near, at, and slightly over the limit was like. The PSX product introduced a feature that later made it back to some of our PC titles, called "Arcade Mode". It was still racing (in that skill mattered), but arcade mode gave the cars far better braking, allowed them to slide and pivot more but spin out less (by changing tire slip curves), and gave drag reduction to cars that were losing the race. We also introduced the smoky burnout/donut ability which immediately made it into the PC title (but had a bug that caused a smoky burnout to be the fastest way to launch the car from a standing start, which critics [rightly] hated). At the end of the day, fairly few people are interested in very realistic racing. (Many of the ex-Papyrus team are over at iRacing now and they're on the ultra-realistic side of things.) If you want to sell a mass-market game, ultra-realism doesn't sell as well as fun and engaging gameplay. The end state of this drive for realism was https://en.wikipedia.org/wiki/Grand_Prix_Legends https://en.wikipedia.org/wiki/Grand_Prix_Legends which I worked on some of the early code for, but left before it shipped. Even in the early stages, with the best computer and graphics card of the day, a full set of physical controls (including force feedback steering), it was difficult to drive the car around for a single lap at 9/10ths pace, let alone race them in traffic.
- mirsadm 7y agoThanks for taking the time to write that! It's super interesting. Have you stuck with games dev since then?
- sokoloff 7y agoNo. If I wanted to stay in games, I’d have 100% stayed with that crew at Papyrus then Sierra and then gone to iRacing with them. Excellent colleagues all around: super talented, super interesting to work and eat/BS with. I wanted a family and financial security and the game industry wasn’t going to take me where I wanted to go (and I worked on generally successful titles for a successful company; most game devs have it even worse). The Sierra Online acquisition was great; loved meeting and talking about games with Ken and Roberta, but then the subsequent spate of acquisitions just killed a lot of the joy and essence of what made the day-to-day work fun, so that also made it easier to leave.
- Lutzb 7y agoI have to use this opportunity: Thank you for all the great IndyCar and Nascar titles released over the early years of the PC platform. The Papyrus racing title hold a very special in my heart/childhood.
- sokoloff 7y agoThanks! There's definitely a cult following and a lot to be proud of, but I have to say that Dave, Randy, Adam, John, Matt, Charles, Anne-Marie, and the rest of the team deserve 99+% of the credit. I played but a bit part (and really enjoyed every moment of it).
- LoSboccacc 7y agoone of my most memorable quotes from childhood is not the halo theme but "I'm Paul Page, from papyrus, this is Indy car racing two"
- ilikecakeandpie 7y agoFWIW my dad, who is a lifetime NASCAR fan, loved the realism
- sokoloff 7y agoCool. I'm not involved with the iRacing team at all, but they have a NASCAR offering and your dad may consider checking that out.
- 6374532 7y agoThis was one of my favorite games to play as a kid. I played it for many hours. The physics, engine sounds, in-car view were really impressive. It is still my favorite racing games to this day. It left a greater impression on me than any other racing game I played since. One question I had is, why weren't cars able to flip upside down in the game? This wasn't a large negative, as the the way the cars crashed and showed damage was quite good. I laughed so much as a kid playing this game, it was pure excitement for me.
- sokoloff 7y agoThe coordinate system for the race management/graphics engine in that game was a 2D system (and in fact was (lat, long) on the track, rather than (X,Y)). We'd convert the (lat, long) into (X, Y, Z) coordinates, take into account the banking and track surface under each tire [painted lines were slightly more slippery than asphalt], do all the physics computations, then cast the (X, Y, Z) back to (lat, long) to send it over to the race/graphics world. Why? Longitudinal measurements are natural for "who's in the lead?" type of questions and all of our track editing tools also worked in lat/long coordinate space.
- unwind 7y agoJust to clarify, do you mean polar coordinates [1]? That would absolutely make sense for a game centered (heh) around racing around a closed track, clever! [1] https://en.wikipedia.org/wiki/Polar_coordinate_system https://en.wikipedia.org/wiki/Polar_coordinate_system
- sokoloff 7y agoNot exactly. Polar is r-theta. The system we used was an x-y system, but one where the coordinate system alignment changed for each track segment. So, think of a world where a straight line in y ["longitude"] was projected into a constant path relative to the centerline of the track's racing surface. (While most NASCAR tracks are ovals and could be represented in polar coordinates fairly naturally, they do have some road courses and the physics and game engine originated in the IndyCar game, which has even more road courses.)
- jakearmitage 7y agoDude, you have to blog about stories like these. It's amazing. Don't underestimate how interesting and fascinating your experience is!
- EvanAnderson 7y agoBased on the grandparent poster's comment below re: the coordinate system and physics engine I have to second this comment. I never played this game and have little interest from a gaming perspective, but I'd love to hear about it from a development perspective.
- beardedwizard 7y agoDude this game was therapy for me as a kid. Thanks.
- agumonkey 7y agoOh you worked at Papyrus ! Man I spent so many hours playing the PC version (Matrox Millenia era) and the physics engine got me hooked (and the car body editor). Saving replays just to see how multi car crashes would look like (sometimes even self cancelling multi agent collisions) A time traveling thanks
- ndesaulniers 7y agoDitto, I remember driving around the course backwards and wrecking all opponents. I probably spent many hours as a seven year old just doing that. So much fun!
- agumonkey 7y agoSame same, although my favorite was trying to bump opponents on there rear wheels, just enough so they'd make long drifts and chaotic spins.
- zelon88 7y agoI remember playing this on DOS with my dad. It was one of the games that got me into computer gaming, so thank you for that. For me, personally this one was up right up there with Wolfenstein 3D and the Wing Commander series. One of my favorite parts of the game was decorating the cars with paint and decals. Papyrus also had Indy Car Racing which I also enjoyed.
- michaelgrafl 7y agoI think that's pretty cool.
- weinzierl 7y agoSounds awesome and reminds of the good old times. I don't know much about consoles but in the home computer era, a ton of the awesome stuff was accomplished by clever trickery triggered by interrupts generated by the electron beam. The Commodore 64 for example could trigger an interrupt at an arbitrary screen position and not just H-blank or V-blank. We used to call these raster interrupts. Graphics on the screen border, simultaneous graphics and text mode, split screen effects, more than 8 hardware sprites and the light pen were all things that were only possible on the C64 because of that capability. If you want to learn about this check out Shallan50k on Twitch, he does awesome streams about these techniques. The Acorn is a good counterexample of a much more powerful machine which lacked the ability to do raster interrupts and that is in my opinion one major reason the Acorn had relatively poor graphics.
- sokoloff 7y agoI cut my teeth on the Atari 8-bits, where we used vblank and hblank interrupts for all kinds of tricks like you described. The inspiration for this solution came directly from that experience. Side note: I was always jealous of the way better sound hardware on the C64. It's also crazy to me to think that I paid probably around $1000 in 1981 dollars (equivalent of $3500 today) to buy an 8-bit computer with 48K of RAM.
- jlarcombe 7y agoYes. It's possible to do on the Acorn but few games at the time took the trouble to do so. It requires very accurate cycle counting. There have been a number of recent demos that take things to the next level though, and someone has even got raster interrupts working on the Electron, which is frankly astonishing: https://www.youtube.com/watch?v=PUl1SGUSkbI https://www.youtube.com/watch?v=PUl1SGUSkbI
- weinzierl 7y agoI've also heard that there is a hardware mod to give the Acorn true raster interrupts.
- 7y ago
- saber6 7y agoWow this is a great story! I remember playing Crash Bandicoot on the original PS and being wowed at the physics. Thanks!
- dmbaggett 7y agoThat is super cool. At the time -- I was like 12 -- all those horizontal and vertical blank hacks on the Atari 800 seemed like total black magic to me. I had no idea you could even hook the VBLANK or HBLANK interrupt on PS1. Wow.