View Full Version : Military Advisor
ruff_hi Apr 10, 2008, 07:09 AM I've been thinking about the worst advisor screen in the game ... the military adviser! Here are some suggestions for improvements ...
add some tabs
put the location of Great Leaders (ie units with attached Great Generals) in the list of units
Tab - Situation Room, that shows ...
List of other leaders
Their relationship with you
current thread level (see below)
Will Declare war on someone else? (yes / no - including reason if NO)
key resources indicator? (ie do they have copper!)
copy of glance tab but include if 2 AIs have touching borders
Threat Level
5 levels (very low, low, moderate, high, extreme)
Basic position is level 3 (moderate), adjusted as follows:
+1 for border tension
+1 if str > 2.0
+2 if WHEOOH
-1 if str < 0.5
-1 if Friendly (I always mix these up, is 'Pleased' better than 'Friendly'?)
-2 if Pleased
I'm not planning on putting in adjustments for nutcases (ie monty)
Thoughts, suggestions, other?
Ekmek Apr 10, 2008, 12:03 PM very cool idea! maybe something that identifies key resources (i.e. oil, iron, horses, uranium) or who has them. since thats what you are most likely to fight for too.
OnmyojiOmn Apr 11, 2008, 05:11 PM Honestly, I'd just really like it if you could make it open a little faster. I'd use it more often if not for the delay.
ruff_hi Apr 15, 2008, 04:44 PM Honestly, I'd just really like it if you could make it open a little faster. I'd use it more often if not for the delay.Not much you can do about the delay - it is cycling over all visible units to build the unit list.
Ekmek Apr 15, 2008, 06:19 PM this idea maybe too much work but it would be cool to get it organized by wars. so any units lost when at war with that civ gets recorded in "the Xciv-YCiv war or Turn/year"
then you get a better idea if you killed a lot or not. I'd be happy if it just simply calculated casualties using the numbers from the demographics screen. Everytime you lost a unit that equal 10,000 people that value gets added. So at the end you would see a report like:
"XCiv-YCiv War of 950AD - 50,000:150,000"
just a thought...
·Imhotep· Apr 16, 2008, 01:21 PM I'd rather like to see an overview of units with the currently highest XP. Maybe even with the option to locate them via map...
ruff_hi Apr 16, 2008, 01:58 PM The current system stores units by ...
combat type unit type
I looked at the code to see if I could pull Great Leader units (ie ones with GGs attached) out and it got a little confusing. I'll see (warning: low priority, lower even than other things) if I can free up the first index and make it a user specified item ... options are:
XP level promotion location (in city, in territory, outside territory)
Any other options? Once I can do one, it should be easy to do the others.
·Imhotep· Apr 16, 2008, 05:00 PM I think that would suffice. Indeed it would be rather nice to have that feature, especially for HE and West Point planning...
ruff_hi Apr 20, 2008, 01:50 PM skeleton posted to the SVN. I will post some screenies and discussion here tonight.
alerum68 Apr 20, 2008, 02:01 PM sweet!:) Will try and play around with it today and see what can be tweaked.;) BTW - Can you modify your Unit Renamer Mod so it will have the .INI file for it located in a BUG Mod directory in My Games, instead of the BTS folder? I think we'll need to do that with the CustomDomAdvisor folder too.
ruff_hi Apr 20, 2008, 02:22 PM The military advisor has been built out from the victory condition screen. I left the 'settings' tab in just for testing purposes.
Screen Shot 1 ...
http://img88.imageshack.us/img88/5800/bugmilitary0052uz9.jpg
Standard military adviser. Moved the GG emergence bar from the bottom and put a border around it. Not happy with that border yet - will play some more. One issue is that the standard military adviser minimap has a border but I cannot get that to work ... border works but the minimap appears behind the border if you leave the 'deployment' tab.
Screen Shot 2 ...
http://img88.imageshack.us/img88/7277/bugmilitary0053rs6.jpg
Obviously not complete Worse Enemy will be "n/a" until the patch. After that, it will show the leaderhead icon (or none) Threat index I will discuss later. Thinking of a progress bar that changes color based on some items Active wars - leader heads of people who indicated leader is fighting strat res - icons of strategic resources (copper, iron, oil, aluminum, ??) with a little counter showing how many (determined from trade screen) create reminders - duh! - typo, meant to be 'declare war?' with a yes or no ... if no, will include reason why not
Ekmek Apr 20, 2008, 02:28 PM :eek: really cool! I like it so far!
alerum68 Apr 20, 2008, 02:32 PM Looks good Ruff. How about we change that Settings Tab to one that will let you create a list that will have units listed based on combat experiences, so you can find that guy with 19 exp a bit easier?
ruff_hi Apr 20, 2008, 02:38 PM Threat Index ...
progress bar, 0 to 100
0 - 20, words = NIL, color = green
20-40, Low, Brown
40-60, Moderate, Yellow
60-75, High, Orange
75-100, Extreme, Red
25 pts for ATTITUDE ... -15 to +15 = 25 to 0
25 pts for strength rating ... -50% to +50% = 25 to 0 (str = us / them - 1)
20 pts for close borders or ocean exposure (us) and them with knowledge of astronomy
30 pts if they are WHEOOH
ruff_hi Apr 20, 2008, 02:39 PM Looks good Ruff. How about we change that Settings Tab to one that will let you create a list that will have units listed based on combat experiences, so you can find that guy with 19 exp a bit easier?Current listing is sorted on unit-type. Going to free that up so that you can select level, XP, Location (city, within borders, outside borders), etc. Any other suggestions?
alerum68 Apr 20, 2008, 02:40 PM Only one:
Hurry Up So I Can Play With It!:p
edit: I got some! Listing based on health status, and if the unit can be upgraded.
EmperorFool Apr 20, 2008, 09:29 PM BTW - Can you modify your Unit Renamer Mod so it will have the .INI file for it located in a BUG Mod directory in My Games, instead of the BTS folder? I think we'll need to do that with the CustomDomAdvisor folder too.
I will do those at the same time I fix the main INI file loading. Rather, fixing the main INI file loading will change those automatically.
ruff_hi Apr 21, 2008, 10:34 AM Re the strategic resouces (Copper, Iron, Horses, Ivory, Oil, Aluminium, Uranium) ... there are lots of options about how to show this. I'm flipping between ...
A) only showing the resources that we know (from the trading screen) they have and the number they have
B) showing all resources (and number from trading screen). If they know the tech that reveals it (and we do too), but they don't have any, then showing zero. If they don't know the tech (or we don't), then just show an empty resource icon with no counter on it. Is there a way of showing a resource icon but having it "grey'ed" out?
I'm leaning towards B.
·Imhotep· Apr 22, 2008, 05:54 AM @ruff:
Threat is spelled with "t" :p ...or are those direct links to the CFC threads about wars with those leaders :D ?
Other than that: Looks great ! :goodjob:
ruff_hi Apr 22, 2008, 07:13 AM @imhotep - thanks for that. I picked that up last night. I even had threadindex scattered thru the code. Not sure what I was thinking ... could have been that people were giving me a hard time on here and I decided to code up a thread threat index. :D
·Imhotep· Apr 22, 2008, 09:59 AM @ruff:
I've loaded up your new Military Advisor in my recent SP game. Interestingly enough it shows worst enemies, but doesn't apply the correct attitude icons in some cases (Tokugawa is furious for example).
http://img156.imageshack.us/img156/2770/madq9.jpg
Imhotep
ruff_hi Apr 22, 2008, 10:23 AM I know that I have an attitude issue with BUG Military adviser at present (I wish that was the only problem with it). Also, worse enemy is not 'unaltered' for version 3.13 (it will be 'n/a' in the formal BUG MA release). I put it in as a place holder because a little bird told me that this information will be in the next patch.
alerum68 Apr 22, 2008, 11:10 PM Did that little birdie happen to mention when that patch is likely to come out?;)
ruff_hi Apr 23, 2008, 07:58 PM Been thinking about my threat index ... here are the colours that we could use to grade from NIL to EXTREME. I'll take a look at this tonight and see if I can put it in order. Feel free to suggest your own order. I'm thinking of having 10 colours that slowly move from ??? to RED.
http://img165.imageshack.us/img165/7681/bugmagrade0061ws1.jpg
Note: The colours in the game look more vibrant than those shown above.
ruff_hi Apr 23, 2008, 09:45 PM Here is my suggestion. The 10 colours at the bottom in order from LOW to EXTREME risk.
http://img294.imageshack.us/img294/7971/bugma0065st3.jpg
EmperorFool Apr 23, 2008, 11:46 PM Mixing shades of grey in with colors looks confusing to me. I think I'd go with the reverse of the chromatic spectrum. From lowest to highest.
Black
Dark Grey
Light Grey
White
Violet (Purple)
Blue
Green
Yellow
Orange
Red
This way first the brightness increases from black to white, then it gets into colors and goes from highest spectrum to lowest. Maybe swap out the grey and white for other colors, like brown or whatnot.
The Doc Apr 24, 2008, 04:43 AM I think 10 colors are too much because they differentiate too little. I would prefer a simpler system with 5 colors that have a clear definition. Maybe the colors that the "Homeland Security Advisory System (http://en.wikipedia.org/wiki/Image:Hsas-chart.jpg)" is using.
ruff_hi Apr 24, 2008, 06:27 AM sounds good to me ...
http://upload.wikimedia.org/wikipedia/commons/f/f3/Hsas-chart.jpg
ruff_hi Apr 24, 2008, 06:29 AM sounds good to me ...
http://upload.wikimedia.org/wikipedia/commons/f/f3/Hsas-chart.jpg
Threat Index ...
progress bar, 0 to 100
0 - 20
20-40
40-60
60-75
75-100
25 pts for ATTITUDE ... -15 to +15 = 25 to 0
25 pts for strength rating ... -50% to +50% = 25 to 0 (str = us / them - 1)
20 pts for close borders or ocean exposure (us) and them with knowledge of astronomy
30 pts if they are WHEOOH
Can anyone suggest items that we can add to the calculation of the threat index so that it is more gradual and not so lump (ie WHEOOH!)
The Doc Apr 24, 2008, 07:42 AM WHEOOH could be something like era/technologies researched, culture points accumulated, land area, population, power of allies or number of cities/units. Or is that all part of the strength rating? :dunno:
alerum68 Apr 24, 2008, 08:38 AM Hey Ruff... don't forget to write up a doc for this.;)
And I like 5 colors myself.
ruff_hi Apr 24, 2008, 08:49 AM Hey Ruff... don't forget to write up a doc for this.;)Baaa - humbug! Its hard enough to produce the actual screens. I was also going to post the BUG MA as a mod component which will need some docs for it.
Bindamel Apr 24, 2008, 10:56 AM sounds good to me ...
http://upload.wikimedia.org/wikipedia/commons/f/f3/Hsas-chart.jpg
Threat Index ...
progress bar, 0 to 100
0 - 20
20-40
40-60
60-75
75-100
25 pts for ATTITUDE ... -15 to +15 = 25 to 0
25 pts for strength rating ... -50% to +50% = 25 to 0 (str = us / them - 1)
20 pts for close borders or ocean exposure (us) and them with knowledge of astronomy
30 pts if they are WHEOOH
Can anyone suggest items that we can add to the calculation of the threat index so that it is more gradual and not so lump (ie WHEOOH!)
WHEOOH should be a multiplier, rather than an addition. If the overall threat level is low, then the odds that they're coming after you is also low.
Do AI also say WHEOOH if they're already at war? That would be low threat level as well. In fact you may want to add in already at war with someone else as a reduction to threat level anyway.
Close borders should be a bigger value than astronomy + coastal city. Unless their fleet is known to be in the ocean, approaching. :eek:
EmperorFool Apr 24, 2008, 11:52 AM WHEOOH should be a multiplier, rather than an addition. If the overall threat level is low, then the odds that they're coming after you is also low.
I agree; if I don't fear their army, that they are gearing up for war doesn't increase my fear any more. If I fear their SoD, I pretty much drop whatever I'm doing and start mobilizing if I see they go WHEOOH.
Do AI also say WHEOOH if they're already at war? That would be low threat level as well. In fact you may want to add in already at war with someone else as a reduction to threat level anyway.
I believe so. I can't remember having an AI declare on me while being at war with someone else.
I know power rating captures the following, but maybe some would still be good to include separately.
First, key technological differences like access to Macemen when you only have Axemen or Riflemen when you only have Macemen. Ideally it would increase with each turn that the gap remained and dissipate once you close it.
Second, access to strategic resources.
Iron is slight at first
No metals is bigger at time of Macemen
Coal is slight (faster redeploy in borders)
Oil is huge
I think the major thing that is missing from all this is some sort of insanity level of the particular AI. Monty, Issy and Shaka should get an automatic bump up to the next higher threat level.
Finally, is there an event for when the AI extorts money or a tech. Perhaps this is a sign they think they might like to attack. I know I've started giving in to those demands more often after reading Sisiutil's ALCs.
ruff_hi Apr 24, 2008, 12:00 PM I like the WHEOOH as a multiplier. Building in complicated tech differentials is possible but I'm not sure I want to hard code those. Maybe I include key military techs (Copper, Iron, CS+Mach, Rifling, Industrialisation, Tank tech) in a similar way that I am including strategic resources. I am not putting in modifications for known nut-cases (Monty, Boudica, etc) as the player has to think about this themselves. Actually, we could make this a configuration (list of leaders with level adjuster ... -1, 0, +1) and include that in the ini file (not the option screen).
I think that they have a different reason for not trading war declarations if they are already in a war.
EmperorFool Apr 24, 2008, 01:29 PM Actually, we could make this a configuration (list of leaders with level adjuster ... -1, 0, +1) and include that in the ini file (not the option screen).
GMTA. I thought exactly this as I read your post. This would work great.
I think that they have a different reason for not trading war declarations if they are already in a war.
Sure, and the point is that you need to take that into consideration. If they are WHEOOH, it's only a multiplier if they are not at war. Maybe being at war just makes it less of a multiplier, but I almost think being at war itself should be a multiplier (e.g. 50% or 66%). Actually, sometimes they will be at war but not be WHEOOH, right?
ruff_hi Apr 24, 2008, 01:32 PM I think they are WHEOOH if, and only if, they are preparing for war. If they are in a war, they give another reason.
http://civilization4.net/files/modding/PythonAPI/Types/DenialTypes.html
EmperorFool Apr 24, 2008, 03:56 PM I'm pretty sure in my current game one of my friends was at war and said WHEOOH when I checked if they'd join in my war against a different AI. I'll check some of my back saves.
Edit: Yes indeed. Brennus declared war on Elizabeth (who was at war with Monty). This is the only war at this time. Brennus is WHEOOH for declaring on all other AIs. I don't know if it makes a difference, but he wants peace with Elizabeth as he's lost all his troops in her land and cannot advance (didn't advance actually).
Perhaps that's the difference. If the AI is willing to end the war, it cannot start another one yet?
ruff_hi Apr 26, 2008, 06:22 AM I'm stuck! I'm trying to write a short python function that will return the following (input parameter is the leader the active player is trying to trade with):
1) Yes / No / Mixed based on if it will declare war on all known players, no known players or a mixture of yes and no
2) The reason for not declaring war (first No answer)
3) boolean if any reason is WHEOOHs
I've looked at the code for trading tech and resouces but, to me, a war declaration is different as I need to loop over the other players to see if the input player will trade war to the active player.
This is what I have so far ...
def getDeclareWar(self, iLeader):
sReturn = ["", "", False]
tradeData = TradeData()
tradeData.ItemType = TradeableItems.TRADE_WAR
for iLoopLeader in range(gc.getMAX_PLAYERS()):
gcLoopLeader = gc.getPlayer(iLoopLeader)
if (gcLoopLeader.isAlive()
and (gc.getTeam(gcLoopLeader.getTeam()).isHasMet(gc.ge tPlayer(self.iActiveLeader).getTeam())
or gc.getGame().isDebugMode())
and not iLoopLeader == self.iActiveLeader
and not gcLoopLeader.isBarbarian()
and not gcLoopLeader.isMinorCiv()):
# code here to check if iLeader will trade war with iLoopLeader to iActiveLeader
return sReturn
Other functions I will have to use ...
loopPlayer.canTradeItem(iActivePlayerID, tradeData, False))
loopPlayer.getTradeDenial(iActivePlayerID, tradeData) == DenialTypes.NO_DENIAL and other denial types ... in particular 'DENIAL_TOO_MUCH'
ruff_hi Apr 26, 2008, 06:35 AM I've committed what I have to the SVN. It is still very much (!!) a work in progress - the code is a bit of a mess but it works. Be sure to grab IconGrid_BUG.py as I had to add some functionality to IconGrid.py for the military adviser (namely, the ability to hide the grid items and for a cell to hold a progress bar).
EmperorFool Apr 26, 2008, 08:24 AM I'm heading out for the weekend, returning Monday, but off the top of my head I'm guessing that you need to put the target Civ into the TradeData.iData field.
tradeData.iData = iLoopLeader
# Check if it will trade, and if not, grab the DenialType
Sorry for the lack of detail. Check MoreCiv4lerts for examples of checking the status of a trade. I think that's all you're missing.
BTW, if you want to match your naming style with the rest of the BUG code (and most mods I've seen so far), here are a few changes.
Use "p" as a prefix when "pointing" at an object instead of "gc".
Technically, iLoopLeader is actually a player #; you'll see iLoopPlayer a lot. The pPlayer you get from gc.getPlayer(iLoopPlayer) has a method, getLeaderType() which returns a LeaderHeadType, technically the Leader #.
I can't wait to check it out when I get back. This will be a really nice addition to the game.
ruff_hi Apr 26, 2008, 09:01 AM noted on the player / leader thing ... I've only recently been using leader so it shouldn't be a biggie swapping that back. re pointer ... as soon as I figure out what a fracking pointer is ... I will start using a 'p'.
Thx for the trade info ... I'm off to watch the mets v braves ... will look at it when I get back or tomorrow.
EmperorFool Apr 26, 2008, 02:00 PM A pointer is the address of some object in memory, whether that's an int, a string, or a CyPlayer.
Think of an address like the address to your home. The address is not your home -- you cannot live in it, and it has no bedrooms. It only "points to" your home. Given your address, I can find your home.
If you want me to come to your home, you don't describe your home in every detail, thus "giving me" your home. That would take too much time; it's an "expensive" operation. Instead you give me the address.
The same goes for objects like CyPlayer. The code uses the address in memory of the object as a reference to it. It can pass the pointer to other functions cheaply since it's a small amount of data. If it were to pass all of the data in the CyPlayer each time, it would be more expensive.
Pointers serve other more important purposes, however. By passing a pointer, the function that receives it can modify the original object.
For example, if you tell me your house is blue, I can't change its color. But if you give me your address, I can go to your home and paint it.
On a related note, the ever popular prefix in Windows coding "sz" means "string, zero-terminated." That means that the variable holds a string of characters ending in a special "this is the end" character that has ASCII value zero.
The practice of using standard prefixes in variable names is called Hungarian Notation. It became popular with the introduction of loosely-typed languages like VB. Python is loosely-typed as well. Languages like C, C++ and Java are strongly-typed: you have to tell the compiler exactly what each variable can hold.
This is acceptable, though confusing, in Python
x = 5 # holds an int
x = x + 3 # ok, now it holds the int 8
x = "Bob" # now it holds a string
x = x + 4 # runtime error, "cannot concatenate str and int"
You won't find the problem until you run the code. In Java, it won't even be runnable at all.
int x = 5; // can only hold an int
x = x + 3; // ok
x = "Bob"; // compile error, "cannot assign String to int"
Each type of language typing rules has its advantages. Most people shy away from Hungarian Notation (clear documentation is far preferable), but almost all of the code pulled into BUG uses it, so I did as well when changing things. You'll see much of the new BUG code doesn't use it.
ruff_hi Apr 27, 2008, 01:09 PM Just uploaded the latest version of the military adviser. The only (!) outstanding items are the threat index and the strategic resources.
http://img72.imageshack.us/img72/7034/bugma0067pn3.jpg
ruff_hi Apr 27, 2008, 01:11 PM For example, if you tell me your house is blue, I can't change its color. But if you give me your address, I can go to your home and paint it.Actually, the house is gray and it does need a paint. Thx for your offer - I will be in contact to take you up on that ... gee I hope you paint well.
Anyway - back to pointers - very nice description above. That just leaves me with the problem of when is a variable a pointer and when is it an int :D
ruff_hi Apr 27, 2008, 01:54 PM I'm at a bit of a cross roads about what to do with the strategic resources column. Initially, I thought to show the strategic resources they didn't have and / or the number that they did. Then I thought that the resources don't hurt you - it is the units they can build that do. So, I could show the units that they can build in this column - that would be a lot in the late game and devalue this column.
So, now I am considering showing the units that they can currently build (that you cannot build) based on their known tech and known resource. Thus, if they know bronze working and have copper but you cannot build axemen, then this column would show axemen in that list.
Thoughts / comments / input?
alerum68 Apr 27, 2008, 02:30 PM I like the last option best. That, or maybe just their most powerful unit they can build with their resources?
ruff_hi Apr 27, 2008, 03:20 PM I like the last option best.Thinking further about this ... it should be pretty easy. Get the list of units that the other leader can build (excluding non-combat units - workers, spies, missionaries, settlers, etc) Get the list of units you can build (excluding non-combat units) Compare lists removing duplicates Remove units from the list where the player does not know, or cannot research, the required tech and you are done (I think)
EmperorFool Apr 27, 2008, 06:25 PM I like that a lot as well. It sums up their military technological advantage. I wonder how easy it will be to code up, however.
Consider that cities that are not attached to their trade network will have a different set of buildable units. I know this is very rare in the late game where the list could get large. A good source of example code will be the code in CvMainInterface that draws the build order section in the bottom-center of the screen.
About the "denial reason" column, I wonder if this has any value as is. Clearly, if they are WHEOOH, that needs to be shown. I believe if they say that about AI X, they say it about all AIs.
However, the other denial reasons will vary based on the AI, so a single reason is misleading and I dare say unimportant. Perhaps this just needs to be a WHEOOH column by itself. Sure, it's in the threat index, but I think it's important enough to be called out separately. I still want to add it to the scoreboard.
ruff_hi Apr 27, 2008, 08:22 PM Some people have been talking about how unbalancing a WHEOOH alert is. I wanted to display the info but make the user work a little bit for it. Oh - by the way, the underlying denial for WHEOOH is 'DENIAL_TOO_MANY_WARS' which is interesting. It is generated when the AI is at war and has too much to do to. I guess it is also generated when the AI is planning for war. I was thinking of wrapping the text to fix the overflow problem but maybe we just go with the WHEOOH option and put a little fist beside the leader head.
EmperorFool Apr 27, 2008, 11:33 PM I understand the argument about it being an unbalancing feature, but I disagree somewhat. If you have the patience to check each AI each turn, you will get the same feature.
Thus, being uber patient or having nothing better to do with your time is an unbalancing feature. Similarly, being a good tactition is an unbalancing feature.
This alert would actually balance it so everyone -- even impatient people -- can use this information. As it stands, I only benefit from the info now if I happen to randomly check and they have it. That's not skill -- it's luck, and I don't want luck where it's not needed.
In any case, make it an option and we satisfy everyone. :) I know, that wouldn't satisfy everyone, but it sounds good.
And ya, I was thinking the fist, too.
ruff_hi Apr 28, 2008, 04:59 AM MA status ...
threat index - need to settle on the initial calculation routine and put it into play
strategic units on the main screen
scrolling - looked at this last night, copied the code and it didn't work - will look again and then probably put it aside
free up the main sort criteria (currently unit combat type) so that the user can select what it is - need drop down, refresh button and auto-refresh check box
glance screen
I'm not above asking for help so if anyone wants to chip in, feel free. I'm going to be looking at the main sort criteria today so the other items are free for your pleasure.
ruff_hi Apr 28, 2008, 08:49 PM MA status ...
threat index - need to settle on the initial calculation routine and put it into play
strategic units on the main screen
scrolling - looked at this last night, copied the code and it didn't work - will look again and then probably put it aside
free up the main sort criteria (currently unit combat type) so that the user can select what it is - need drop down, refresh button and auto-refresh check box
glance screen
How do you return 2 items from a function?
EmperorFool Apr 28, 2008, 10:30 PM How do you return 2 items from a function?
def getXandY():
return 2, 5
def printXandY():
x, y = getXandY()
print x
print y
In the above the return statement creates a tuple (an unmodifiable list) containing the two values 2 and 5. Using "x, y = ..." breaks apart the tuple. You could also do
def printXandY():
values = getXandY()
print values[0]
print values[1]
but I generally reserve that for when the returned items truly form a single item, for example a 3D point (x, y, z).
ruff_hi Apr 29, 2008, 08:38 AM Thx EFool - that will come in useful. I've split my work into first release and future release so that I am forced to concentrate on getting a version finished as opposed to playing with future features.
MA status ...
threat index - need to settle on the initial calculation routine and put it into play
strategic units on the main screen
scrolling - looked at this last night, copied the code and it didn't work - will look again and then probably put it aside - done and committed (revision 645)
hide strategic resource information if no tech and resource trading
hide threat index if cannot see power
MA status for future release ...
free up the main sort criteria (currently unit combat type) so that the user can select what it is - need drop down, refresh button and auto-refresh check box
glance screen
Currently working on threat index.
ruff_hi Apr 29, 2008, 09:25 PM MA status ...
threat index - need to settle on the initial calculation routine and put it into play
hide threat index if cannot see power
strategic units on the main screen
hide strategic resource information if no tech and resource trading
scrolling - looked at this last night, copied the code and it didn't work - will look again and then probably put it aside - done and committed (revision 645)
MA status for future release ...
free up the main sort criteria (currently unit combat type) so that the user can select what it is - need drop down, refresh button and auto-refresh check box
glance screen
Currently working on threat index.
·Imhotep· May 01, 2008, 09:35 AM @ruff:
Here is a shot from my recent game.
http://img360.imageshack.us/img360/3664/mave3.jpg
Right now it doesn't weight defensive pacts correctly. I have defensive pacts with Mehmed and Ramesses (both are friendly towards me) which means they can't declare on me right now - so the threat index should be guarded/green. Also Monty is a vassal of Mehmed and can't declare, yet the threat index is high... This is with latest revision 654 (or 652?) from the SVN.
Imhotep
ruff_hi May 01, 2008, 09:46 AM Threat index is calculated from:
relationship ... -15 to +15 is rescaled to 0 to 38
strength ... 50% to 150% (us / them) is rescaled to 38 to 0
threat is sum of above times 1.3 if WHEOOH
(38+38) * 1.3 is approx 100 which is what I was aiming for.
5 categories are delimited by ...
< 15 then Low
>= 15 and < 35 then Guarded
>= 35 and < 55 then Elevated
>= 55 and < 75 then High
>=75 then Extreme
I am more than happy to take suggestions into the make up of this threat index to include other items and to change the cutoff positions.
EmperorFool May 01, 2008, 11:51 AM First is to define exactly what "Threat Index" means in subjective terms (not numbers). For example, is it the likelihood that an AI will DoW on you or the danger they would pose if you were warring?
If it's the former, than having a PA should eliminate the index, and a DP with them should lower it (can they not declare war at all, or just less likely to?). Also, perhaps them having a DP with other civs would lower their likelihood of DoWing and losing the DP (dunno). Being a vassal would eliminate the index since they cannot DoW.
If it's the latter, having a DP with a civ other than you should possibly increase the index because it only matters if you DoW on them. Having a PA with another civ should increase the index as well.
Actually, I can see the argument against both of these as long as the player keeps in mind to consider the index of all civs that will be involved in the war. It would be difficult to quantify how the index should change as a result of a DP or PA, since it should really change based on the index of the other civs, but that then causes a feedback loop.
I think were aiming for the latter, not trying to guess the likelihood of a DoW but rather just judging the seriousness of being in a war with each civ.
Suggestion: Maybe PAs should be denoted in the screen somehow, perhaps by grouping those civs together. At least have some sort of mark so you are aware that you may be fighting multiple civs.
ruff_hi May 01, 2008, 12:43 PM I view the threat Index (TI) as an indication of the likeihood of a war declaration combined with how bad that would be. I think that we should include DP and Vassals in the calculation - maybe combine the calculation for PAs. All of the calculation inputs should be opened to the user so that they can turn things off but we should definitely have a view on what it is. I'll think about this and post more later (maybe the weekend).
Also, allow for an adjustment by leader.
Ekmek May 01, 2008, 01:16 PM I like the WHEOOH as a multiplier. Building in complicated tech differentials is possible but I'm not sure I want to hard code those. Maybe I include key military techs (Copper, Iron, CS+Mach, Rifling, Industrialisation, Tank tech) in a similar way that I am including strategic resources. I am not putting in modifications for known nut-cases (Monty, Boudica, etc) as the player has to think about this themselves. Actually, we could make this a configuration (list of leaders with level adjuster ... -1, 0, +1) and include that in the ini file (not the option screen).
I think that they have a different reason for not trading war declarations if they are already in a war.
arent there AI weights in the xml associated with more important resources and techs. Maybe that could used in the point system for the threat level.
ruff_hi May 01, 2008, 01:29 PM arent there AI weights in the xml associated with more important resources and techs. Maybe that could used in the point system for the threat level.No. That information is not available via the usual interface and so I don't think that we will be reflecting this information. Actually, this is another argument against having any leader adjustments included. Hmmn - as such, I don't think the 'production' version of BUG will include this but I think that we should include the ability for this so that the user can adjust it - just to stop requests coming in - thoughts?
EmperorFool May 01, 2008, 01:54 PM I'd recommend leaving out the per-AI user adjustments and focus on the main features. I'm already used to keeping an eye on Monty, and I bet others are as well. Put it into the feature tracker and we can hit it later.
ruff_hi May 01, 2008, 03:33 PM MA status ...
threat index - need to settle on the initial calculation routine and put it into play
hide threat index if cannot see power - could include comment "n/a"?
strategic units on the main screen
hide strategic resource information if no tech and resource trading - see if I can include comment
scrolling - looked at this last night, copied the code and it didn't work - will look again and then probably put it aside - done and committed (revision 645)
Add list of leaders that the current leader has a DP with
Add list of leaders that the current leader has vassalaged
Adjust Threat Index to include reduction value for DPs (say, 0.6?)
Adjust Threat Index for leaders that are vassals (duplicate their masters or completely remove?)
master icon - do we want this?
MA status for future release ...
free up the main sort criteria (currently unit combat type) so that the user can select what it is - need drop down, refresh button and auto-refresh check box
glance screen
worst enemy icon (only when patch has been released)
Currently working on threat index.
ruff_hi May 02, 2008, 03:44 PM Main sort criteria on the deployment tab ...
Currently, the main sort criteria is unitcombattype. Non combat units (workers, settlers, etc) have a combat type of 0. The other units have a combat type of 1, 2, etc. This makes it really easy to use the combat type as an index (0, 1, 2, 3, ...) and that is the way the code has been set up.
I want to free up the main index (leave the other 3 as they are - which are unit, array of all units, unit count). There are also some sub-routines (is that the right name) that control if you select a group, then you also select the subsets of that group. The parameters are very inconsistent in that some take the unit id, some take the unit type, others take the unit pointer. I want to consolidate all of those items and make it a single type ... unit pointer.
Now, if python was like C, or Visual VB, we could use a text value as a pointer to an array value (or the key to a member of a class). However, to the best of my knowledge, we cannot do that. So - here is what I am thinking regarding the main index ...
it needs to be a number .. 0, 1, 2, 3, ... it should be open ended and anything could be it
So, in my advanced programing skill (HAHA!), here is the method that I developed that will do this ...
create an array called PrimaryIndexKey. Use that index to hold the values that reflect the main index and use the array index for that value as the index for the unitlist index. Maybe an example would be clearer ...
Example
Say you want to use the following as your main index ... Own City Own Territory Foreign City Foreign Territory Other
... then you would need to execute the following code (pseudo) ...
PrimaryIndexKey = []
call getPrimaryIndexValue (pUnit) which does the following: determine the type of key you are looking for (in this case, one that is unit location based) check PrimaryIndexKey to see if the value this unit has (ie Own City) is in the array (loop over the PrimaryIndexKey array if it is, just return the index and the fact that you found the index and you are done if it isn't, append the value and return the index and the fact that you had to append the value.... now, back to the calling subroutine, then you get back a true / false and a number. If the boolean value is true, then you need to append an array to the unitlist array (I think it is [0,0,[],0 but check the code). Then use the number you get back from getPrimaryIndexValue to add that unit to the unitlist array.
The following is the code that zero-ises the unit list array ...
for iUnit in range(gc.getNumUnitInfos()):
self.unitsList[iUnit] = (gc.getUnitInfo(iUnit).getUnitCombatType(), iUnit, [], 0)
obviously, we cannot use this, thus we need to go with ...
self.unitList = [[]]
... and when we append a unit, we add something like this ...
x = getprimarykeyindex
self.unitlist.append(x, unit.unittype, [], 0)
Well - that was my thoughts but feel free to laugh and tell me the right way to do it. When we do it, I thing that the first that we should code up is the type of key = unitcombattype (ie what it is now) and then we should have the code exactly replicate what you currently see.
ruff_hi May 02, 2008, 03:48 PM Now - regarding the screen - I was thinking that we move the map down a touch, put in a drop down that contains the possible primary keys available, a check box that says "auto refresh" with hover "auto refresh when changing the drop down or using F5)" and a Text "Refresh" that is visible when the list box is dirty and not there when it is not.
Layout would be ..
[-----------drop down----------------]
[------check box-----][---refresh-----]
[-------------MAP -------------------]
[-------------MAP -------------------]
[-------------MAP -------------------]
[-------------MAP -------------------]
[-------------MAP -------------------]
[-------------MAP -------------------]
[-------------MAP -------------------]
[---GREAT GENERAL -PROGRESS BAR---]
EmperorFool May 02, 2008, 04:16 PM I'll start with the easy part first. :)
. . . a check box that says "auto refresh" with hover "auto refresh when changing the drop down or using F5)" and a Text "Refresh" that is visible when the list box is dirty and not there when it is not.
Why is this needed? The only reason to change the primary key index is to refresh the list. If there were multiple selection criteria, e.g. filtering checkboxes and such, then it may make sense. Also, it isn't necessary if it is quick to run.
That being said, I understand all that you said there and am on the same page. Now that tougher part.
First, as I understand you, the primary key index is the criteria by which the list groups units. Initially we'll have combat type, but others could be location, promotions, whatever. Okay, I doubt we'd do promotions, but it could be done.
Now, if python was like C, or Visual VB, we could use a text value as a pointer to an array value (or the key to a member of a class).
I think by this you mean a Python dict(tionary) class (http://docs.python.org/lib/typesmapping.html). It is like an array in that you use an index to locate an item, but it is different in that the index can be anything -- a string, an int, a float, a Butterfly or PyPlayer object, whatever you want. Also, with Python you can mix them in the same dict, which I do not recommend.
units = {}
units["Warrior"] = [CombatType.MELEE, gc.getUnitInfo(...)]
units["Archer"] = [CombatType.ARCHERY, gc.getUnitInfo(...)]
...
print units["Warrior"][1].getName()
The only naughty point is that dictionary keys are not ordered, so you have to sort them some other way. This is pretty straightforward, but not as trivial as when using an array.
# print out unit names, sorted by combat type above
keys = units.keys()
keys.sort()
for key in keys:
unit = units[key]
print unit[1].getName()
Now I poked around the code a little when looking at the GG thing, and my first impression is :eek:. It is horribly inefficient and needlessly complex. It would not take much to rewrite it, and I highly recommend doing so in order to make adding more grouping types.
I'm quite happy to do this part if you don't mind. I think what I can come up with will then be far easier for you to add more groupings to.
ruff_hi May 02, 2008, 07:06 PM Why is this needed?The F5 takes a long time to load because it is populating the array prior to displaying it. I can easily see the situation where the user wants to display units by location (say) but the last time he used F5 it was set up to show by level. He hits F5, has to wait until the stupid array is populated just to change the primary key and wait again.
I think by this you mean a Python dict(tionary) class (http://docs.python.org/lib/typesmapping.html).Did you read the part about me being a hack coder and not actually understanding anything that I am doing?
I'm quite happy to do this part if you don't mind.Be my guest. Are you planning on linking the dropdown to the bug.ini file - that was what I was thinking.
EmperorFool May 02, 2008, 07:17 PM He hits F5, has to wait until the stupid array is populated just to change the primary key and wait again.
Ah good point. I hadn't thought of it applying between F5 hits. I also realized there are other filters: the leaders you select. The user may want to click a few leaders and then load the list.
Did you read the part about me being a hack coder and not actually understanding anything that I am doing?
You've done some good stuff so far, so don't sell yourself short. I just wanted to make sure I understood what you were saying so I could explain the right thing.
Are you planning on linking the dropdown to the bug.ini file - that was what I was thinking.
How about an option to set the default selection that gets used each time you start civ? I would just rather not rewrite the .ini file every time they select a new option in the MA itself. I'm going to do the same thing for Raw Commerce -- you will set a BUG option to determine the default when civ loads, but switching it in the city screen won't change that default. Cool?
ruff_hi May 02, 2008, 07:26 PM How about an option to set the default selection that gets used each time you start civ? I would just rather not rewrite the .ini file every time they select a new option in the MA itself. I'm going to do the same thing for Raw Commerce -- you will set a BUG option to determine the default when civ loads, but switching it in the city screen won't change that default. Cool?Sounds good.
As I read the code, all visible units (regardless of leader) are loaded into the array at the start so selecting the leader is just a matter of refreshing the list box and you don't have to loop over the units again.
I'm at the stage of removing junk from the MA but I haven't touched the deployment subroutines for ages. Feel free to work from the version in the SVN. I only have the strategic resources columns to go and then I will upload what I have.
Edit: Oh, have to revisit the index too and ... oh, just see the latest status post above.
ruff_hi May 03, 2008, 09:01 AM Here is a screenie from the sit rep from the latest version ...
http://img292.imageshack.us/img292/6954/bugma0068jx0.jpg
little fist shows WHEOOH strategic advantage is when you can build a unit and the AI player cannot strategic disadvantage is when the AI player can build a unit and you cannot two hidden columns that should get displayed if they become required (vassals, defensive packs)
Note re no player water units in above pic: the units to build are generated from the capital city so if the capital city doesn't have water access, then no navel units can be built and it appears that the AI has an advantage. I'm going to include code to cycle thru the units and include all combat units that can be built anywhere - this will remove this problem.
Note re strategic disadvantage of out of date units: I'm currently just checking on a 1 to 1 basis, I need to remove a unit if a player can build it or one of the units that that unit upgrades to. This will remove (say) the horse archer from Monty because I can build the knight.
The threat index is as per above but now includes: not shown if AI player is a vassal multiplied by 20% if AI player has a defensive pact with human player
ruff_hi May 03, 2008, 09:04 AM MA status ...
threat index - need to settle on the initial calculation routine and put it into play
hide threat index if cannot see power - could include comment "n/a"?
strategic units on the main screen
hide strategic resource information if no tech and resource trading - see if I can include comment
scrolling - looked at this last night, copied the code and it didn't work - will look again and then probably put it aside - done and committed (revision 645)
Add list of leaders that the current leader has a DP with
Add list of leaders that the current leader has vassalaged
Adjust Threat Index to include reduction value for DPs
Adjust Threat Index for leaders that are vassals (duplicate their masters or completely remove?)
master icon - not enough room
remove strategic units if player can build an upgrade of a unit
cycle thru cities so that all units possible are included
expose all text to XML for multi-language support
MA status for future release ...
free up the main sort criteria (currently unit combat type) so that the user can select what it is - need drop down, refresh button and auto-refresh check box <-- EmperorFool has stuck his hand up for this one - good luck!
glance screen
worst enemy icon (only when patch has been released)
Currently working on improving the strategic unit list for improved units and water units.
alerum68 May 03, 2008, 09:06 AM That looks so good Ruff... I wouldn't be suprised if this gets rolled into the next patch for BTS. BTW - Are you using the US's comical threat index names?:)
ruff_hi May 03, 2008, 09:09 AM That looks so good Ruff... I wouldn't be suprised if this gets rolled into the next patch for BTS. BTW - Are you using the US's comical threat index names?:)Yes - see post a page or two back. Using that terminology and colour scheme.
Cammagno May 03, 2008, 09:39 AM Note re no player water units in above pic: the units to build are generated from the capital city so if the capital city doesn't have water access, then no navel units can be built and it appears that the AI has an advantage. I'm going to include code to cycle thru the units and include all combat units that can be built anywhere - this will remove this problem.
It will also remove problem of capital city not been connected to some resource to which the other cities instead are connected.
Note: last commit in SVN seems to have a bug (I think in IconGrid_BUG.py), no interface at all using it, everything ok reverting to previous one.
ruff_hi May 03, 2008, 09:53 AM oops - that is what happens if you change a statement with zero testing. Fixed.
·Imhotep· May 03, 2008, 10:53 AM @ruff:
Sit - Rep is not working ATM for me - if I try to change to it all I get is a the map from the overview page and the rest is blank. Tried clearing the cache too...
The Doc May 03, 2008, 11:21 AM That looks so good Ruff... I wouldn't be suprised if this gets rolled into the next patch for BTS. BTW - Are you using the US's comical threat index names?:)
+++
Really awesome. :D
Just a small suggestion: I think it would be better to show the threat index even when the civ is an ally or vassal, maybe as empty bar with a title that tells that the civ is an ally or vassal respectively. That way it wouldn't look as if the index is broken or something. :)
Cammagno May 03, 2008, 11:48 AM +++
Really awesome. :D
Just a small suggestion: I think it would be better to show the threat index even when the civ is an ally or vassal, maybe as empty bar with a title that tells that the civ is an ally or vassal respectively. That way it wouldn't look as if the index is broken or something. :)
I support this. And it gives the info of them being ally or vassal witthout the need of other columns.
EmperorFool May 03, 2008, 12:56 PM Wow, Ruff, this looks really nice! Here are a couple suggestions from the screenshot:
Change "Strategic" label on top line to "Strategic Advantage" and change the labels below to "Theirs" and "Ours". I assumed the advantage showed their advantage, so this would make it totally clear I think.
Perhaps include a modifier to the TI for WE? +10% maybe (1.1)?
I also agree that this looks like something Firaxis should include. :goodjob:
Sam_Yeager May 03, 2008, 02:53 PM I notice the screenie in post #71 still reads 'Thread Index' :rolleyes: Time for a global find and replace? :D
EmperorFool May 03, 2008, 03:00 PM Two more nitpicks:
If you open the MA with the Sit-Rep tab displayed, switching to the Units tab doesn't draw the minimap.
One of my maps is big enough to force the combat experience bar so low that it partially covers the Units tab text.
·Imhotep· May 03, 2008, 05:40 PM Okay, I don't know what's actually wrong here - but with revision 708 I have no useable MA at all ! Installed BUG anew thrice to no avail...
http://img291.imageshack.us/img291/8145/civ4screenshot0000qm2.jpg
Solutions appreciated, BUG is running fine apart from that.
Imhotep
EmperorFool May 03, 2008, 06:02 PM Crap, I committed my half-done MA changes accidentally when I applied Amra's Sevopedia addition. I've fixed the problem. Sync up and try again, please. You should also now see Amra's addition.
I apologize for the partial commit. I deselected the wrong modified file. :(
ruff_hi May 03, 2008, 06:45 PM Just a small suggestion: I think it would be better to show the threat index even when the civ is an ally or vassal, maybe as empty bar with a title that tells that the civ is an ally or vassal respectively. That way it wouldn't look as if the index is broken or something. :)It shows for players that have a DP with you. I was going to add 'Vassal' and no progress bar for leaders that are someone's vassal. There are two extra columns that are added if vassals or DPs exist in the game ... one showing vassals and the other showing DPs.
Change "Strategic" label on top line to "Strategic Advantage" and change the labels below to "Theirs" and "Ours". I assumed the advantage showed their advantage, so this would make it totally clear I think.Good suggestion - was never really happy with what I had.
Perhaps include a modifier to the TI for WE? +10% maybe (1.1)?Not so sure on this because it is a little bit of double counting. They already have a higher threat index because of the negative attitude.
ruff_hi May 03, 2008, 06:46 PM If you open the MA with the Sit-Rep tab displayed, switching to the Units tab doesn't draw the minimap.I've seen that and haven't really developed a solution. The 'bringminimaptofront' command doesn't seem to work. Solution I have is exit F5 and restart - minimap comes up then. Not idea but it works.
ruff_hi May 03, 2008, 06:48 PM One of my maps is big enough to force the combat experience bar so low that it partially covers the Units tab text.
Stop playing with big maps. Ok, quite happy to move the stupid thing around. What do you think of a panal that is the background for the map, progress bar and the unitlist panal?
ruff_hi May 03, 2008, 06:49 PM MA status ...
threat index - need to settle on the initial calculation routine and put it into play
hide threat index if cannot see power - could include comment "n/a"?
strategic units on the main screen
hide strategic resource information if no tech and resource trading - see if I can include comment
scrolling - looked at this last night, copied the code and it didn't work - will look again and then probably put it aside - done and committed (revision 645)
Add list of leaders that the current leader has a DP with
Add list of leaders that the current leader has vassalaged
Adjust Threat Index to include reduction value for DPs
Adjust Threat Index for leaders that are vassals (duplicate their masters or completely remove?)
master icon - not enough room
remove strategic units if player can build an upgrade of a unit
cycle thru cities so that all units possible are included
expose all text to XML for multi-language support
BUG: If you open the MA with the Sit-Rep tab displayed, switching to the Units tab doesn't draw the minimap
MA status for future release ...
free up the main sort criteria (currently unit combat type) so that the user can select what it is - need drop down, refresh button and auto-refresh check box <-- EmperorFool has stuck his hand up for this one - good luck!
glance screen
worst enemy icon (only when patch has been released)
Currently working on improving the strategic unit list for improved units and water units.
EmperorFool May 03, 2008, 06:50 PM Not so sure on this [modifier for Worst Enemy] because it is a little bit of double counting. They already have a higher threat index because of the negative attitude.
Good point. I don't know the AI mechanics at all. The only thing about WE I do know is that if you trade with a WE you get negative diplomacy modifiers, and that doesn't apply here really.
I do know that I've seen an AI give me a penalty for trading with their WE only to scan the Glance tab to find they were at Pleased or Friendly with every civ. So they were pleased with their worst enemy. Nice. This is right up there with being at war with an AI that is still pleased with you. :)
EmperorFool May 03, 2008, 06:55 PM What do you think of a panal that is the background for the map, progress bar and the unitlist panal?
That sounds fine to me. I'm quite happy to have it all on one panel like the FA, a single blue (or whatever) background behind everything.
Also, I continued the thing I started earlier -- showing GG-led units as another group in the list -- so I could get familiar with the original MA code, and have it working. I have the minimap showing up correctly all the time now with a minor related quirk. Once I get that done I'll commit.
To handle different groupings, I'd like to rewrite all the unit location code from scratch as I said earlier, and I won't be able to complete that today.
ruff_hi May 03, 2008, 07:01 PM I'm flicking the whole 'deployment' screen to you - get wild!
EmperorFool May 03, 2008, 07:05 PM Is it really necessary to copy the Glance tab to the MA? By enabling the hover for the leaderheads, you'd get the list of diplomatic modifers, and if you really want to you could add the attitude icons to the Sit Rep tab.
For the label "Will Declare On" how about "Will Declare War" or "Will Go To War"? Hmm, "Will Declare War On" would be great, but it makes the column so wide.
ruff_hi May 03, 2008, 07:09 PM I can see myself want to go sit-rep, glance and back and forth - thought it would be good to have it very handy. The sit-rep uses icongrid which doesn't seem to support all of the hover text that you might want. I looked into adding the attitude icons but, again, icongrid does some fairly draconian text formatting. I'm thinking of freeing that up with format parameters but that is certainly something for down the track.
What about "Declare?" or "Declare On?"
EmperorFool May 03, 2008, 07:35 PM True about IconGrid, though it does have the hovers for techs in the trade screen. How about at least getting the hovers for the units? :) Regarding the attitude icons, they are just characters in the font like the fist you already have.
This just popped into my head, though I don't think I'm sold on it. The fist is currently being used as "at war" in the scoreboard. Perhaps instead of using it again here for "mobilizing" (WHEOOH), we could use the flexed arm (power) or the movement (foot, as in mobilizing). Ick, I don't much like any of those. :) Just tossing out (bad) ideas.
I wanted to get "war" in the label since "declare" is ambiguous to me (you can declare peace). I was thinking "Will Attack", but then the AI will often DoW without actually attacking. :crazyeye:
ruff_hi May 03, 2008, 07:44 PM I did have attitude in there originally and icongrid made it look horrible.
The hover for units is 'WIDGET_TRAIN' which works ok for units that you can train but causes a crash for units that you cannot (ie roman preat). Is there another unit based hover that we could use? Also, I couldn't get the hover to come through correctly - kept saying that a phant was a stealth fighter (or something like that).
"Go to War?" or "War?"
·Imhotep· May 03, 2008, 07:45 PM You might have a problem late game. I tested revision 709 with my recent Emperor game. MA broken. Went back to a save from 275 BC, same game. MA absolutely fine. The save for investigation is attached. Oh, and can you win the game for me ? :D ;)
Imhotep
ruff_hi May 03, 2008, 07:52 PM You might have a problem late game. I tested revision 709 with my recent Emperor game. MA broken. Went back to a save from 275 BC, same game. MA absolutely fine. The save for investigation is attached. Oh, and can you win the game for me ? :D ;)Thanks for this game - I'll take a look at why the sit-rep isn't showing up. I cannot believe that you built your capital on coal - what were you thinking? :D
Edit: I put in some code to try and add columns for vassals and DefPacks but only if they are present. It seems my code for doing this is broken. I'll revisit and see what I can do.
EmperorFool May 03, 2008, 07:55 PM Try WIDGET_PEDIA_JUMP_TO_UNIT.
Stealth oliphants!!! "Wait till the boys back at the Shire hear about this!"
Dunno about the heading. It's probably fine as it is now.
·Imhotep· May 03, 2008, 08:00 PM @ruff:
My guess it has something to do with PAs - as I have one with Ramesses but hadn't one 275 BC of course. Yet 275 BC Monty was a vassal of Mehmed and the MA worked just fine...I have the save if you want it.
Imhotep
EmperorFool May 03, 2008, 08:13 PM Okay, I've committed what I have on the deployment screen. The redraw problems should be fixed, so please play around with clicking lots of things. I can now start on the new version.
Here are the two groupings I know of:
Combat type + Lead by GG
Location
Your Cities
Your Territory
Friendly Cities
Friendly Territory
Enemy Territory
Neutral Territory
For Location, do we need to separate Friendly into Team and non-Team? I doubt it, but just asking. And do we care about Cities vs. Territory for Friendly?
The determination of own/friendly/enemy should be made regardless of the unit's owner, right? Meaning selecting an AI will show you their units in your territory under "Your Territory/Cities", right? Can you think of a better word than "Your"? "Home"? "Own"? "Domestic"? Your civ's adjective, e.g. "Indian Cities"?
What other groupings can you think of?
Now that I think of it, for the Location grouping, will the secondary grouping still be unit type? If so, that means you'll see each unit type under each grouping. This will make the list much longer. For combat type, Archers only appear under the Archery group. With Location, it will appear under each group where there is at least one Archer. Should we group by combat type instead?
Certainly, it would be nice to have a secondary grouping dropdown as well, so you could select "Location"/"Combat Type" or "Location"/"Unit Type" for more detail. I suppose you could then select "Combat Type"/"Location". Is this much detail desired, and more importantly, truly useful?
I need more ideas for groupings as that will help me in designing the code and interface.
ruff_hi May 03, 2008, 08:21 PM EFool - there are a bunch earlier on in this thread from me and Imhotep. See the first page.
Re combat type - I'd leave it as is first time thru and see how it looks.
ruff_hi May 03, 2008, 08:32 PM You might have a problem late game. I tested revision 709 with my recent Emperor game. MA broken. Went back to a save from 275 BC, same game. MA absolutely fine. The save for investigation is attached. Oh, and can you win the game for me ? :D ;)
ImhotepTry revision 711. I also imported EmporerFools' deployment code into my version of BUGMA which probably means that I introduced some errors in it :D.
EmperorFool May 03, 2008, 08:51 PM I'd rather like to see an overview of units with the currently highest XP.
That's a sort order -- not a grouping. Can you think of a way to group units by XP, for example by level? Okay, Ruff suggested by XP and level as well.
promotion
Grouping by promotion could work, but it has some quirks. Do you show those with Combat 3 in the Combat 1 group as well since they have C1? Same for other promotions with multiple levels.
Listing based on health status, and if the unit can be upgraded.
These both seem like candidates for filtering as opposed to grouping or sorting by adding checkboxes ("Injured", "Upgradeable" and "Promotable"), though grouping would work as well by creating two groups for each, or even a % scale in the case of Health.
Is "Movable" desired for finding units that can still move? It will highlight all defenders, so it's probably useless.
Did I miss any others?
Certainly, a sort order when displaying individual units is a good idea. XP, level, health, strength (normal or actual).
I'm wondering now if we could start with one of the other community MAs for this tab? IIRC, there's a good one but the complaint is that it's slow to load. I could take a look at it and see if I can optimize it. Any recommendations for one with great features?
alerum68 May 03, 2008, 09:02 PM Is there anyway we can give it a reduce size healther bar, similiar to Ruffs Thread Index?
EmperorFool May 03, 2008, 10:13 PM Is there anyway we can give it a reduce size healther bar, similiar to Ruffs Thread Index?
Can you please elaborate? Are you saying to shrink the GG bar? Or are you talking about grouping by health?
ruff_hi May 03, 2008, 10:43 PM well - unit combat type is a sort order too. I was thinking that the list box would show a list of numbers so that you can see how many units you have that are 15 XPs. I see your point re promotion - can they get added in twice. I hate having to search for medic units.
I mainly use F5 for finding units that are hiding and for getting a unit count. Level would be good so that you can see which unit is closest to unlocking the HE and Pentagon.
alerum68 May 03, 2008, 10:52 PM Yes, shrink the GG bar, and use it as a health bar... or maybe take the health bar that hovers over units, and have it displayed there?
Maybe, instead of adding a sort order for all promotions, just add it for ones that you use often. Medic Units, City Attackers, Woodsman II... things like that.
ruff_hi May 03, 2008, 10:54 PM Stupid unit upgrades. I found this code
gc.getUnitInfo(k).getUpgradeUnitClass(iUnit)
... which is a boolean but I cannot figure out if it shows that k is an upgrade of iUnit or the other way around. Look at this list ...
Unit to test ... Maceman ... the first boolean is k then iUnit and the next is them reversed. From the civopedia ... mace upgrades to rifle or Grenadier (which in turn, upgrade to infantry, etc. I'm hoping to get a list of all units that a mace could become.
Lion False False
Bear False False
Panther False False
Wolf False False
Settler False False
Worker False False
Fast Worker False False
Scout False False
Explorer False False
Spy False False
Cereal Mills Executive False False
Sid's Sushi Executive False False
Std Ethanol Executive False False
CreateCon Executive False False
Mining Inc Executive False False
AlumCo Executive False False
Civ Jewels Executive False False
Jewish Missionary False False
Christian Missionary False False
Islamic Missionary False False
Hindu Missionary False False
Buddhist Missionary False False
Confucian Missionary False False
Taoist Missionary False False
Warrior False False
Quechua False False
Swordsman False False
Jaguar False False
Gallic Warrior False False
Praetorian False False
Axeman False True
Phalanx False True
Vulture False False
Dog Soldier False False
Maceman False False
Samurai False False
Berserker False False
Spearman False False
Impi False False
Holkan False False
Pikeman False False
Landsknecht False False
Musketman False False
Musketeer False False
Janissary False False
Oromo Warrior False False
Rifleman False False
Redcoat False False
Grenadier False False
Anti-Tank False False
Infantry True False
SAM Infantry False False
Mobile SAM False False
Marine False False
Navy SEAL False False
Paratrooper False False
Mechanized Infantry False False
Archer False False
Skirmisher False False
Bowman False False
Longbowman False False
Crossbowman False False
Cho-Ko-Nu False False
Chariot False False
War Chariot False False
Immortal False False
Horse Archer False False
Numidian Cavalry False False
Keshik False False
Knight False False
Camel Archer False False
Cataphract False False
Conquistador False False
Cuirassier False False
Cavalry False False
Cossack False False
War Elephant False False
Ballista Elephant False False
Tank False False
Panzer False False
Modern Armor False False
Gunship False False
Catapult False False
Hwacha False False
Trebuchet False False
Cannon False False
Machine Gun False False
Artillery False False
Mobile Artillery False False
The CvPediaUnit.py file in 'def placeUpgradesTo(self):' has 'gc.getUnitInfo(self.iUnit).getUpgradeUnitClass(k) ' and shows the k unit button on the iUnit screen. There is also some other code that just clears up the unique unit issues (I think).
EmperorFool May 04, 2008, 05:47 AM I'm wrestling with how to add sort/group options and keep the list usable at the same time. For example, if you have a lot of units and select "Promotion"/"Unit Type" you'll see each unit type listed below each promotion with at least one unit of that type having the promotion. This will mean a lot of scrolling to see the totals:
ALL UNITS (182)
NONE (33)
Warrior (2)
Archer (10)
Axeman (4)
Swordsman (1)
Spearman (3)
Chariot (6)
Galley (5)
Trireme (2)
COMBAT 1 (18)
Warrior (1)
Archer (1)
Axeman (3)
Swordsman (2)
Spearman (4)
Chariot (2)
Galley (1)
Trireme (4)
COMBAT 2 (5)
Warrior (1)
Spearman (1)
Chariot (2)
Trireme (1)
...
I limited that to the early years when you have only a few promotable unit types (workers, settlers, spies, etc. would not be shown in the promotion view). Imagine this list when you've got 20 or so types.
Perhaps just adding a "None" grouping would solve this. You could select "Promotion"/"None" and see just the list of promotions without the unit type breakdown below it.
For the filtering checkboxes -- injured :yuck:, promotable (a star), can move :move:, upgradeable :strength: -- I'll need DDS graphics instead of the font glyphs. Is anyone particularly adept at The Gimp or some other graphics program and can make DDS versions (or find if they exist already) of these characters? If so, could you do the same for :food:, :hammers:, and :commerce:?
ruff_hi May 04, 2008, 07:04 AM For the filtering checkboxes -- injured :yuck:, promotable (a star), can move :move:, upgradeable :strength: -- I'll need DDS graphics instead of the font glyphs. Is anyone particularly adept at The Gimp or some other graphics program and can make DDS versions (or find if they exist already) of these characters? If so, could you do the same for :food:, :hammers:, and :commerce:?I can do that. Any thing else that you need?
EmperorFool May 04, 2008, 07:15 AM If you could sketch out some layouts, that'd be great. Space will be a premium, so I'm thinking we could move the GG bar elsewhere (to the bottom panel maybe?) or make it smaller and then put the group/sort/filter options above the map as you suggested.
[-------- L E A D E R H E A D S ---------]
Group: [Menu1] [Menu2] [--- L I S T ---]
Sort: [Menu] [x Details]
[---- Filter Buttons ----]
[------- M A P --------]
I figure two levels of grouping should be okay, yes? I'm not sure about sort yet. It really only applies when you are viewing the individual unit details. A button for that needs to be created as the current one is a bit large: "+/- Show Unit Details".
I've got the code to store define and capture all the groupings for the ones we discussed:
Combat Type
Unit Type
Promotion
Location
I'm currently dealing with Promotion as it is the first one to require multiple values for a single unit. None of this is being displayed or has even been tested in Civ yet, so don't get too excited. ;)
·Imhotep· May 04, 2008, 07:20 AM NEAT WORK GUYS ! The MA now works perfect with my late game save, and the map is drawn correctly when switching between Deployment and Sit-Rep. One minor issue with Sit-Rep: If the human can build only an obsolete version of the unit the AI has (in my case I have Tanks and Fighters, he has Modern Armour and Jet Fighters) the obsolete version shouldn't be listed as strategig advantage... other than that: very cool, this is a masterpiece !
Imhotep
ruff_hi May 04, 2008, 07:25 AM One minor issue with Sit-Rep: If the human can build only an obsolete version of the unit the AI has (in my case I have Tanks and Fighters, he has Modern Armour and Jet Fighters) the obsolete version shouldn't be listed as strategig advantage... other than that: very cool, this is a masterpiece !That is a known issue that I am trying to fix. I am not sure the python code allows me to do it ... or, I am using the wrong code (this is much more likely) :D.
ruff_hi May 04, 2008, 07:27 AM A button for that needs to be created as the current one is a bit large: "+/- Show Unit Details".Isn't that button just text and so we can shorten it in python? Suggest same for sort option.
Re GG progress bar - what about shoving it up with 'Military Advisor' to get it out of the way? Not pretty but ...
ruff_hi May 04, 2008, 07:28 AM MA status ...
threat index - need to settle on the initial calculation routine and put it into play
hide threat index if cannot see power - could include comment "n/a"?
strategic units on the main screen
hide strategic resource information if no tech and resource trading - see if I can include comment
scrolling - looked at this last night, copied the code and it didn't work - will look again and then probably put it aside - done and committed (revision 645)
Add list of leaders that the current leader has a DP with
Add list of leaders that the current leader has vassalaged
Adjust Threat Index to include reduction value for DPs
Adjust Threat Index for leaders that are vassals (duplicate their masters or completely remove?)
master icon - not enough room
remove strategic units if player can build an upgrade of a unit - currently looking at this but the code I see doesn't work :hmn:
cycle thru cities so that all units possible are included
expose all text to XML for multi-language support
BUG: If you open the MA with the Sit-Rep tab displayed, switching to the Units tab doesn't draw the minimap
MA status for future release ...
free up the main sort criteria (currently unit combat type) so that the user can select what it is - need drop down, refresh button and auto-refresh check box <-- EmperorFool has stuck his hand up for this one - good luck!
glance screen
worst enemy icon (only when patch has been released)
Currently working on cycling thru all cities to pick up all units that can be built.
EmperorFool May 04, 2008, 07:51 AM I'm pretty sure I can write some code to help you detect obsolete units. It will set up an obsoleted-by table when the screen opens and then use the set of all units you and the AIs can build to remove obsolete ones.
Psuedocode:
screen.open:
build obsolete table
build list of units player can build
for each non-player civ:
build list of units civ can build
draw list of player advantages using civ-unit-list
draw list of civ advantages using player-unit-list
Give me a few minutes* and I'll post some real code. :)
* Actual results may vary. Ask your doctor if you experience bleeding gums or severe flatulence.
EmperorFool May 04, 2008, 08:02 AM Quick question: If you can build Musketman, should the screen show Musketeer as an advantage for French AIs? If so, I assume it should not show Musketman as an advantage for you; they can't each be better than the other.
Of course, some would argue that Swordsman is better than the Aztec replacment -- the one that builds without Iron but is weaker. In this case, both should be shown.
The simple solution is to treat civ-specific units as the regular kind. In the first example, neither Musketman nor Musketeer would be displayed.
Which of the three options do you prefer?
EmperorFool May 04, 2008, 08:56 AM Here's a first attempt. It considers Musketman and Musketeers to be unrelated. They will each display in the advantages in the case I outlined above. This handles cases where the civ-specific unit isn't better than the default unit in all cases. It's left up to the player to decide.
You'll need to alter the code that you use to generate the list of units that a civ can build. I'd like to introduce you to the handy set() class (http://docs.python.org/lib/types-set.html). It holds a collection of objects (in this case unit type IDs), but each value will only appear once no matter how many times you add it. They are great for comparing to each other (union, difference, subset, etc).
Here's some sample usage code to highlight the functions you'll likely need to use:
units = set() # create a new, empty set
units.add(5) # put 5 into the set
units.add(2) # put 2 into the set
units.add(5) # 5 already in set, nothing happens
if 5 in units:
print "5 is in the set"
if 1 not in units:
print "1 is not in the set"
other = set()
other.add(1)
other.add(2) # other == (1, 2)
print units & other # intersection --> (2)
print units | other # union --> (1, 2, 5)
print units - other # minus --> (5)
print units ^ other # items only in one set or the other --> (1, 5)
# equivalent to union - intersection
Now here's the code so far. Note: I have not tested this at all.
def buildObsoleteGraph(self):
NUM_UNITS = gc.getNumUnitInfos()
# Create graph of single-step upgrades (Swordsman to Maceman)
self.obsoleteUnits = {}
self.completeUnits = set()
for iUnitA in range(NUM_UNITS):
infoA = gc.getUnitInfo(iUnitA)
upgrades = set()
self.obsoleteUnits[iUnitA] = upgrades
for iUnitB in range(NUM_UNITS):
infoB = gc.getUnitInfo(iUnitB)
if infoA.getUpgradeUnitClass(infoB.getUnitClassType() ):
upgrades.add(iUnitB)
# Now add all transitive upgrades (Swordsman to Rifleman)
for iUnit in self.obsoleteUnits.iterkeys():
self.buildObsoleteClosure(iUnit)
def buildObsoleteClosure(self, iUnit):
upgrades = self.obsoleteUnits[iUnit]
if iUnit not in self.completeUnits:
nextUpgrades = set()
for iNextUnit in upgrades:
nextUpgrades |= self.buildObsoleteClosure(iNextUnit)
upgrades |= nextUpgrades
self.completeUnits.add(iUnit)
return upgrades
def isObsolete(self, iUnit, enemyUnits):
upgrades = self.obsoleteUnits[iUnit]
return len(upgrades & enemyUnits) > 0
ruff_hi May 04, 2008, 09:05 AM Quick question: If you can build Musketman, should the screen show Musketeer as an advantage for French AIs? If so, I assume it should not show Musketman as an advantage for you; they can't each be better than the other.I was going to treat UUs as totally different units. So if Rome can build preats and I can build swords, then that is a strategic advantage to both of us. Admittedly, not much of an advantage to me but the user will have to just work those out by himself.
EmperorFool May 04, 2008, 09:14 AM Great! That's exactly what the code that I posted does. It wouldn't be too hard to make them equivalent, if you change your mind.
I'm against making one better than the other simply because the decision is a) subjective and b) situational. Beserker is pretty much the same as Maceman on a Pangea; the Iron-less Swordsman is usually not an advantage; Praets always kick ass over Swordsman, etc.
ruff_hi May 04, 2008, 09:47 AM like the code - thx EF. I'm just going to run thru my logic so that you can get a laugh and correct me. BTW - set() sounds great! I have a unit that player A can build ... UnitA (think horse archer).
I also have set of units that player B can build.
Now, I want to display UnitA if that unit (or any of the units that UnitA upgrades to) is not in the set that B can build. So if the set of units that B can build contains a chopper, then no horse archer.
There are obviously a number of ways of doing this but here is how I was thinking of approaching it.
pseudo code...
AllPlayerAs_Units = getCanTrain(PlayerA)
AllPlayerBs_Units = getCanTrain(PlayerB)
for UnitA in AllPlayerAs_Units
UpgradeSet_UnitA = get_set_of_units_to_check(UnitA)
if len(UpgradeSet_UnitA & AllPlayerBs_Units) > 0:
add UnitA button
def getCanTrain(PlayerA)
I already have this
def get_set_of_units_to_check(UnitA)
I will be looking at your code to build this
EmperorFool May 04, 2008, 09:54 AM That looks great. Part of the code is done above for you:
for UnitA in AllPlayerAs_Units
UpgradeSet_UnitA = get_set_of_units_to_check(UnitA)
if len(UpgradeSet_UnitA & AllPlayerBs_Units) > 0:
add UnitA button
becomes
for UnitA in AllPlayerAs_Units
if not self.isObsolete(UnitA, AllPlayerBs_Units):
add UnitA button
ruff_hi May 04, 2008, 10:50 AM Here is my code ... basically EFools with some variable renaming so it wasn't as confusing for me
def PrintUpgrades(self):
if len(self.FutureUnitsByUnitClass) == 0:
self.buildFutureUnitsByUnitClass()
for u in (self.FutureUnitsByUnitClass):
sDummy = "Unit Upgrade (%s): " % (gc.getUnitInfo(u).getDescription())
upgrades = self.FutureUnitsByUnitClass[u]
for k in upgrades:
sDummy += " %s" % (gc.getUnitInfo(k).getDescription())
print sDummy
return
def buildFutureUnitsByUnitClass(self):
NUM_UNITS = gc.getNumUnitInfos()
# Create graph of single-step upgrades (Swordsman to Maceman)
self.FutureUnitsByUnitClass = {}
self.UnitsAlreadyMapped = set()
for iUnitA in range(NUM_UNITS):
infoA = gc.getUnitInfo(iUnitA)
upgrades = set()
self.FutureUnitsByUnitClass[iUnitA] = upgrades # <-- creates a link between these two items
for iUnitB in range(NUM_UNITS):
infoB = gc.getUnitInfo(iUnitB)
if infoA.getUpgradeUnitClass(infoB.getUnitClassType() ):
upgrades.add(iUnitB) # also adds iUnitB to FutureUnitsByUnitClass array
# Now add all transitive upgrades (Swordsman to Rifleman)
for iUnit in self.FutureUnitsByUnitClass.iterkeys():
self.buildFutureArray_Closure(iUnit) # just starting the recursive call
def buildFutureArray_Closure(self, iUnit):
upgrades = self.FutureUnitsByUnitClass[iUnit]
if iUnit not in self.UnitsAlreadyMapped:
nextUpgrades = set()
for iNextUnit in upgrades:
nextUpgrades |= self.buildFutureArray_Closure(iNextUnit) # note recursive call
upgrades |= nextUpgrades
self.UnitsAlreadyMapped.add(iUnit)
return upgrades
... and here are the results of that print ...
Unit Upgrade (Lion):
Unit Upgrade (Bear):
Unit Upgrade (Panther):
Unit Upgrade (Wolf):
Unit Upgrade (Settler):
Unit Upgrade (Worker):
Unit Upgrade (Fast Worker):
Unit Upgrade (Scout): Explorer
Unit Upgrade (Explorer):
Unit Upgrade (Spy):
Unit Upgrade (Cereal Mills Executive):
Unit Upgrade (Sid's Sushi Executive):
Unit Upgrade (Std Ethanol Executive):
Unit Upgrade (CreateCon Executive):
Unit Upgrade (Mining Inc Executive):
Unit Upgrade (AlumCo Executive):
Unit Upgrade (Civ Jewels Executive):
Unit Upgrade (Jewish Missionary):
Unit Upgrade (Christian Missionary):
Unit Upgrade (Islamic Missionary):
Unit Upgrade (Hindu Missionary):
Unit Upgrade (Buddhist Missionary):
Unit Upgrade (Confucian Missionary):
Unit Upgrade (Taoist Missionary):
Unit Upgrade (Warrior): Vulture Dog Soldier Maceman Samurai Berserker Spearman Impi Holkan Pikeman Landsknecht Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry Axeman Phalanx
Unit Upgrade (Quechua): Machine Gun Axeman Phalanx Vulture Dog Soldier Maceman Samurai Berserker Spearman Impi Holkan Pikeman Landsknecht Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Mechanized Infantry
Unit Upgrade (Swordsman): Maceman Samurai Berserker Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Jaguar): Maceman Samurai Berserker Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Gallic Warrior): Maceman Samurai Berserker Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Praetorian): Maceman Samurai Berserker Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Axeman): Maceman Samurai Berserker Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Phalanx): Maceman Samurai Berserker Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Vulture): Maceman Samurai Berserker Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Dog Soldier): Maceman Samurai Berserker Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Maceman): Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Samurai): Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Berserker): Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Spearman): Pikeman Landsknecht Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Impi): Pikeman Landsknecht Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Holkan): Pikeman Landsknecht Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Pikeman): Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Landsknecht): Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Musketman): Infantry SAM Infantry Mobile SAM Mechanized Infantry Rifleman Redcoat
Unit Upgrade (Musketeer): Infantry SAM Infantry Mobile SAM Mechanized Infantry Rifleman Redcoat
Unit Upgrade (Janissary): Infantry SAM Infantry Mobile SAM Mechanized Infantry Rifleman Redcoat
Unit Upgrade (Oromo Warrior): Infantry SAM Infantry Mobile SAM Mechanized Infantry Rifleman Redcoat
Unit Upgrade (Rifleman): Mechanized Infantry Infantry SAM Infantry Mobile SAM
Unit Upgrade (Redcoat): Mechanized Infantry Infantry SAM Infantry Mobile SAM
Unit Upgrade (Grenadier): Mechanized Infantry Infantry SAM Infantry Mobile SAM Machine Gun
Unit Upgrade (Anti-Tank): Mechanized Infantry
Unit Upgrade (Infantry): Mechanized Infantry SAM Infantry Mobile SAM
Unit Upgrade (SAM Infantry): Mobile SAM
Unit Upgrade (Mobile SAM):
Unit Upgrade (Marine):
Unit Upgrade (Navy SEAL):
Unit Upgrade (Paratrooper):
Unit Upgrade (Mechanized Infantry):
Unit Upgrade (Archer): Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry Longbowman Crossbowman Cho-Ko-Nu
Unit Upgrade (Skirmisher): Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry Longbowman Crossbowman Cho-Ko-Nu
Unit Upgrade (Bowman): Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry Longbowman Crossbowman Cho-Ko-Nu
Unit Upgrade (Longbowman): Infantry SAM Infantry Mobile SAM Mechanized Infantry Rifleman Redcoat
Unit Upgrade (Crossbowman): Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Cho-Ko-Nu): Rifleman Redcoat Grenadier Infantry SAM Infantry Mobile SAM Machine Gun Mechanized Infantry
Unit Upgrade (Chariot): Knight Camel Archer Cataphract Conquistador Cuirassier Cavalry Cossack Gunship
Unit Upgrade (War Chariot): Knight Camel Archer Cataphract Conquistador Cuirassier Cavalry Cossack Gunship
Unit Upgrade (Immortal): Knight Camel Archer Cataphract Conquistador Cuirassier Cavalry Cossack Gunship
Unit Upgrade (Horse Archer): Knight Camel Archer Cataphract Conquistador Cuirassier Cavalry Cossack Gunship
Unit Upgrade (Numidian Cavalry): Knight Camel Archer Cataphract Conquistador Cuirassier Cavalry Cossack Gunship
Unit Upgrade (Keshik): Knight Camel Archer Cataphract Conquistador Cuirassier Cavalry Cossack Gunship
Unit Upgrade (Knight): Conquistador Cuirassier Cavalry Cossack Gunship
Unit Upgrade (Camel Archer): Conquistador Cuirassier Cavalry Cossack Gunship
Unit Upgrade (Cataphract): Conquistador Cuirassier Cavalry Cossack Gunship
Unit Upgrade (Conquistador): Gunship Cavalry Cossack
Unit Upgrade (Cuirassier): Gunship Cavalry Cossack
Unit Upgrade (Cavalry): Gunship
Unit Upgrade (Cossack): Gunship
Unit Upgrade (War Elephant): Conquistador Cuirassier Cavalry Cossack Gunship
Unit Upgrade (Ballista Elephant): Conquistador Cuirassier Cavalry Cossack Gunship
Unit Upgrade (Tank): Modern Armor
Unit Upgrade (Panzer): Modern Armor
Unit Upgrade (Modern Armor):
Unit Upgrade (Gunship):
Unit Upgrade (Catapult): Mobile Artillery Cannon Artillery
Unit Upgrade (Hwacha): Mobile Artillery Cannon Artillery
Unit Upgrade (Trebuchet): Mobile Artillery Cannon Artillery
Unit Upgrade (Cannon): Mobile Artillery Artillery
Unit Upgrade (Machine Gun): Mechanized Infantry
Unit Upgrade (Artillery): Mobile Artillery
Unit Upgrade (Mobile Artillery):
Unit Upgrade (Work Boat):
Unit Upgrade (Galley): Transport Galleon East Indiaman
Unit Upgrade (Trireme): Frigate Destroyer Missile Cruiser Stealth Destroyer Attack Submarine Caravel Carrack
Unit Upgrade (Caravel): Frigate Destroyer Missile Cruiser Stealth Destroyer Attack Submarine
Unit Upgrade (Carrack): Frigate Destroyer Missile Cruiser Stealth Destroyer Attack Submarine
Unit Upgrade (Galleon): Transport
Unit Upgrade (East Indiaman): Transport
Unit Upgrade (Privateer): Stealth Destroyer Destroyer Missile Cruiser
Unit Upgrade (Frigate): Stealth Destroyer Destroyer Missile Cruiser
Unit Upgrade (Ship of the Line): Stealth Destroyer Destroyer Missile Cruiser
Unit Upgrade (Ironclad): Stealth Destroyer Destroyer Missile Cruiser
Unit Upgrade (Transport):
Unit Upgrade (Destroyer): Stealth Destroyer Missile Cruiser
Unit Upgrade (Battleship): Missile Cruiser
Unit Upgrade (Missile Cruiser):
Unit Upgrade (Stealth Destroyer):
Unit Upgrade (Submarine):
Unit Upgrade (Attack Submarine):
Unit Upgrade (Carrier):
Unit Upgrade (Airship): Fighter Jet Fighter
Unit Upgrade (Fighter): Jet Fighter
Unit Upgrade (Jet Fighter):
Unit Upgrade (Bomber): Stealth Bomber
Unit Upgrade (Stealth Bomber):
Unit Upgrade (Guided Missile):
Unit Upgrade (Tactical Nuke):
Unit Upgrade (ICBM):
Unit Upgrade (Great Prophet):
Unit Upgrade (Great Artist):
Unit Upgrade (Great Scientist):
Unit Upgrade (Great Merchant):
Unit Upgrade (Great Engineer):
Unit Upgrade (Great General):
Unit Upgrade (Great Spy):
Which all looks pretty dang good to me. I think this is good to go.
ruff_hi May 04, 2008, 11:24 AM MA status ...
hide threat index if cannot see power - could include comment "n/a"?
hide strategic resource information if no tech and resource trading - see if I can include comment
remove strategic units if player can build an upgrade of a unit - thx to EFool's great code for this
cycle thru cities so that all units possible are included
expose all text to XML for multi-language support
BUG: If you open the MA with the Sit-Rep tab displayed, switching to the Units tab doesn't draw the minimap
MA status for future release ...
free up the main sort criteria (currently unit combat type) so that the user can select what it is - need drop down, refresh button and auto-refresh check box <-- EmperorFool has stuck his hand up for this one - good luck!
glance screen
worst enemy icon (only when patch has been released)
Currently working on cycling thru all cities to pick up all units that can be built.
EmperorFool May 04, 2008, 11:42 AM I'm getting a Python error with the latest version -- trying to modify a dictionary while iterating over its items. I see the problem and will attempt a quick fix. I've attached the save that causes it.
ruff_hi May 04, 2008, 11:54 AM the other solution to that python error is not to fall behind in tech! Thx for fixing this EFool
EmperorFool May 04, 2008, 11:59 AM Fixed. I also added the cycling through all cities when checking whether or not a unit can be built.
One thing I see that may be incorrect, but I'm not sure yet, is that only the single AND prerequisite tech is checked. It ignores the other techs. This is at the point where it's removing enemy units you shouldn't know about yet due to limited tech.
I'd say look at the code that draws the unit buttons in the city screen. It will draw a disabled button, meaning you can't build it due to resource restrictions, but you do know how to.
ruff_hi May 04, 2008, 12:45 PM FixedThanks.
I also added the cycling through all cities when checking whether or not a unit can be built.I knew is was dead easy - just didn't have time to do it. Anyway, thanks.
One thing I see that may be incorrect, but I'm not sure yet, is that only the single AND prerequisite tech is checked. It ignores the other techs. This is at the point where it's removing enemy units you shouldn't know about yet due to limited tech.
I'd say look at the code that draws the unit buttons in the city screen. It will draw a disabled button, meaning you can't build it due to resource restrictions, but you do know how to.Good point. I'm not sure of the code regarding the other pre-reqs. Your suggestion is where I originally looked and that is covered by the canTrain() function. There are some parameters that control if you have the knowledge to train a unit (parameter 3 = true IIRC) and can train but are missing a resource or already have the max allowed (parameter 3 = false IIRC).
Thus I had to try and work out the tech thing manually.
ruff_hi May 04, 2008, 12:47 PM MA status ...
hide threat index if cannot see power - could include comment "n/a"?
hide strategic resource information if no tech and resource trading - see if I can include comment
remove strategic units if player can build an upgrade of a unit - thx to EFool's great code for this
cycle thru cities so that all units possible are included
expose all text to XML for multi-language support
BUG: If you open the MA with the Sit-Rep tab displayed, switching to the Units tab doesn't draw the minimap
MA status for future release ...
free up the main sort criteria (currently unit combat type) so that the user can select what it is - need drop down, refresh button and auto-refresh check box <-- EmperorFool has stuck his hand up for this one - good luck!
glance screen
worst enemy icon (only when patch has been released)
It seems that we are just working on tidy up bits. I should have the above all squared away by tomorrow and ready for a formal release.
Does anyone have a nice screenshot showing the sit-rep off?
ruff_hi May 04, 2008, 01:04 PM Just posted about the BUG MA in the mod component thread as well as the Civ4 mod items announcement thread - will get specifically mentioned on the front page :D.
ruff_hi May 05, 2008, 10:19 AM For the filtering checkboxes -- injured :yuck:, promotable (a star), can move :move:, upgradeable :strength: -- I'll need DDS graphics instead of the font glyphs. Is anyone particularly adept at The Gimp or some other graphics program and can make DDS versions (or find if they exist already) of these characters? If so, could you do the same for :food:, :hammers:, and :commerce:?On second thought - I bet these are already available (ie they show up in the city bar and on the main interface). I'll try and track them down for you.
EmperorFool May 05, 2008, 11:28 AM That would be great, thanks. For the Raw Yields changes to the city screen, the :traderoute: icon would also be helpful. :)
The deployment tab is coming along nicely. I completed the support code that will classify all units into any number of groupings. I have the four groupings listed above complete, except that promotions is only picking the first promotion. Shouldn't be too hard to make it do multiple.
The next step is getting that info into the window. One nice thing about the way I've coded it is that the list of units doesn't need to be reprocessed when you change groupings or filters; it will just redraw the list. Hopefully this will make the tab more usable.
EmperorFool May 05, 2008, 01:18 PM Group selection is working great, and it's no slower than the original code. It still needs to process all units when you switch the leader selection, but I could do some work to change even that later.
I now have it drawing the list, so you can see the breakdowns and counts. I put counts on both groupings. Thus you'll see 11 units in enemy territory, as well as that 3 are Archer, 2 are Swordsman, etc.
Next is the selection code so you can limit which ones display on the minimap.
@Ruff - Do you have a sketched up layout for the dropdowns and buttons? I'm getting close to being ready to hook up some UI elements. :)
ruff_hi May 05, 2008, 01:40 PM Look in 'C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\XML\GameInfo\CIV4EmphasizeInfo.xml' for hammer, coin and food. These are pointers to the dds files that show the city manager buttons.
Still working on foot, unhealthy, arm and trade.
ruff_hi May 05, 2008, 01:44 PM @Ruff - Do you have a sketched up layout for the dropdowns and buttons? I'm getting close to being ready to hook up some UI elements. :)You posted something on the last page that looked ok to me ...
[-------- L E A D E R H E A D S ---------]
Group: [Menu1] [Menu2] [--- L I S T ---]
Sort: [Menu] [x Details]
[---- Filter Buttons ----]
[------- M A P --------]
Did we decide where you are putting the GG emergence bar?
EmperorFool May 05, 2008, 02:03 PM Did we decide where you are putting the GG emergence bar?
I'll start with the bottom panel, between SIT-REP and EXIT since there's a lot of space there. We'll see how that looks.
As for the DEPLOYMENT tab, we are now at feature parity with the original MA insofar as the unit list has all the original features: drawing, selecting, and showing unit details.
I am now ready to hook up UI elements to allow you to change the groupings, sort and filters. I still need to code sorting and filtering, of course, but the original version doesn't have these either.
But first a lunch break. :) I'll commit the current version so people can play around with it.
Edit: I've committed it with Location and Unit Type as the default groupings. If you want to change these, go to lines 1193-4 in CvBUGMilitaryAdvisor.py and change the group keys:
grouping1 = self.stats.getGrouping("loc")
grouping2 = self.stats.getGrouping("type")
Legal values are "loc", "type", "combat", and "promo". Remember, "promo" only shows the first promotion a unit has.
Cammagno May 06, 2008, 02:19 PM @Ruff:
Thanks for exposing to XML the text of MA, I've just translated it. :)
Can I ask you what "Def Packs" arel, so that I can translate that label accordingly? :blush:
Oh, and there is still a bit of text not in XML, that is the alert levels names.
Thaks again :)
EmperorFool May 06, 2008, 02:26 PM Can I ask you what "Def Packs" are?
Defensive Pact: if you get attacked, I automatically declare war on your attacker.
ruff_hi May 06, 2008, 02:50 PM Oh, and there is still a bit of text not in XML, that is the alert levels names.DUH! Totally missed those. I'll XML (verb: to expose something to XML :D) them later today.
Cammagno May 06, 2008, 02:55 PM Defensive Pact: if you get attacked, I automatically declare war on your attacker.
Oh, yes thanks, I know what a Defensive PacT is, it was with a Defensive PacK that I had problems! :DDD
Ok, it may seem strange to you, but for a foreign guy like me it's not so easy to understand that a mistype is there (even when probably to you it's evident) in particular if it creates another valid word :blush:
Anyway, I translated it, and I also changed that "k" into a "t" for other languages. Thanks :)
ruff_hi May 06, 2008, 03:07 PM Well, if you read anything (ANYTHING!) that I type, then typo's are a given. For reference: a defensive Pack is a group of guys that last year played for the Giants. Their job is to sack the Quarter Back and win the super bowl. (joke!)
EmperorFool May 06, 2008, 03:07 PM I know what a Defensive PacT is, it was with a Defensive PacK that I had problems! :DDD
Defensive Pack: When you have defensive pacts with more than one civ. ;)
Usage: "No way I'm attacking that six pack!"
Edit: Serves me right not reading the next page of replies. Ruff's joke is better! :lol:
Cammagno May 06, 2008, 03:13 PM Well, if you read anything (ANYTHING!) that I type, then typo's are a given. For reference: a defensive Pack is a group of guys that last year played for the Giants. Their job is to sack the Quarter Back and win the super bowl. (joke!)
:D
Sorry, but I'm Italian, so I have no frack idea what a quarterback or a superbowl are ;) Well, not entirely true, I know that they have something to do with american football :)
ruff_hi May 09, 2008, 06:45 PM For the filtering checkboxes -- injured :yuck:, promotable (a star), can move :move:, upgradeable :strength: -- I'll need DDS graphics instead of the font glyphs. Is anyone particularly adept at The Gimp or some other graphics program and can make DDS versions (or find if they exist already) of these characters? If so, could you do the same for :food:, :hammers:, and :commerce:?Done. See the BUG folder under the ART folder in the SVN. Let me know if you want any more or these look crappy. I can move the around a little (Left, Right, Up, Down) but I cannot make them actually look any better.
EmperorFool May 28, 2008, 04:26 PM I'm about to get started on this; just finishing up a few PLE things first so I can commit what I have.
I'm noticing some weirdness with the Threat Index bar though. In my latest game I found it wasn't scrolling correctly. IIRC, the bars would shift up as you scrolled down (that's fine), but when you scrolled back up, they wouldn't shift back down.
I say IIRC because now in the same game (though updated to latest SVN), the bars are completely missing. I can see the research of most AIs, and it's very late game (I just got Laser), so I should be able to see lots of bars. I see you made a recent change about not showing bars under certain circumstances, none of which apply to my game.
I've attached the save in case you want it.
ruff_hi May 28, 2008, 04:35 PM thx - will look at the scrolling issue too.
Balderstrom May 29, 2008, 05:46 AM I've attached the save in case you want it.Oh come on. Zip...Rar... what the hell ? :-)
EmperorFool May 29, 2008, 06:11 AM I haven't learned to read or write ZIP yet. I only speak it conversationally.
ruff_hi May 30, 2008, 02:44 PM I'm noticing some weirdness with the Threat Index bar though. In my latest game I found it wasn't scrolling correctly. IIRC, the bars would shift up as you scrolled down (that's fine), but when you scrolled back up, they wouldn't shift back down.The attached save doesn't have enough players alive to check so I didn't look at this issue.
I say IIRC because now in the same game (though updated to latest SVN), the bars are completely missing.I did look at this, and after putting in about a zillion prints and looking at the code to store the stacked bar stuff, I went back and looked at this ...
bDataFound = True
try:
stackedbarData = rowData.cells[startIndex + offset].stackedbar[0]
except:
bDataFound = False
if not bDataFound:
Code like this occurs in 4 places. Does anyone see what is wrong with the above? I swapped the '= True' and '= False' during development and only deleted one of the 'not' statements.
EF - can you delete the 'not' from 'if not bDataFound:'. It'll then work.
You current game raises the question of losing the threat index if you don't have enough spy points to see the demographics. Do we want to totally lose the threat index or do we want to put in a fixed amount for unknown power (say 75% of max) and stick an '*' on the 'GUARDED'? I'm thinking yes.
EmperorFool Jun 01, 2008, 03:02 PM The attached save doesn't have enough players alive to check so I didn't look at this issue.
Oops. I'll send an earlier save when I get home.
EF - can you delete the 'not' from 'if not bDataFound:'. It'll then work.
Again, I'll try when I get home. Are you saying this will fix my issue? Is it in SVN then?
You current game raises the question of losing the threat index if you don't have enough spy points to see the demographics.
I was lamenting that very thing the other day. I think it should show the meter as you suggested. Ideally the player would be able to specify a power guess to use, but I don't think many players would anyway. Maybe it should choose a random power every time you open the screen. :mischief:
ruff_hi Jun 01, 2008, 03:03 PM Its not in SVN - thought you were working on MA and didn't want to tread on your toes. Can you remove 'NOT' and send it thru with your next update.
EmperorFool Jun 01, 2008, 03:09 PM You can go ahead and fix it now. I'm used to doing mergers when I commit for work. :) We're working in different areas of the file, so it's generally painless.
ruff_hi Jun 01, 2008, 03:58 PM done ...
Revision: 782
Author: ruff_hi
Date: 4:57:24 PM, Sunday, June 01, 2008
Message:
Fixed bug with BUGMA and threat index
changed tech researched message in logger
put in some testing code in BUGMA and IconGrid_BUG - disabled print
put in Alt-T to dump list of colors to log - in autolog file, used to hunt down in-game CTD bug.
----
Modified : /BUG Mod/CustomAssets/Python/Contrib/CvModName.py
Modified : /BUG Mod/CustomAssets/Python/Contrib/autologEventManager.py
Modified : /BUG Mod/CustomAssets/Python/Screens/CvBUGMilitaryAdvisor.py
Modified : /BUG Mod/CustomAssets/Python/Screens/IconGrid_BUG.py
Cammagno Jun 02, 2008, 02:29 AM done ...
Revision: 782
Author: ruff_hi
Date: 4:57:24 PM, Sunday, June 01, 2008
No more interface again (at least for me). :crazyeye:
ruff_hi Jun 02, 2008, 06:42 AM No more interface again (at least for me). :crazyeye:Fixed. I really should test my code before committing.
EmperorFool Jun 02, 2008, 10:32 PM I really should test my code before committing.
Every time you say that, it seems like a new realization for you. :D
ruff_hi Jun 02, 2008, 10:44 PM yeah, well ... at least I am consistent. I actually found a way for my python edit to check the syntax.
alerum68 Jun 02, 2008, 11:23 PM Ruff get Eclipse.
EmperorFool Jun 03, 2008, 04:12 PM Ruff get Eclipse.
I second the motion. Eclipse also deals with SVN, merging, exporting (to CustomAssets), and more. It's not the easiest thing to pick up, but heck, Alerum figured it out, so it can't be too difficult. :p
alerum68 Jun 03, 2008, 04:33 PM Yeah I figured it out! Wait... whatta mean by that?!
Anyway, I was thinking about sorting options, and think we should do some slight changes. Change Show/Hide Individual Units to a checkbox on the right hand side of where the units are displayed. In the location where that toggle Show/Hide was adding a drop down menu. In the drop down menu, have the current sorting options, plus a few others: Location: Everywhere, Can Promote, and Current Level. The Current Level will be sorted within it's own pane as well, so you can select all level 5 units. And I know it's a bit US-centric, but what about changing Sit-Rep to War Room?
Also, I think we should add a panel below the Combat Experience that when you select a unit, will show avaliable promotions to that unit, and when you click on one it actually will promote the unit.
ruff_hi Jun 03, 2008, 05:25 PM yeah, ok. Got any training available? Its 141mb - does that sound right? eclipse-SDK-3.3.2-win32.zip. Will have to wait until I get home (or work).
EmperorFool Jun 03, 2008, 07:07 PM Have the current sorting options, plus a few others: Location: Everywhere, Can Promote, and Current Level.
You're mixing sorting and filtering, and I think we covered the main ones above. I'll be adding checkboxes for filtering: wounded/healthy, promotable, etc. Everywhere is covered by not sorting by location. Level is a sorting.
The Current Level will be sorted within it's own pane as well, so you can select all level 5 units.
By "own pane" do you mean a subtree within the whole tree, just as the current view separates units in "Friendly Territory" from all other locations, but still in the same single tree? If so, this is covered by selecting the Level sorting (soon).
And I know it's a bit US-centric, but what about changing Sit-Rep to War Room?
I don't know about War Room since all tabs in this screen essentially make up a War Room, but I do think that a non-abbreviated word might be a good choice. This is more about foreign intelligence, so maybe "Intel" (ya, abbreviated, suckola). Dunno, I do like Sit-Rep though, so I'll just shut up now.
Also, I think we should add a panel below the Combat Experience that when you select a unit, will show avaliable promotions to that unit, and when you click on one it actually will promote the unit.
Hmm, that might be cool, but it seriously clutter the screen. Once i get the basic sort/filter functionality complete, we'll see how much screen real estate we have left. If we do promos, upgrades would be a good compliment.
EmperorFool Jun 03, 2008, 07:13 PM Got any training available?
A quick walk-through with Alerum or myself would during setup would help greatly. There are a few things you need to add (SVN and Python support) that is simple to do once you've done it, but not obvious. If you try on your own, you want the "pydev" and "subclipse" plugins -- and the sites for each do have install instructions, so you can do it on your own no doubt.
What I've done is create a workspace for Eclipse (it's where all project files and settings are stored) as "C:\Coding\Civ". Then I created a new "SVN Checkout" project named "BUG Mod" and checked out the "BUG Mod" subtree of our repo. The one option you must make sure to enable is Pydev's "force tab mode" or something like that. If you use spaces for tabs, you'll screw up any files you modify.
Its 141mb - does that sound right? eclipse-SDK-3.3.2-win32.zip.
That sounds right.
Random Typographer's Note: You only use two spaces after sentence-ending punctuation when using a monospace font like Courier or a typewriter.
alerum68 Jun 03, 2008, 08:16 PM Random Typographer's Note: You only use two spaces after sentence-ending punctuation when using a monospace font like Courier or a typewriter.
I'm guessing this statement goes hand in hand with the other one you made a few days ago about not having anyone to test a MultiPlayer game with?:p
It's really simple to set up Eclipse Ruff. If EF isn't around to walk you through the set up, then send me an IM on yahoo and I'll help.
ruff_hi Jun 04, 2008, 12:20 AM Random Typographer's Note: You only use two spaces after sentence-ending punctuation when using a monospace font like Courier or a typewriter.L i s t e n b u c k w h e a t - s o m e o f u s l e a r n t t o t y p e o n a n o n - e l e c t r i c t y p e w r i t e r a n d n o w o u r s p a c e b a r t h u m b i s a u t o p r o g r a m e d t o h i t t h e s p a c e b a r t w i c e !
I'm guessing this statement goes hand in hand with the other one you made a few days ago about not having anyone to test a MultiPlayer game with?:pWell said!
·Imhotep· Jun 05, 2008, 08:31 AM @ruff:
Eclipse is just plain great. I use it myself. Besides, EF can help you with everything - he is the man ! :)
ruff_hi Jun 05, 2008, 01:29 PM d/l eclipse, unzipped, ran exe, failed to start, reviewing instructions .....
You will need a Java runtime environment (JRE) to use Eclipse (Java 5 JRE recommended). All downloads are provided under the terms and conditions of the Eclipse Foundation Software User Agreement unless otherwise specified
A who? And what the heck is an IDE? Why can't I just use notepad? :waaaaaaaaaaah:
Balderstrom Jun 05, 2008, 01:34 PM IDE: Integrated Development Environment
You should have JRE (Java), that can be acquired from SUN fairly easily.
I haven't installed Eclipse myself, but have used other Java apps for video editing and what not. You should be able to just doubleclick or rightclick on the .jar file and "open with Java"
or choose the Java .exe from "choose program..."
I use MetaPad, ConTEXT (syntax hilighting sometimes) and NotePad as a scratchpad occasionally (I have it sized to open as a rectangle small pane).
IDE's are the future, and where the industry is headed, but I'm oldschool still. I may buckle under one of these days.
ruff_hi Jun 05, 2008, 02:10 PM ok, eclipse and two "pydev" and "subclipse" plugins installed. Next (tonight or tomorrow, weekend, next month) will involve changing some config options (outlined by EF above) and seeing if it actually works.
EmperorFool Jun 24, 2008, 06:36 AM The latest BUG-MA has a few issues, and I have some suggestions.
http://i222.photobucket.com/albums/dd275/EmperorFool/Bugs/BUG-MA.pngWorst Enemy: Column is too narrow now (threat bar partially inside WE icon) and the header says only "Wo..." Perhaps use a small icon so only the actual leader of the row uses a large icon, and make the header be two rows.
Maybe put the WHEOOH fist next to the threat index bar again since they kinda go hand-in-hand.
I had a game where the bar was not drawn at all for a single civ, though it did say "Elevated" IIRC. Sorry, I thought I had that saved, but I can't find which save now. Looking at the code I can't see any reason why this would happen. Is there a case that I'm not thinking of where that's intended behavior?
In my current game (Lizard Breath), all Strategic Advantages cells have the red "n/a" symbol, but Qin has Feudalism and Longbows in his nearby cities and I do not. Also Monty has Horses and Chariots and I do not.
In the same save, Qin has no worst enemy (same red "n/a"), but I think I am his WE because he DoWs me in a few turns. Is it possible for an AI to not have a WE, or is this because I have a non-standard name (not the actual leader's name) for my leader? So I just demanded Monotheism from him 20 times, moving him from Cautious to Furious, and I'm still not his WE. The scoreboard also doesn't show it, but I know the WE indicator has worked for me plenty, and I never use a normal name -- I always change it, so I don't think that's it. Can he really not have a WE?
Hmm, in the second save, Boudica, de Gaulle has no WE either, though note that he hasn't warred with any of the remaining civs yet. Also, the Strat Advs for Saladin show "N/A", yet he is behind me in techs (Riflemen vs. Infantry IIRC, no Cannons). The other SAs look correct I think (they at least show something).
Thinking about the "Active Wars" and "Will Declare?" columns, perhaps group them just like the "Strategic Advantages" columns. Put "War" as the main heading, and "Active" and "Willing"/"Would"/"Bribe" or something like that for "Will Declare?" This would make it clear that both columns are about war. I was also thinking maybe reverse the two columns, so "Active" is on the left.
Note that I'm using 3.13, Bhruic's DLL, and the latest BUG from SVN. Removing Bhruic's patch makes no difference.
ruff_hi Jun 24, 2008, 08:32 AM A civ can have no WE. I'll take a look at your other suggestions and use these games to track down some of the issues re strat advantage.
EmperorFool Jun 24, 2008, 05:07 PM I'm not looking at the code, but I know you were thinking of having it loop through all cities to check for buildability of the SAs. I was thinking it should loop through only the cities that you know about, so if you don't know they have any coastal cities, you'd think they couldn't build boats. If you like that idea, I can code it up pretty quick if you'd like.
However, as I see their cultural borders develop, sometimes you can deduce where a city must be, and I mark those with a sign. There's no way to work these into the algorithm without leaking information (telling me if I'm correct about my sign). I typed this because I was going to suggest treating the signs as an assumed city, but I don't see how that can be done. You need an actual CyCity to test for buildability, and that's where the leak comes from. So ignore this paragraph. :)
EmperorFool Jun 24, 2008, 08:33 PM I see in the code that you're looping through all cities. The change to make it ignore cities you don't know about, I think you can use CyCity.isRevealed(eTeam, False):
pPlayer = gc.getPlayer(iPlayer)
eTeam = gc.getPlayer(self.iActivePlayer).getTeam()
...
for c in range(pPlayer.getNumCities()):
pCity = pPlayer.getCity(c)
if pCity
and not pCity.isNone()
and pCity.isRevealed(eTeam, False)
and pCity.canTrain(iUnit, False, False):
iUnits.add(iUnit)
break
ruff_hi Jun 27, 2008, 11:28 AM pPlayer = gc.getPlayer(iPlayer)
eTeam = gc.getPlayer(self.iActivePlayer).getTeam()
What is the difference between 'p' and 'e' at the beginning of player and team? I put in the 'p' for pointer. You put in the 'e'? Or are you just messin' with my head?
ruff_hi Jun 27, 2008, 11:37 AM I'm going to look at the sit-rep this afternoon during my plane flight - unless I play a HOF game :D. Things that I will look at changing: put a header over the declare and current called 'War Status' Change 'Will Declare' to 'Optional' Swap 'Active' and 'Optional' widen the screen for people with wider screens (we should look at this for all of the adviser screens - the HOF guys did move (or remove) worse enemy, just not sure where to - might remove it and replace it with an icon if YOU are the AIs worse enemy, leave the AI-AI worst enemy info on Glance change the '*' to 'est' so it is clearer look at EFool's 'Strategic Advantage issues mentioned above
EmperorFool Jun 27, 2008, 12:40 PM What is the difference between 'p' and 'e' at the beginning of player and team?
In Python, it is only a convention to denote what the variable holds. Just so that's clear, it doesn't do anything to the code.
Now, you are right that a "p" prefix means Pointer. The "e" prefix denotes an enumeration (set number of items like the religions or the teams or players). It holds an integer from 0..max-1. -1 can sometimes be used to mean "none", for example NO_RELIGION == -1.
The Python API is quite confusing. CyGame.getActivePlayer() returns an ePlayer. CyGlobalContext.getActivePlayer() returns a CyPlayer object. CyPlayer.getTeam() returns an eTeam, so to get the CyTeam object you must use gc.getTeam(pPlayer.getTeam()).
A lot of the existing mod code uses "i" instead of "e". I try to match what already exists. "e" is what all the C++ code uses. In the end, they're all integers. :)
Please don't remove WE from MA. I like having one-key access to that screen whereas I typically leave the EFA on the Techs tab.
When I get a generic hover-text function for screens, I can make it so hovering over the Threat Index will explain what the * means.
I would love to widen the screens, and that's good to know it's already been done. CDA would require another set of pages as well.
Cammagno Jun 28, 2008, 06:08 AM The latest BUG-MA has a few issues, and I have some suggestions.
Oh, good. Sorry for the suggestion I've given by mail, I've not yet read this thread.
Worst Enemy: Column is too narrow now (threat bar partially inside WE icon) and the header says only "Wo..." Perhaps use a small icon so only the actual leader of the row uses a large icon, and make the header be two rows.
I agree, great idea!
Maybe put the WHEOOH fist next to the threat index bar again since they kinda go hand-in-hand.
Good
Thinking about the "Active Wars" and "Will Declare?" columns, perhaps group them just like the "Strategic Advantages" columns. Put "War" as the main heading, and "Active" and "Willing"/"Would"/"Bribe" or something like that for "Will Declare?" This would make it clear that both columns are about war. I was also thinking maybe reverse the two columns, so "Active" is on the left.
Yes, maybe it's better in this way.
EmperorFool Jun 28, 2008, 07:09 AM Maybe "Possible" for "Will Declare" since it's possible to trade for it.
Aristos Jun 29, 2008, 12:47 PM Maybe I just don't know, but is there any way to use the "beta" MilAdv while waiting for the new version of BUG?
Could you please pack the files in a zip and post it here?
EmperorFool Jun 29, 2008, 01:30 PM BUG 2.30 has the latest Military Advisor, unless I'm off my meds again and am just forgetting. I haven't had a chance to tackle this beast yet. Do you see the "Sit-Rep" tab? If so, you have the goodies.
If you want to get crazy, you can check out the different grouping properties. Open CvBUGMilitaryAdvisor.py and go to line 1086.
grouping1 = self.stats.getGrouping("loc")
grouping2 = self.stats.getGrouping("type")
You can change the strings ("loc", "type") to any of these values:
"type" - Unit Type
"combat" - Combat Type
"level" - Level
"loc" - Location
"promo" - Promotion*
* For this one to work properly, you'll actually need a modified file. Replace the entire contents of the file "Python\BUG\UnitGrouper.py" with this:
## UnitGrouper
## Builds groups of units for use in reporting or screens.
## Copyright (c) 2008 The BUG Mod.
from CvPythonExtensions import *
import BugUtil
# globals
gc = CyGlobalContext()
# Base grouping classes
class Grouper:
"""
Holds all Grouping definitions.
"""
def __init__(self):
self.groupings = []
self.groupingsByKey = {}
def _addGrouping(self, grouping):
grouping.index = len(self.groupings)
self.groupings.append(grouping)
self.groupingsByKey[grouping.key] = grouping
def getGrouping(self, key):
if key in self.groupingsByKey:
return self.groupingsByKey[key]
else:
return None
class Grouping:
"""
Applies a formula to place units into groups.
key: used for sorting groupings; must be in the range [0, 999] inclusive
title: used to display the group
"""
def __init__(self, key, title):
self.index = None
self.key = key
self.title = title
self.groups = {}
def _addGroup(self, group):
self.groups[group.key] = group
def calcGroupKeys(self, unit, player, team):
return None
class Group:
"""
Represents a single group value within a grouping.
key: used for sorting groups; must be in the range [0, 999] inclusive
title: used to display the group
"""
def __init__(self, grouping, key, title):
self.grouping = grouping
self.key = key
self.title = title
def getTitle(self):
return self.title
# Grouping definitions
class UnitTypeGrouping(Grouping):
"""
Groups units by their unit type.
Ex: Warrior, Maceman, Panzer
"""
def __init__(self):
Grouping.__init__(self, "type", "Unit Type")
for i in range(gc.getNumUnitInfos()):
info = gc.getUnitInfo(i)
if info:
self._addGroup(Group(self, i, info.getDescription()))
def calcGroupKeys(self, unit, player, team):
return (unit.getUnitType(),)
class UnitCombatGrouping(Grouping):
"""
Groups units by their combat type.
Ex: None, Melee, Gunpowder, Naval
"""
def __init__(self):
Grouping.__init__(self, "combat", "Combat Type")
self.NONE = 0
self._addGroup(Group(self, self.NONE, "None"))
for i in range(gc.getNumUnitCombatInfos()):
info = gc.getUnitCombatInfo(i)
if info:
self._addGroup(Group(self, i + 1, info.getDescription()))
def calcGroupKeys(self, unit, player, team):
return (gc.getUnitInfo(unit.getUnitType()).getUnitCombatT ype() + 1,)
class LevelGrouping(Grouping):
"""
Groups units by their level, 1 to MAX_LEVEL (30).
Units over level MAX_LEVEL are put into the MAX_LEVEL group.
"""
def __init__(self):
Grouping.__init__(self, "level", "Level")
self.MAX_LEVEL = 30
for i in range(self.MAX_LEVEL):
self._addGroup(Group(self, i, BugUtil.getText("TXT_KEY_UNIT_GROUPER_LEVEL_GROUP", (str(i),))))
self._addGroup(Group(self, self.MAX_LEVEL, BugUtil.getText("TXT_KEY_UNIT_GROUPER_LEVEL_GROUP", ("%d+" % self.MAX_LEVEL,))))
def calcGroupKeys(self, unit, player, team):
return (max(0, min(unit.getLevel(), self.MAX_LEVEL)),)
class PromotionGrouping(Grouping):
"""
Groups units by their promotions.
Ex: Combat 1, Cover, Tactics
"""
def __init__(self):
Grouping.__init__(self, "promo", "Promotion")
self.NONE = 0
self._addGroup(Group(self, self.NONE, "None"))
for i in range(gc.getNumPromotionInfos()):
info = gc.getPromotionInfo(i)
if info:
self._addGroup(Group(self, i + 1, info.getDescription()))
def calcGroupKeys(self, unit, player, team):
promos = []
for iPromo in range(gc.getNumPromotionInfos()):
if unit.isHasPromotion(iPromo):
promos.append(iPromo + 1)
if not promos:
promos = (self.NONE,)
return promos
class LocationGrouping(Grouping):
"""
Groups units by their location on the map.
Ex: Domestic City, Friendly City, Enemy Territory
"""
def __init__(self):
Grouping.__init__(self, "loc", "Location")
self.DOMESTIC_CITY = 0
self.DOMESTIC_TERRITORY = self.DOMESTIC_CITY + 1
self.TEAM_CITY = self.DOMESTIC_TERRITORY + 1
self.TEAM_TERRITORY = self.TEAM_CITY + 1
self.FRIENDLY_CITY = self.TEAM_TERRITORY + 1
self.FRIENDLY_TERRITORY = self.FRIENDLY_CITY + 1
self.NEUTRAL_TERRITORY = self.FRIENDLY_TERRITORY + 1
self.ENEMY_TERRITORY = self.NEUTRAL_TERRITORY + 1
self.BARBARIAN_TERRITORY = self.ENEMY_TERRITORY + 1
self._addGroup(Group(self, self.DOMESTIC_CITY, "Domestic City"))
self._addGroup(Group(self, self.DOMESTIC_TERRITORY, "Domestic Territory"))
self._addGroup(Group(self, self.TEAM_CITY, "Team City"))
self._addGroup(Group(self, self.TEAM_TERRITORY, "Team Territory"))
self._addGroup(Group(self, self.FRIENDLY_CITY, "Friendly City"))
self._addGroup(Group(self, self.FRIENDLY_TERRITORY, "Friendly Territory"))
self._addGroup(Group(self, self.NEUTRAL_TERRITORY, "Neutral Territory"))
self._addGroup(Group(self, self.ENEMY_TERRITORY, "Enemy Territory"))
self._addGroup(Group(self, self.BARBARIAN_TERRITORY, "Barbarian Territory"))
def calcGroupKeys(self, unit, player, team):
plot = unit.plot()
if not plot or plot.isNone():
return None
if plot.isBarbarian():
return (self.BARBARIAN_TERRITORY,)
teamId = team.getID()
ownerId = plot.getRevealedOwner(teamId, False)
if ownerId == -1:
return (self.NEUTRAL_TERRITORY,)
elif ownerId == player.getID():
if plot.isCity():
return (self.DOMESTIC_CITY,)
else:
return (self.DOMESTIC_TERRITORY,)
else:
owner = gc.getPlayer(ownerId)
ownerTeamId = owner.getTeam()
if ownerTeamId == teamId:
if plot.isCity():
return (self.TEAM_CITY,)
else:
return (self.TEAM_TERRITORY,)
elif team.isAtWar(ownerTeamId):
return (self.ENEMY_TERRITORY,)
else:
if plot.isCity():
return (self.FRIENDLY_CITY,)
else:
return (self.FRIENDLY_TERRITORY,)
class StandardGrouper(Grouper):
def __init__(self):
Grouper.__init__(self)
self._addGrouping(UnitTypeGrouping())
self._addGrouping(UnitCombatGrouping())
self._addGrouping(LevelGrouping())
self._addGrouping(PromotionGrouping())
self._addGrouping(LocationGrouping())
# Classes for tracking stats about groups and units
class GrouperStats:
"""
Holds stats for a set of groupings.
"""
def __init__(self, grouper):
self.grouper = grouper
self.groupings = {}
for grouping in self.grouper.groupings:
self._addGrouping(GroupingStats(grouping))
def _addGrouping(self, grouping):
self.groupings[grouping.grouping.key] = grouping
def processUnit(self, player, team, unit):
stats = UnitStats(unit.getOwner(), unit.getID(), unit)
for grouping in self.groupings.itervalues():
grouping._processUnit(player, team, stats)
return stats
def getGrouping(self, key):
if key in self.groupings:
return self.groupings[key]
else:
return None
def itergroupings(self):
return self.groupings.itervalues()
class GroupingStats:
"""
Holds stats for a grouping.
"""
def __init__(self, grouping):
self.grouping = grouping
self.groups = {}
for group in self.grouping.groups.itervalues():
self._addGroup(GroupStats(group))
def _addGroup(self, group):
self.groups[group.group.key] = group
def _processUnit(self, player, team, unitStats):
keys = self.grouping.calcGroupKeys(unitStats.unit, player, team)
for key in keys:
self.groups[key]._addUnit(unitStats)
def itergroups(self):
return self.groups.itervalues()
class GroupStats:
"""
Holds stats for a group of units.
"""
def __init__(self, group):
self.group = group
self.units = set()
def _addUnit(self, unitStats):
self.units.add(unitStats)
def title(self):
return self.group.title
def size(self):
return len(self.units)
def isEmpty(self):
return self.size() == 0
class UnitStats:
"""
Holds stats about a single unit.
"""
def __init__(self, playerId, unitId, unit):
self.key = (playerId, unitId)
self.unit = unit
def __hash__(self):
return hash(self.key)
def __eq__(self, other):
return self.key == other.key
ruff_hi Jun 30, 2008, 07:57 PM MA updated in SVN. Take a look. I did the following:
made the WE icon smaller split the WE heading onto two rows changed 'will declare' to 'optional' changed '*' to '(est)' when threat index is estimated due to not enough spy points made the screen wider on wider screens (if you know what I mean - mind you, deployment is now scrunched to the left :D) probably some other stuff but I cannot remember
http://img58.imageshack.us/img58/5948/bugma0012qt5.jpg
Edit: woohoo ... 4000th post!
alerum68 Jun 30, 2008, 08:43 PM Looks much cleaner Ruff. Good job!
·Imhotep· Jul 01, 2008, 05:45 AM I like that change the most:
probably some other stuff but I cannot remember
:rotfl: :lol:
ripple01 Jul 01, 2008, 08:56 AM Looks good, Ruff. Could you perhaps center "Military Advisor" over the screen when using it in widescreen mode?
Cheers,
ripple01
The Doc Jul 02, 2008, 12:11 PM Playing in 1024x768 I noticed that MA is no longer maximized as the other advisors are: click (http://www.abload.de/img/12ji6o.png)
I also marked to phrases that are not translatable atm because of missing tags.
Apart from that, great job, ruff_hi. :goodjob:
ruff_hi Jul 02, 2008, 12:14 PM ahh yes. I chopped off 30 or 40 pixals from each side (or half from each side - not sure which). I'll remove the reduction part of the code if you are running a 1024 wide screen.
ruff_hi Jul 03, 2008, 06:18 AM BUG Military Adviser
The BUG mod has developed an enhanced Military Adviser. We have expanded the display of units by adding more sort features. We have also added another tab (Sit-Rep, sort for Situation Report) that details various military information about the other players). The following pages document these two tabs.
We have also expanded the adviser to take advantage of wide screens.
ruff_hi Jul 03, 2008, 06:26 AM BUG Military Advisor: Sit-Rep tab
The Sit-Rep tab (short for Situation Report) contains military based information on the other players. The following is an example (note: large version of graphic is attached to this post):
http://img365.imageshack.us/img365/5134/bugmasitrep0027xl1.jpg
The columns (left to right) are: Icon of the particular player WHEOOH ("We have enough on our hands") indicator. This information is displayed when you hover over the 'declare on X' option in the diplomatic screen for a particular player. It means that the player is currently in a war or is at peace but planning for war in the future. A small icon of the players worst enemy. This information is new to patch 3.17. If the player has no 'worse enemy', a null icon is displayed (Khan above). The Threat Index (see below) Two columns of strategic advantage information, ours v the player and the player v us (see below) Wars: currently active wars and wars that the player is happy to be bribed into. Two other columns not displayed because they are situational: Vassals and defensive pacts. These two columns are only displayed if a player has a vassal or defensive pact.
Threat Index
The threat index is a crude, 5 level indicator that ranges from Low (lowest) to Severe (highest). An index (0 to 100) underlies the setting of the level.
Index < 15, Level = Low
Index >= 15 and Index < 35, Level = Guarded
Index >= 35 and Index < 55, Level = Elevated
Index >= 55 and Index < 75, Level = High
Index >= 75, Level = Severe
The Index is made up of two major components with some adjustments. The major components are: Relationship Power
Relationship
The relationship component is based on the pluses and minuses from the AI attitude and is capped at -15 and +15. There are 38 points which are allocated to this component with +15 attitude corresponding to 0 points and -15 attitude corresponding to 38 points (linear between -15 to -15).
Power
The power component is based on the power ratio (power from the demographic charts) of our power divided by the AI power. It is capped at 0.5 and 1.5. There are 38 points are allocated to this component with 1.5 power ratio corresponding to 0 points and 0.5 power corresponding to 38 points (linear between 1.5 to 0.5).
If their power is not know (ie not enough espionage points), then then this component is estimated at 38 * 0.75 and "(est)" is added to the Level.
Adjustments
If the AI is in WHEOOHs mode and not at war (ie planning for war), then the Index is multiplied by 1.3. If you have a defensive pact with the AI, then the Index is multiplied by 0.2.
Strategic Advantage
The strategic Advantage information is primarily non-domestic unit based (workers, settlers, missionaries, corporate execs, spies, etc are excluded). The information required is tech and resource knowledge. If you don't have this information, then the cancel icon is displayed. Unique Units are a strategic advantage and are not canceled by the regular unit (see Sitting Bull above). Any unit that you can build (tech and required resource) that the AI cannot (including any possible upgrade) is a strategic advantage to you. The same applies to the AI.
For example: If you can build knights and the AI can build horse archers, you have a strategic advantage (Knight) and the AI doesn't (your knight cancels out the horse archer even though you cannot build it as the horse archer upgrades to a knight).
Aristos Jul 03, 2008, 03:17 PM excellent work!
One question: any chance that you may add rollover info to the strategic advantage icons?
Arian Jul 03, 2008, 03:27 PM Ruff, excellent work! :hatsoff:
Are you planning to publish the Military Advisor as a separate ModComp out of the BUG mod?
EmperorFool Jul 03, 2008, 04:25 PM Any chance that you may add rollover info to the strategic advantage icons?
I'll check the code. This should be possible since it works for techs in the Foreign Advisor's tech trading tab. Same for hovering over each leaderhead.
Are you planning to publish the Military Advisor as a separate ModComp out of the BUG mod?
He did a separate release originally. I have been working on enhancements to the Deployment tab, but unfortunately I have been derailed by PLE work and getting ready for the 3.0 release. He may have been waiting for my slowpoke ass to finish. :cry:
alerum68 Jul 03, 2008, 04:30 PM This is everything you want included in the Docs Ruff? The screenshot won't go in this release, because I play to make screenshots for all items at one time, and don't want to have MA with a screenshot, and nothing else.
Arian Jul 03, 2008, 04:40 PM He did a separate release originally. I have been working on enhancements to the Deployment tab, but unfortunately I have been derailed by PLE work and getting ready for the 3.0 release. He may have been waiting for my slowpoke ass to finish. :cry:
I did try to merge that one. I works fine the first couple of turns but after a while the sit-rep only displays one leader. Could be that I didn't merge it correctly or that the mod is causing the problem.
I'll just wait for the new version and try again.
Thanks in advance. :)
Cammagno Jul 03, 2008, 04:58 PM I did try to merge that one. I works fine the first couple of turns but after a while the sit-rep only displays one leader. Could be that I didn't merge it correctly or that the mod is causing the problem.
I'll just wait for the new version and try again.
Thanks in advance. :)
If you only like MA, you can also install BUG (it's not big) and disable all the other BUG features from the option screen.
ruff_hi Jul 03, 2008, 06:22 PM This is everything you want included in the Docs Ruff? The screenshot won't go in this release, because I play to make screenshots for all items at one time, and don't want to have MA with a screenshot, and nothing else.It is everything that I was planing to write up for the sit-rep. Going to leave deployment to EF. Ok, re screenie.
Arian Jul 03, 2008, 06:41 PM If you only like MA, you can also install BUG (it's not big) and disable all the other BUG features from the option screen.
I like the BUG mod and all its features, but I always thought it would quite a job to merge the BUG mod (I've never done that).
EmperorFool Jul 03, 2008, 06:48 PM It depends on what you're merging it with. I assume you've got another mod you like a lot. The trouble comes when both mods modify the same files. XML files can be merged fairly painlessly, but Python files take coding knowledge.
If you give me some more info, maybe I can let you know how much work it would be.
Arian Jul 03, 2008, 07:04 PM If you give me some more info, maybe I can let you know how much work it would be.
That's much appreciated.
The mod I play most is based on History in the Making from Grave. I added some Python/XML-components as well as quite a lot of artwork from our forum-artists. It has BUG in it already. This mod is at 3.13 and I hope it's gonna be updated to 3.17 someday.
Aristos Jul 04, 2008, 12:20 AM I'll check the code. This should be possible since it works for techs in the Foreign Advisor's tech trading tab. Same for hovering over each leaderhead.
Done :D
Look here: http://forums.civfanatics.com/showpost.php?p=6997192&postcount=16, I attached the edited BUG MA file. Works like a charm. Even jumping to the Sevopedia.
ruff_hi Jul 04, 2008, 05:49 AM I knew that was an outstanding issue. Will d/l and take a look
ruff_hi Jul 04, 2008, 06:26 AM Done :DAdded to SVN with some code chopped due to python crash.
EmperorFool Jul 04, 2008, 06:28 AM Excellent. Thanks guys. Does it close the window and open the diplomacy dialog when you right-click a leader as well? I was only able to get that to work for some leaderheads in the Foreign Advisor. I didn't know if it was just me or IconGrid that was getting in the way.
ruff_hi Jul 04, 2008, 06:29 AM It did when I just tested it. Not 5 minutes ago. Yes, ruff testing code - who would have thought!
Aristos Jul 04, 2008, 02:18 PM Just one note: I am getting this...
and I don't know why. I cannot find the source of the problem. It happens when you scroll down the list in SitRep.
EmperorFool Jul 04, 2008, 02:47 PM It looks like IconGrid doesn't play nicely with StackedBar. I noticed that once you scroll down, scrolling up doesn't move the stacked bars. I haven't played a game requiring me to scroll in a while, so that problem may be fixed.
Aristos Jul 04, 2008, 03:39 PM It looks like IconGrid doesn't play nicely with StackedBar. I noticed that once you scroll down, scrolling up doesn't move the stacked bars. I haven't played a game requiring me to scroll in a while, so that problem may be fixed.
I'm using your SVN's so it's the latest update. It does not appear fixed.
ruff_hi Jul 04, 2008, 04:17 PM Can you upload a save with enough leaders to cause this issue. I will take a look.
Aristos Jul 04, 2008, 04:48 PM here it is.
ruff_hi Jul 04, 2008, 05:36 PM Thanks. I've fixed the problems. One thing to note is that Huayna Capac says he has a worst enemy (-4, you have traded with my WE) but when you hover over everyone else, none of them are his worst enemy (if so, then how have you traded with his WE - confusing). Do you know everyone in this game? Answer: No. You know 13 and there are 14 opponents remaining. Thus the issue with the the mis-aligned entries. I'll update the SVN.
EmperorFool Jul 04, 2008, 06:05 PM I assume he traded with Huayna's previous WE.
The Doc Jul 06, 2008, 08:30 AM The new sort texts at the "Deployment" tab isn't translatable yet:
http://www.abload.de/img/bild-0002nvj.jpg
And: Is it possible to make the field for "Worst" a bit wider? :worship: In the German version it looks like this:
http://www.abload.de/img/bild-0003h73.jpg
Cammagno Jul 06, 2008, 08:33 AM The new sort texts at the "Deployment" tab isn't translatable yet:
http://www.abload.de/img/bild-0002nvj.jpg
And: Is it possible to make the field for "Worst" a bit wider? :worship: In the German version it looks like this:
http://www.abload.de/img/bild-0003h73.jpg
Also in Italian :(
ruff_hi Jul 06, 2008, 09:42 AM I'll take a look at the WE part.
ruff_hi Jul 06, 2008, 10:30 AM I have a fix. How do I commit it under a code freeze?
alerum68 Jul 06, 2008, 10:46 AM You don't.:( I wish this was caught earlier, but it's going to have to wait til 3.1.:(
Cammagno Jul 06, 2008, 11:55 AM You don't.:( I wish this was caught earlier, but it's going to have to wait til 3.1.:(
After the packing and beta-release of 3.0 I think he can, it's a fix ;)
EmperorFool Jul 06, 2008, 01:02 PM See my thoughts on this in the Development thread. I think these fixes should go in. We can test this sucker, the packaging process, etc. for the next few days. Then we can package one last time with these tiny fixes and do a quick test on that, just to make sure it packaged right.
Philly D. Jul 15, 2008, 08:19 PM Two suggestions:
- a minor wording issue: 'optional' is an incorrect term in the column where AI leaders that other AI leaders could declare war on if asked are indicated. 'Potential' is a better term,
- and although it may take a bit of work, the threat level should take into account if you have the lowest power rating.
EmperorFool Jul 15, 2008, 08:58 PM Although it may take a bit of work, the threat level should take into account if you have the lowest power rating.
It currently factors in the power rating of each AI. Are you suggesting that it apply a separate penalty across the board (heighten the threat level for every AI) if you have the lowest power rating?
The problem with that is you can only know that if you have spent enough on espionage to see everyone's demographics. We could certainly test for that and apply an added factor, but I am rarely in that boat (can see all demographics) until later in the game and have a much higher power rating than nearly everyone else.
In any case, what factor would you suggest? Perhaps even a special warning text at the top of the screen: "You're in danger of being dog-piled!" :)
Cammagno Jul 16, 2008, 12:40 AM Minor issue:
the "est" label shoud be XMLized to be transable :blush:
EmperorFool Jul 16, 2008, 12:42 AM A minor wording issue: 'optional' is an incorrect term in the column where AI leaders that other AI leaders could declare war on if asked are indicated. 'Potential' is a better term.
I suggested "Possible" earlier, but I like "Potential" much better.
I would have suggested "Venal" -- "Obtainable for a price" -- but that applies to the bribee, not the object (war) for which you pay them.
EmperorFool Jul 16, 2008, 12:45 AM Minor issue:
the "est" label shoud be XMLized to be transable :blush:
Further, I recommend returning the "*" next to the labels and putting a single short description of the meaning at the bottom of the screen. This should obviously be XMLable. New word! :D
* Power ratio estimated to be 0.75
In fact, you could turn the assumed power ratio into an option so users could set it themselves to be more optimistic/pessimistic.
Cammagno Jul 16, 2008, 01:27 AM Further, I recommend returning the "*" next to the labels and putting a single short description of the meaning at the bottom of the screen. This should obviously be XMLable. New word! :D
* Power ratio estimated to be 0.75
In fact, you could turn the assumed power ratio into an option so users could set it themselves to be more optimistic/pessimistic.
Good, I like it :)
I also don't like the fist icon, so I hope somebody suggest a better one... or "Somebody" create a better one ;)
ruff_hi Jul 19, 2008, 11:36 PM Further, I recommend returning the "*" next to the labels and putting a single short description of the meaning at the bottom of the screen. This should obviously be XMLable. New word! :D
* Power ratio estimated to be 0.75
In fact, you could turn the assumed power ratio into an option so users could set it themselves to be more optimistic/pessimistic.Nice, but where do we put the "* Power ratio estimated to be 0.75" comment? Can it be a hover on the heading?
BTW: the contribution to the threat index from power is assumed to be 75% of max (max = 38 points and is reached when their power is 1.5x or greater than yours). Thus a 75% power contribution to the threat index is actually an assumption that their power is 1.25x yours. So the comment should be ...
"* Actual power ratio unknown, assumed to be 1.25x".
EmperorFool Jul 20, 2008, 01:36 AM I was thinking at the bottom where other tab labels would go. I was going to move the XP counter there on the deployment page as well. However, I think we could do a hover, though it would of course be manual.
As I need to make a generic hover tool for screens for the CDA, I'll put that at a higher priority now.
Thanks for the clarification of the calculation. I remembered 0.75 from a chat with you but couldn't remember how it was used. Regardless, whatever message is displayed should use a "%f" placeholder and put in the actual defined constant in Python.
ruff_hi Aug 10, 2008, 11:21 AM Problem: gray out the buttons on the strategic advantage on the MA
Issue: the buttons are put there with 'screen.setImageButton'. This doesn't have an 'enabled / disabled' status.
Solution: Can you overlay one icon over another? Yes you can - I have done it with the specialist chevron additions in the city screen. I'm thinking that I create a dds file with a red cross on it ('x') and overlay that over any icon that is 'disabled'.
Any other suggestions?
Note: the grayed out icons on the main interface are done using 'screen.disableMultiListButton'.
NikNaks Aug 10, 2008, 11:30 AM Couldn't you just overlay the grayed out buttons (i.e. obscuring the original button) or vice versa?
EDIT: 2000th Post! WOOOO!
ruff_hi Aug 10, 2008, 11:33 AM you could, but the (AFAIK) the buttons only come in one 'shade'. Thus we would have to create 400,000 gray buttons - no one wants to do that.
Edit: 4246 posts!
NikNaks Aug 10, 2008, 12:03 PM I'd do it if no-one else will.
ruff_hi Aug 10, 2008, 01:24 PM you could, but the (AFAIK) the buttons only come in one 'shade'. Thus we would have to create 400,000 gray buttons - no one wants to do that.
I'd do it if no-one else will.
NN - don't do it - that is just silly :D. We'll use the overlay and it will work fine.
EmperorFool Aug 10, 2008, 01:28 PM Don't create a gray version of each button. Instead, create a single 50% gray overlay icon that is the same size as the button icons. To do this, create a 100% black square that is 50% transparent.
I also like the idea of a red X to make it clear what it means. You could add this to the corner of the 50% gray image above.
If that doesn't work (it should given how transparency works), perhaps alter IconGrid to use Multilist buttons? Aren't they the same layout? A grid of buttons (in each single cell) placed by row with a scrollbar when there are too many. Granted this is a lot more work than just adding a second image, so definitely try the above or consider your other option (just an X) first.
My main reason for avoiding making a grayed out version of every button is that it doesn't work with any mod that adds units, and we want to encourage the spread of BUG to every mod. Otherwise, how will I ever take over the world??
Edit: The 50% gray overlay was a little dark, and 25% didn't make much of a difference (all viewing in GiMP -- not in Civ). So here's a test 25% red overlay. Someone with more GiMP knowledge should play around with some possibilities to find something that works. And of course we'll need to see it in game to really know what Civ will do with it.
http://i222.photobucket.com/albums/dd275/EmperorFool/New%20Features/Mockups/Red25Overlay.png
Left: 50% transparency, center: normal image, right: 25% red overlay
ruff_hi Aug 10, 2008, 02:21 PM It seems that EF and I are on the same page. Just back from walking the dog and I hit upon the '50% gray' overlay solution. I think this is were we call on our graphics guy (that is you NN!) for the development of several overlay options. I'll start the coding while I am waiting for the various overlays. :D
NikNaks Aug 10, 2008, 02:29 PM Okay, so you want me to mock up some different versions?
EmperorFool Aug 10, 2008, 04:40 PM Okay, so you want me to mock up some different versions?
Yes, please. Take an existing unit button to get the shape and make it a solid color with various transparencies. Unfortunately, my tests show that it just makes the existing button darker which makes sense. That's why I did the color version so it's clearer.
However, darker with a solid red X might be perfect.
ruff_hi Aug 11, 2008, 09:29 PM Problem: gray out the buttons on the strategic advantage on the MA
Issue: the buttons are put there with 'screen.setImageButton'. This doesn't have an 'enabled / disabled' status.
Solution: Can you overlay one icon over another? Yes you can - I have done it with the specialist chevron additions in the city screen. I'm thinking that I create a dds file with a red cross on it ('x') and overlay that over any icon that is 'disabled'.
Any other suggestions?
Note: the grayed out icons on the main interface are done using 'screen.disableMultiListButton'.
Ruff <--- idiot!!! I was having issues coding up the 'enable / disable' toggle for this so I had a good look at the code again ... only to find that I was trying to change the individual icons and not the multi-list icons. Naturally, when I look at the code that positions the icons we want to gray ... they are put there by multi list thingo which does have the gray options. Sorry niknaks for wasting your time.
NikNaks Aug 12, 2008, 01:29 AM Meh, it wasn't hard to do anyway :lol: Don't worry about it.
ruff_hi Aug 14, 2008, 11:51 AM I've got the code working in IconGrid_BUG to accept a 'enabled / disabled' flag. However, when you set the icon to disabled, it doesn't look different. The only difference is that it doesn't 'glow' when you hover on it, nor is the 'unit info' displayed when you hover.
This strikes me as a bit useless - any other ideas about how to show the icon as disabled?
One option I have is to add a little 'x' to the icon, but to do that I would need to work out where the icon was (X,Y).
EmperorFool Aug 15, 2008, 07:08 PM Are they placed as checkboxes such that they take two art file strings? The second is the "highlight" image applied over it. We could use this to make the X as the second image is overlayed on top of the unit graphic.
Have you compared the code that creates the multilist objects in MainInterface to that in IconGrid? Maybe they supply a parameter that tells how disabled icons look.
ruff_hi Aug 15, 2008, 10:51 PM Have you compared the code that creates the multilist objects in MainInterface to that in IconGrid? Maybe they supply a parameter that tells how disabled icons look.Yes I have - looked at the code that creates the multi-list and looks at the code that adds the icon. I've tried the maininterface code and still get the non-flashing icon for disabled.
EmperorFool Aug 15, 2008, 11:13 PM I see two differences.
First, when creating the table, they specify different table types (empty versus normal). I doubt this is significant as the styles tend to be how they are drawn.
Second, when adding items in MainInterface, WidgetTypes.WIDGET_TRAIN is used instead of WidgetTypes.WIDGET_PEDIA_JUMP_TO_UNIT. I don't know what will happen if you switch them as training typically expects a city to be selected. If the user happens to have a city selected and clicks the icon, they may alter their build queue for that city.
ruff_hi Aug 16, 2008, 06:24 AM I tried both of those differences to zero change in the unit icon.
ruff_hi Sep 03, 2008, 12:46 PM I thought of a solution to the 'not enabled' icons looking the same as the enabled icons this morning. Finally! How about we add an icon at the start of the list with a '?' (thx NikNaks) on it to represent that the following icons are estimates.
This isn't perfect but it is better than what we have now.
Cammagno Sep 10, 2008, 02:12 AM I really like the new ordering options, thanks a lot EF! ^_^
It's a pity that it's not possible to avoid the unwanted multiple selection (it would be perfect to be able to select groups of units according to the choosen criteria... but maybe with filters it will be possible)... but at least now ()thanks to Ruff I'm able to select single units :D
Is it possible to increase the width of the pannel containing the units name? (there is a lot of empty space on the right that can be used) As you can easily immage, in Italian all the unit entries nowc are multi-lines ones...
EmperorFool Sep 10, 2008, 03:10 AM It's a pity that it's not possible to avoid the unwanted multiple selection.
It's definitely possible. I just need to recode it (what's new, eh?) to be aware of this. I'm still using the original game's selection logic, and it doesn't handle items that show up in multiple places or have similar values.
An example of where this gets really strange is that in a recent large test game of mine, selected "Level 11" to see where my uber-Infantry is at, it also selects my single "Mining Inc. Executive". :confused: So yes, I gotta fix this issue.
As for widening the screen, I would like to do that. I'm hoping to wait until I add filtering, but I think I'm going to hold off on the filtering for a while. There are a lot of other features I'd like to add which will be a) smaller and easier and b) more interesting to work on. So I'll see about widening the list as it shouldn't be hard.
Cammagno Sep 10, 2008, 04:33 AM It's definitely possible. I just need to recode it (what's new, eh?) to be aware of this. I'm still using the original game's selection logic, and it doesn't handle items that show up in multiple places or have similar values.
An example of where this gets really strange is that in a recent large test game of mine, selected "Level 11" to see where my uber-Infantry is at, it also selects my single "Mining Inc. Executive". :confused: So yes, I gotta fix this issue.
This is really good to listen! :) :) :)
If this issue can be adressed, the filter stuff becomes secondary... still intereresting to have it sooner or later, but sure not a priority.
As for widening the screen, I would like to do that. I'm hoping to wait until I add filtering, but I think I'm going to hold off on the filtering for a while. There are a lot of other features I'd like to add which will be a) smaller and easier and b) more interesting to work on. So I'll see about widening the list as it shouldn't be hard.
Just to be sure... I'm speaking of widening the list of units, not the full screen (for higher resolutions).
And what about the "disappearing units bug"? Is it supposed to be fixed? I ask this to know if I have to report disappearing units or not :)
EmperorFool Sep 10, 2008, 04:52 AM Just to be sure... I'm speaking of widening the list of units, not the full screen (for higher resolutions).
The screen already widens itself for higher resolutions. Are you saying that on a wider screen, it should take up all that empty space on the right? This is easily doable and I'll probably do it in a day or so unless someone takes a stab at it (please! :D).
Are you saying that on normal resolution (1024x768) you want the unit list to be wider, to take some space from the minimap? This will take some reworking of the screen -- laying out the components to have less space between them and playing with the coordinates. It's this extra work that I'd rather do just once, but it's not difficult if someone wants to take it on.
And what about the "disappearing units bug"? Is it supposed to be fixed? I ask this to know if I have to report disappearing units or not :)
Yes! I am now using the correct way to iterate across all units. If there were no disappearing units on the original MA, there shouldn't be any now (same code). However, if you do find a missing unit, please post about it. :)
This is really good to listen!
English lesson of the day: You listen to someone so that you can hear them speak. So it's "good to hear."
Cammagno Sep 10, 2008, 01:40 PM The screen already widens itself for higher resolutions. Are you saying that on a wider screen, it should take up all that empty space on the right? This is easily doable and I'll probably do it in a day or so unless someone takes a stab at it (please! :D).
Are you saying that on normal resolution (1024x768) you want the unit list to be wider, to take some space from the minimap? This will take some reworking of the screen -- laying out the components to have less space between them and playing with the coordinates. It's this extra work that I'd rather do just once, but it's not difficult if someone wants to take it on.
To tell the truth, my suggestion/request was limited to the first thing :)
English lesson of the day: You listen to someone so that you can hear them speak. So it's "good to hear."
Thanks! :)
ruff_hi Sep 14, 2008, 03:16 PM back to the issue of the sit rep strategic icons disappearing when you declare war. EF and I have discussed this and have developed the following solution ...
ruff_hi (7/10/2008 2:16:04 PM): so, in suido-code ...
ruff_hi (7/10/2008 2:16:13 PM): if have iron-working:
ruff_hi (7/10/2008 2:16:26 PM): if not trade-network: icon grey
ruff_hi (7/10/2008 2:16:37 PM): if trade-networking + iron: icon solid
ruff_hi (7/10/2008 2:16:46 PM): if trade-networking, no iron: no icon
ruff_hi (7/10/2008 2:16:55 PM): with the last 3 ifs indented
emperor.fool (7/10/2008 2:17:04 PM): ya essentially
emperor.fool (7/10/2008 2:17:16 PM): I think you can genericize it and get some help from canTrain()
ruff_hi (7/10/2008 2:17:47 PM): right - that that we (YOU!!) have completely re-written how this code works out YES / NO by unit, I'll take a look to see if we can do the above
emperor.fool (7/10/2008 2:18:20 PM): if canTrain() if connected: solid else: grey elif canTrain(False) -- the one that checks if *could* train with rsrc grey else: hidden
ruff_hi (7/10/2008 2:18:23 PM): yes - the cantrain has a paramater that controls if it cares about the resource
We tried to grey out the icons but the mechanism we are using to add the icons (appendmultilistButton) doesn't seem to like us. It has the ability to have enabled / disabled icons but (for reasons unknown), the icons look exactly the same on our screen. Don't tell me that they are different under the city screen - we know - we just don't know why.
Anyway, we've decided to add a '?' icon at the front of the list when you are unsure of the resources (iron, etc). I'll post some examples after we have it in the system.
ruff_hi Sep 14, 2008, 06:00 PM I've updated the code, pulled up one of my test games, gave someone (the bottom guy) all the techs and checked the sit rep ...
http://img228.imageshack.us/img228/777/sitrepprewar0049uj6.jpg
I then declared war (note, he has some vassals) ...
http://img228.imageshack.us/img228/668/sitrepwar0050ie7.jpg
2 things jump out at me ... I can build riflemen but he can build infantry. However, as I don't know that he can build infantry, sit-rep is showing I have the advantage with riflemen. Do we want to leave that in - or is removing riflemen a spoiler?
2nd - I declare war and now I have an advantage due to ivory? I'll have to dig into the game to see what the elephant situation is pre war.
EmperorFool Sep 14, 2008, 06:39 PM I see a few strange things.
1. Why can you build Maceman, UU Pikeman, and Crossbowman now that you have Rifling? I do tend to follow a very similar tech path each game (except my current game, but I haven't reached Rifling yet), so maybe this is possible. I usually hold off on Military Science (Grenadier) until much later (trade), so your lack of it shouldn't be an issue.
2. War Elephants should show up as gray for the vassals because you don't know if they have Ivory or not, but you do know they have the tech to build it. This points out a case we hadn't covered: when you can build something that they might be able to build if they have the resource. Or maybe you did think of it.
3. Zara has Infantry, but you don't have the techs required to know that he has them. Fine, but you do know that he has Rifling, so why is Rifleman (and indeed the units in (1) above) displayed for you?
|
|