punch
Deep Blooper
Posts: 23
|
Post by punch on Aug 24, 2023 23:09:21 GMT
Hello! For reasons that are not entirely clear to me, I got the urge to go back to PC Engine development after abandoning it a couple of years ago. And with that, I decided to revive an old project of mine from back then which was to make a vanishing point 3D racing game on the console, like Outrun. I always thought this was a genre untapped on the system and I want to make a game that can come close to the quality of the best racers in other contemporary systems.
But! Before I even get there, I need to actually put the basics in practice.
Racing game! This project/demo is an attempt to make a basic but satisfying 3D racing game heavily inspired on Pole Position... but not a port, my objective is not to replicate it millimetrically. The goal here is to have a fun, polished and most importantly finished racing game for PC Engine fans to enjoy, and as a launchpad for a more complex racing game I want to make in the near future.
To achieve this, here are the tasks that need to be completed and their status(es?):
✅PC tool to adjust and precompile data on the fly, and relearn how the techniques below can be implemented on the PC Engine
✅Basic raster road using scanline interrupts ✅Z-mapped texture/palette changes on the road ✅Perspective shifting on horizontal movement ✅Incremental road curving ❌Incremental road curving with depth multiplier ❌Sectors for S-Curves and better representation of road changes
✅Basic metasprite engine - Lots of room for improvement but technically done
✅Roadside sprite projection ✅Lane-based opponent placement
❌Cross-lane opponent movement ❌Collision Detection ✅Music engine working properly alongside road interrupts - Squirrel working successfully ❌ ?Mystery scaling techniques? ?
Now with proper motivation for this project and without 1001 real life issues to halt progress, development of the game is going smoothly and relatively quickly.
As soon as any playable demo is available I'll post it here for your enjoyment. Major updates will be posted in this thread, and minor quips will go here: mast.pceninja.com/
There! A much better opening post that actually contextualizes what the hell I'm talking about.
|
|
exodus
Punkic Cyborg
Posts: 161
|
Post by exodus on Aug 25, 2023 3:26:54 GMT
|
|
punch
Deep Blooper
Posts: 23
|
Post by punch on Aug 25, 2023 6:27:50 GMT
If only PCE got a super scaler-like hardware addon... then maybe, until then it's just a dream lol
|
|
|
Post by elmer on Aug 26, 2023 14:59:18 GMT
With another surge of motivation I decided to restart my old PC Engine vanishing point 3D racer project from scratch and it's going pretty well so far. Hills are still an old nemesis of mine but I've decided to keep it simple (flat roads) and actually do the Pole Position demo I mentioned way back when. You do realize, don't you, that NONE of the old 80s arcade games, or home computer ports, that did this road effect successfully, with or without hills, actually did any realtime 3D math? On 6502 home computers like the Atari 8-bit and C64, the road effect is just accomplished by setting an X and Y scroll coordinate on every line of the screen ... i.e. it just depends upon an RCR interrupt on the PCE, and then clever construction of the background map/maps that you switch between.
|
|
punch
Deep Blooper
Posts: 23
|
Post by punch on Aug 26, 2023 16:53:42 GMT
With another surge of motivation I decided to restart my old PC Engine vanishing point 3D racer project from scratch and it's going pretty well so far. Hills are still an old nemesis of mine but I've decided to keep it simple (flat roads) and actually do the Pole Position demo I mentioned way back when. You do realize, don't you, that NONE of the old 80s arcade games, or home computer ports, that did this road effect successfully, with or without hills, actually did any realtime 3D math? On 6502 home computers like the Atari 8-bit and C64, the road effect is just accomplished by setting an X and Y scroll coordinate on every line of the screen ... i.e. it just depends upon an RCR interrupt on the PCE, and then clever construction of the background map/maps that you switch between. But I'm not doing any realtime 3D math...? Faux scaling of objects from the horizon to the camera require at least some degree of obedience to perspective projection to look good, and that can be clearly seen in the higher tier of vanishing point racers like Lotus Turbo Challenge for example (even ZX spectrum games do this well sometimes, have you not seen Chase HQ?). I've spent an ungodly amount of time looking at what games of the kind seemed to do and I've noticed what gets approximated in various degrees of accuracy or just thrown out the window altogether. The whole point of my little dumb PC app is to precompile data I can use to give my PCE game a convincing effect, and adjust some parameters easily with instantaneous feedback. Even dividing the road into sectors instead of cheaply sliding a curve in and out of the screen is in if everything goes to plan. The only real problem I'm trying to solve is how to position sprite objects in the road in a somewhat convincing manner without needing much aside from shifts and adds -- I know some PCE games have great road rendering but put the sprites in wrong but belieavable spots far from the camera, which is not too bad since things are fast and you could attribute it to the cars changing lanes. Roadside objects are trival to position since you can just also precompile their screen X by Z coordinate. Maybe I can have precompiled "lanes" and use some sort of cheap interpolation to have them change lanes? I don't know yet, I have to experiment.
All in all it does seem like I have most of the tricky parts figured out already, I just need to reimplement on the PC Engine since I don't want to use my goony codebase from years prior.
NONE of the old 80s arcade games, or home computer ports, Pole Position has *perfect* perspective projection and scaling for cars, and this extends to the Atari STe too nowadays since someone reverse engineered the arcade game and ported it 1:1 to the machine. OutRun even uses bezier curves for bending tracks I believe. I think you're underestimating what can be done realistically quite a bit. Also: I know you probably remember I was foolishly trying to do a lot of heavyweight stuff on the PC Engine a couple of years ago and that's where your assumptions probably came from, so that's alright, but I don't know why you need to have such a condescending tone in all your posts, dude. Chill out.
|
|
|
Post by turboxray on Aug 27, 2023 19:15:04 GMT
Don't mean to get anyone alarmed.. Considered me alarmed!
|
|
|
Post by paranoiadragon on Aug 28, 2023 1:04:27 GMT
Since the technical mumbo jumbo goes over my head, I'll just ask. When it comes to scaling objects, I assume it's just frames of animation? What's your goal for a format? Arcade CD perhaps? Not that I fully understand how the memory on that thing works, maybe that would be an awesome way to go to get a really smooth looking racing game assuming that it has to use frames of animation for scaling.
|
|
punch
Deep Blooper
Posts: 23
|
Post by punch on Aug 28, 2023 4:58:44 GMT
Since the technical mumbo jumbo goes over my head, I'll just ask. When it comes to scaling objects, I assume it's just frames of animation? What's your goal for a format? Arcade CD perhaps? Not that I fully understand how the memory on that thing works, maybe that would be an awesome way to go to get a really smooth looking racing game assuming that it has to use frames of animation for scaling. Yes, it's just copies of the same sprite shrunk down since it's impossible to scale them in real time (otherwise all games without dedicated hardware for this would do it!). The Arcade Card would probably be extremely well suited for smooth scaling by brute force but the storage sprites take is not the only problem you need to deal with. There's really not much room to work with on VRAM for these types of games, plus bandwidth limitations, how much data you could pipe down to VRAM to update ('scale') sprites per frame while still reserving processing time for everything else the game needs, etc. etc.
Even a simple job might not be as simple as previously thought -- I spent the weekend trying to figure out how I'm going to fit the road graphics into VRAM and even for my simple Pole Position-ish game this is a big decision. The width of the road on-screen is roughly what you'd expect from PCE OutRun when it's showing five lanes at the start of the game, and look at that game's background layout:
The largest width the road graphic can get to is 512px wide! On OutRun the game actually erases tiles if you go to the lanes on the edge of the road so a duplicate road doesn't appear and ruin the visual effect. It doesn't look like it but the road texture does get that big, and so does the road in pole position in my approximate port. I could make my game's background be composed of 2x8 screens instead of 2x4 to have more room, but a 2x4 background already takes 1/8th of the available VRAM!
Doing a simpler racer is not a trivial task by any means (unless you want a really simplistic and unconvincing game that's not really worthy of being a PC Engine game, like we're talking below F1-Race on the Famicom level), and it's not my goal to blow the lid off PCE racing games right now (that's what stalled my project last time). There's already lots of little technical choices as-is to make the game work haha.
BTW I haven't decided if this will be HuCard or CD but I'm doing HuCard right now for arbitrary reasons and/or convenience. Who knows, maybe I could even trick someone into making cool chiptunes for it once it gains form as an actual PCE game hehe (should be soon).
EDIT: I just realized you can also have a 1024x256 background too (4x1 screens) so that helps a bit more too hehe.
|
|
punch
Deep Blooper
Posts: 23
|
Post by punch on Sept 1, 2023 2:53:40 GMT
I don't have much time to work on this these days unlike the last time around, but I'm making much faster progress for some reason.
edit: nevermind!
|
|
|
Post by DarkKobold on Sept 1, 2023 22:57:22 GMT
Yes, it's just copies of the same sprite shrunk down since it's impossible to scale them in real time (otherwise all games without dedicated hardware for this would do it!). The Arcade Card would probably be extremely well suited for smooth scaling by brute force but the storage sprites take is not the only problem you need to deal with. There's really not much room to work with on VRAM for these types of games, plus bandwidth limitations, how much data you could pipe down to VRAM to update ('scale') sprites per frame while still reserving processing time for everything else the game needs, etc. etc.
Even a simple job might not be as simple as previously thought -- I spent the weekend trying to figure out how I'm going to fit the road graphics into VRAM and even for my simple Pole Position-ish game this is a big decision. The width of the road on-screen is roughly what you'd expect from PCE OutRun when it's showing five lanes at the start of the game, and look at that game's background layout:
Given these limitations, do you have to stream graphics, or do you store multiple zoom levels for other racers in VRAM? Is the goal to have a single type of opponent, and use PAL swapping to get variations? Also, how do you go about making the choice of how many zoom levels to include? You don't really even need hardware based scaling, if you've pre-generated a bunch of different zoom levels, it'd be near impossible to tell, imo. IIRC, Super Mario Kart got away with an abysmal number of zoom levels.
|
|
punch
Deep Blooper
Posts: 23
|
Post by punch on Sept 2, 2023 7:54:29 GMT
Yes, it's just copies of the same sprite shrunk down since it's impossible to scale them in real time (otherwise all games without dedicated hardware for this would do it!). The Arcade Card would probably be extremely well suited for smooth scaling by brute force but the storage sprites take is not the only problem you need to deal with. There's really not much room to work with on VRAM for these types of games, plus bandwidth limitations, how much data you could pipe down to VRAM to update ('scale') sprites per frame while still reserving processing time for everything else the game needs, etc. etc. Even a simple job might not be as simple as previously thought -- I spent the weekend trying to figure out how I'm going to fit the road graphics into VRAM and even for my simple Pole Position-ish game this is a big decision. The width of the road on-screen is roughly what you'd expect from PCE OutRun when it's showing five lanes at the start of the game, and look at that game's background layout: Given these limitations, do you have to stream graphics, or do you store multiple zoom levels for other racers in VRAM? Is the goal to have a single type of opponent, and use PAL swapping to get variations? Also, how do you go about making the choice of how many zoom levels to include? You don't really even need hardware based scaling, if you've pre-generated a bunch of different zoom levels, it'd be near impossible to tell, imo. IIRC, Super Mario Kart got away with an abysmal number of zoom levels. This is a single opponent, multiple palettes game for sure. I'm doing a game *inspired* by pole position (if I call this a port then it would need to be much more accurate and that's extra work and not the point right now). In fact, now that you mention it, I completely forgot to contextualize what I'm doing in the original post. Oops! Pole Position 1/2 has only one sprite shared with the player and the moving obstacles (an F1 car, duh!) so not only the original game already does that, but there are a lot of frames for the car not counting possible scaled down versions (11 angles + the forward facing + the previous 11 mirrored), more reason to only have one car sprite. I think going full 12 sprites will be stupid no matter the way I approach VRAM usage, so let's say it's 4+1. Each car sprite (metasprite) is 4x2 hardware sprites. 1 16x16 sprite = 40 words 8 sprites x 40 = 320 words 320 words x 5 metasprites = 1600 words or 0x640 Using my own game as an example and other commercially available games I surveyed, it's safe to say there's no need to store tiles for the background up to 0x3000 on VRAM. So that leaves us with 0x7f00 - 0x3000 = 0x4f00 free words 0x4f00 / 0x640 = 12 full unique, 5-frames, 8-sprite-per-frame "cars". Or, more generically, 0x4f00 / 0x40 = 316 16x16 sprites. So the situation is not *that* dire that you have to stream data to VRAM every time. And really, if you consider Pole Position there's a lot of leeway since there's only the F1 car and one or two unique billboards on-screen at once, generally. If I were to dedicate all of VRAM just for the F1 cars I'd have 12 scaling steps, probably more, since a smaller metasprite equals less VRAM. You might be thinking that in a more complex game VRAM will quickly run out but the real limit on the PC Engine for these kinds of games is the limit of 16 sprites per scanline. This means the screen CAN be crowded with a decent variety of sprites for cars and roadside objects sometimes, but within reasonable limits. Great visuals can be achieved without much extravagance, take outrun (which should be the gold standard imo), it has two different cars and two different roadside objects on screen at any given point. And it seems like cars have what, 7, 8 scaled sprites? It's not too shabby and the game has pretty good visuals, and what's shown on screen is fully loaded onto VRAM when needed. I think that game has room for improvement but one thing at a time... I have to get my basic racer up and running first Here's a quick survey on what racing game does what, in order of best to shittiest game: Outrun - doesn't stream
SCI - doesn't stream Final Lap Twin - doesn't stream, does not swap sprites
Knight Rider SP - doesn't stream Chase HQ - doesn't stream Victory Run - doesn't stream, swaps sprites very sporadically
Racing Damashii - doesn't stream, does not swap sprites Bari Bari Densetsu - doesn't stream
F1 Triple Battle - doesn't stream, does not swap sprites
F1 Pilot You are the King of Kings(tm) - STREAMS (wtf?!? this one out of all games?) Unrated: Road Spirits (CD) - Firefox refuses to complete the download for this game no matter where I get it from for some reason. Conspiracy?
Jinmu Denshou - doesn't stream Space Harrier - streams only player sprite and background tiles, doesn't even use raster effects at all(!)
In my case I can comfortably store all the frames for my F1 car in many scaling steps on VRAM, and I also have two practical scaling tricks on my sleeve that I want to test, which I hope will be viable on actual hardware. The only real need I see for streaming at the moment is for the big billboards this game shows. My goal is to display them in full resolution (96x64) which is big but still on the realm of possible, I'll just have to take extra care in handling them. ...that's a lot of text. The second question is easier to answer: I'll include as many "scaling levels" as I can fit, and only further development will really tell how many are those. I'm probably adding prescaling + previewing on my PC app for quick changes.
To avoid making another post for this, progress is still going smoothly. My previous post was edited out because I was talking about a bug I was having but I interpreted it completely wrong making the point of the post moot (I really should keep the inane updates on my mastodon server). Road rendering via scanline effects is working OK and interacting with the precompiled data from my app, but the real relevant stuff (curves, sectors, horizontal perspective shifting) are still to be implemented. Squirrel is working with the constant interrupts in my game without a hitch, too! I already have some tunes from Pole Position in it. Hopefully I'll add road shifting and curves this weekend, then I can move on to work on the sprite engine.
|
|
exodus
Punkic Cyborg
Posts: 161
|
Post by exodus on Sept 3, 2023 17:49:09 GMT
If only PCE got a super scaler-like hardware addon... then maybe, until then it's just a dream lol yeah, it's totally impossible as-is... but if you make pole position work, maybe a stripped down variant could be within the realms of dream reality for me at some point!!
|
|
|
Post by DarkKobold on Sept 6, 2023 22:19:26 GMT
In my case I can comfortably store all the frames for my F1 car in many scaling steps on VRAM, and I also have two practical scaling tricks on my sleeve that I want to test, which I hope will be viable on actual hardware. The only real need I see for streaming at the moment is for the big billboards this game shows. My goal is to display them in full resolution (96x64) which is big but still on the realm of possible, I'll just have to take extra care in handling them. ...that's a lot of text. The second question is easier to answer: I'll include as many "scaling levels" as I can fit, and only further development will really tell how many are those. I'm probably adding prescaling + previewing on my PC app for quick changes.
FWIW, I read it all and enjoyed it. It seems like you could set up a gif with different # of frames, so maybe you don't need all 12. Also, apparently Outrun (the arcade version) runs at 30Hz, so even they weren't able to do everything they wanted on that hardware at 60Hz. Also, why did you switch from motorcycles? You'd need fewer sprites per animation, but more frames of animation.
|
|
punch
Deep Blooper
Posts: 23
|
Post by punch on Sept 10, 2023 7:33:51 GMT
In my case I can comfortably store all the frames for my F1 car in many scaling steps on VRAM, and I also have two practical scaling tricks on my sleeve that I want to test, which I hope will be viable on actual hardware. The only real need I see for streaming at the moment is for the big billboards this game shows. My goal is to display them in full resolution (96x64) which is big but still on the realm of possible, I'll just have to take extra care in handling them. ...that's a lot of text. The second question is easier to answer: I'll include as many "scaling levels" as I can fit, and only further development will really tell how many are those. I'm probably adding prescaling + previewing on my PC app for quick changes.
FWIW, I read it all and enjoyed it. It seems like you could set up a gif with different # of frames, so maybe you don't need all 12. Also, apparently Outrun (the arcade version) runs at 30Hz, so even they weren't able to do everything they wanted on that hardware at 60Hz. Also, why did you switch from motorcycles? You'd need fewer sprites per animation, but more frames of animation. Many games run on a lower framerate to get time to do everything, so it's possible I will need to do that too, but again that will be answered in practice when more stuff is in place. I just finished making a tool to prescale the sprites so next step is implementing sprite projection and see how heavy this will end up being, it's obvious that's going to be a big contributor to eaten CPU cycles .
I didn't really switch from motorcycles as this is just a stepping stone to a possible bike game in the future, emulating Pole Position was done out of convenience as it's a simple but great racing game and all assets are there to use already.
EDIT: for those watching at home... yeah I kinda slowed down updates a bit but worry not, this game is much better programmed than the previous attempt and I have a clear view of everything start to finish. New updates soon!
|
|
punch
Deep Blooper
Posts: 23
|
Post by punch on Oct 3, 2023 2:55:05 GMT
Sprite placement and scaling is in! It might not look like it from the gif, but I've implemented the lane system for placing hese sprites arbitrarily on the track. I just chose to set the two lanes I used to the edge of the road. This can also be used to cheaply position the car sprites on the road when they're not changing actual lanes in-game.
One thing of note is that the sprites look a bit misaligned but that's just because of the perspective projection and how I used the metasprite's center to position it on the lane. Putting it left/right aligned to the lane will look 10x better.
Another thing... I built the metasprite spec by hand and that's something I'm not doing ever again... so my focus now will probably be to write a tool so I can adjust things without wanting to ragequit this project entirely, like for example increasing the size of the billboards (I was too cautious with scaling) and adding legs to the metasprite.
|
|