Actions

Keys Configuration Format: Difference between revisions

From Populous Wiki

(Created page with "Change Populous default keys using programming or hex editor. The file was decoded on November 23rd 2013. All the addresses are correct, but typos can and will exist. If the...")
 
No edit summary
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Change Populous default keys using programming or hex editor. The file was decoded on November 23rd 2013.  
The Populous Keys configuration file remains mostly unknown. It contains a 4 byte header, and each key appears to be a 15 byte chunk.  The first byte (global offset 0x0) of the header indicates the number of 15 byte blocks that follow (starting at global offset 0x4).
 
All the addresses are correct, but typos can and will exist. If there is a typo or wrong address let [[Brandan Tyler Lasley|me]] know or correct it!


== Introduction ==
== Introduction ==
Key def.dat is a file that you have to create by using the Populous key editor included in the game ([http://www.brandanlasley.com/releases/Thread/Popre/Best%20Patches/key_def.dat Key def download]). Once you save, the file is created and it is located in ./save/Key def.dat. Each key is stored in a hexadecimal address, the combination key is always 1 in front of it. So if 1 is pause 2 will be the combination key. The combination key is like shift + key but in the file format it reads key + shift.
The Populous Key configuration file is located in ./saves/Key def.dat ([http://www.brandanlasley.com/releases/Thread/Popre/Best%20Patches/key_def.dat Key def download]) after you use the built in keys editor inside the game. The keys configuration file uses the systems keycode map to determine what keys are available to use. This website has the key codes that seem to work wit most US QWERTY keyboards [http://www.penticoff.com/nb/kbds/ibm104kb.htm keycode list for US QWERTY].
 
Each key needs to be converted from hexadecimal to a integer. This can be done in programming by simply reading information from the address, else if you're using a hex editor (like HxD) you'll have to that by hand using a converter like [http://home.paulschou.net/tools/xlate/ Paulschou] (use the values from CHAR), once you got the number it should range from 1-105, if it exceeds that, you're reading the wrong location or you got your math wrong. In [[#In Programming]] you will be told how to convert the values from keycode (the integer number you just got) to ASCII using programming methods. If you want to change them by hand without programming, all the key definitions are on this list [http://www.penticoff.com/nb/kbds/ibm104kb.htm keycode list for US QWERTY], remember that you have to convert those numbers back to hex from the [http://home.paulschou.net/tools/xlate/ Paulschou]'s link, or by [[#In Programming|programming]].


This is not a complete decode of the file, however its most of the common key commands for Populous, if you find more, feel free to add them!
Inside the key blocks contains a modifier and a key. The modifier is optional and can be removed by setting it to 0. The modifier keys have no particular pattern associated with them, it could very well be hard coded.


All numbers are stored in big-endian format!
All numbers are stored in big-endian format!
Line 22: Line 18:
|INT32
|INT32
|4
|4
|0x0
|0
|Header, first byte is number of keybindings in file
|-
|-
|
|
|15
|15
|0x4
|4
|-
|-
|
|
|15
|15
|0x19
|19
|-
|-
|
|
|15
|15
|0x34
|34
|-
|-
|
|
|15
|15
|0x49
|49
|-
|-
|
|
|15
|15
|0x64
|64
|-
|-
|
|
|15
|15
|0x79
|79
|-
|-
|
|
|15
|15
|0x94
|94
|-
|-
|
|
|15
|15
|0x109
|109
|-
|-
|
|
|15
|15
|0x124
|124
|-
|-
|
|
|15
|15
|0x139
|139
|-
|-
|
|
|15
|15
|0x154
|154
|-
|-
|
|
|15
|15
|0x169
|169
|-
|-
|
|
|15
|15
|0x184
|184
|-
|-
|
|
|15
|15
|0x199
|199
|-
|-
|
|
|15
|15
|0x214
|214
|-
|-
|
|
|15
|15
|0x229
|229
|-
|-
|
|
|15
|15
|0x244
|244
|-
|-
|
|
|15
|15
|0x259
|259
|-
|-
|
|
|15
|15
|0x274
|274
|-
|-
|
|
|15
|15
|0x289
|289
|-
|-
|
|
|15
|15
|0x304
|304
|-
|-
|
|
|15
|15
|0x319
|319
|-
|-
|
|
|15
|15
|0x334
|334
|-
|-
|
|
|15
|15
|0x349
|349
|-
|-
|
|
|15
|15
|0x364
|364
|-
|-
|
|
|15
|15
|0x379
|379
|-
|-
|
|
|15
|15
|0x394
|394
|-
|-
|
|
|15
|15
|0x409
|409
|-
|-
|
|
|15
|15
|0x424
|424
|-
|-
|
|
|15
|15
|0x439
|439
|-
|-
|
|
|15
|15
|0x454
|454
|-
|-
|
|
|15
|15
|0x469
|469
|-
|-
|
|
|15
|15
|0x484
|484
|-
|-
|
|
|15
|15
|0x499
|499
|-
|-
|
|
|15
|15
|0x514
|514
|-
|-
|
|
|15
|15
|0x529
|529
|-
|-
|
|
|15
|15
|0x544
|544
|-
|-
|
|
|15
|15
|0x559
|559
|-
|-
|
|
|15
|15
|0x574
|574
|-
|-
|
|
|15
|15
|0x589
|589
|-
|-
|
|
|15
|15
|0x604
|604
|-
|-
|
|
|15
|15
|0x619
|619
|-
|-
|
|
|15
|15
|0x634
|634
|-
|-
|
|
|15
|15
|0x649
|649
|-
|-
|
|
|15
|15
|0x664
|664
|-
|-
|
|
|15
|15
|0x679
|679
|-
|-
|Total
|Total
Line 213: Line 210:
|}
|}


<!--
== Combination keys ==
== Combination keys ==
The combination keys use a different keycode format. I don't know if there is a pattern to this or if the game has custom keycodes for these.
The combination keys use a different keycode format. I don't know if there is a pattern to this or if the game has custom keycodes for these.
Line 459: Line 457:


=== VB .NET ===
=== VB .NET ===
This is code that will decode all the unknown keys seen above to ACSII, [http://www.theasciicode.com.ar/|ASCII table]
This is code that will decode all the unknown keys seen above to ASCII, [http://www.theasciicode.com.ar/|ASCII table]


Use a code [http://www.developerfusion.com/tools/convert/csharp-to-vb/ converter] to translate to C#.
Use a code [http://www.developerfusion.com/tools/convert/csharp-to-vb/ converter] to translate to C#.
Line 757: Line 755:
}
}
</source>
</source>
-->

Latest revision as of 06:57, 1 April 2018

The Populous Keys configuration file remains mostly unknown. It contains a 4 byte header, and each key appears to be a 15 byte chunk. The first byte (global offset 0x0) of the header indicates the number of 15 byte blocks that follow (starting at global offset 0x4).

Introduction

The Populous Key configuration file is located in ./saves/Key def.dat (Key def download) after you use the built in keys editor inside the game. The keys configuration file uses the systems keycode map to determine what keys are available to use. This website has the key codes that seem to work wit most US QWERTY keyboards keycode list for US QWERTY.

Inside the key blocks contains a modifier and a key. The modifier is optional and can be removed by setting it to 0. The modifier keys have no particular pattern associated with them, it could very well be hard coded.

All numbers are stored in big-endian format!

Block Format
Data Type Length Position (DEC) Description
INT32 4 0 Header, first byte is number of keybindings in file
15 4
15 19
15 34
15 49
15 64
15 79
15 94
15 109
15 124
15 139
15 154
15 169
15 184
15 199
15 214
15 229
15 244
15 259
15 274
15 289
15 304
15 319
15 334
15 349
15 364
15 379
15 394
15 409
15 424
15 439
15 454
15 469
15 484
15 499
15 514
15 529
15 544
15 559
15 574
15 589
15 604
15 619
15 634
15 649
15 664
15 679
Total 709 Bytes