The Let's Play Archive

Policenauts

by slowbeef

Part 23: Chase Your Quarry

This update will be a little different than others. There's a lot of tech talk to be had, so we're gonna have a relatively short, action-packed update of what is, undoubtedly, my least favorite scene in the game.

In fact, although we realistically had no shot at a 2008 release, this one scene took me over a month alone, and officially put the nail in that coffin. It's not a bad scene, and although I don't think I can fairly say it was "the hardest part", it was definitely the most effort for the least gain.

So, first up, let's start with a cool car chase video! (Note: Summary added since it's been a bit since the last update)

Screens below!




























Anyway, last time on Policenauts, a car bomber was tinkering with our car...









Car seems alright.

Yeah, as mentioned in the thread, this is a totally weird thing for Jonathan/Ed to just gloss over. But the car bomber didn't get to finish his work apparently (hopefully?), so we get in a car and chase after him.







I don't know if we can catch him in this!
Maybe if you'd step on it!
Son of a bitch. This is gonna be fun.






You're mine now!



When Zorak posted the Policenauts thread on release, I was a little stunned to see how many people had trouble with this.

The biker weaves back and forth, as cars and trucks in other lanes threaten to change lanes and ram into us!

Lock-on kinda sucks here, as the biker tends to change lanes as you shoot him, meaning he's on the move a lot, and getting out of the way of the last locked-on spot. If you are having trouble with this scene, it doesn't matter if you hit the biker or the bike, so focus on that taillight and just wail on him, until you get to the next scene.

Note that the biker will shoot back, and take a lot of health if he does, which is why you shouldn't let up. Shooting other cars will incur a health penalty... but even worse, Ed's a terrible driver. He'll crash into any car in the middle lane, incurring a health penalty. The idea is that you an shoot near these cars and they'll move out of the way.

Frankly, I find it's just easier to concentrate on shooting the biker.





This is the best I can do!







Exciting action! I'll be talking about just how technically fucked this whole scene is, and I think part of the reason - as walldial will undoubtedly show us - is that this version differs VASTLY from its old PC counterpart.

Namely, the 3D0, PSX, and Saturn versions have "THREE-D EFFECTS!" in that simple 2D images of cars and trucks are scaled toward us. Beautiful.





Welcome to part two of the biker shootout! Our health gets refilled, but it's more of the same.



So keep doing it in the tunnel and Jonathan hops back in the car.











Finally, to end the scene, we do this in the Residential section.

Here is exciting video of the end of the car chase, which I recommend watching!



Jonathan keeps shooting.









Unfortunately, the bike lands in front of an oncoming truck...





And Ed swerves out of the way.





He manages to miss the truck, but-







They jump the curb, knocking over a fire hydrant, and flipping the car.







Almost impossibly, the biker manages to get up and run.







Yeah, I'm fine. Let's go!






Okay, I hate to cockblock everyone in the middle of a chase sequence, but we've got a lull here, and the preceding sequence took me a month to ROMhack. Now, if you're looking, that's like 8 lines total - so yeah, this was easily the largest effort/amount translated ratio.

So, lemme show you the first pass at trying to translate this and introduce a broader ROMhacking problem.



"Wow, slowbeef. That looks awful, and nothing like the rest of the game's text. What's going on here?"

Well, thanks for asking, Hypothetical You!... which I guess is actually me? We're looking at a fairly common text rendering issue in ROMhacking - the problem of Fixed Width Fonts versus Variable Width fonts.

Your computer program is typically taking character data - numbers which represent letters of an alphabet/character set - cross referencing those numbrers with a big font file, using that font file to get a font graphic and drawing words/lines of dialogue with the font graphics. So how does it do that? If it's drawing a sentence (like this web browser is), how does it specifically find the graphic for say, "w" or "!" in a big graphical font file? How do you even organize all the font graphics in that file?

Imagine that you have fonts that are the same width and height (16x16 is a typical size for Japanese characters). So that means there's 256 pixels per character. So you take the bits per pixel (bpp) and multiply that by the width and height and by the ordinality of the character. And you have a pretty regular font file, where your characters are easily encoded and easily found.

So your 42nd character will be at file location 42 * width (16) * height (16) * bpp - since the width and height are always the same, that's an eay calculation to do.

Fixed-width - where the width of all characters is the same - tends to look okay for Japanese, where all the characters tend to be wide anyway. In fact, it's so common, you'll see odd things in Japanese video games like diagonal exclamation points, just to pad out the few instances where it doesn't look okay.

But as the preceding screenshot shows, fixed width looks like shit in English. We have a lot of narrow characters, like lowercase i's and t's. This is why a lot of old Nintendo and SNES games would just print everything in capital letters - it was easier than trying to code up variable-width letters. (That said, ROMhackers have various tricks to work around that.)

Now variable-width fonts look much better in English, at the cost of being harder to implement. Fortunately, Policenauts on the PSX supports variable-width fonts.

"Okay, but why are we discussing it now, for this scene?"

Because there's two font files on each disc for Policenauts. There is one font file that does variable width fonts, which almost all of the game uses.

There's another font file that is for this scene alone, that only does fixed width.

"Wait, wait, wait - why does the motorcycle scene, which has 8 lines of dialogue total - have its own font file?"

I dunno.

...

...

If you wanted a better answer, I don't have one.

What makes it even weirder is that both font files use the same file format - basically, what Konami does is say "Our variable-width font characters can only be a max of 16 pixels wide." For anything smaller, it has a tiny header that says "the character is only x pixels wide" and then the graphical data for that character. The rest of the space until the next character is blank.

That way, it can use the same "character * 16 x 16 * bpp" calculation - no matter how wide the character is, it "Starts" at the same location as a fixed-width font would. In fact, you can even copy the variable-width font file over the fixed-width font file, and vice-versa and things still work because the text-drawing routine can handle fixed and variable widths!

...Except, well, that's not the only weird thing about the motorcycle scene. Here's a sample of the "script" for that scene.

code:
There he is!
You're mine now!
Watch you don't fall!
Can't you get any closer?
EThis is the best I can do!
EWe're entering at tunnel!
JThis some kinda joke? I know I'm hitting him!
...
JI need to watch out for the other cars on the road.
JI need to remember to reload when I'm out of bullets.
The script for this scene - again, 8 lines of dialogue total - is in its own file called C_CON1.DOC. There's no C_CON2.DOC; and in fact, no other DOC files on either Policenauts disc. The first 8 lines correspond to Jonathan and Ed's dialogue, but for some reason all the lines past 4 are prepended with E and J. Then the file ends with a few Game Over comments that are never actually used by the game.

"Okay, that's weird. But once you figured out the dialogue is there, and that the font files are compatible, you can just change the text, and you're set right?"

No, because that's just the start of our headache here. The text-drawing code is actually special and different, just for this scene. First, it's hard coded to ignore anything below a certain character range, so it's was specifically written to not write English (again, unlike the rest of the game).

But once I found and removed that hard-coded limit, another problem - it actually didn't have the code to draw the narrower characters. It still tried to draw everything as a 16x16. I spent a good, long while trying to transplant code here to do it before realizing: "Oh look, it's just eight damn lines of dialogue."

So basically I wrote a script to draw out the character data, correctly spaced, and drew it over the graphic data for some of the Kanji we were no longer using. Now the game just prints out a sequence of characters which correspond to drawing out these sentences, if that makes sense.

One last thing?

The Motorcycle Subtitle Bug

The following is the Japanese version of the Motorcycle scene - or one specific part of it. This is not an emulator fault; hardware will do the same thing on the original released game.

Video

Those subtitles go by really, really fast. We considered that a bug.

We managed to compress that to two subtitles, and keep each onscreen twice as long to give the player a shot at reading the dialogue. Yeah I delayed an update for a few days to get footage of that... ...

Okay, next up, more chase.