Joined: Wed Mar 31, 2004 8:59 pm Posts: 4045 Location: New Jersey, USA
User Profile Settings (blam.sav)
Player Profile Keyboard Settings
In deciding that Zeus should import and use the same key configurations within its scenario viewer to control movement of the camera and editing that Halo / Halo Demo are configured by the user to use in the game, I've begun analyzing the Documents > Halo Demo > savegames > [profile] > blam.sav file in order to determine how the keyboard controls are saved within the file.
After a few minutes of comparing files, it seems like there is a character map (a list of all the supported characters, as described in the vcky Virtual Keyboard tag in the metadata of the ui.map file) that consists of a SHORT value for each character beginning at offset 0x134 and ending at offset 0x93A, spanning a total of 2054 (0x806) bytes. Within this 2054-byte character map are SHORT values, one SHORT value for each supported character of the input devices, listed in ASCII order (I think), such as 1, 2, 3... a, b, c, etc. . Here's a snapshot of what it looks like in HexEdit:
As a reminder, these byte values must be reversed in order to switch between Little Endian and Big Endian, if you were to interpret the values as integer numbers.
You can see that all those "empty" values are 7F FF (or FF7F when converted, which is a value of 65,407). Each of these SHORT values represents a keyboard character. When you see a value of 7F FF, it means this keyboard character is not assigned a task or binding to a control in the player's profile. However, if you see a different value at this offset, then the SHORT value at that offset ties that character to its keyboard control function.
For example, 00 13 is a value used by the player profile control "Move Forward". When that 00 13 value is at offset 0x156, which is the offset representing the character 1, then the 1 key is mapped to "Move Forward". If this "Move Forward" setting is changed in the game so that it is mapped to the character 2 instead, then the offset 0x156 will return to a value of 7F FF and the next SHORT value in the character map, which is at offset 0x158, will change to 00 13.
Below, I have the "Move Forward" control set to 3 instead of 1 or 2 used in the example above. The ??? values are represented by 7F FF in SHORT value in the hex code.
You have multiple input devices, of course, including a mouse and keyboard with the configuration shown in the picture above. The second column represents the Mouse input device. This device's character map starts at offset 0x20E, which shows us that the majority of the unmapped characters in the input device character map are representing values for supported gamepads and other miscellaneous input devices supported by the game. Thus, the actual keyboard map is between offsets 0x134 and 0x20E, a size of 218 bytes (0xDA bytes). Perhaps there are 218 keyboard characters in the vcky tag in the ui.map file?
I will now present a complete character map for you (a work in progress) :
Code:
Character Map Analysis for Halo Demo's blam.sav file
Complete Keyboard Input Device Mapping
The main text values for these settings are available in the following tag in your ui.map file: ui\shell\main_menu\settings_select\player_setup\player_profile_edit\controls_setup\controls_keyboard_button_names
The main text values for these settings are available in the following tag in your ui.map file: ui\shell\main_menu\settings_select\player_setup\player_profile_edit\controls_setup\controls_mouse_button_names
The main text values for these settings are available in the following tag in your ui.map file: ui\shell\main_menu\settings_select\player_setup\player_profile_edit\controls_setup\controls_binding_labels
Note that you will not be able to manually change the mapping for the values within the blam.sav file unless you also change the 4-byte checksum at the end of the file. Without changing the checksum, the game will revert to default controls.
Move Forward 0013 Move Backward 0014 Move Left 0015 Move Right 0016 Look Up 0017 Look Down 0018 Look Left 0019 Look Right 001A
_________________ Obey God's Commandments and you will live. What good does it do you to have hatred in your heart? It does no good, but kills you, because it is disobedient to the God of Life who said, "Do not hate your brother in your heart." Forgive.
Last edited by Sparky on Sun Jun 26, 2011 10:34 am, edited 1 time in total.
Sun Jun 26, 2011 9:38 am
nil
HaloMD Dev
Joined: Sat Jul 05, 2008 8:38 am Posts: 752 Location: null zone
Re: User Profile Settings (blam.sav)
Bets the byte order is dependent on whether or not the native architecture is ppc (big endian) or i386 (little endian).
Joined: Wed Mar 31, 2004 8:59 pm Posts: 4045 Location: New Jersey, USA
Re: User Profile Settings (blam.sav)
The character map list is in progress. See the first post for the latest.
I'll have to test some more values before I can say with certainty that the values coincide with the related ustr Unicode String List tag values. It looks rather promising, though the Wheel - and Wheel + values use both the "Wheel" string and the -/+ strings located in a separate ustr tag.
Anyway, there's a checksum which is the last 4 bytes of the blam.sav file. The file gets overwritten with default values if the checksum fails. If you simply change a value in the file with Hex Edit, the checksum will fail and you will lose your user profile configuration settings for the input device controls at least.
Lucky for me, Zeus will just read the settings rather than write them, so I don't have to figure out the checksum nonsense. (But nil probably already knows from the gametype files, don't you?)
_________________ Obey God's Commandments and you will live. What good does it do you to have hatred in your heart? It does no good, but kills you, because it is disobedient to the God of Life who said, "Do not hate your brother in your heart." Forgive.
Sun Jun 26, 2011 10:39 am
Modzy
Pearl Dev
Joined: Fri Feb 22, 2008 11:06 pm Posts: 3008 Location: Not having time to do anything.
Re: User Profile Settings (blam.sav)
nil wrote:
Bets the byte order is dependent on whether or not the native architecture is ppc (big endian) or i386 (little endian).
_________________ Join the server by typing "modzysoft.com:2306" into direct IP or use HaloMD.
modzysoft.com:2305
modzysoft.com:2301
Sun Jun 26, 2011 1:51 pm
Sparky
HDM Admin
Joined: Wed Mar 31, 2004 8:59 pm Posts: 4045 Location: New Jersey, USA
Re: User Profile Settings (blam.sav)
I was going to make another topic for this question, but just out of curiosity, which keyboard controls do you guys use?
Here are mine:
_________________ Obey God's Commandments and you will live. What good does it do you to have hatred in your heart? It does no good, but kills you, because it is disobedient to the God of Life who said, "Do not hate your brother in your heart." Forgive.
Mon Mar 19, 2012 5:53 pm
Vegerot
SEAL
Joined: Thu Nov 26, 2009 10:13 pm Posts: 625 Location: Behind you with an Energy sword.
Re: User Profile Settings (blam.sav)
The hayls wrong wit'u? That is the most retarded keyboard setup I've ever seen.
_________________
Bunneh wrote:
Now, please don't spam my newsfeed on how you need like 3 dildoes to make a giant dick statue on penisland or any of those other shitty facebook games.
Wed Mar 21, 2012 4:06 pm
Samuco
Peon
Joined: Mon Apr 26, 2010 1:39 am Posts: 100
Re: User Profile Settings (blam.sav)
You obviously have not seen mine then :p
Wed Mar 21, 2012 11:14 pm
nil
HaloMD Dev
Joined: Sat Jul 05, 2008 8:38 am Posts: 752 Location: null zone
Re: User Profile Settings (blam.sav)
@Sparky:
Interesting you adjusted to esdf instead of wasd, probably to give you more key choices? Most settings seem reasonable, except for the MISC ones besides tab as showing scores, since your right hand ought to remain on mouse. Your reload option seems terrible for backpack reloading though, and double melee, however.
Nothing that special with my controls, though I use T,G,B for chat functions and tab for showing scores. Wheel for changing weapons.
Working with HaloMD, I had only recently figured out the checksum. There's a script in the HaloMD app bundle that just takes the file path to the blam file and fixes the checksum on it. (In particular, the CRC32 of whole file is always 0xFFFFFFFF, so you have to forge the last 4 bytes to make it so).
Joined: Wed Mar 31, 2004 8:59 pm Posts: 4045 Location: New Jersey, USA
Re: User Profile Settings (blam.sav)
The main idea I use is to keep my hand on the keys I should when I should. The movement keys (strafing in each direction, crouching, jumping) and the activate key are primary and therefore I use my pinkie for most other functions. The mouse I associate with aim-related, complicated, and secondarily repetitive actions such as firing, meleeing, throwing things, reloading, scope zoom and switching equipment. The mouse I use has five reprogrammable buttons. There is a related topic at MGM already about input devices like mice and trackballs. When I go to chat, I don't need to use the mouse anymore, since my hands are on the keyboard to type letters, so I move my right hand away from the mouse, tap the ";" semicolon with my right pinkie and start typing, pressing Return to submit the text.
ESDF brings my hand into a more natural location away from the Caps Lock key on the left and lets me keep my movement fingers on the appropriate keys. It's more natural because that's where your left hand is located when you are typing; you just slightly place your left middle finger up onto the E key.
_________________ Obey God's Commandments and you will live. What good does it do you to have hatred in your heart? It does no good, but kills you, because it is disobedient to the God of Life who said, "Do not hate your brother in your heart." Forgive.
Thu Mar 22, 2012 2:44 pm
002
Ranger
Joined: Wed Aug 16, 2006 5:48 pm Posts: 780 Location: into the void of a world that cannot hold
Re: User Profile Settings (blam.sav)
Fire is left mouse Throw grenade is V or right mouse Scope is Z or middle mouse Running is WASD Aiming is with mouse or arrow keys Crouch is C Picking up Weapons is X Changing Weapons is TAB Chatting is TYH Jump is Space Changing grenades is G Melee is F Use is E F1 is player scores Q is flashlight Alt-F4 is ragequit
pretty default control scheme
Wed Aug 01, 2012 5:15 pm
Sparky
HDM Admin
Joined: Wed Mar 31, 2004 8:59 pm Posts: 4045 Location: New Jersey, USA
Re: User Profile Settings (blam.sav)
002 wrote:
Fire is left mouse Throw grenade is V or right mouse Scope is Z or middle mouse Running is WASD Aiming is with mouse or arrow keys Crouch is C Picking up Weapons is X Changing Weapons is TAB Chatting is TYH Jump is Space Changing grenades is G Melee is F Use is E F1 is player scores Q is flashlight Alt-F4 is ragequit
pretty default control scheme
Do you use your thumb to press the G key?
_________________ Obey God's Commandments and you will live. What good does it do you to have hatred in your heart? It does no good, but kills you, because it is disobedient to the God of Life who said, "Do not hate your brother in your heart." Forgive.
Wed Aug 01, 2012 7:05 pm
Mgalekgolo
Commando
Joined: Thu Jun 24, 2010 6:36 am Posts: 2608
Re: User Profile Settings (blam.sav)
I would always use the index of my left hand, but i'm left handed so idk if that effects it or not.
_________________
Yarok wrote:
There may be a giant dildo protruding from your forehead.
Wed Aug 01, 2012 7:45 pm
002
Ranger
Joined: Wed Aug 16, 2006 5:48 pm Posts: 780 Location: into the void of a world that cannot hold
Re: User Profile Settings (blam.sav)
Sparky wrote:
Do you use your thumb to press the G key?
Not unless I am moving to the right, which I use middle finger for up (W) and index for right (D). I use my index for G and thumb for space. This makes it easier to rush into players with the assault rifle.
I only use thumb for V, space, and C.
Mgalekgolo wrote:
I would always use the index of my left hand, but i'm left handed so idk if that effects it or not.
It can and probably does. You can, however, be a touch-typist who learned it that way.
Users browsing this forum: Google [Bot] and 1 guest
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum