HUD Modding

The Great Apple

Big Cheese
Joined
Mar 24, 2002
Messages
3,361
Location
Oxford, England
So I've been looking lately into tweaking Civ 4's HUD and it would seem that it has been implimented in a rather odd way.

Firstly, all the art files, seemingly for the HUD are stored in the art folder... however aren't actually used. After a bit of reasearch I found a project somebody was doing shortly after the game's release. (http://forums.civfanatics.com/showthread.php?p=3270763).

Basically, the HUD is loaded separetly in "Theme" files, rather than as you would expect - in the art files. This seems rather strange, as there is a large lump of files simply not being used. This would seem to be a rather daft idea, soaking up disk space. I don't know if the reduntant ones are loaded into the game at the start, but given the fact that everything else in the assets folder is I'd guess so. I really hope the game doesn't load both sets into memory...

Anyway, the conclusion of the project was that the only way to mod the HUD files was to mess around insde the theme directory and do all sorts of clever stuff which I skimmed over when reading.

This conclusion, in my opinion, is just plain wrong. If you pop into CvMainInterface.py you can just make it so that the HUD is loaded from the art files instead of the silly theme files, by tweaking around with the files. I have no idea why they chose to use silly theme files.

On a side note - if you check around line 200 in CvMainInterface.py there is a little bug which means that the left lower panel is loaded twice, once from the art files, and then overwriten with the theme file one. Weird.

This is quite advantageous. It should be very easy this way to have the HUD changing mid-game (era-specific), or even making the HUD race specifc in certain mods.
 
TGA, this is how I control the merc manager button and add it during different parts of the game depending on the player's current condition. Honestly I thought this was common knowledge.
 
TheLopez said:
TGA, this is how I control the merc manager button and add it during different parts of the game depending on the player's current condition. Honestly I thought this was common knowledge.
Hmmm - can you explain the whole themes/not themes thing to me then?
 
I was talking about using art for the merc mod not themes, and about how the game was using themes and not art.
 
Ah right - I'm currently stripping out all the theme related stuff and replacing it with .dds stuff, so that I can properly tweak the main interface.
 
The Great Apple said:
Ah right - I'm currently stripping out all the theme related stuff and replacing it with .dds stuff, so that I can properly tweak the main interface.
If you're going to do that perhaps you could organize it in a mod-like fashion so that if someone wants to mess around with the UI they can just download these changes and then go from there and create their own stuff.

As for why they did that, I'm guessing they figured that organizing the UI in a theme like fashion would make it easier to mod and make it more modular (which it would if done right) but just didn't have enough time to fully implement it and we got stuck with this weird kinda deal. :)
 
Rabbit said:
If you're going to do that perhaps you could organize it in a mod-like fashion so that if someone wants to mess around with the UI they can just download these changes and then go from there and create their own stuff.
I really should have thought of that before I started ripping CvMainInterface.py apart. Unfortunetly I was working from an already quite heavily modified version, and I've been slipping in other mods on my way through.

It's quite amazing the power you've got over the interface though - check this out (the panel at the bottom goes up and down depending on how many buttons you have):



EDIT: I might actaully release a mod to stack units in cities like that - looks better IMO, and you don't have to worry about those stupid scroll arrows for a bit longer.
 
Very cool.
 
The Great Apple said:
EDIT: I might actaully release a mod to stack units in cities like that - looks better IMO, and you don't have to worry about those stupid scroll arrows for a bit longer.

Looks very nice TGA. Especially the feature with the button bar sizing, I really like it. I'm nearly finished with the next version of my Plot List Enhancement, which is doing something similar with the main interface plot list. I guess we had very similar ideas TGA :).
 
The Great Apple said:
EDIT: I might actaully release a mod to stack units in cities like that - looks better IMO, and you don't have to worry about those stupid scroll arrows for a bit longer.

You really should release something like this. Can you put something like this in the custom assets folder or does it really require a mod that you have to load.

Does anyone have a link to a guide on how to modify the HUD or themese?
 
Rabbit_Alex said:
You really should release something like this. Can you put something like this in the custom assets folder or does it really require a mod that you have to load.
I should be able to rip out the side stacking quite easily. I haven't quite ironed out all the bugs yet though.

Rabbit_Alex said:
Does anyone have a link to a guide on how to modify the HUD or themese?
There's a really old one lying about somewhere about editing themes - check the first post. I'm beginning to think that if you want to edit some parts of the original interface, or do a bulk edit this is probably a better method. Some of the interface isn't replicated in DDS form for example.

To modify it using DDS files you just get your graphic, and then tell the game where to put it (often just replacing ones created by themes) using the addDDSGFC method rather than addPanel, setStyle.

I still can't shake the feeling that there's a reason behind the whole themes thing. Maybe they are less resource intensive or something?
 
Yeah I saw that screenshot in the WH:40K thread, didn't know about the dynamic panel though, nice. I really wish I had more time to get into UI modding as GUIs are my favorite subject... oh well, I guess it's back to dragons and space marines. :lol:
 
12monkeys said:
Looks very nice TGA. Especially the feature with the button bar sizing, I really like it.
I'm having a little bit of a problem with the bar getting too large and obscuring the bottom three working tiles for the city. I might add some buttons, one for units, one for buildings/wonders/processes (if I can work out how). I don't want to have to go back to that silly scroll bar and only two rows!

BTW - 12monkeys, have you got city plotlist stacking like shown coming in your newest version? Are you planning on having it?
 
The Great Apple said:
I'm having a little bit of a problem with the bar getting too large and obscuring the bottom three working tiles for the city. I might add some buttons, one for units, one for buildings/wonders/processes (if I can work out how). I don't want to have to go back to that silly scroll bar and only two rows!

BTW - 12monkeys, have you got city plotlist stacking like shown coming in your newest version? Are you planning on having it?

My intention was the mod main interface plot list, but my changes are also available in the city view. I did quite a lot of improvements in the plot list.

Here are some highlights :
1.) different plot lsit views :
vertical stacks, horizontal stacks, multiline and standard view. The first two displays the units in stacks using different grouping (see below). the second one is a simple multiline display of the unit buttons, so that there is no need of scrolling anylonger. Standard view is as it already is but without this crappy display and scroll bug coming with civ4.

2.) different groupings :
you can group the stack views by unit type or selection group. Means, that for each unit type/selection group a single stack is disaplyed. Gives you an simple overview about the units on a plot, especiall when you have lot of them.

3.) display filters :
you can filter the plot list by the following parameters : healthy, wounded, domestic, combat, air, sea, ground. You can combine the filters as you like.

4.) enhanced unit info pane :
the unit info pane has been replaced and slighly improved. You get the following additional information : number of possible promotions, number of turns a wounded unit needs to be healed (under current circumstances), remaining moves as a float value.

5.) additional infromation on the plot list :
if a unit is promotable, it is indicated by a small arrow (for upgrade) in the icon. The rest is as my alrady released plot list enhancements.

6.) upgrade view :
displayes only upgradable units, with their possible upgrades as vertical a stacks on top. Moving the mouse over such a upgrade button displays the units infromation as well as the price to upgrade a single unit, all units of the same type on the same plot, all player units of the same type. By pressing such a button the unit is upgraded (with ctrl all on the plot, with alt all player units).

7.) promotion view :
same as upgrade view, but with poromotable units and the posssible promotions. You can only promote a single unit (multiple units makes no sense).

Those last two views, makes it very easy to promote/upgrade larger numbers of units and makes it easy to create your own specialist units.

8.) Move highlighter :
is implemented in two ways : when selecting a unit (as you already knows) or by presing alt key and move the mouse over a plot list unit button: so you dont need to select it first.

Thats all I can remember right now. Ok, I agree, it was a more or less detailed overview ;). The mod is more or less ready now and I plan to release a version this weekend (except the patch will be released before).
 
here some teasers (from left to right) :

1.) standard view with the enhanced unit info pane. The pane is displayed as soon as you move the mouse over a plot list button. The small buttons beneath the plot list buttons are the switches to control the plot list (views, filters, groupings)

2.) multiline view. the units are disaplyed in multiple lines, so that you have them all in one view. No scrolling any longer

3.) vertical stack view, here grouped by unit type. Each unit type builds one stack. Horizontal scrolling possible.

4.) horizontal stack view. Same as vertical but the stacks are oriented horizontal. I only implemented this one, because in some resolution you have more room on the vertical axis. OK, and it was fun to implement it ;).

5.) vertical stack, grouped by selection groups. Each vertical stack represents one selection group. If you add a unit to the selection group (by pressing shift and click it) it jumps automatically to the stack of the belonging group. Ideal to create stacks of mixed units, because you always have an overview which units belongs to what group.
 

Attachments

  • Civ4ScreenShot0002.JPG
    Civ4ScreenShot0002.JPG
    359.2 KB · Views: 83
  • Civ4ScreenShot0003.JPG
    Civ4ScreenShot0003.JPG
    355.8 KB · Views: 83
  • Civ4ScreenShot0004.JPG
    Civ4ScreenShot0004.JPG
    355.4 KB · Views: 62
  • Civ4ScreenShot0005.JPG
    Civ4ScreenShot0005.JPG
    350.6 KB · Views: 71
  • Civ4ScreenShot0006.JPG
    Civ4ScreenShot0006.JPG
    361.8 KB · Views: 102
some more teaser :

6.) promotion view. All promotable units are displayed in the bottom row. Above each unit, its possible promotions are displayed. By clicking such probmotion button, the promotion is automatically applied to the unit. Very usefull if you collect promotions and wants to apply it just before battle starts.

7.) upgrade view. All upgradable units are displayed in the buttom row. Above each unit, its possible upgrades are displayed. By clicking one of the upgrade, its automatically applied. By holding down the ctrl key and clicking a button, all units of the same type and on the same plots are upgraded. Holding down the alt key, all players untis are upgraded. In the info pane on the left, some infromation about the upgrade and its costs is disaplayed.

8.) the plot list in the city view. Just to document that there is no speciality against the main interface view. But it is easy to switch in off there.
 

Attachments

  • Civ4ScreenShot0008.JPG
    Civ4ScreenShot0008.JPG
    361 KB · Views: 105
  • Civ4ScreenShot0009.JPG
    Civ4ScreenShot0009.JPG
    357.9 KB · Views: 104
  • Civ4ScreenShot0000.JPG
    Civ4ScreenShot0000.JPG
    292.2 KB · Views: 75
12monkeys said:
here some teasers (from left to right) :
I love it. Great job! Total control! I especially like the vertical stacking - I can see it being very VERY useful for controling large stacks. Have you put a toggle on the movement highlighting there as well?

That's also one amazing unit you've got there - I was thinking you'd found a way to edit the unit mouseover info, but then I noticed all those promotions...

EDIT: Your second set of images don't seem to be there.

EDIT2: Oh... there they are
 
The Great Apple said:
I love it. Great job! Total control! I especially like the vertical stacking - I can see it being very VERY useful for controling large stacks. Have you put a toggle on the movement highlighting there as well?

That's also one amazing unit you've got there - I was thinking you'd found a way to edit the unit mouseover info, but then I noticed all those promotions...

EDIT: Your second set of images don't seem to be there.

EDIT2: Oh... there they are

There is no toggle for the highlighter. It is displayed as soon as you select one unit by the plot list. It is also displayed, when you press the Alt-Key and hover the mouse over a unit in the plot list. So you can easily see where all the units can go without selecting them. I haven't add a toggle for it, because it works quite fast (at least at my computer). Do you think I it needs one?

The units are made with the world builder, because I need some for testing. And yes, I found a way to mod the mouse over info. Or better : I found a way to replace it. I have to create a new one to modify it.
 
12monkeys said:
The units are made with the world builder, because I need some for testing. And yes, I found a way to mod the mouse over info. Or better : I found a way to replace it. I have to create a new one to modify it.
Awsome - that'll do me. I'll probably wait until you release this then I'll take a peek at it.
 
The Great Apple said:
Awsome - that'll do me. I'll probably wait until you release this then I'll take a peek at it.
Hah! Worked it out already. Alot easier than I thought it was going to be (I think.... haven't gone into all the details yet :p)
 
Back
Top Bottom