[MOD] Plot List Enhancement

12monkeys

Prince
Joined
Nov 24, 2003
Messages
440
Location
Germany, Europe
==================================================
Name : Plot List Enhancements
Version : v2.03
Date : 14.04.2006
Author : 12monkeys (@civfanatics + @apolyton)
==================================================

============
Motivation :
============
The motivation for this mod was born when I tried to fiddle a unit stack with a large number of units. It was a frustrating experience, due to the strange behavior of the plot list and some bothering bugs in Civ4. So I started to create this mod here. It is a more or less complete reprogrammed plot list with a bunch of new features. Not all of the features may be used at one time, but I think everybody will find something hes looking for.
It is based on the previous version of the Plot List Enhancement although is has been reworked completely. There is not muched left except some graphics.


============
Features :
============
The features are devided into the following chapters :
1.) Enhanced unit buttons in the plot list
2.) Mouse over info pane of the unit buttons in the plot list
3.) Unit/group selection in the plot list
4.) Plot list display modes
5.) Plot list unit filters
6.) Plot list grouping modes
7.) Plot list uprade View
8.) Plot list promotion View
9.) Move highlighter
10.) Configuration

Here are the details to those chapters:


------------
1.) Enhanced unit buttons in the plot list
------------
Spoiler :

Each unit button provides you now with some additional information. This makes it easier to determine what status a single unit has, without selecting it first. Following information is implemented :

a.) Health Indicator :
the colored spot in the upper left corner is displayed in a darker color, as soon as the unit is wounded. This feature can be switched off in the ini-file.

b.) Health Bar :
At the top of each unit button, a vertical stacked bar is displayed. This stacked bar indicates the remaining health points of the unit in percent. The colors of that bar can be configured in the ini-file, as well as the display itself. The default colors are green and red.

c.) Move Bar :
At the top of each unit button, below the health bar, another vertical stacked bar is displayed. This indicates the remaining movement points of the unit in percent. The colors of that bar can be configured in the ini-file, as well as the display itself. The default colors are blue and yellow.

d.) Mission Indicator :
in the lower right corner, the units actual mission is disaplyed. The following mission types are indicated :
FORT (blue) -> unit is fortified
PAT (light blue) -> unit is at air patrol
GOTO (light green) -> unit has a goto command.
EXP (dark green) -> unit is at exploring mission
HEAL (light red) -> unit is in healing mode
SEN (yellow) -> unit is in sentry mode
SKIP (light gray) -> unit is skipped in current turn
AUT-B (orange) -> worker is automized
AUT-C (orange) -> worker is automized for a city
AUT-N (orange) -> worker is automized for building a trade network
The display of this mission indicator can be switched off by ini file.

e.) Promotion Indicator :
A unit which can be promoted, is displayed with a light blue frame in the plot list. This indicator can be switched on/off in the ini file.

f.) Upgrade Indicator :
A unit which can be upgraded to any other unit, will get a small orange up-arrow in the lower left corner of its unit button. The arrow is displayed regardless if you have the money for the upgrade or not. This indicator can be switched on/off in the ini file.

------------
2.) Mouse over info pane of the unit buttons in the plot list
------------
Spoiler :

When you move the mouse over any unit button in the plot list, an info pane is displayed on the left side of the screen. This Info pane has been been modified in the following places :

a.) Remaining movement points :
The remaining movement points of the unit are displayed as a floating value with 1 decimal

b.) Strength + Turns-To-Heal
The current unit strenght is displayed as a floating value with 1 decimal. In case the unit is wounded a third value is displayed in brackets. This number indicates the number of rounds the units need to heal completly under the current circumstances. This circumstances takes consideration of city building (like hospital), the unit's promotion (Medic, or any other promotion with self heal abailites) the promotions of units on the same or adjacent tiles, the territory the unit is on.

c.) Specialties
The special abilites a unit gains due to a promotion are displayed in a different color than the specials it gains due to its unit type. The color can be modified in the ini file, the default color is light gray.

d.) Experiance
The unit's experience points are displayed in the following format : <curr-exp>/<needed-exp>. Where <curr-exp> is the units current experience points and <needed-exp> is the units needed experience points to get the next higher level. Both values are only displayed if the unit has an experience value > 0.

e.) Level
The unit's level is displayed in the following format. : <curr-lev>/<possible-lev>. Where <curr-lev> is the unit's actual level and <possible-lev> is the level the unit could have due to its expereience points. In other words : the first value shows the number of promotions the unit already has, the second value shows the number of promotion the unit could have. Both values are displayed, as soon as one of the values is > 0.

Because this info pane has to be reprogrammed completely new, the layout differs slighly from the built-in one. There may also be soe differences in the infromation I haven't documented herer. If so, please contact me.

------------
3.) Unit/group selection in the plot list
------------
Spoiler :

The selection in the plot list has also been improved by eliminating some bugs of the Civ4 standard verion :

a.) Civ4 bug : when selecting a unit on the very right the plot list is rebuild so that the selected unit is at position 10 in the plot list -> fixed
b.) Civ4 bug : under some special circumstances the scroll arrows did disappear -> fixed
c.) Civ4 bug : when selecting a unit with Alt-key pressed, all units should be selected. Because it is not possible to put units with different domain type into one group, always the first domain in the plot list is selected. -> fixed. All units with the same domain type as the selected unit will be put together into a group.

The rest of the selection method is pretty much the same as before :
- Shift : to add single units or their groups to the selected group
- Ctrl : to select all units of the same type
- Alt : to select all units of the same domain type.

Remark:
The main problem of the complete mod was to modify the unit selection in the plot list. The existing API function CyInterface.selectUnit() and CyInterface.selectGroup() are quite a mess. You have no chance to create a selection group without the function CyInterface.selectGroup(). The problem with that is, that this function doesn't have a any parameter for a unit. It directly checks the existing units on the plot and takes it decisions, so that you don't have any influence to it. Because I want that the selection groups doesn't select any unit which is not disaplyed due to one of the display filter, I had to make several crazy program climbs (you can watch them in the selectGroup() function in the PLEMainInterface.py). Main method to avoid those things is to temporarily move away (with CyUnit.setXY()) those units I don't want to be added to the group, create the group witht CyInterface.selectGroup() and then move back those "parked" units.
Due to that changes it might be possible, that there are some error in I havn't catched so far. Also, the behavior of the complete selection functionality could be slightly different to that you know. If you found any problems, just inform me, please.

------------
4.) Plot list display modes
------------
Spoiler :

To improve the display of a large ampunt of units on one plot, I added some disaply modes :

a.) Standard mode :
The units are displayed in one vertical line with scroll buttons on the right side. As already mentioned in chapter 3., the bothering bugs with the display have been eliminated.

b.) Multiline mode :
All units are disaplyed in several lines, so that there is no scrolling needed. The display starts in the lower left corner. Using this view, no scroll buttons are needed, except you have so much units on one plot, that the screen height is not enough to display them in multi line view. In this case, vertical scroll buttons (up and down arrow) are disaplyed.

c.) Vertical stacks :
Dependant on the grouping mode (see chapter 6.) some units are disaplyed in vertical stacks. You can scroll left an right with the scroll buttons. In the unit type grouping mode, units of the same type are displayed in a vertical stack, in the selection group grouping mode selection groups are displayed in a vertical stack.

d.) Horizontal stacks :
Pretty much the same as the vertical stacks with the only difference, that the stacks are horizontal oriented. You may now ask what that is for. Two reasons. First: because of the different screen ratios this option may be better than the vertical stacks (you have smaller stacks, but more lines). Second : it was fun to do it ;)

------------
5.) Plot list unit filters
------------
Spoiler :

There are several unit filters added. You find them next to the display mode buttons. The following filters have been implemented (the button in brackets) :
a.) Wounded untis (red cross)
b.) Healthy units (green cross)
c.) Domain filter air units (plane)
d.) Domain filter sea units (ship)
e.) Domain filter land units (car)
f.) Domestic units (house)
g.) combat units (tank)
h.) player units (green flag)
i.) foreign units (red flag)

An active filter is displayed with a red frame. By default all filters are inactive (-> no frame). Also all filters are EXCLUSIVE filters. That means, if you press a filter button the belonging units are NOT displayed.

------------
6.) Plot list grouping modes
------------
Spoiler :

There are two groping modes implemented. The grouping modes have influence in the order the units are disaplyed. If a stack display mode (vertical or horizontal) is selected it also have influene, to what is displayed in a stack :

a.) Unit type grouping (the button with the 3 squares which are behind each other) default grouping mode) :
In simple words : the units are sorted as in Civ4 Standard. When the display mode is a stack mode, then units of the same type are put into one stack.
In more complex words :
The grouping is done by unit type. That means that the untis are sorted by the following order :
- Player. Order : player units, then all other players in the order of their player id.
- Domain. Order : sea, air, land
- Combat strength. Descending order(-> means strongest first)
- Unit type. Order by unit type id, descending
- Unit level. Order descending.
- Unit experience. Order descending.
- Unit ID. Order ascending. This is just added to get a reproducable sorting in case anything else isn't unique.

ATTENTION :
There is one exception for the sorting : cargo'ed units. As soon as a unit is cargo of another unit, the cargo unit is always displayed BEHIND its transporting unit. Within the cargo units, the sorting is as mentioned above. This is as in Civ4 standard, but has some effects to the stacked views modes : cargo units are displayed together with their tranport unit in the same stack, where the cargo units are on top off their transport unit.

b.) Selection group grouping (the button with the square and the triangle in brackets) :
In simple words : the units which are in the same selection group are displayed together. Also the selection groups are displayed right most wihtin their domain. When the display mode is a stack mode, then units within the same selection group are put into one stack.
In more complex words :
The above grouping is slightly changed :
- Player. Order : player units first, then all other players in the order of their player id.
- Domain. Order by sea, air, land
- Selection group : Ascending order by their internal group id.
- Combat strength. Descending order (-> means strongest first)
- Unit type. Order by unit type id, descending
- Unit level. Order descending.
- Unit experience. Order descending.
- Unit ID. Order ascending. This is just added to get a reproducable sorting in case anything else isn't unique.

Again, cargo units are displayed together with their transport units. This view is ideal to create complex selection groups.

Tip : try the "Group" grouping and create selection group by selecting single units holding the shift key down. Looks funny ;)

------------
7.) Plot list uprade view
------------
Spoiler :

The upgrade view (button with the up-arrow) can be used, to get a clear overview about the units which can be upgraded. It also provides a simple method to upgrade a bunch of units without selecting each unit first.
When you press the button only units which can be upgraded are displayed in one line. If you also have a stack view active (important!!!), above each unit its possible upgrades are dispalyed. The upgrade buttons are disable (displayed, but you can't push them) you don't have enough money to perform the upgrade.
By pressing one of those upgrade buttons, the belonging unit is upgraded to that type. Usually that results in that the unit disappears from the view, because in ost cases only one upgrade is possible. If you press the ctrl-key when pressing an upgrade button all units on that plot are upgraded, when pressing the alt-key all player units are upgraded. If you run out of money during those multi upgrades, it simply stops doing it (as it is now in Civ4).
By moving the mouse over an upgrade button, a special info pane is displayed on the left side of the screen. It provides you with the unit type related info of the upgrade and with three values in brackets, seperated by a slash. The three values have the following meaning:
- costs to upgrade one unit
- costs to upgrade all units on the plot (hold down ctrl-key)
- costs to upgrade all play units (hold down alt-key)
If one of the values exceeds your current budget, it is displayed in red, otherwise in green. The colors can be modified in the ini-file. Of course, those multi-upgrades only upgrades the units of the same unit type. eg. all bombers or all german tanks.

------------
8.) Plot list promotion view
------------
Spoiler :

This view (button with the "star" on it) is very similar to the upgrade view. It displayes only units which can be promoted. If a stack view is active, above each unit its possible promotions are displayed. By pressing such a promotion button, the promotion is performed and the display is refreshed. This could result in that the unit disappears from list because there are no more promotions possible, or that new promotions are displayed if the experience points of the units does allow that.
You can use the "level" in the unit info pane to check how much promotions are possible. (see chapter 2.)

------------
9.) Move highlighter
------------
Spoiler :

When you hold down the alt-key, hover the mouse over a plot list button, the plots the unit can reach with its remaining movement points are highlighted. For that I implemented my Move Highlighter mod. Remark : the standard version of the move highlighter which highlights the move area when you select a unit is NOT implemented. THis can be done seperatly. Refer to the related thread for that, please.

------------
10.) Configuration
------------
Spoiler :

The PLE come now with a INI-file. Several above mentioned features can be switched on/off in this ini file. Also some colors can be adjusted and some key parameters of mouse over info can be changed. Just have a look in the file, everything is documented.


============
Requirements :
============
Civ4 patch v1.61. If you have Civ4 patch v1.52 use version v2.02 instead.


============
Installation :
============
copy the files from the ZIP into their corresponding folders in the "My Documents\My Games\Civilization 4" folder. Installation at own risk!. If you have already a modified versions of any file in this mod, you can manually merge them by looking for the comments "12monkeys - <mod name> - begin/end".
If you have an older version installed, you may uninstall it first. Some files became obsolete and some files have changed locations. But it doesn't harm if you keep them, they simple not used anylonger.


============
Updates :
============
a.) from 2.02 to 2.03 :
just replace the PLEMainInterface.py, CIV4ArtDefines_Interface.xml and CvScreensInterface.py with old one.


============
Issues :
============
no known yet, so I count on you!


============
Ideas for future realeases :
============
Current work list for next update is as follows.

planned new features :
1.) make the number of button rows and cols configurable (besides the autmoatic mode)
2.) make the plot button size configurable via INI
3.) always show unit level and experiences in the mouse over help

other ideas (not sure if they'll be implemented) :
1.) try to show additional characteristics which are mod dependant (e.g. from mod Promotions and perks)
2.) sum up promotion values to single lines (eg. instead of 2 lines with "+15% defense jungle" and "+15% defense plains", just display 1 line with "+15% defense jungle, plains")
3.) hide update of the healthbar till battle ends (configurable).
4.) redessign PLE buttons to a more Civ like design (round buttons)

bug fixes :
1.) fixing issues with malfunctioning mouse over info by usage of some new v1.61 API features.
2.) DONE! fixing turn to heal calculation
3.) DONE! display negative promotion values (currently the're not displayed)
4.) DONE! fixing "double move" attributes in mouse over inof (currently they're canbe displayed twice)
5.) DONE! fixing pOldPlot issue
6.) DONE! switch off PLE button when switching interface mode (eg. when switching to world builder)
7.) DONE! unit movmements wrong calculated
8.) DONE! python error when chaningin python code while game is running



============
Release Notes :
============
Spoiler :

============
v2.03 :
- making compatible with Civ4 patch 1.61

v2.02 :
- selecting unit from city screen now returns correctly to map and focus the selected unit and enables standard scroll behavior as well (thx. _alphabeta_ for reporting)
- debug message removed when selecting a unit in the plot list (thx. Michelangelo for reporting)

v2.01 :
- Fortify bonus is now displayed in mouse over info pane (thx. _alphabeta_ for reporting)
- selecting unit from city screen now returns correctly to map and focus the selected unit (thx. _alphabeta_ for reporting)
- "100% <civ>" removed from mouse over info (thx. _alphabeta_ for reporting)
- code improvement : selectGroup() method simplified
- no mouse over info pane in city view
- mouse over repositioned in case the interface is hide (ctrl-I)

v2.0 :
- stack and multiline views
- display filters
- promotion indicator and view
- upgrade indicator and view
- move bar
- move highlighter
- INI file
- improved mouse over info
- improved/fixed unit selection

v0.96 :
- changed to work with Civ4 patch 1.52
- removed dynamic plot list size, because firaxis implemented the function.

v0.95 beta:
- added healthbar
- changed spot color
- added mission icons
- implemented dynamic plot bar size
- added promotion indicator
- lots of comments added
- single units will get their plot list button as well

v0.9 beta:
- initial release


============
Credits :
============
The Great Apple, Belizan :
- for the inital idea and motivation of the implemented Move Highlighter

Dr. Elmar Jiggle :
- for the used INI Parser (modders : use it!)

Firaxis and the Civ4-Team :
- making this game so moddable. Although I havn't played it since months, I still have a lot of fun to mod it. I never had so much fun with a game over such a long time.

Civ4 community at civfanatics, especially in the C&C subforum :
- for all the inspiration, help and ideas.


----------------------------------------------
PlotListEnhancements-2.03.zip replaced with 59 views
 

Attachments

  • PlotListEnhancements-0.96.zip
    229.6 KB · Views: 902
  • PlotListEnhancements-2.0.zip
    93.7 KB · Views: 447
  • PlotListEnhancements-2.01.zip
    94.3 KB · Views: 485
  • PlotListEnhancements-2.02.zip
    94.3 KB · Views: 495
  • PlotListEnhancements-2.03.zip
    94.6 KB · Views: 2,698
here some screenhots of the actual version (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

  • Civ4ScreenShot0016.JPG
    Civ4ScreenShot0016.JPG
    354.6 KB · Views: 3,760
  • Civ4ScreenShot0010.JPG
    Civ4ScreenShot0010.JPG
    359.4 KB · Views: 2,545
  • Civ4ScreenShot0012.JPG
    Civ4ScreenShot0012.JPG
    349.8 KB · Views: 1,822
  • Civ4ScreenShot0011.JPG
    Civ4ScreenShot0011.JPG
    357 KB · Views: 2,046
  • Civ4ScreenShot0013.JPG
    Civ4ScreenShot0013.JPG
    353.1 KB · Views: 2,062
some more screenshots :

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 units 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 it works there as well .
 

Attachments

  • Civ4ScreenShot0014.JPG
    Civ4ScreenShot0014.JPG
    357.8 KB · Views: 1,256
  • Civ4ScreenShot0015.JPG
    Civ4ScreenShot0015.JPG
    351.8 KB · Views: 1,239
  • Civ4ScreenShot0001.JPG
    Civ4ScreenShot0001.JPG
    292.5 KB · Views: 1,557
A zoom on the plot list, to show some details about the new control buttons, health and move bar and mission icons.
 

Attachments

  • Civ4ScreenShot0000.JPG
    Civ4ScreenShot0000.JPG
    187.4 KB · Views: 1,387
I, too, works mod on same CvMainInterface.py.

So I integrated your Plot line button mod to mine.
I attached modified version of the file here.
Please take a look at your code and, if you have a opinion, let me know..

My mod requires few library I wrote other than just "CvMainInterface.py"
Full mod and other files will be relased shortly (next week ?)
I am polishhing codes and writing documentations.
So littel time to do all the things, So slow pace....
Older version of the libray is available in this thread.

http://forums.civfanatics.com/showthread.php?t=151957
 

Attachments

  • CvMainInterface.zip
    25.6 KB · Views: 423
12monkeys said:
--------------------------------------------------
Name : Plot List Enhancement
Version : v0.96 (for Civ4 patch 1.52)
Date : 24.12.05
Author : 12monkeys (@civfanatics + @aployton)
--------------------------------------------------

If someone is interested, here there are the merged files to use this mod together with Tubby Rower's "GameClockMod" and/or with Snaitf's "Show Attitude Mod".
 
Cammagno said:
If someone is interested, here there are the merged files to use this mod together with Tubby Rower's "GameClockMod" and/or with Snaitf's "Show Attitude Mod".

And here there is the merged file to use this mod together with SupremeOverlord's "Enhanced Foreign Advisor" or Requies' "Exotic Foreign Advisor".
 
Hi 12monkeys, I'm trying to add this to my modcomp, but for some reason it causes many buttons of the main interface to disappear. for example, I select my settler at the start of the game and I don't have the buttons that allow me to build a city, move, sleep, etc.
all I did to fix the problem was deleting from the CvMainInterface.py file all the changes I had imported from your mod, and it is now fixed, so the problem must be there somewhere.

do you have any clue what might be going on?
or maybe I just failed to implement it properly and should try again paying more attention?

thanx in advance for your support :)
 
[to_xp]Gekko said:
Hi 12monkeys, I'm trying to add this to my modcomp, but for some reason it causes many buttons of the main interface to disappear. for example, I select my settler at the start of the game and I don't have the buttons that allow me to build a city, move, sleep, etc.
all I did to fix the problem was deleting from the CvMainInterface.py file all the changes I had imported from your mod, and it is now fixed, so the problem must be there somewhere.
do you have any clue what might be going on?
or maybe I just failed to implement it properly and should try again paying more attention?

Does your mod contain Tubby Rower's "GameClockMod" and/or Snaitf's "Show Attitude Mod"? If so, you may try to use my merged CvMainInterface.py, that you can find a couple of messages above in this thread (3 versions are available, depending on the mods you want to use).
 
yeah, the gameclockmod is in there ( I didnt put it in myself though, GraveEatr did ;) ) . I'll check out your file, thanks a lot!
 
Cammagno, I've tried the file you gave me, and it gives me the same problem as before. maybe I'm doing something wrong though: since I can't just overwrite my own cvmaininterface cause I have other changes stored in there that I need, I'm just copy/pasting the changes located inside the ###modification blocks### . should I be doing this differently?
thanx in advance for your support ! :)
 
[to_xp]Gekko said:
Cammagno, I've tried the file you gave me, and it gives me the same problem as before. maybe I'm doing something wrong though: since I can't just overwrite my own cvmaininterface cause I have other changes stored in there that I need, I'm just copy/pasting the changes located inside the ###modification blocks### . should I be doing this differently?
thanx in advance for your support ! :)

Well, they are "modification blocks", not "added blocks", so (if you hadn't done it before) you have to pay attention to use them to replace the original lines instead of simply adding them. For this task is veryuseful to use a text editor with compare/merge functions. Maybe the better way to procede is to take the merged file (who is tested and works fine) and to add (replacing when neeeded) your personal changes to it. Just my two cents, of course :)
Oh, and pay attention to the tabs! It's strange, but sometimes it seems that they are important and if you mess up them you may get some stange effect.
 
Cammagno said:
Well, they are "modification blocks", not "added blocks", so (if you hadn't done it before) you have to pay attention to use them to replace the original lines instead of simply adding them. For this task is very useful to use a text editor with compare/merge functions. Maybe the better way to procede is to take the merged file (who is tested and works fine) and to add (replacing when neeeded) your personal changes to it. Just my two cents, of course :)
Oh, and pay attention to the tabs! It's strange, but sometimes it seems that they are important and if you mess up them you may get some stange effect.

yep, that is exactly what I was trying to do , I had noticed that I had to replace some lines with the modified code and not just add it in.
but it gave problems anyway for some strange reason. anyway, now TheLopez is kindly doing it for me, and since he's a programmer, I'm not surprised he already succeeded in doing it :)
I still didn't get the chance to try it myself, but he said it works and he's testing it and it will be ready very soon.
thanks for your help Cammagno, the MainInterface file I needed was yours and not the original one , since I got the game clock mod in my mod, so you did help a lot :)
 
Top Bottom