Dirty Bomb

Dirty Bomb

Not enough ratings
Morty's guide to custom UI configs
By likho1eye
This is a guide on how to edit ShooterUI.ini by hand, and what I learned making my own UI config.
   
Award
Favorite
Favorited
Unfavorite
About
This is an instruction manual to how to edit Dirty Bomb's UI config by hand.

Why not simply use HUDEdit[forums.dirtybomb.com], you may ask?

You can, and you probably should. However when you're done with it, you will almost certainly need to correct some things by hand in the file it generated, and this guide is here to teach you how to do that.
Where to start
Dirty Bomb's UI configuration is stored in the C:\Users\<user>\Documents\My Games\UnrealEngine3\ShooterGame\Config\ShooterUI.ini file.

Most of the relevant settings are under [ShooterGame.SGUIHUDPlayer] section, and look something like this:
MinimapPosition=(Align=(H=HA_LEFT, V=HA_TOP), Attach=(H=HA_LEFT, V=HA_TOP, HA="", VA=""), PixelOffset=(X=0, Y=0))

Unfortunately you cannot edit the file while the game is running, so every time you make a change, you will have to restart the game to see how it looks. Yes this is pretty tedious, but once you get a grip on various settings, you won't have to do that much.
UI scale
The first line in the [ShooterGame.SGUIHUDPlayer] section will look like this:
NativeHUDResolution=(X=1280, Y=720)
Confusingly this has nothing to do with resolution. The numbers above are there to setup a scale, which will be used to calculate offsets for all the widgets below.

For building a new config from the scratch, I've changed mine to
NativeHUDResolution=(X=1000, Y=1000)
for simplicity of calculation. You might as well set it to be 100x100 and pretend those are percentages, because that's exactly what they mean.

Or, if you plan to change config only a little and don't want to redo all the offsets, you could keep those numbers as is, but just have to remember that quarter of the screen from the left is 1280 / 4 = 320, while quarter of the screen from the top is 720 / 4 = 180.

Wherever to keep the default scale or reset it like I have, is simply a matter of how much change you want to make. For a few tweak - keep the default scale. For a major rework - reset it to something that is easy to do math with.
Config syntax
Let's pick apart this config line for the player's health bar:
PlayerHealthPosition=(Align=(H=HA_LEFT, V=HA_TOP), Attach=(H=HA_CENTER, V=HA_CENTER, HA="", VA=""), PixelOffset=(X=150, Y=125), ShadowOffset=(X=-1, Y=-1))
There are three main settings here:
  • Align - confusingly named attachment point on the widget itself. This does NOT control alignment of content inside the widget, as the name might suggest.
  • Attach - specifies a point on an axis or another widget to attach to.
  • PixelOffset - a vector from Attach point to Align point. Despite being called "pixel" the distance is actually measured in grid points we've set up above.

Allowed values
  • H = HA_LEFT/HA_CENTER/HA_RIGHT
  • V = HA_TOP/HA_CENTER/HA_BOTTOM

In the above example health bar's top left corner will be used as a reference point for positioning it against the center of the screen, and then offset by 150 grid points to the left and 125 grid points down.


Attaching to another widget
This is something HUDEdit does not support, but config syntax does. Instead of attaching to the edge or center of the screen, you can attach widget to another widget to position them relative to each other. This is done using HA and VA parameters in the Attach section.

Let's attach minimap to the right edge of the health bar and vertically center it:
MinimapPosition=(Align=(H=HA_LEFT, V=HA_CENTER), Attach=(H=HA_RIGHT, V=HA_CENTER, HA="PlayerHealth", VA="PlayerHealth"), PixelOffset=(X=-50, Y=0))
Simply use the name of the config you want (without "Position" portion) for either of the variables or both, depending on which axis you want. You can attach your widget to two different widgets on vertical and horizontal axis. Or you could attach vertically to the edge of the screen, and horizontally to a widget, and vice versa.

Offset direction
Offsets are measured in grid points from left to right, and from top to bottom. However! if you attach to either HA_RIGHT or HA_BOTTOM, the corresponding axis will be inverted.
In the example above I've set X=-50, which means 50 point to the right of the health bar. Setting it to X=50 would make minimap overlap health bar.

Known issues
What to try when things don't look right, even though you've configured everything correctly.

Screen padding
The screen has a few pixels padding around the edges. You can't push widgets past it. This appears to be by design.

Invisible defaults
Some widgets have default values for their properties, that may break things for you. Explicitly reset HA/VA properties to "" and offsets to zero, and that may straighten things out.

Wrong/confusing displacement box
Some widgets have their box defined differently from what you actually see on the screen.
In some cases it makes sense, like GameWaveTimer's box actually extends significantly to the right to accommodate for "OVERTIME" notification, so if you try to center align it horizontally, it will seem out of place, but actually isn't.
In other cases, those are clearly bugs, like minimap and badge notifications having displacement boxed that clearly don't match visual parts for no good reason. You'll just have to work around that with offsets.
Thanks
Happy coding, and leave questions and comments below.
2 Comments
Lenk 10 Feb, 2018 @ 1:46am 
~~ ONLY ~~ 200+ ~~ IQ ~~ HUMANS ~~ ALLOWED ~~
Salt & Fury 6 Feb, 2018 @ 9:26pm 
Thumbs up for your explanation in plain English!

I actually have a better understanding now on how mods work in general ;)