|
Post by Mystery on Nov 8, 2024 0:56:39 GMT -5
Is there a way to modify the font that is used in the text box popup to display the pstr.txt strings?
A lot of textual UI elements are just images, like the number counters for ammo, so I'm wondering if there is a way to change the default font for the GCS as well.
|
|
|
Post by lgb3d on Nov 8, 2024 1:15:00 GMT -5
I might be wrong but in the past Chris shown how to replace the default midi sound swaping palette "voice" . If I remember right it's Ibk files for that MIDI. I would believe the text would be similar. Probably a file under a different format
|
|
|
Post by Mystery on Nov 8, 2024 1:30:38 GMT -5
I mean the "gcsFONTS" file sounds awfully suspicious, so there might be a way...
|
|
|
Post by lgb3d on Nov 8, 2024 2:01:17 GMT -5
Yeah. You're heading the right path yes the number count is a VGA graphic. And through different experiences with the fourth code I've got hex display on screen undesirable but interesting. But the pstr I believe that would be something along the line of GCS font. But on the other hand that might be the font for the editor. So you might want to look at a finished game to see if there is a font file there too exclude any chance you're looking at the font for the editor as it graphically appears a bit different
|
|
chris
Junior Member
Posts: 58
|
Post by chris on Nov 8, 2024 10:26:17 GMT -5
Great question. According to the GCSP manual pfont.dat is the "ingame font for text messages". I'm willing to bet that it's the characters being represented in straight-up binary in some way, probably not VGA since there's no color, it's 1 bit. The character size looks to be 5x7 so that's a clue. Maybe I'll goof around if I've got some time today and see if I can figure it out.
|
|
|
Post by lgb3d on Nov 8, 2024 12:36:50 GMT -5
Radical answer Chris I knew you had this.
|
|
chris
Junior Member
Posts: 58
|
Post by chris on Nov 8, 2024 12:55:06 GMT -5
I wrote something to dump the contents to a binary representation expecting to see some kind of pattern. I mean, kinda, there's a pattern, but I'm not seeing anything readable. Knowing Kevin I'm sure he did something clever here lol. I figured it would just be a straight up 1 bit map but doesn't appear that this is the case. Here it is if anyone wants to take a look (throw this into Notepad and set the font to Terminal, 5pt)
[edit: scratch that, see below...]
|
|
chris
Junior Member
Posts: 58
|
Post by chris on Nov 8, 2024 14:00:53 GMT -5
Okay figured it out after after stacking up the output every byte. It is indeed a binary representation, each byte represents one line of every character, if you draw each byte below the last one, it will draw the whole font (rotated counter-clockwise and flipped).
Here's a PNG file of the output (corrected to make it readable). Mystery, feel free to edit this file (leaving the size and position of characters as-is) and I'll see if I can generate a replacement PFONT.DAT for you Attachments:
|
|
|
Post by Mystery on Nov 8, 2024 15:14:39 GMT -5
Wow that's really impressive.
So the characters are 6x8 pixels if I see that correctly?
I just looked at the file with a hex editor real quick. So each byte is one vertical column in the file, right? Not quite sure yet why the image is only 764x8 and not 768x8 as the file size would suggest (the latter being divisible by 6, the width of the characters).
Oh and binary is literally binary. For example the 3rd line in a "3" is 10010010.
I have no clue how you converted that to PNG or how you would convert that thing back though. Maybe if I looked up image formats and finally bothered to learn Python...
|
|
chris
Junior Member
Posts: 58
|
Post by chris on Nov 8, 2024 15:54:58 GMT -5
Yes you are correct, I noticed I had accidentally truncated the PNG file after I posted it, add 4px to the left of the image and you're good to go. And yes, 6x8 for each character, although for the most part the 6th column is being used as a space so the characters don't bump up next to each other.
I used Clickteam Fusion to read the binary and dump it to the screen, exported the overlay. It's good for rapidly prototyping apps like this. I've created quite a GCS toolchain over the years with it and at some point I'm hoping to package it all up and share with this forum.
But yeah feel free to send me back a PNG at some point and I'll write an app that does the opposite, read the png file and write the bytes to a file, should be easy enough.
|
|
|
Post by lgb3d on Nov 8, 2024 16:49:20 GMT -5
Dang you guys got right down to the root of this one pretty quick
|
|
|
Post by Mystery on Nov 9, 2024 0:32:24 GMT -5
I always wanted to tinker with the font but thought it wasn't possible for the longest time. But a few days ago I came to the conclusion "better safe than sorry". Good thing I asked.
That collection of GCS tools sounds sweet.
Work on my game starts this weekend, so I'll get a font together. I have some other ideas for fonts for future projects so if a tool emerges from this, that would be great!
|
|
chris
Junior Member
Posts: 58
|
Post by chris on Nov 9, 2024 9:47:12 GMT -5
It's been on my mind as well to try to reverse-engineer cuz I'm tired of looking at that same ugly font lol, just never had an excuse to do it until yesterday and it sounded like a fun challenge.
I created a modified font last night for fun. When I get time I'll write the app to turn it back into binary and see how it looks. I will say this font is so tiny that it's hard to really express something interesting that is readable at the same time. Like I could try to cram Helvetica into this bitmap but it's probably gonna look hideous especially at fixed width haha.
But yeah the toolset can view/save/convert VGA/VGR images (although awfully buggy), replace bits of universe files with hacked code automatically, a whole fluid animation editor based on the Windows one that can also swap in your changes during game testing, an MP3->WAV converter that outputs to appropriate GCS specs, and other random stuff as I need them. Right now it's just in an ugly unpleasant state and not ready to turn loose on anybody.
It can also can detect when a game is running in Dosbox and hook into the universe registers, so you can make the game play MP3s, open websites, detect keypresses, stuff like that. I also am creating a couple of DOS applications, a TSR that can read/write universe registers while a game is running and detect keypresses, and a PNOCOMP hook that can do just about anything between cutscenes by reading the state of the game and looking for what universe register you interrupted the game with. Really fun hacky stuff, but life would be so much easier if only we had the source code.
You might try asking Kevin again sometime if his contact info still works. I think when you asked him for the source code he was thinking the Windows engine source which is why he was concerned about compiling it. The GCSP as a standalone product should compile just fine (in DOS with Borland at least). I'm convinced we could really take our projects to the next level without even having to touch the C code, but even if we do it would be super easy to do stuff like remove cheat codes and useless keyboard keys.
|
|
|
Post by lgb3d on Nov 9, 2024 14:37:58 GMT -5
I really like what you're saying about a loophole in between menu and the game detecting Universe registers. Like I've been doing some crazy stuff with menu. But what you're describing is next level.. very interested
|
|
chris
Junior Member
Posts: 58
|
Post by chris on Nov 9, 2024 15:57:58 GMT -5
Yeah so here's how it works. I put a stub PNOCOMP.EXE that replaces the real PNOCOMP, which is renamed to PNOCOMP_.EXE. When you interrupt the game with register 127, it hits GCSMenu, which then re-launches PNOCOMP and tells it to continue from STATE.BIN. But it hits the fake PNOCOMP instead, which reads register 127 (or any other register) and will be programmed to launch an additional EXE (for instance change the CD player track, run a game or whatever), etc. and then pass the command line arguments to the real PNOCOMP when it's done. For instance maybe your player goes up to a computer terminal. You can throw register 127=5 or something, the menu shows you sitting down at the terminal maybe, then you boot into a fake DOS terminal you wrote in QBasic where you have to do some hacking. If the hacking is successful, you can modify a universe register in STATE.BIN, then boot back into the game, and the game will know you hacked the terminal and open a door or something. Cool stuff. I have a proof of concept, it'll totally work
|
|