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

Bug Reports

Discussion in 'Civ4Col - Medieval: Conquests' started by Kailric, Aug 4, 2013.

  1. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
  2. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Well, my new installation of Windows 8 finally ate all my CD installed version of Col so now I have to work with the Steam version. It also erased all my mods including the one I been testing your saved games on. So, have you not been able to play sense installing 2.0h? As I am not quite understanding the bugs you have been reporting. You stated once that it would not load and then you stated everything was fine here...

    Anyway, I am confused about what you are reporting.
     
  3. mastrude

    mastrude Paraclete of Kaborka

    Joined:
    Oct 9, 2006
    Messages:
    329
    Gender:
    Male
    Location:
    Santa Cruz, ca
    You are not the only one who's confused. :) Yesterday I for a while I wasn't able to play at all--every game failed, leaving no traces, three or four times. I enabled logging, and then the failures stopped. I've been playing one game since then.

    I will try to get a handle on this. [EDIT:] My current guess is that I had been playing the TAC mod and these were my first M:C games after restarting the game -- in other words, some weird kind of caching issue. I'll test this. I didn't succeed in making these crashbugs recur so far.

    I think there's a slash/backslash problem in several lines of Civ4Builinginfos.XML. They cause the 12 error messages on startup, every time.
     
  4. mastrude

    mastrude Paraclete of Kaborka

    Joined:
    Oct 9, 2006
    Messages:
    329
    Gender:
    Male
    Location:
    Santa Cruz, ca
    In this screenshot, the calculations are incorrect for production of luxury food. The numbers at the botton show +7/turn. This is correct, 6 from the baker and 1 from the butcher. We're only producing 1 cow/turn. But the number for the butcher shows a 6 production.

    Also, the amount of spice is not decreasing.
     
  5. mastrude

    mastrude Paraclete of Kaborka

    Joined:
    Oct 9, 2006
    Messages:
    329
    Gender:
    Male
    Location:
    Santa Cruz, ca
    Here's another drop to the desktop, at the end of the turn of the saved game attached, 770 AD. The PythonErr.log shows some stuff. Also the XML.log shows some other things. I had to split the XML Log in 3 parts.
     

    Attached Files:

  6. mastrude

    mastrude Paraclete of Kaborka

    Joined:
    Oct 9, 2006
    Messages:
    329
    Gender:
    Male
    Location:
    Santa Cruz, ca
    Here's another drop, this time failure to open, using 2.0h and the Medieval Faireweather map. Died before an initial autosave could be made. What are these references to Superseded Medieval_Tech.py?
     

    Attached Files:

  7. mastrude

    mastrude Paraclete of Kaborka

    Joined:
    Oct 9, 2006
    Messages:
    329
    Gender:
    Male
    Location:
    Santa Cruz, ca
    Another game, just started. It seems like the commands to the characters aren't working. Two items were highlit for promotion, but you could press the star button four or five times and nothing would happen. Finally the star button took effect and I could promote them. I'm guessing there was a lot of silent error processing behind the scenes, and I'm attaching the PythonErr.log.

    Likewise my pedlar is wounded and I can't set him to healing.

    I'm guessing this is related to the action buttons not appearing at all, the other game. I'm going on strike until the 12 xml text errors are fixed. :)
     

    Attached Files:

  8. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,272
    Edit CivilizationIV.ini and set both DisableFileCaching and DisableCaching to 1. That should eliminate that problem, though the game starts slower.

    While you are in that file, tracking bugs becomes easier if you set
    • HidePythonExceptions = 0
      AutoSaveInterval = 1 (autosave each turn)
    MaxAutoSaves can be whatever you want, but if you want to go as far back as the default settings, then it should be 20.
     
  9. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    I just uploaded another update, 2.0i. I had to completely reinstall my test version from scratch and all of its updates all the way through to 2.0i and the mod works just fine for me. Maybe you could try reinstalling everything and apply the updates one at a time in order again.

    Edit: I tried to load your saved game but it will not load. There is some hug difference in the version you are running and mine. I have installed the latest update 2.0i but still I was able to load some of your pre 2.0h saved games so I would highly advice reinstalling the mod and all the patches.
     
  10. mastrude

    mastrude Paraclete of Kaborka

    Joined:
    Oct 9, 2006
    Messages:
    329
    Gender:
    Male
    Location:
    Santa Cruz, ca
    OK, will do.
     
  11. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,272
    I noticed the AI is to some extend the vanilla one and as a result of this the AI import/export suffers from this:
    • There is only one European price. Planning stage doesn't take price modifiers into account.
    • The AI either imports or exports a yield. It can't really do both for the same yield.
    • Inland cities will never export yields, only transport them to port cities.
    • Can't export on land routes if civ has no port cities. (result of previous issue)
    On top of that I haven't figured out if/how the AI uses the different trade routes. It's possible exports are hardcoded to ships.

    There is no easy fix for this. We are looking into AI assumptions, which are coded deep into the code and takes some effort to solve. Luckily it would appear the AI somehow gets strong enough to provide the correct difficulty anyway, but maybe they only do that if they happen to start next to the sea.

    I would suspect this problem increases with map size as big maps can place some civs rather far from the sea. On the other hand the "European" trade screens are less important in M:C meaning maybe the AI survives without using them at all.
     
  12. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    I noticed some of that as well when working on making the AI produce Nobles. I have succeeded in that to some degree as the AI will build Butchers houses in appropriate cities and start to move all their Beef and Spices there.

    The AI still only uses the Vanilla "Europe" for trade and does not consider the new Trade Routes. I haven't made it that far in their coding yet. They can however access the Europe Screen either over land or sea and they will trade with Natives more.

    NOTE: If you are in cheat mode you can "shift-click" the Immigration screen to pop up the old Europe Screen. I do this quite often when using AutoPlay to test how the AI is doing in Europe Trade Screen.


    At the start of the game the AI will found it's first city next to an Ocean plot if it is at all possible. They will "cheat" so to speak and find a good spot even if they haven't explored there yet or you could say they get lucky and move in the right direction every time :)

    Edit: I am starting to learn Economics in my college studies now. I am excited about it as maybe I can use what I learn to improve the economy of M:C :)
     
  13. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,272
    I have spend the last few days studying the AI and how it treats yields. I found a few glitches where I fixed some of them. One example is if the AI is short on money it will increase production of what it sells in Europe. It had one list for what to produce and one for what to sell and those two were different. Now they both use Check_YieldGroup_AI_Sell_To_Europe() to prevent they ever get out of sync again.

    However there are still some issues left, which I didn't touch, or rather I haven't done anything about yet.

    YIELD_STONE has little special code. I wonder if the AI really cares about it and if it is able to use stone as intended.
    I wondered about changing the code to merge behavior with YIELD_LUMBER, but if I do that I'm scared that it could start to produce stone instead of lumber.

    I'm unhappy with the code to produce luxury goods. Somehow it looks wrong and I highly suspect the AI values luxury food much different from what we do. However I haven't figured out if I can do anything about it. Also for some reason the code appears a bit messy and possibly a bit random. Rather than do something about it, somebody should take the time to really look into the AI and plan what the AI is supposed to do.

    The AI appears to be happy to trade YIELD_SPICES. It wants to buy it from natives and Europe, but at the same time it wants to sell it to Europe. I'm considering adding an assert to check for both buying and selling in Europe as the code appears to hardcode a yield for either import or export. Doing both with a yield appears to be unsupported and I'm unsure how the AI actually handle spices at the moment.

    I found that the code has some hardcoded behavior for some yields and I assigned a yield group for that. However setting bIsNativeTrade in XML provides the very same result. While it works with the current code, it would be better to have just one place to set this behavior. I kind of prefer the yield group as it provides noteworthy faster code but XML is a bit easier to edit. I'm not sure which option is the best here.

    Maybe we should consider making a design decision about yields and XML. Now that we control yields from a single file we might hardcode yields there if it can be done by simply adding a new group. This should be possible for all booleans as the groups are either true or false for a specific yield. After all it's fairly limited what kind of yield modding you can do without recompiling anyway and the in-dll solution is designed for speed where XML isn't. Anything which is more complex than on/off should still be done in XML.

    Sounds interesting but do remember that most economic theory is invented in post medieval times. The view on economics has changed ALOT. Also remember that you educate yourself to get a job, not to become a better modder, though they can easily coexist. This comes from a guy who took a welding class at uni "because it sounded fun" :lol: Well now I do know some stuff about welding, casting and stuff and you never know when it might be useful.
    I never learned anything useful for ingame stuff like that when I attended university. However I was a really novice programmer when I started... but not anymore :)
     
  14. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Yep, coding the AI is tricky. You do one thing thinking the AI will react a certain way but instead it messes them up completely. I mentioned this before but when I add code I make it so that it works for the player with no regard to the AI. I do this because I don't want to spend hours programing the AI to work a feature if it is bugged or still in debate of being a feature. So, there is a whole bunch of programming to do as far as AI is concerned. But, they are well enough now that they can kick the Popes arce most times.

    Stone is only used in the late game for building Walls, Cathedrals, and such and they build those just fine. I can't exactly remember but I may have changed it so that the AI ignores yield cost to buildings as it was getting stuck on building a building over and over if it did not have the resources.


    But it works? The AI can now produce Nobles at an effective rate as before they would only gain Nobles through Immigration. As far as coding goes I simply made it so they will send all Cattle and Spices to a City that can actually produce Luxury Food and then made it so they want sell their Luxury Food. Whereas before they would not do this. I couldn't make it work just like Food because I seen that this would cause errors, but it was a simple change really.

    Well, I myself want to buy Spices from the natives and sell it to Europe because it is good profit in it and it is the way I designed it. How the AI handles any yield is fairly simple really.

    Faster sounds good.

    Well, even though the theory of economics was invented more recently the workings of medieval economics are still the same. The definition of economics is the study of efficient use of scare resources. So by that definition economics has been going on sense the beginning of time we just haven't labeled it as such. I've learned that there are 4 broad categories or scarce resources; land, labor, capital (note: economically this is not money but rather items used to produce goods and services such as factories, storage, tools, and equipment), and entrepreneurship. All of these are present in M:C so I have a feeling all that I learn can be applied here too:cool:
     
  15. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,272
    That sounds reasonable. However the bug I referred to is that the AI is coded to buy spice in Europe and then sell it in Europe. However there is a piece of code in CvPlayerAI.cpp which I think assumes the AI will never buy and sell the same yield in Europe. Because of this the AI's behavior is in undefined territory.

    I propose spice should be a member of YieldGroup_AI_Buy_From_Natives and YieldGroup_AI_Raw_Material.
    The first one makes the AI buy the yield at natives (hence the name) while the latter makes the AI sell the yield in Europe if they have more than the buildings consume.

    I propose removing spice from YieldGroup_AI_Buy_From_Europe and YieldGroup_AI_Sell_To_Europe.
    The sell here means it should sell to Europe whenever it has the yield disregarding if the buildings needs this yield. The buy one shouldn't need an explanation.

    Currently spice is a member of all four groups. I just copied the behavior from the hardcoded yields in CvPlayerAI.cpp, but that's not the same as that is what we really want. It's not as bad as it looks as I decided on a little design change when I implemented the groups. When deciding if a yield should be sold, it will ignore YieldGroup_AI_Sell_To_Europe settings if the yield also has YieldGroup_AI_Raw_Material. This design change prevents the AI from selling spice even if it needs it for the butchers. Previously it might have been a bit random if it sold it or gave it to the butcher, but right now it will only sell whatever isn't used by the butcher.

    I think it would be a good idea to go though all groups in Yields_Medieval_Tech.cpp and see if all yields are defined as intended.

    Come to think of it, we shouldn't allow more than one of YieldGroup_AI_Raw_Material, YieldGroup_AI_Sell_To_Europe and YieldGroup_AI_Buy_From_Europe to be set.
     
  16. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    That sounds like a good plan.
     
  17. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,272
    It is, but are you going to do it? :lol::p
     
  18. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Well, if I have to do it I don't know when I'll be able to set aside time to work on this. I wouldn't mind looking into it but it may take me awhile.
     
  19. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    I haven't played the Git version in a while but downloaded the newest version and started up a game just now. First off my monks can't found Monasteries. What's worst is when I created the Debug version to see why and attached the MVC++ to M:C the game crashes as soon as I return back to the game with the below codes...

    Code:
    The thread 'Win32 Thread' (0x19bc) has exited with code 1073741855 (0x4000001f).
    The thread 'Win32 Thread' (0xcdc) has exited with code 1073741855 (0x4000001f).
    The thread 'Win32 Thread' (0x15c8) has exited with code 1073741855 (0x4000001f).
    The thread 'Win32 Thread' (0x678) has exited with code 1073741855 (0x4000001f).
    The thread 'Win32 Thread' (0x1ba8) has exited with code 1073741855 (0x4000001f).
    The thread 'Win32 Thread' (0x7dc) has exited with code 1073741855 (0x4000001f).
    The thread 'Win32 Thread' (0x17c4) has exited with code 1073741855 (0x4000001f).
    The thread 'Win32 Thread' (0x1b90) has exited with code 1073741855 (0x4000001f).
    The thread 'Win32 Thread' (0x1824) has exited with code 1073741855 (0x4000001f).
    The thread 'Win32 Thread' (0xa80) has exited with code 1073741855 (0x4000001f).
    The thread 'Win32 Thread' (0x8ec) has exited with code 1073741855 (0x4000001f).
    The thread 'Win32 Thread' (0xb74) has exited with code 1073741855 (0x4000001f).
    The thread 'Win32 Thread' (0x12c8) has exited with code 1073741855 (0x4000001f).
    The thread 'Win32 Thread' (0x1d04) has exited with code 1073741855 (0x4000001f).
    The program '[5428] Colonization.exe: Native' has exited with code 1073741855 (0x4000001f).
    Also, one FA appeared on the first turn..

    File: CvCityAI.cpp
    Line: 1046
    Expression: kBuildingInfo.getSpecialBuildingType() != NO_BUILDING
    Message: BUILDING_BONUS_BANANA has no special building

    I don't have time to try to figure this out at the moment. I am using the steam version of the game, which before I was using the CD version, which Windows 8 so kindly:mad: erased. I don't recall, however, having an issue with the Debuging on the steam version. Anyway, any ideas why the game crashes when I try to debug?
     
  20. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,272
    Debug version works for me. I loaded a savegame (single player, no AI for testing) and it worked fine. I can't build monesteries, but I also discovered another problem. There is a bandit with 24 HP left. He has +10% power (veteran?) and +75 defense from plot. This gives him a total power of 48.83, making him totally unbeatable for my veteran soldiers, which only has a power of 3.3. Also archer profession appears to be missing.

    The weird part is that all this worked the last time I checked :confused:
     

Share This Page