[REF] Modding Technical Hints

Panzer / Allied General Remake: Strategies, Tactics, Efiles, Custom Campaigns, Customizations, Documentation.

Moderator: Radoye

Post Reply
HexCode
Corporal
Corporal
Posts: 205
Joined: 2019-09-30 18:54, Monday

[REF] Modding Technical Hints

Post by HexCode » 2019-10-21 18:11, Monday

CONTENT LINKS
==============

Introduction
viewtopic.php?f=95&t=189#p828

Filename Neatness
viewtopic.php?f=95&t=189#p829

Tab-Separated Unicode Text Files
viewtopic.php?f=95&t=189#p872

Engine Hexadecimal Character Strings
viewtopic.php?f=95&t=189#p976

Unit Class Purchase Accessibility
viewtopic.php?f=95&t=189#p1314

Unit Icon Orientation
viewtopic.php?f=95&t=189#p1407

Creative "Containers"
viewtopic.php?f=95&t=189#p2246


===================================================================

INTRODUCTION
==============

This topic should be of potential interest to modders. Depending on the particular subject, "light" modders may or may not be particularly interested. By the way, for purely technical reasons, some references to PG1-DOS will be unavoidable.
Last edited by HexCode on 2019-12-17 19:53, Tuesday, edited 8 times in total.

HexCode
Corporal
Corporal
Posts: 205
Joined: 2019-09-30 18:54, Monday

FILENAME NEATNESS

Post by HexCode » 2019-10-21 18:26, Monday

FILENAME NEATNESS
==================

This post is about a couple of hints that may help readers better organize their PGF scenario / campaign definition files.

Anyone who takes a cursory look at the contents of the \SCENARIO sub-folder will be served with a visual... mess of sorts ! Specifically:

1) xxx.PGSCN files are rather well... behaved. "xxx" usefully and efficiently stands for a 3-digit descriptor sporting leading zeroes as well. Thus "xxx" may span all integers in the range "000" to "999" inclusive (yes, 000.PGSCN is quite acceptable). One thousand (1,000) scenario definition slots should be quite adequate, I should think...

2) Companion files MAPxx.SET and MAPxx.STM hark back to the days of PG1-DOS. Fortunately, PGF has not hard-coded this precise format. Thus, renaming such files to MAPxxx.SET and MAPxxx.STM so as to match the indexing of the companion xxx.PGSCN file is a very good idea provided one:

a) Appropriately updates the "SET file" designation in the xxx.PGSCN file.

b) Appropriately updates the name of the companion MAPxxx.STM file by ever so lightly hex editing the MAPxxx.SET file, starting at decimal offset 048.

Incidentally, the suggested procedure under point (b) goes back to the days of PG1-DOS. Many, many years ago it was discovered and conclusively demonstrated that only the format of MAPxx.SET was hardcoded. To this effect, the companion *.STM file was defined within MAPxx.SET. Well, this "tradition" has been heeded to and emulated by PGF as well. This is the reason why the AG \SCENARIO sub-folder contains files with such wonderfully descriptive names as MOSCOW.STM and OVERLORD.STM...

3) In my opinion, xxxx.PGBRF files are quite... dysfunctional. They are all over the place ! Luckily, the format Xxxx.PGBRF seems to be a life saver. "X" stands for any capital letter (Z is such an obvious choice). "xxx" can span all (leading zero) integers in the range "000" to "999" inclusive (yes, Z000.PGBRF is quite acceptable). One thousand (1,000) campaign briefing slots should be more than adequate, I should think... Thus:

a) The campaign definition file PG.PGCAM is perfectly happy to accommodate the suggested format.

b) All briefing files will be neatly presentable at the very end of the \SCENARIO sub-folder file listing, no longer cluttering the... landscape !

HexCode
Corporal
Corporal
Posts: 205
Joined: 2019-09-30 18:54, Monday

TAB-SEPARATED UNICODE TEXT FILES

Post by HexCode » 2019-10-22 23:16, Tuesday

TAB-SEPARATED UNICODE TEXT FILES
=================================

Introductory Documentation

Here's a somewhat modified version of what PGF's Developer had to say on the subject:
PGF uses a number of different external support data files: Equipment Spec File (EQUIPMENT.PGEQP), Campaign Definition File (PG.PGCAM) and Scenario Parameters Files (xxx.PGSCN) ... Although PGF's external support data files are diverse in substance, they all use the same data organization scheme: they are Tab-Separated Unicode Text Files.

a) Each such file contains a number of tables separated by one or more empty lines.

b) All columns in a table are separated by a single tab character. Multiple tabs, spaces or any other delimiters are not supported.

c) Lines starting with the character # are treated as comments and are completely ignored by the program. Often, the comments are used to provide identifier labels for the columns in the tables.

d) The files use UTF-16 encoding. Among other things, this allows for easy language localization of the information contained in the game's external support data files.

Since the above files are "plain text", they can be edited in any text editor, including MS-Notepad. However, a better way to work with such files is to open them in MS-Excel. MS-Excel understands tab delimiters and presents the file contents in a visually convenient tabular format. While working with such a file in MS-Excel, one can change the widths of any columns at will - this, per se, will not affect the file in any adverse way, when ultimately saved.

Please keep in mind that empty lines are very important: they specify where a table ends and the next one begins. So, do not remove empty lines or insert new empty lines where they were not there before. If one does so, chances are that he may render the whole file unreadable !
Typical... Headaches

Typical Headache #1 ==>
Help please ! My desktop crashed so now I'm using my laptop to play PGF. I've been unable to find my MS-Office disk. I've tried to use the spreadsheet functions in MS-Works and Open Office to modify PGF's Equipment File. For whatever reason neither seems to work. Open Office allows me to save the file with the correct file name and extension but, once saved, PGF doesn't "see" the file. Any suggestions ?
Typical Headache #2 ==>
There's a problem with spreadsheet programs adding quotation marks here and there ... PGF ignores quotation marks; consequently, a reference such as 3" (Gun) is displayed as 3 (Gun).
Headache... Remedies

For Typical Headache #1, the following "medication" has proven quite effective:

Make sure the modified PGF Efile is saved with UNICODE encoding - otherwise it won't work ! I sometimes forget to do it when I edit PGF's Efiles and then I get crashes when I try to run the game (just like you do). To repeat, all you need is to re-save the file selecting the UNICODE encoding option and it will work !

For Typical Headache #2, the following "medication" has proven quite effective:

Don't expect perfection out of automatism. Once any heavy duty modifications are in place, just use MS-Notepad or MS-Wordpad to effect a light edit of undesired present or desired absent quotation marks !

Caveats

1) Not every spreadsheet program version is capable of saving text files with UTF-16 encoding. Even somewhat dated MS-Excel versions can't do that !

2) UTF-8 encoding just will not do. It has to be UTF-16 encoding !

3) More precisely, UNICODE has to be UTF-16LE TSV (i.e., Little Endian Tab Separated Version) and not CSV (i.e., Comma Separated Version). The text file's first two bytes always show as hexadecimal "FF FE". Moreover, the file sports Windows-style "carriage returns / line feeds" (CR/LF).

Hints

A) To create a UTF-16LE TSV text file from scratch, just run a relatively recent version of MS-Notepad and save the file with Encoding: UNICODE. This will automatically generate the appropriate Unicode byte signature. To add data, use the TAB key to insert tabs (column separators) and the ENTER key to end a line (insert "carriage return-line feed" pair). After one adds a couple of lines in MS-Notepad, the rest can be done in a capable spreadsheet program like some relatively recent version of MS-Excel.

B) Sometimes, it's easier to use an original PGF external support data file as a template / shell. To this effect, one can use a capable text editor to paste spreadsheet tab-separated data into the template file and save the latter.

Additional Commentary

MS-Notepad

For editing purposes, I still use MS-WIN XP. When I open a PGF *.PGSCN file, the file's contents are displayed in all their glory. If I, then, turn around and attempt to invoke the "Save As" dialog box, the "Encoding" option displayed at the very bottom of the dialog box which is automatically chosen for the file is "Unicode".

Now, my Notepad version gives me 4 "Encoding" choices:

"ANSI"
"Unicode"
"Unicode big endian"
"UTF-8"

CRITICAL CLARIFICATION : When Microsoft tells me "Unicode", they actually mean "UNICODE: UTF-16LE TSV (i.e., Little Endian Tab Separated Version)"... By the way, the Notepad version that's native to MS-Windows 10 explicitly lists a UTF-16 LE encoding option.

Spreadsheets

Technical realities here can be a bit challenging...

With respect to MS-Office Excel versions, the "big picture" appears to be like this: No version later than 2011 allows the user to choose some specific encoding option... Presumably, all such spreadsheets assume that the encoding is and, in any case, should be, UTF-16LE...

With respect to OpenOffice Calc versions, encoding designations such as "Unicode" and / or UTF-16 aren't UTF-16LE. Rather,they are UTF-16BE (Big Endian). Calc does preserve PGF's UTF-16LE encoding but, for some reason, "normalizes" row length by inserting a bunch of trailing tabs at the row's end... For example, If one row is 9 cells long and all other rows 5 cells long, Calc makes all rows 9 cells long. Every row in the file will have the same length - that of the longest row. When this happens, PGF's engine is unable to properly "read" such a "padded" file and crashes. The extra tabs must be manually removed. Files where all rows have the same length (e.g., EQUIPMENT.PGEQP) are treated rather kindly by Calc.
Last edited by HexCode on 2019-12-15 00:50, Sunday, edited 1 time in total.

HexCode
Corporal
Corporal
Posts: 205
Joined: 2019-09-30 18:54, Monday

ENGINE HEXADECIMAL CHARACTER STRINGS

Post by HexCode » 2019-10-27 18:38, Sunday

ENGINE HEXADECIMAL CHARACTER STRINGS
======================================

Any "advanced" modders curious to "look inside" and, possibly, modify PGF's engine need to know a couple of technical things.

PGF's engine contains a plethora of character strings. A 2-byte "widestring" consists of two consecutive bytes (16-bit format). 2-byte "widestrings" (UTF-16, technically) constitute the native string format of fairly recent vintage MS-Windows OS's. Consequently, such "widestrings" are all around the place...

UTF-16 is a character encoding of the Unicode character set. In UTF-16, each Unicode character is represented by one or (occasionally) two 16-bit “code units” (by comparison, a byte is an 8-bit “code unit”).

By the way, the NULL character in this encoding is represented by a 16-bit "code unit" in which all of the bits are set to 0 ("00 00").

A UTF-16 character string consists of a sequence of 16-bit "code units" and it is a convention of many programming languages that the NULL character marks the end of a character string buffer. In these programming languages, the appearance of a 16-bit NULL will cause the character string to terminate and be defined as such.

To illustrate matters, consider the character string "air". Inside PGF's engine, the very same character string would appear as

61 00 69 00 72 00 00 00

and be defined as such due to the "terminating" 16-bit NULL character.

HexCode
Corporal
Corporal
Posts: 205
Joined: 2019-09-30 18:54, Monday

UNIT CLASS PURCHASE ACCESSIBILITY

Post by HexCode » 2019-11-08 17:55, Friday

UNIT CLASS PURCHASE ACCESSIBILITY
=================================

"Classic" Content

Those hobbyists who never venture into scenario territory other than SSI's PG1 / AG stock one (i.e., SSI's 38 plus 39 original scenarios adapted for play under PGF) are always greeted by a truncated list of unit classes that can be purchased via PGF's New Unit Purchase (NUP) Screen (invoked by clicking the button depicting a dollar sign).

Given a particular SSI-vintage scenario, the following typical section embedded in the relevant scenario definition file xxx.PGSCN (residing in the \SCENARIO\ sub-folder), among other things, "instructs" PGF's User Interface (UI) to visually activate (literally, give the green light) on the NUP Screen those unit classes (decimal format identifiers) which sport "1" (Boolean) designations right next to them and only those:

Code: Select all

# Purchasable classes
# Class   Can Purchase
    0           1
    1           1
    2           1
    3           1
    4           1
    5           1
    6           1
    8           1
    9           1
    10          1
    15          1 
Unit classes 7, 11, 12, 13, 14, 16 and 17 are nowhere to be found in the preceding xxx.PGSCN section. The program interprets this... glaring absence as a "0" (Boolean) designation and keeps such unit classes in a dormant (i.e., inaccessible) state when it comes to effecting NUPs throughout the scenario's duration.

Wanting More...

Some modders may wish to visually activate even more unit classes on the NUP Screen. The logical, straightforward thing to do is, of course, to vertically expand the foregoing xxx.PGSCN section by adding entries identifying the unit classes that a modder may wish to visually activate as well, among other things. Not surprisingly, a typical such entry would comprise the relevant decimal format identifier of the unit class featuring an "1" (Boolean) designation right next to it. For example:

11 1

among other things, "instructs" PGF's UI to visually activate the Submarine unit class on the NUP Screen.

The List Is Too Long

Unfortunately, PGF's (stock) UI can't fully handle the visuals triggered by an "instruction" to activate the full unit class set. The culprit here is none other than the file PURCHASE.HTM residing in the \UI\ sub-folder.

Ok, Then, Just Replace

The following is the suggested HTML code replacement of the contents of PURCHASE.HTM that should do the trick by introducing a scroll list:

Code: Select all

<html.dialog style="overflow:hidden">
<link rel="stylesheet" type="text/css" href="axis.css">

<body.dialog style="font-family: tahoma; color: @BUTTON_TEXT_COLOR; overflow:hidden">
<div style="left:1#; top:1#; bottom:2#; width: 130px; overflow:hidden">
<div id="Header">
<img src="purchase_header.png" />
</div>

<div>

<table style="position:relative; top: 3px;">
<tr><td.pgbtn2 id="cmd_ok" disabled>
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR" id="PurchaseText">PURCHASE</div><div style="position: relative; bottom: 13px" id="PurchaseText">PURCHASE</div>
</td></tr>
<tr><td.pgbtn2 id="cmd_cancel">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">EXIT</div><div style="position: relative; bottom: 13px">EXIT</div>
</td></tr>
</table>
</div>

<div style="margin-top: 10px; position: relative; height: 14px; overflow: hidden" id="FlagList">
<table>
<tr id="Tr1">
<td.flagbtn type="radio" name="flag"><img.flagbtn_int src="flag01.png" /></td>
<td.flagbtn type="radio" name="flag"><img.flagbtn_int src="flag02.png" /></td>
<td.flagbtn type="radio" name="flag"><img.flagbtn_int src="flag03.png" /></td>
<td.flagbtn type="radio" name="flag"><img.flagbtn_int src="flag04.png" /></td>
<td.flagbtn type="radio" name="flag"><img.flagbtn_int src="flag05.png" /></td>
</tr>
</table>
</div>

<div style="height: 388px; overflow: auto">
<table style="margin-top: 10px" id="ClassList">
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass0">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Infantry</div><div style="position: relative; bottom: 13px">Infantry</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass1">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Tank</div><div style="position: relative; bottom: 13px">Tank</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass2">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Recon</div><div style="position: relative; bottom: 13px">Recon</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass3">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Anti-Tank</div><div style="position: relative; bottom: 13px">Anti-Tank</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass4">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Artillery</div><div style="position: relative; bottom: 13px">Artillery</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass5">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Anti-Aircraft</div><div style="position: relative; bottom: 13px">Anti-Aircraft</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass6">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Air Defense</div><div style="position: relative; bottom: 13px">Air Defense</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass7">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Structure</div><div style="position: relative; bottom: 13px">Structure</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass8">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Fighter</div><div style="position: relative; bottom: 13px">Fighter</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass9">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Tac Bomber</div><div style="position: relative; bottom: 13px">Tac Bomber</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass10">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Level Bomber</div><div style="position: relative; bottom: 13px">Level Bomber</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass11">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Submarine</div><div style="position: relative; bottom: 13px">Submarine</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass12">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Destroyer</div><div style="position: relative; bottom: 13px">Destroyer</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass13">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Capital Ship</div><div style="position: relative; bottom: 13px">Capital Ship</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass14">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Air Carrier</div><div style="position: relative; bottom: 13px">Air Carrier</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass15">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Ground Xport</div><div style="position: relative; bottom: 13px">Ground Xport</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass16">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Air Xport</div><div style="position: relative; bottom: 13px">Air Xport</div>
</td></tr>
<tr><td.pgbtn2 type="radio" style="behavior: radio;" name="unitclass" id="unitclass17">
    <div style="color: @BUTTON_ETCHED_TEXT_COLOR">Naval Xport</div><div style="position: relative; bottom: 13px">Naval Xport</div>
</td></tr>
</table>
</div>

<div style="height: 100%%"/>
</div>

<div.sunken class="background" style="left:2#; top:1#; height:100%%; width: 100%%">
<widget.typelist type="select" id="UnitList">
</widget>
</div>

<div.sunken class="background" style="left:2#; top:2#; height:127; width: 100%%">
<widget.typelist type="select" id="TransportList">
</widget>
</div>

<div style="left:3#; top:1#; bottom:2#; height:100%%; width: 170; overflow: hidden">
<div style="text-align: center">
<img src="purchase_panel.png" />
<div style="margin-left: 20px; position: relative; top: -76px">Prestige: <span id="Prestige">99999</span></div>
<div style="position: relative; top: -63px">
<p style="margin:-2; padding:0">UNITS AVAILABLE</p>
<table><tr>
<td align=left>Core: <span id="CoreUnits">999</span></td>
<td style="width: 5px;"></td>
<td align=right>Auxiliary: <span id="AuxUnits">999</span></td>
</tr></table>
</div>
<div style="position: relative; top: -53px">Total cost: <span id="TotalCost">0</span></div>
</div>

<div style="color: @TEXT_COLOR; text-align:center; font-family: Arial; position: relative; top: -30px" id="UnitStats">

<div class="background" id="UnitBlock">
<p id="UnitType">Wehr Inf</p>

<table cellspacing=-1 cellpadding=0>
<tr>
<td>
<table cellspacing=-1 cellpadding=0>
<tr><td align=right style="width: 63px">Cost</td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td align=right>Max Ammo</td></tr>
<tr><td align=right>Max Fuel</td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td align=right>Movement</td></tr>
<tr><td align=right>Spotting</td></tr>
<tr><td align=right>Range</td></tr>
<tr><td align=right>Initiative</td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td align=right>Soft Attack</td></tr>
<tr><td align=right>Hard Attack</td></tr>
<tr><td align=right>Air Attack</td></tr>
<tr><td align=right>Naval Attack</td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td align=right>Ground Def</td></tr>
<tr><td align=right>Air Def</td></tr>
<tr><td align=right><span id="UnitCloseDefName">Close</span> Def</td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td align=right>Target Type</td></tr>
</table>
</td>
<td>
<table style="height: 100%%" cellspacing=-1 cellpadding=0>
<tr><td id="UnitCost" align=center style="width: 70px"></td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td id="UnitMaxAmmo" align=center></td></tr>
<tr><td id="UnitMaxFuel" align=center></td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td id="UnitMovement" align=center></td></tr>
<tr><td id="UnitSpotting" align=center></td></tr>
<tr><td id="UnitRange" align=center></td></tr>
<tr><td id="UnitInitiative" align=center></td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td id="UnitSoftAttack" align=center></td></tr>
<tr><td id="UnitHardAttack" align=center></td></tr>
<tr><td id="UnitAirAttack" align=center></td></tr>
<tr><td id="UnitNavalAttack" align=center></td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td id="UnitGroundDefense" align=center></td></tr>
<tr><td id="UnitAirDefense" align=center></td></tr>
<tr><td id="UnitCloseDefense" align=center></td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td id="UnitTargetType" align=center></td></tr>
</table>
</td>
</tr>
</table>
</div>

<p>&nbsp;</p>

<div class="background" id="TransportBlock">
<p id="TransportType">Opel 6700</p>

<table>
<tr>
<td>
<table cellspacing=-1 cellpadding=0>
<tr><td align=right style="width: 63px">Cost</td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td align=right>Max Fuel</td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td align=right>Movement</td></tr>
<tr><td align=right>Spotting</td></tr>
<tr><td align=right>Initiative</td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td align=right>Soft Attack</td></tr>
<tr><td align=right>Hard Attack</td></tr>
<tr><td align=right>Air Attack</td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td align=right>Ground Def</td></tr>
<tr><td align=right>Air Def</td></tr>
<tr><td align=right><span id="TransportCloseDefName">Close</span> Def</td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td align=right>Target Type</td></tr>
</table>
</td>
<td>
<table id="TransportBlock" style="height: 100%%" cellspacing=-1 cellpadding=0>
<tr><td id="TransportCost" align=center style="width: 70px"></td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td id="TransportMaxFuel" align=center></td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td id="TransportMovement" align=center></td></tr>
<tr><td id="TransportSpotting" align=center></td></tr>
<tr><td id="TransportInitiative" align=center></td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td id="TransportSoftAttack" align=center></td></tr>
<tr><td id="TransportHardAttack" align=center></td></tr>
<tr><td id="TransportAirAttack" align=center></td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td id="TransportGroundDefense" align=center></td></tr>
<tr><td id="TransportAirDefense" align=center></td></tr>
<tr><td id="TransportCloseDefense" align=center></td></tr>
<tr style="height: 5px"><td/></tr>
<tr><td id="TransportTargetType" align=center></td></tr>
</table>
</td>
</tr>
</table>
</div>

</div>


</div>

</body>
</html>
By the way, the unambiguous terminological designation "Structure" has replaced "Forts", let alone, "Fortifications"... Moreover, not every "Capital Ship" is a... "Battleship"; therefore...

HexCode
Corporal
Corporal
Posts: 205
Joined: 2019-09-30 18:54, Monday

UNIT ICON ORIENTATION

Post by HexCode » 2019-11-13 16:29, Wednesday

UNIT ICON ORIENTATION
======================

The present post focuses on the orientation of unit icons contained in graphics file TACICONS.BMP. The "default" orientation is characterized by Side 0 (e.g., "Axis") unit icons facing towards the east and Side 1 (e.g., "Allied") unit icons facing towards the west. A "symmetrically flipped" orientation is also employed in certain scenarios. In this latter case, Side 0 unit icons face towards the west and Side 1 unit icons face towards the east.

PGF's code implements the above feature in a rather unorthodox way. Instead of sticking to the generally intuitive way of single data entry reference (or, even, horizontally adjacent data entry references) the code embraces a counter-intuitive data structure based on... vertical adjacency ! The "problem" with this implementation is that a prospective modder may get the impression that there are more degrees of freedom in tinkering with the relevant entries in file xxx.PGSCN than is actually the case...

It turns out that the "default" orientation is triggered by the following "vertically adjacent" data entries:

# Sides
# Index ... Orientation
0 ................. 0
1 ................. 1

On the other hand, the "symmetrically flipped" orientation is triggered by the following "vertically adjacent" data entries:

# Sides
# Index ... Orientation
0 ................. 0
1 ................. -1

HexCode
Corporal
Corporal
Posts: 205
Joined: 2019-09-30 18:54, Monday

CREATIVE "CONTAINERS"

Post by HexCode » 2019-12-17 19:51, Tuesday

CREATIVE "CONTAINERS"
======================

We're all familiar with organic, naval and air transports, right ? Well, what are they really ? They're composite units where one unit is transporting ("containing") its companion. The requisite technical specifications reside within files *.PGSCN. Specifically:

# Units
# Hex....{Unit} Type....Organic Transport Type....Sea/Air Transport Type

"Normally" an organic transport unit may "contain" some "allowable" land unit and a naval transport unit may simultaneously "contain" the whole companion duo. BUT, no unit can enjoy naval and air transport status simultaneously...

"Normally" ? "Allowable" ? These qualifiers refer to PGF's "classic" content. They don't circumscribe what's technically possible.

As a rule, a creative "container's" design necessitates tinkering with and / or adding new unit stats to be hosted within file EQUIPMENT.PGEQP and, possibly, generating some new icon(s) to be incorporated into file TACICONS.BMP.

Example #1

Armor transporter units could provide organic transport to tanks and tank destroyers.

Example #2

Submarines that can surface and dive.
Radoye wrote:I have modeled the existing submarines as submerged ones - submarine class, spotting = 1, no use of deck guns, slow(er) speed - and I created a surfaced duplicate for each submarine in the Destroyer class, spotting = 2, use of deck guns where appropriate (HA / SA attack values for shore bombardment, AA values for defending from air attack), fast(er) speed (where appropriate), and assigned these as organic transports to the submerged sub. Clicking on the truck mount / dismount icon switches between surfaced / submerged modes. The surfaced sub loses the bonuses of the Submarine class (cannot evade, can be attacked by all classes not just Destroyers). I find it works rather nicely, very similar to how Pacific General used to handle submarine combat !
Example #3

Consider the WWII "Murmansk Run" which assisted the Soviet war effort. Naval transport units could be tasked to ferry, say, fighter units.

Post Reply