![]() |
Re: Blitzkrieg Banzai? (SP1 Conversion)
Well, I think I have a decompression routine that works for SPCAMO version games. Now comes the hard part of reversing it.
|
Re: Blitzkrieg Banzai? (SP1 Conversion)
1 Attachment(s)
A compressed section is made up of multiple interspersed compressed and uncompressed run-length encoded data blocks.
Each run-length coded data block consists of: [N] a run-length coding byte (RLB) [b] one or more data bytes. The Run Length Coding Byte (RLB) is the trigger that tells us what type of data block it is: If the RLB is equal to or less than 127, it's a uncompressed run-length coded (URLC) data block, which is used for sequences with mixed values: [N] The RLB indicates the number of data bytes that follow, which can be from 1 to 127 bytes. [b] Individual Data Bytes that can be copied/edited as/is. If the RLB is equal to or greater than 128, it's a compressed run-length coded (CRLC) data block, which is used for large sequences of identical data bytes to save space. [N] The RLB indicates the number of identical data bytes that follow from 1 to 127 bytes. BIG IMPORTANT NOTE: To get the true RLB for a CRLC block, you need to subtract 128 from the initial RLB. For example, if your CRLC has a RLB of 250, it's true length is actually: 250 – 128 = 122 Byte RLB. (This is what tripped me up; I was assuming 250, 0 meant 250 bytes of identical 0 value.) [b] Data Value for All the Bytes in this block. The decompressed data is the sequence of N times the data byte B. A visual representation of the typical sequence of a compressed data block is attached. RED: Section Header. 4-byte Header Marker (37 0 0 0) followed by compressed size (33 0 0 0) and the compressed flag (1). GREEN (Uncompressed) and BLUE (Compressed) Blocks You can see how the RLB says 16 bytes, followed by 16 bytes, then you have a compressed block of 86 bytes (214 - 128 = 86) with a value of zero; and so on so on. |
Re: Blitzkrieg Banzai? (SP1 Conversion)
With both compressed and uncompressed datablocks both taking up 127 bytes, it looks like a quick and dirty compression method would be:
read chunks of 127 bytes. If bytes all match, compress. If there's mismatch, run as uncompressed. EDIT: And of course, you don't need to recompress; you can just insert the newly uncompressed section into the scenario file and change the section header to account for the new length and change the COMPRESSED flag from "Y" to "N" and it'll load in game :D |
Re: Blitzkrieg Banzai? (SP1 Conversion)
Both the game code and the code Fred uses have a mixture of " we start numbering from zero here but 1 here"..........it makes life "interesting"
|
Re: Blitzkrieg Banzai? (SP1 Conversion)
So far I have:
https://i.imgur.com/NLOKD9r.png It's an early proof of concept so far; I need to figure out some way of simply typing in a formation number, e.g. A0 and the editor automatically places that unit on the same hex as that unit. I won't bother with load/passenger tables. Let SPWW2/SPMBT do that in the editor. Too many things to screw up in an undocumented game file. Basically, you still have to manually edit facings with mouse right clicking, but that's OK; it's a lot less work than having to "hunt and peck" across a map looking for hex locations off a spreadsheet. |
Re: Blitzkrieg Banzai? (SP1 Conversion)
Naturally, since I've cracked the compression code; this means that SP2 support isn't *that* far off.
There are a few interesting ideas in Hapschott's SP2 collection like: Quote:
Quote:
Quote:
Quote:
|
Re: Blitzkrieg Banzai? (SP1 Conversion)
Conversion Guide Part II:
################################################## ### Copy your converted "spmap999.dat" to your WinSPWW2 or WinSPMBT \Maps folder. Start your game of choice (MBT or WW2), load the scenario editor: Hit MAP-CUSTOM button and load the map (999). (NOTE: Unfortunately, it appears that smoke/damage conditions get wiped clean during conversion) While you're in there, set up the initial conditions of the scenario: Player Nations, Date, Visibility, Type of Battle, etc. This information will be in the _Scenario_Data.csv file for handy reference. and buy the OOBs for each side. OOB information for the original scenario will be in the _Units.csv file for handy reference. WHY NO AUTO CONVERSION OF OOBs?: One of the big reasons why I didn't design an automatic conversion of the OOB/unit list is this: SP1 OOBs were very simplistic; while SPWW2 OOBs are much more realistic and have more granular detail with 25~ more years of research in them, plus the larger size of OOBs allowing more detail. Case in point; for Japan in November 1945 in Steel Panthers I; you have the following infantry formations available in the OOB: Infantry Plt SNLF Plt Cavalry Plt Engineer Plt Engineer Sec Sniper Spec Atk Force Machine Gun Sec Meanwhile, in Steel Panthers: World War II, you have for the same time period in the Japanese OOB: Para Spd Co[A] Paratroop Co[A] Para Platoon[A] Para Mor Sec[A] Para HMG Pl [A] Para Enq Pl [A] Gldr Spd Co[G) Glider Co[G] Glider Pl [G] Gldr Mor Pl [G] Gldr HMG Pl [G] Gldr Enq Pl [G] Para Pl -[A] Rifle Platoon A Mot Recce Co Mot-Inf Platoon Rifle Platoon C Rifle Platoon E Infantry Co A+ Infantry Co B+ Infantry Co C+ Infantry Co D+ Infantry Co E+ Infantry Co F+ Infantry Co A Infantry Co B Infantry Co C Infantry Co D Infantry Co E Infantry Co F Infantry Co G Infantry Co H Rifle Platoon D Rifle Platoon B Para Pl - Paratroop Co Para Platoon Para Special Co Para HMG Pl Imp Guards Co Imp Guards Pl SNLF Company SNLF Company - SNLF Platoon Mountain Pl Mountain Co Ski Company Ski Platoon Militia Company Militia Platoon Patrol Mot Patrol Sec Mntd Patrol Sec Mot Scout Sec Scouts Mntd Scout Sec Mountain Scouts Imp Gds Scouts SNLF Scouts Ski Scouts Sniper Sniper Group SNLF Sniper Mountain Sniper Inf-AT Section Special Atk Det Engineer Pl Para Eng Pl Imp Gds Eng Pl SNLF Eng Pl Machinegun Sec Machinegun Pl Bn HMG Co Regt HMG Co Bn HMG Co - Regt HMG Co - Heavy Wpn Pl A Heavy Wpn Pl B Heavy Wpn Pl C Para Mortar Pl AAMG Section You can now get a much more closer approximation to reality than with a simple "auto convert" -- more work for you in figuring out what the new scenario OOB should be, but in return getting a much more improved scenario -- a "Gold" scenario, so to speak. Once you've bought your formations, save the game as slot 999. Copy that savegame file over into the conversion tool folder. IMPORTANT NOTE: The current version of SPCAMO slicer forms a file list of the files in it's directory, and picks the first one with the string "_VLOCs.csv" in it's list -- so if you have two scenario dumps in the tool directory, only the alphabetically first CSV file will be used by SPCAMO slicer for VLOC automatic editing. Run "SPCAMO Slicer.exe" It's currently hardcoded to load "spWW2scn0999.dat", in this initial release. It'll spit out a bunch of debug information: Quote:
NOTE: Currently, I have no idea how to program it so that it displays section 48's offset correctly, but that's for another day. It will then display more debug information. Quote:
S1_COMP_ORIGINAL.BIN S1_UNCOMPRESSED.BIN S17_COMP_ORIGINAL S17_UNCOMPRESSED.BIN S37_COMP_ORIGINAL.BIN S37_UNCOMPRESSED.BIN The original compressed versions are for debug purposes. It'll then tell you it's found the VLOC.csv file: Quote:
Quote:
It will then reassemble everything via inserting the edited sections (sections 17 and 32 currently) into the original scenario file. Because of the way Python handles file input; I basically have to reassemble the file from scratch from: File Data Before Segment Edited Segment File Data After Segment And repeat it so on. The newly edited file will be named "spWW2scn0998.dat" It will be like 892 kB (versus about 320 kB for the original file). This is because I inserted uncompressed sections into the file via changing the header flags. But don't worry! Simply copy "spWW2scn0998.dat" over to your SPCAMO scenario folder and load it up in WW2/MBT's Scenario editor. Change a few things, like move a unit 1 hex away; change the facing, etc and then save it as normal in the scenario editor. When you check the newly saved file, it'll be back to a "normal" file size as the built in game compression re-compresses it for us, with no work needed on our end. |
Re: Blitzkrieg Banzai? (SP1 Conversion)
Quote:
C0 SO Rifle Sqd Passenger - B9: T-34/76c at Location 82-10 |
Re: Blitzkrieg Banzai? (SP1 Conversion)
73.8 MB ZIP
Current version of the SP1 Conversion tools. Still includes the full scenarios for SP1; so unpacked size is 946 MB (!!!) :eek: I'll work on figuring out a way to work with ZIP files so that the next release isn't so massively huge on disk space. (Plus, I need to do that so that it doesn't break when I add the SP2 stuff). |
Re: Blitzkrieg Banzai? (SP1 Conversion)
So it looks like:
Stock SSI SP2 Scenarios are uncompressed at 689kb. SP2 Scenarios saved with the in-game editor have their compression turned "on" and are arranged like "SPCAMO" scenarios and I can use some of what I created to edit SPCAMO scenarios there. Given that the original concept was for SP2 to be run with a disc in the CDROM Drive (to show movies and to act as copy protection); and given the original requirements: 486 DX/2 66 MHz 8 MB RAM + 1 MB SVGA Card 2x CDROM Speed (330 kb/sec) They possibly ran some tests with computers using the original Steel Panthers I requirements (486 DX 33 MHz) to see how well it would run on the older hardware and figured out that having the game read uncompressed scenarios from the CDROM drive was faster than trying to have the slower PC decompress scenario files. They probably figured from an "emotional" perspective, people would tolerate slower load times for save games or user created scenarios on older hardware. |
All times are GMT -4. The time now is 09:30 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.