Forum > Research & Development

Python reimplementation of SGS

(1/3) > >>

Gamen:
Here's the source code of an almost complete re-implementation of the Sogna Game System in Python. It's mostly based off reverse-engineering RSR and Typing, so other games will probably have quirks. There was one with audio in particular that I noticed with M1, where looping sounds would not be stopped and replaced with other sounds like dialogue if they played too long. That one at least can be fixed by toggling "Play PCM Immediately" under the Audio menu. There's also something funny with fade ins in V16.

I'm not expecting anyone to actually use this, since it is not superior to the original engine except in lower CPU usage (mine uses a timer for the animation thread instead of a spinlock). In addition to Python 2.6 or 2.7, it requires wxPython 2.8 (UI), NumPy (bulk data processing), pyAudio (audio playback, of course), Construct 2.5 (parsing), and optionally Cython (to compile faster versions of the decompression algorithms). All the essential components together take 27MB - a substantial increase over RSR's 104KB SGS.exe. And since SGS.exe is Win32, it's not going to be unplayable on computers for a long time.

In other words, while it works, it's mainly a proof of concept and I expect it will be more useful as a guide than a tool, since the only missing bits that I'm aware of are a lack of support for the i18n opcodes (I have no International versions) and fullscreen. If you have questions I can probably answer them, but be warned I did this in May and then forgot about it until now, so my memory may be a little fuzzy - and that's ignoring the bits that I did in 2011 and earlier, which are even fuzzier.

Oh, and it's public domain - as if it weren't likely an unapproved derivative work as it is.

JG:
This is fascinating on so many levels.  I've been tinkering with hacking SGS.EXE to make a single version capable of playing any VIPER game and here you go and just completely recreate it from scratch.

Haven't tried it yet but highly impressed that this is a first version.  Most of what you've done I've also done, but in pieces. I can decompress SGS.DAT files (and recompress them) and I can decode (and reencode) ANM files and I can decompile (and recompile) most of the WIN programs with my tools, but nothing that puts them all together into a single usable program.

I definately need to take a look at some of your opcodes in interpreter, as for some of them I haven't been able to figure out exactly what all the arguments do yet.


Boy I hope you could help me figure out the PC98 coding formats - especially BTR.  It's been a dream of mine to finally port BTR to Windows.  (I'd settle for just being able to decode the image files and rip the text out of scenario files.)

Gamen:
I've never taken a look at the PC-98 games - I've never gotten a PC-98 emulator to work, for that matter, but even then I don't have any media for them - so I don't know how alike the PC engine is. I was greatly aided by being able to decompile the SGS.exe binary, even though it was a impenetrable mess, but I'd have to settle for merely disassembling the PC-98 engine.

As for trying it out, my memory was apparently quite pessimistic when it came to recalling how well it worked when compiled - I had remembered that it was not compatible, but I just tested it again and it seems to work fine. So here's a compiled version: http://www.sendspace.com/file/uhhh9k (...I love that file id so much). Just drop player.exe and its 3 companions into a game folder and run it.

Edit: If you do try it out, if you get static during the Sogna logo instead of their theme switch the audio to 16-bit. Also you can run a game by drag-and-dropping SGS.DAT onto player.exe, or putting a shortcut to player.exe in your Send To folder and right-clicking on SGS.DAT and choosing Send To -> <shortcut to player.exe>.

JG:
Forum attachments > download sites.



This is amazingly well done with only minor glitches in the games I tried.

The only thing I could see missing was language control, unless its so smart that it doesn't show you those controls unless the SGS.DAT has TEXT.xx files.  Didn't appear so but V16 Intl stalled at the first waitforlayer after Akira finishes her prologue so maybe it just didn't get that far.

Gamen:
Hmm, I tried attaching it... Perhaps it failed because I tried to preview first.

Yeah, I mentioned that I hadn't done anything with the internationalization (i18n) opcodes. I don't have any International versions to test it with, so I didn't implement it. The "next" button on the debug screen can advance past that, but since the implementation is missing anyway, not exactly playable... So not, it's not that smart.

Taking a look at the PC-98 version of CTR... Holey moley. There looks to be nothing shared between the windows and PC-98 versions. Even the DAT file format isn't the same, though it looks deceptively similar. And when I looked through the disassembled SGS.COM, nothing really stood out as familiar. Not promising.

Edit: Solved *cough* the lack of an International version somewhat more quickly than my previous failures prepared me for. I'll see what I can do.

Navigation

[0] Message Index

[#] Next page

Go to full version