1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

K-Mod: Far Beyond the Sword

Discussion in 'Civ 4 - K-Mod: Far Beyond the Sword' started by karadoc, Jan 8, 2011.

  1. Jabarto

    Jabarto Emperor

    Joined:
    May 15, 2007
    Messages:
    1,025
    Location:
    Colorado, U.S.
    That's so that the Guerilla line will be off limits to most melee units, but ones that start with Guerilla I (e.g, the Gallic Warrior) aren't limited to the first level. Same thing with Samurai; Drill I isn't allowed for melee units, but Drill II, III, and IV are, so the Samurai can get the complete line.
     
  2. rbj2001

    rbj2001 Warlord

    Joined:
    May 26, 2006
    Messages:
    188
    Well exactly. The AIs are always coming to me and offering 50 gold for Code of Laws, or Polytheism for Philosophy, or other such unfair deals. It makes sense for me to refuse to prevent them getting a massive tech boost.

    If I offer the AI a similarly unfair deal, they always refuse, and only take a deal if they gain more beakers of science than you do from the trade. But it seems like you're saying that civs will accept such deals if they come from another AI civ? If so, it's an asymmetry that rigs tech trading against human players.
     
  3. Groff

    Groff Prince

    Joined:
    Mar 31, 2010
    Messages:
    380
    Gender:
    Male
    Location:
    RS
    First a big thank you to karadoc for this great mod. I have a question also, is there i way i could use your mod but without BUG mod that's included with it (as i seem to have some issues with the included BUG mod - number of cities is incorrect, most of the time the warning/pop up messages don't display). I want to use your mod and the original BUG (i have no issues with the BUG if i use the original one, only with the one included in your mod) but I'm not sure if it's possible or have to do it?
     
  4. King Pluto

    King Pluto Emperor

    Joined:
    Feb 16, 2009
    Messages:
    313
    Location:
    Massachusetts
    I never really got an answer to my questions here. Can anyone elaborate what's needed to integrate these BULL features with KMOD? I'm getting somewhat bored with vanilla BTS and want to branch out into my own mod with KMOD as the base, but I want my micro tools from BULL. Any help on where to start to implement these features would be great...
     
  5. karadoc

    karadoc AI programmer

    Joined:
    Oct 3, 2005
    Messages:
    1,568
    Location:
    Australia
    The number of cities display is, in some sense, deliberately incorrect. In BUG (without K-Mod), the accurate number of cities is assumed to be available to the player almost all the time because the player can simply count the cities in the trade screen. In K-Mod this is no longer the case. The AI doesn't show their cities in the trade screen during peace time, and so that city counting method is no longer available. So the K-Mod city count is simply the number of cities that you have seen; which is likely to be less than the total number.

    Originally I'd just removed this city count feature completely - but I put it back in with this limited functionality because some people were asking for it. I realise that there are other methods to get a slightly more accurate guess for the number of AI cities even if you haven't seen them, but I don't really like to embed stuff like that in the UI because those methods are a result of weakness of the game mechanics rather than a deliberate ways to provide information to the player.

    --

    As for BUG warning messages. Can you give particular examples of things that don't work? I personally dislike those BUG alert features, and so I always have them disabled.

    To answer your question, it non-trivial to separate K-Mod from BUG. BUG is fairly tightly integrated, and it wouldn't be easy to completely extract it. However, the alert features and the number-of-cities count that you have mentioned are both features that can be easily disabled using the BUG settings screen. In fact they are both disabled in the default K-Mod settings because I think they are probably not useful to most players.

    I said that the frequency of the AI's trades could be estimated by looking at how often the AI offers deals to you. I didn't mean to imply that the quality of trades could be estimated like that.

    The AI will sometimes often human players very poor deals that they wouldn't offer to an other AI player. When AI players trade with one another, here is the formula they use to determine whether or not the trade is acceptable:
    Code:
    // K-Mod. Minimum percentage of trade value that this player will accept.
    // ie. Accept trades if 100 * value_for_us >= residual * value_for_them .
    int CvPlayerAI::AI_tradeAcceptabilityThreshold(PlayerTypes eTrader) const
    {
    	if (isHuman())
    		return 75;
    
    	int iDiscount = 25;
    	iDiscount += 10 * AI_getAttitudeWeight(eTrader) / 100;
    	// This puts us between 15 (furious) and 35 (friendly)
    	// in some later version, I might make this personality based.
    
    	// adjust for team rank.
    	int iRankDelta = GC.getGameINLINE().getTeamRank(GET_PLAYER(eTrader).getTeam()) - GC.getGameINLINE().getTeamRank(getTeam());
    	iDiscount += 5 * iRankDelta / std::max(6, GC.getGameINLINE().countCivTeamsAlive());
    
    	if (GET_PLAYER(eTrader).isHuman())
    	{
    		// note. humans get no discount for trades that they propose.
    		// The discount here only applies to deals that the AI offers to the human.
    		iDiscount /= 2;
    	}
    	return 100 - iDiscount;
    }
    // K-Mod end
    
    Note: in the original BtS AI this value was not a variable, the threshold was 2/3 for all AI trades. Whereas the K-Mod AI is more likely to offer generous deals to players that are further behind, and players to whom they have good relations.


    The WHEOOHRN indicator on the scoreboard was removed because civs no longer reliably tell the player that they have "enough on our hand right now" when preparing for war. In the unmodded game, looking for WHEOOHRN was a reliable indicator that the civ was preparing for war. In K-Mod it is not, and so the fist indicator on the scoreboard was removed. If you want to re-enable the fist thing anyway (even though it is no longer reliable), you should look for things like "isShowWorstEnemy" and "Worst Enemy Icons" in the python files that the scoreboard uses. From memory there were just a couple of lines that would need to be changed to re-enable it, but I don't remember exactly where they are...

    The pre-chop feature requires changes to the DLL. In the source code for the BULL version of the DLL you can find how it interrupts chopping between turns when pre-chop is enabled. The main reason I haven't included that feature is that the BULL implementation breaks multiplayer mode. It causes OOS errors. (The secondary reason, and the reason I haven't bothered trying to implement it a different way is that I don't really like the feature anyway. I'd rather not enshrine that style of gameplay by making explicit UI features for it.)

    For the mouse-over text. I don't know what you have in mind. K-Mod has generally better mouse-over text than BUG. There are many changes in K-Mod which fix inaccuracies and inconsistencies in various mouse-over texts for both BULL and the unmodded game. But perhaps there are still some obscure BULL texts which are not included. Which things in particular do you think are missing?
     
  6. Groff

    Groff Prince

    Joined:
    Mar 31, 2010
    Messages:
    380
    Gender:
    Male
    Location:
    RS
    Thanks for the quick reply, well I have to say that the way BUG report's number of cities has a lot more sense the way you set it up. And about those warning messages, seems I didn't check all the things that I wanted in the options menu so some of them weren't showing up, I got all of that sorted out now, it was my fault. Once again thanks for this great mod, love the way culture works now.
     
  7. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,602
    Location:
    israel
    karadoc hi dude,

    keep up the mulltiplayer party :) dont add crappi oos codes :)
     
  8. xcrissxcrossx

    xcrissxcrossx Prince

    Joined:
    Jun 16, 2007
    Messages:
    314
    Location:
    Indiana
    Actually I've noticed that virtually every time an AI offers me one of those deals, it is because they were researching the tech they want from you, and only have like 1 turn left to go before they research it themselves. I've found it's almost always worth accepting those deals.
     
  9. groovydude49

    groovydude49 Chieftain

    Joined:
    Apr 24, 2013
    Messages:
    3
    Location:
    USA
    Karadoc - I just downloaded your mod last night, and only just now got to fire it up. I've gotta say, from reading this thread and the change log, it sounds awesome. I also downloaded the Blue Marble file you have, however, it doesn't seem to work no matter where I put it. Would you mind clarifying where the file needs to be? Thanks!
     
  10. Gamer999

    Gamer999 Chieftain

    Joined:
    Nov 6, 2010
    Messages:
    28
    There are few changes I would like to have in the mod.

    Ingame option to turn off global warming. The current global warming system doesn't scale well with earth maps and other special scenarios for modern era (At least the latter one). This would make some unique scenarios playable without seperate mod.

    For being playing the game for a while again I have always wondered why the AI uses worst possible units against minor stacks or single units I send in their territory. For example if I send spearman in highly defensive position next to AI stack that includes war elephant, horse archer and 2 axeman they attack in that order instead of using 2 axeman first. When I'd send one war elephant the AI would waste stack of catapults first and then attack starting with worst units. I quess that could make even better chance for the next unit to win or get more experience but for cost of losing much more. Or then the AI just handles all units like stacks which could make little more sense.
    This is a major problem that I can't really understand from the AI and has been problem in the non-modded version as well.
     
  11. Lone Wolf

    Lone Wolf Deity

    Joined:
    Dec 4, 2006
    Messages:
    9,896
    Am I the only one who thinks that the AI is a bit too raze-happy? :p
     
  12. noto2

    noto2 Emperor

    Joined:
    Jul 11, 2008
    Messages:
    1,709
    Welp....I'm back. Didn't play any Civ since January, and no vidya at all since early Feb, but right now I just need to veg out. I don't want to get Civ 5... partially because I don't want to get a new computer to handle it and partially because it didn't seem interesting to me. So I'm going to fire up trusty ol' Kmod and see how it goes. Doesn't seem that too much has changed since January.
    What are you up to these days, Karadoc? Programming for anyone? Do you still tinker with Kmod at all?
     
  13. karadoc

    karadoc AI programmer

    Joined:
    Oct 3, 2005
    Messages:
    1,568
    Location:
    Australia
    Hello there noto2,
    I do still tinker with K-Mod - but I haven't been making any significant progress lately. I'm not programming for anyone else either. I'm not really doing anything at all.

    @Gamer999 the problem of the AI using the wrong units to clear away invaders is a difficult problem to solve. The reason it happens is that the AI's decision making process basically just involves them cycling through each of their units one by one and looking for the best thing that the unit could do. There are very few circumstances where the AI will take into account what its other units are doing. It just looks for the best thing each individual unit could do.

    So, if the AI is trying to decide what to do with a war elephant, they might see a spearman and think "well, my attack odds aren't too bad - and I really want to get rid of that spearman. So I'm going to attack." They don't look to see if there is some other unit who could do a better job.

    This is behaviour is due to a flaw in the system; and that flaw causes other problems too. I think the best way to solve it would be to completely rewrite the AI so that instead of cycling through each unit and asking "what should this unit do", it instead should create a list of objectives and then cycling through the objectives and ask "which unit (if any) should do this". (Although, such a system would have other problems...)
    Anyway, the upshot is that this kind of problem is difficult to completely fix. I don't intend to make any major structural changes to fix it, because I don't think it would be worth it (and it might not work well anyway) - but I might be able to make some tweaks to make it less likely for the AI to make mistakes like that.

    As for the scaling of global warming. I'm not certain what you mean about it becoming 'unplayable'. Do you mean that global warming becomes extremely strong well before the end of the game? If you have some particular example of a map / settings combination where this happens, I'd like for you to post about it in the GW feedback thread. Regardless of whether or not there's an option to turn GW off, I'd like for it to work properly on all maps! And as for having an option to turn it off... does anyone happen to know if it's possible to add / change the available options in the custom-game settings screen independently of all custom maps? In particular, is there some way I could add a new dropdown menu to control the strength of global warming; and change the multiplayer options so instead of a checkbox for 'simultaneous turns', there's a dropdown menu with 3 options (sequential, simultaneous, and a new semi-simultaneous option)? - If this stuff can be added to the general game options (not the map settings) then I might implement it... but otherwise I don't think there is a suitable place for a 'no GW' option.

    @groovydude49 That BM file needs to be unzipped into the K-Mod Assets folder, so that it looks something like this:
    C:\games\Civilization 4 Complete\Beyond the Sword\Mods\K-Mod\Assets\BM tiles.FPK. Note that the thing you downloaded is compressed using 7-Zip. You have to extract the .FPK file to use it, and to do so, you'll need 7-Zip.

    @Lone Wolf, the AI probably does raze cities too often if it is trying to win - but it happens to be one of the ways that the AI shows its personality... ie. each AI leader has a 'Raze City Probability' which determines how likely that leader is to raze a city. This is a feature carried over from the original BtS AI. In K-Mod, the AI does an evaluation of the city before deciding whether or not to raze it, and so it generally won't raze really good cities - but still, some AI leaders are likely to raze a lot of cities whereas some other AI leaders will keep most cities.

    As I said, I don't think the AI has great strategy in this area, but I don't think it's a big deal and so I've think it's ok to let the AI keep that kind of personality trait. (I think it's good that different AI leaders behave in different ways, even if it means some AI leaders aren't as likely to win as others.)
     
  14. noto2

    noto2 Emperor

    Joined:
    Jul 11, 2008
    Messages:
    1,709
    I already posted in the GW feedback thread and I just wanted to say this here, briefly: your GW addition does significantly change the late game and I think for the better. However, players who haven't planned for it could easily feel overwhelmed. For those of you who feel this way, let me suggest that you take GW seriously and plan for it and adapt to it. There are a ton of things that in the base game you probably ignored that you should probably not ignore in kmod.

    Recycling centers are amazing not only for the health benefits but they also reduce your pollution and thus the unhappiness from GW.

    Late game happiness bonuses from things like hit singles and from the broadcast towers are more important now, you might not be able to skip them

    Also, if you're planning on doing something like spamming coal plants and industrial parks, keep in mind that not only will you have major health problems but this will cause major unhappiness problems as well. You may be forced to run environmentalism, for example.

    Anyway, as I said before, I think the GW you added to the game is actually one of the best things about Kmod. Why? Because there are all these aspects of the game that one could ignore, as I just pointed out, whereas in Kmod these things actually need to be used (like recycling centers).
     
  15. TiglathPileser

    TiglathPileser Warlord

    Joined:
    Nov 25, 2010
    Messages:
    143
    Just noticed the AI is building forts over forested calendar luxuries but not replacing them with plantations post calendar.
     
  16. rbj2001

    rbj2001 Warlord

    Joined:
    May 26, 2006
    Messages:
    188
    I wonder if it might be possible to get rid of the "you razed one of our cities!" -2 attitude, when the city gets razed due to only being size 1 (i.e. you don't have any choice in the matter).

    Maybe it could be a sliding scale in attitude according to the city that you raze, from -3 (large, important city containing wonders) to 0 (size 1 city with no buildings)?
     
  17. noto2

    noto2 Emperor

    Joined:
    Jul 11, 2008
    Messages:
    1,709
    Hey Karadoc, any chance I could convince you to merge Kmod with one of the graphic enhancing mods like BAT? I'm bored of Civ4 graphics, I hate Civ5, there are mods out there with interesting graphics but their gameplay is not as good as Kmod
     
  18. karadoc

    karadoc AI programmer

    Joined:
    Oct 3, 2005
    Messages:
    1,568
    Location:
    Australia
    The K-Mod AI will do that deliberately if they prefer the :hammers: and :health: bonus of the forest over the yield bonus of the plantation.

    It would be a bit of a pest to make it a sliding scale, because the current implementation is that the game counts the number of cities razed and then just multiplies by -2 to get the attitude adjustment. To make it a sliding scale it would have to be changed so that it counts something else rather than counting cites, and that might have unintended side-effects if those number are used for something else (or it might not). Maybe it would be fair enough to not count the cases where the player has no choice - but on the other hand, razing a size 1 city in the early game can be a really big deal... so maybe it's fair enough to count them! I'm not really sure if the game would be better with that thing changed.

    Like this?
     
  19. Zacar

    Zacar Warlord

    Joined:
    Jan 7, 2006
    Messages:
    160
    The free unit supply number (in parenthesis) in financial advisor varies based on the amount of units outside my borders. I think it would be more useful if this number was the hard limit of units I can have out at once without cost.

    Is there a reason for not having more than 18 player slots?

    I used to play some version of BBUGAI. I miss some things of varying importance from there:
    -Forest indicates how many turns it has been chopped (mouse hover)
    -Cities indicate the amount of turns until next culture level (mouse hover)
    -Negative money cost number stays yellow if there is enough money for the next turn, otherwise red

    edit:

    If I load civilopedia at the main menu, before loading a saved game, it will remain civilopedia in a game where I decided to use sevopedia. This is a bit confusing. I assume it is due to the default not being sevopedia.

    edit2:

    The default espionage weight is 1. This should be 0 to avoid the situation where the player mistakenly directs espionage to newly met civilizations, when the intention of the player is to focus EP spending.
     
  20. noto2

    noto2 Emperor

    Joined:
    Jul 11, 2008
    Messages:
    1,709
    Oh cool, thanks Karadoc. I hope he updates it though
     

Share This Page