SSTS04.txt

"Sudden Strike Technical Specifications"
NO warranties. NOT fully tested. Use at your OWN risk.
*********************************************

Some values/infos/problems/hints found during tests ...
If you find any mistake/feature, please, you can be the author, too ...

Authors: FH, Rumblefish, ...

--------------------------------------------------------------------------------------
General info about special preprocessor files - with the extension ".pre":

Format of the preprocessor files can be changed "on the fly" anytime - don't rely on them...
If the preprocessor file ".pre" format has been changed from the previous version - then export your new correctly formatted ".pre" files from your old generated "compiled.mis" or "compiled.map" file !

Almost all preprocessor files ".pre" can be used with 0 (zero) filesize during import, but if the preprocessor file has any internal structure (for example "phrases.pre"), it is better to left keywords in place and clear only the definable content...
Don't forget, some parts depend on others - for example, if the "phrases.pre" doesn't include any real phrase, but any script call any phrase, then SuSt will crash!

---------------------------------------------------------------------------------
"locations.pre"
Location events: (various combinations with 'scripts')
1 - show 'Mines' warning & go to the location
4 - calling/deploying support (code '115')
9 - go to the location
25 - deploy support (code '98') & go to the location
& others ...

These events were found in "playable demo"! Don't try them with the "pre-alpha self running" (other scripts) ...

----------------------------------------------------------------------------------
"mines.pre"
Mine types (the point of view = friendly units):
1 - invisible (visible to the foe)
2 - visible, no explosion (only marking?)
3 - visible (invisible to the foe)
4 - nothing
5 - invisible (visible to the foe)
6 - visible, no explosion (only marking?)
7 - visible (invisible to the foe)
8 - nothing
& so on ... 
(It looks, that CDV uses '3' for friendly & '5' for foe mines in both demos...)

---------------------------------------------------------------------------------------
"support.pre"
If You define any of the following types of units ("machine" or "szenit" - these means units: "dmino", "machine" or "rzenit") in support group, then in this group NO tank units (fully tracked) and NO above mentioned "light artillery/support" units will be deployed on map...
Other types of units will be deployed OK (including heavy and antitank artillery and halftracks).
Maybe - some settings in 'groups', but I have no time to discover this in detail ...

"mapunits.pre", "support.pre" common warning about "In=":
If value for option "In=2" (the number of crew), but follows only 1 row of crew type, then "MG" will CRASH.
"MG" is not checking the number of "defined" and "delivered" crew members - it's up to you anyway...

'pre-alpha demo' map (size: 256x256): U,V limits = <0 - 8191>, use only <? - ?>
'playable demo' map (size: 128x128): U,V limits = <0 - 4095>, use only <? - ?>

-----------------------------------------------------------------------------------------
"players.pre"
Example of part of "players.pre" file with notes about format (in braces - ! do not insert braces with numbers into real "players.pre" file - this is shown only for demonstrational purposes !) - please, modify only numbers/strings after equal sign:
.................
Player 0			[not used]
 name="German Force"	[32 bytes total]
 team=0			[1 byte]
 nation=1			[1 byte]
 color=0 252 80		[2 or 3 bytes - not used? - let it be, see NoteColor]
 bomb
  ID=d_bomber		[32 bytes total]
  Number=1		[4 bytes]
  Bombs=1		[4 bytes]
  Reload=0		[4 bytes]
 spy
  ID=d_rama		[32 bytes total]
  Number=1		[4 bytes]
  Bombs=1		[4 bytes]
  Reload=1		[4 bytes]
 transport
  ID=d_bomber		[32 bytes total]
  Number=1		[4 bytes]
  Bombs=1		[4 bytes]
  Reload=1		[4 bytes]
 descent
  group=0		[1 byte]
  expa=0			[1 byte]
  ID 0=doficer		[16 bytes total]
  number 0=3		[1 byte]
  ID 1=dmgun		[16 bytes total]
  number 1=8		[1 byte]
  ID 2=faus		[16 bytes total]
  number 2=8		[1 byte]
  ID 3=d_flamer		[16 bytes total]
  number 3=5		[1 byte]
 planesdir=5		[1 byte]
.................

Attention:  "pre-alpha self running demo" does not have "planesdir" !

Numbers:
1 byte - max = 255 (?)
4 bytes - max = 999 (? if SuSt supports up to 1000 units on a map ? Don't try big numbers !)

NoteColor:
In original "compiled.mis" 2 bytes were found only (3 bytes are theoretically needed?) with other values.
Maybe, "color" is not used in this demo?
Values of 2 bytes from original (now renamed) "compiled.org" are "hardcoded" into every new generated "compiled.mis".

----------------------------------------------------------------------------------------------
"phrases.pre"
This file 'phrases.pre' is used as preprocessor file for MG - in its editable format you can easy change phrases, which are displayed by SuSt playable demo...
If field 'text' includes any message, please surround the complete string with '"' (double quotes).
In one phrase block You can define content of 4 (maximum) lines of text.
Line of text cannot exceed maximum of 64 characters!
The signal line (max 64 chars) have to be included in phrase block!
Original CDV's file 'phrases' allocates space for 100 phrase blocks.

--------------------------------------------------------------------------------------------
Comparing new "compiled.mis" and original "compiled.org" - example for CDV's "playable" demo:

>comp compiled.mis compiled.org
Comparing compiled.mis and compiled.org...
Compare error at OFFSET 18FC
file1 = 61
file2 = 75
Compare more files (Y/N) ? n

As you can see - one problem was found. This is OK...

In the original CDV compiled mission file in the part "players" one string was overwritten by developers with other string (zero-ended), but their sizes differs - the later was 2 chars shorter - so you can see last visible char from the old string (zero ending string follows).
The old string was: "r_kuru"
The new one is: "a_26"
Don't forget, that string is ended with zero (0x00), therefore you can find in the original at {0x18F7} sequence:
"a_26 u" [61 5F 32 36 00 75].

In MG the memory structure is pre-filled with 0x00s, but every old string is overwritten by new one (zero ended) ...
The old string was: "d_rama"
The new one is: "a_26"
Look into "compiled.mis" at {0x18F7} sequence:
"a_26 a" [61 5F 32 36 00 61].
--------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------
The "playable demo" bridge coordinates - if you want to destroy the bridge with mines ...
M=18 N=86
M=18 N=87
M=19 N=86
M=19 N=87
M=20 N=86
M=20 N=87
M=21 N=86
M=21 N=87
M=22 N=86
M=22 N=87
M=23 N=86
M=23 N=87
M=24 N=86
M=24 N=87
M=25 N=86
M=25 N=87
M=26 N=86
M=26 N=87
M=27 N=86
M=27 N=87
--------------------------------------------------------------------------------------------
Engineers can repair a damaged bridge (wooden or iron), but they stop to work just a moment before the bridge is absolutely OK - only infantry can passthru, but not vehicles ...
Stone bridges can be repaired 100% (vehicles can passthru too)!

-----------------------------------------------------------------------------------------------------------------
Warning!
If you want to use the exported parts of the "compiled.map" from the "pre-alpha self running" demo (size:256*256) to generate map for the "playable" demo, don't forget that some things maybe has been changed/broken in the game resources!
Following source definition files looks OK:
- flags.pre
- mini2.pre (mini1.pre is not used, can have 0 filesize)
- rhombs.pre (visible are missing "rivers", "roads", ... mainly defined as "objects")

!But the file "objects.pre" includes any wrong object definition or parameter!

If you use this "objects.pre" then SuSt "playable" demo will auto-quit!
It is necessary to find which object(s) used in "pre-alpha self running" demo are not useable in the "playable" demo...

! This object can be the problem:
Ob=10 in the trees group (ObG=4) in the original "playable" demo resources is BROKEN!
Exchange this Ob=10 with any other tree...

------------------------------------------------------------------------------------------------------------------
******************************************
"playable-demo", "compiled.map", used "objects":
******************************************
------------------------------------------------------------------
ObG=2
Ob=0,1,2,4,7,8,10
------------------------------------------------------------------
ObG=3
Ob=19,24,57,65,66,69,70,72,76,77,80,82,84,85,86
------------------------------------------------------------------
ObG=4
Ob=1,2,3,4,5,9,11,12,13,17,18,19,20,21,25,26,27,28,29,33,34,35,37,40,41,42,43,44,48,49,50,51,52,56,57,58,59,60
------------------------------------------------------------------
ObG=5
Ob=15,56,58,60,61,62,63,64,65,66,68,69,70,117,118,120,122,123,124,125,126,127
------------------------------------------------------------------
ObG=6
Ob=1,16,26,27,28,35,36,37,40
------------------------------------------------------------------
ObG=7
Ob=0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27,28,29,30,31,65,80,81,82,83,104,105
------------------------------------------------------------------
ObG=8
Ob=38,39,41,46,49
------------------------------------------------------------------
ObG=9
Ob=0,8,9,16,17,24,32,33
------------------------------------------------------------------
ObG=10
Ob=5,8
------------------------------------------------------------------
*****************************************************
"pre-alpha self running demo", "compiled.map", used "objects":
*****************************************************
------------------------------------------------------------------
ObG=1
Ob=0,2,3,5,8,10,11,12,13,19,20,22,23,26,27,28,29,30,31,34,35
------------------------------------------------------------------
ObG=2
Ob=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17
------------------------------------------------------------------
ObG=3
Ob=5,13,14,15,21,31,37,45,47,53,61,63,65,66,67,68,69,70,71,74,75,76,96,104,105,112
------------------------------------------------------------------
ObG=4
Ob=0,2,3,4,5,8,9,10,11,12,13,16,17,18,19,20,21,24,25,26,27,28,29,32,34,35,36,37,40,43,44,49,50,51,52,57,58,59,60
------------------------------------------------------------------
ObG=5
Ob=0,5,6,10,12,15,22,33,35,52,53,58,64,65,66,67,68,73,75,76,77,78,79,82,83,84,85,86,87,88,89,100,102,103,104,109,110,111,112,113,114,115,116,117,118,121,122,123,124
------------------------------------------------------------------
ObG=6
Ob=0,1,2,3,5,7,10,11,14,15,16,17,18,19,20,21,22,23,24,32,33,35,36,38
------------------------------------------------------------------
ObG=7
Ob=0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27,28,29,30,31,40,41,42,43,44,46,47,64,65,66,72,73,74,80,81,82,83,84,85,86,87,104,105,112,113
------------------------------------------------------------------
ObG=8
Ob=0,1,2,3,4,5,6,8,9,11,13,14,15,17,18,19,24,25,26,28,29,30,31,32,34,35,37,38,39,40,48,49,50,69,75,78,82,83,84,85,86,88
------------------------------------------------------------------
ObG=9
Ob=0,1,8,9,16,17,24,25,32,33
------------------------------------------------------------------
ObG=10
Ob=0,1,24,26,27
------------------------------------------------------------------
****************************************************************************
Attention!
It looks - not all numbers (in sequential row) are used for "Ob" numbering - some gaps exist...
****************************************************************************
-------------------------------------------------------------------------------------------------------------------------
"rhombs.pre"
Background map cells graphics.

If no "rhombs" are defined, then repeating uniform pattern is used...

-------------------------------------------------------------------------------------------------------------------------
"flags.pre"
Map cells properties.

-------------------------------------------------------------------------------------------------------------------------
"mini1.pre"
Minimap graphics (for map size 128*128).

For map size 256*256 it can have 0 filesize, but is used (have to be ready) for generating "compiled.map"...

-------------------------------------------------------------------------------------------------------------------------
"mini2.pre"
Minimap graphics (for map size 256*256).
Limits for M, N are only <0 - 127>, because the minimap rhomb is more scaled down...

For map size 128*128 it can have 0 filesize, but is used (have to be ready) for generating "compiled.map"...

-------------------------------------------------------------------------------------------------------------------------
"objects.pre"
Map objects (object can be positioned on the map and some can be destroyed too...)

Warning: Original CDV's format of the "objects.pre": lines are sorted by coordinate "V" & "U" (by "M" & "N" in map system) !
Try to export "objects.pre" from the original CDV's playable demo "compiled.map" and check this sorting...
Only this original "sorted" format is supported during "ROF export mode" !

-------------------------------------------------------------------------------------------------------------------------
"rof.ini"
Editable "ini" file for SSG in "ROF export" mode - can be used for temporary eliminating of the content of the editable "rof.pre" file...
ROF (for MAP mode only) means that "rhombs", "objects" and "flags" are all in one file "rof.pre".
Format of the "rof.ini" - max. 1024 lines, every line with max. 64 chars (string in double-quotes).

In this "ini" file you can set many text masks.
If this text mask (exact match, case sensitive) is found inside any line exported from "rof.out", then this line is NOT written into "rof.pre", but into a special temporary file "rof.ext", where resides during "rof.pre" editing...
When the "rof.pre" file si imported back into the "rof.in", then the lines from "rof.ext" are inserted in the correct order (I hope...) into "rof.in" too...

Examples of 2 lines (keyword 'text', equal sign and double quotes are necessary for correct string content recognition):
text="M=0   N=1   Rh=21  RhG=129"
text="Rh=19  RhG=129"

The file "rof.ini" can be empty too (0 filesize) - the eliminating from "rof.pre" will not be activated...

--------------------------------------------------------------------------------------------------------------------------
"scripts.pre"
This file adds AI to units, locations, time events...

The number of scripts in "scripts.pre" can be changed (and will be imported into mission) - follow the format of the "scripts.pre" and the description of scripts made by "Optus" ...

---------------------------------------------------------------------------------------------------------------------------------
(G)AWK
Interesting utility for text file processing (well-known to *N*X people) - some DOS/Win ports exists (CygWin, GNU gawk)...

The format of any editable preprocessor text ".pre" file can be modified before/after editing with "awk" or "gawk"...
This can be usefull, if you prefer more user-friendly look of any data in files, if you want to count any items in files, make any special selection, export, checking...
It can be very helpfull, if you need to analyze the content of any BIG preprocessor file!
"gawk" program source files can be easily shared between developers too - without distributing any *.EXE files...

------------------------------------------------------------------------------------------------------------------------------------
"units.pre"
Editable list of unit-IDs in the following format:
- one unit-ID on one line
- max. number of unit-IDs: 256
- max. length of one unit-ID: 16 (?)
- use lowercase, please
- don't use any foreign characters, please (only basic english alpha-numerics)

Warning: this file is very important for many parts of the SSG!
If you don't know all the necessary things about units definitions - don't change this file!

------------------------------------------------------------------------------------------------------------------------------------
"mapsize.pre"
Editable list of mapsides sizes...

The map have to be the RHOMB type, not RHOMBOID...
For the latest SSG releases are the following map limits set to <16 - 512>:
- min = 16
- max = 512

Coordinates:
Native grid for many preprocessor files has another cell dimension/resolution than that one used for deploying units and objects (U, V)!
This grid is determined mainly by the map size: 256*256 or 128*128 (other map sizes are not known in any published CDV example, therefore they are not generally supported - but they can be created very easily, if the correct file "mapsize.pre" is used !).

To be clear that the resolution is different, labels "M, N" have been used...

Map size 256*256: M, N limits = <0 - 255>, visible <4 - 251>
Map size 128*128: M, N limits = <0 - 127>, visible <4 - 123>

There is for every map size (not only 128 or 256) invisible border 4 units wide implemented ...

General cross-references:
U = N * 32
V = M * 32

------------------------------------------------------------------------------------------------------------------------------------
Sounds for "sounds.pre" & "phrases.pre"
For people, who didn't found in the game resources the file "Sounds.hdr" - a list of mentioned sounds (only some of them are OK!):
$signal, $signal_alert, $signal_goodnews, $signal_morse
ack_deu, ack_rus, ack_ally, accept, push, pull, switch, mult
@informburo, @bark, @birds, @live, @cricket, @forest, @evil, @river, @sea, @gull, @marsh, @strana, @tree (prefix @ means sound designed for "looping" - usefull for "sounds.pre")
mouse_click, bridge, air_explosion, flew, standart_explosion, building, solid, little_boom, water_explosion, tree, hedge, step, step_finish, rocket_launch, katya, reloading, mine, mortar, & many/many others...

------------------------------------------------------------------------------------------------------------------------------------