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

[RaRE] RaR Extended: a combined modmod for the RaR modification

Discussion in 'Civ4Col - Creation & Customization' started by Commander Bello, Aug 26, 2014.

  1. wladyslaw17

    wladyslaw17 Chieftain

    Joined:
    May 31, 2015
    Messages:
    6
    Had that happening to me few months ago. Attached patch should do the trick. It is untested though and as such subject to dev team sign off.
     

    Attached Files:

  2. wladyslaw17

    wladyslaw17 Chieftain

    Joined:
    May 31, 2015
    Messages:
    6
    Forgive my ignorance, I'm not Windows guy.

    I just grabbed git source, installed VS C++ Express 2010 SP1, project file is fine, Makefile is fine as well. Defined compiler used is cl.exe from VS and VS2010 is mentioned in this thread as the way to go. Unfortunately I can't make it compile using VS2010 cl.exe, here is breaking point:

    CvCityAI.cpp(1112): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

    Any idea what compiler/what cl switches was it written for?
     

    Attached Files:

  3. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,556
    I think the problem is that you are missing the correct compiler. The exe was compiled with VS2003, which mean the DLL should too. This mean the setup is made to use 2010 to code in (the GUI is way better) and the Makefile relies on 2003 to compile.

    I wrote a guide here:
    https://sourceforge.net/p/colonizationmodcollection/wiki/compiler setup/
    The git guide on that wiki applies too, except RaRE is not using submodules.
     
  4. wladyslaw17

    wladyslaw17 Chieftain

    Joined:
    May 31, 2015
    Messages:
    6
    Thank you for your hint, with one and few other bits and pieces I got it working. Cheers.
     
  5. wladyslaw17

    wladyslaw17 Chieftain

    Joined:
    May 31, 2015
    Messages:
    6
    This is quick patch that makes custom house sell either all overflow or all amount above threshold set. Simplifying pre-patch logic a bit with only CITY_YIELD_DECAY_PERCENT/100 of over threshold goods are being sold.

    The be honest it still is not fully desired behavior - I'd expect custom house to sell first, total amount of goods get reduced, then overflow is applied when still over limit - but this is good enough as long as our city does not go over storage limit. When it does though overflow is triggered and custom house is bypassed fully.

    That concludes list of issues that were getting in my personal way.
     

    Attached Files:

  6. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,556
    I found some time to look at RaRE again and I added a few updates to git:

    XML type preload
    Loading the XML files is now a two step process. First the files are read, but only basic data is read. Next time the XML files are read, everything is read and the data from the first round is overwritten.
    The result is that XML loading code knows the index of files/types not yet read and that the length of all GC.getNum*Infos() is known before the player constructor is called (useful for JIT arrays).

    The next two are based on code from wladyslaw17 :goodjob:

    Traderoute threshold truncate
    The network package now use 16 bit instead of 8 to set the threshold. This allows values greater than 255.

    Pirate spawning in lake fix
    Barbarian pirate frigates can now only spawn on plots, if the area has at least one plot with access to Europe (naturally the previous checks are still in place, like isWater()). This mean they will no longer spawn in lakes. Unlike wladyslaw17's proposed code, this solution will also rule out inland seas, which are too big to be classified as freshwater lakes.
     
  7. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,556
    I added automated import threshold from M:C. Now feeder service will use an internal import threshold, which will be the highest value of the user set import threshold or the highest required by anything in the construction queue. This makes it useful to to use feeder service to import tools with a threshold of 0.

    I'm not entirely happy with the result though. It is still a hassle to set up imports and exports for each colony. I'm thinking of adding a few buttons to do the following tasks:

    • Clear all
    • Import all (maybe not if the next one is added)
    • Import yields commonly exported to Europe
    • Auto export (possibly also of commonly exported yields)
    • Auto import to supply construction
    • Auto import to supply domestic marked (for X turns determined by spinbutton)
    The idea with the auto settings is that they are only checked in CvCity::doTurn(). This allows them to enable or disable imports and exports and through that add/remove trade routes without the risk of desyncs or crashes. By completely removing the trade route rather than let threshold skip the trade routes if there is nothing to transport, there will be far less trade routes to loop. Based on experience, looping the trade routes can turn into a time consuming task as you get further into the game and have plenty of colonies.

    It would likely make good sense to add a checkbox for each yield to turn automation on/off for each yield. It is possible that you want to auto export all yields, which should be exported, but import and stockpile say ore. You could have a blacksmith in the colony.

    It is also likely that "up to" threshold should be set by feeder service when it increase the threshold. Currently it's not doing that, which mean it will happily import 100 tools when it only needs to import 5.

    All in all a really useful feature I would not do without, but it isn't done yet.
     
  8. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,556
    I added a new concept to traderoutes: auto export.

    The concept is quite simple. The yields are looped anyway in CvCity::doYields(), which made it a nice place to add a new check. If stored yields is higher than the maintain level, then export is turned on. If not, then it is turned off.

    This allows the game to remove all the traderoutes where the source has nothing to export, which should make looping all traderoutes much faster.

    Now that we have 4 checkboxes and 2 spinbuttons for each yield, I added a few extra buttons on top. Clear All is fairly self explaining. The other two are import all and auto export all. The latter two will not actually take all, but rather only the yields, which would be expected to be exported to Europe (tobacco, cigars and so on).

    This mean it should be fairly simple to set up a basic trade network:
    One colony where the ships land and pick up yields to be sold in Europe. This colony is made with "import all".
    All other colonies will then export to that one by hitting "auto export all". It has the bonus that if the natives sell you some yield you don't produce in the colony, the auto export will activate automatically and move it. Once it's gone, export is turned off again for performance reasons.

    EDIT
    I fixed the bug where you have to remove the forest from hills before building wineyard or collector's post. It has minor gameplay implications as forest removal+building without a forest takes the same amount of time as building on a forest. However the help popup tells the resulting yield production and it's just a single click instead of two on two different turns.
     
  9. Commander Bello

    Commander Bello Say No 2 Net Validations

    Joined:
    Sep 3, 2003
    Messages:
    3,858
    Location:
    near Koblenz, Germany
    Sorry for having been silent for so long.

    Actually, I am at the verge of giving up modding based on RaR. :(
    The fact is that RaR is based on TAC, which is based on the NetBandit mod and large parts of Dale's mod and the patchmod (don't know who created this one). Additionally, a lot of other mods have at least partially included.
    In most cases, documentation is at least poor, if available at all (and I as a German at least can understand NetBandit's and the early TAC comments).

    Frankly, many things don't fit.
    The whole evaluation functions are a mess (mainly based on the fact that even Firaxis didn't know what to do in this area). Functionality is scattered all over the whole code, in many cases you find some functionality at places where at least I would never have expected it. Due to the poor commenting you face a really hard time to find such displaced coding blocks.

    Even (or better: especially) the Firaxis coding lacks proper placing.

    In total, it might be wiser to start from scratch, based on a "clean" patched Colonization and then to import desired functionality bit by bit, making sure in the new version it will be properly documented and placed where it really belongs.

    I put in this idea for debate - if the others are still interested in maintaining Colonization (haven't read anything from agnat and vetiarvind since long)?
     
  10. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,556
    First: for those not following the git changes: I added a game option to reduce min colony distance. If it is on (it's off by default), the min distance is reduced by 1 if the founding player owns the plot and all the plots around it (9 in total).

    I did this because the AI is rather poor at utilizing the land. Each time it founds, it assumes it will never be able to build another colony and want the perfect one. With 1 plot radius and min 2 plots between colonies, that leaves half the plots unreachable. It's kind of annoying when it leaves a gap of 8 plots containing silver and timber bonuses and stuff like that. The simple fix to generally move colonies closer sucks because that mean the natives will start with more settlements and less land will be available without upsetting the natives.

    I have tested it and it appears to work. It will however need a lot of long term playtesting to figure out if it messes up game balance.

    Generally speaking, adding non-English comments is a bad design. However I don't think of that as a major issue since it would appear that most of the modders can read it.

    If we are going to start over anyway, we should concentrate on M:C instead. I have started some code cleanup and plan to really clean up after next release. Also I plan on introducing doxygen, which will generate nice looking code documentation based on comments and it will point out if functions are added without comments.

    Remember that the M:C is changing from being a mod into using DLL and python code, which are then shared between multiple mods and each mod can then be made unique using XML only (in this context, graphics and audio belongs to XML). It's the job for the DLL to ensure that the degrees of freedom in XML is high enough to ensure that the mods aren't just reskinned versions of M:C. I can easily imagine some RaR clone using this system and it would be faster to make than to start over based on vanilla. There are a few features missing in the M:C DLL, which RaR makes good use of. However they are all planned features (like the fishing boats).

    M:C has a number of features not present in RaR, like population cap and tech tree. The idea is that the code is simply not activated unless there is XML data for it. In other words if the population cap is unwanted, it is simply set to 200 or something. Anything, which can't be disabled in XML, but makes sense to disable would be a bug, which has to be fixed.

    Also by sharing the code, the bugs and hence bugfixes are also shared. The same goes for performance improvements. That alone should make it worth considering this approach.

    I have thought about this move for a while, but I don't want to do it personally. It is a lot of XML setup and I would rather invest my time inside the DLL than outside of it.
     
  11. Commander Bello

    Commander Bello Say No 2 Net Validations

    Joined:
    Sep 3, 2003
    Messages:
    3,858
    Location:
    near Koblenz, Germany
    I haven't followed all the M:C discussions in detail, as I have to admit. I did have the idea to ask you (the M:C team) for permission of using M:C code, though.
    Then, at a certain point of time you were discussing the trade screens (?) like Silk Road or something alike and I've got the impression that this might not fit into a standard Colonization setup.

    From your comment now I get the impression that this could be rather easily deactivated?
    If so, as far as I am concerned there wouldn't be any reason not to make use of M:C.
     
  12. Commander Bello

    Commander Bello Say No 2 Net Validations

    Joined:
    Sep 3, 2003
    Messages:
    3,858
    Location:
    near Koblenz, Germany
    I am a bit surprised that it seems to work as intended.
    If I'm reading the code correctly, the New World first is divided into "areas" (not to be mixed up with areas as different continents!) for each tribe, meaning that they all will have really big ... well, areas :) available.
    After placing the cities, any tile not being located in a city radius will be unassigned (and somewhere, where I haven't found it yet, once again certain tiles are re-reassigned, but that's another story...).

    Therefore, especially on really huge maps, I would expect your functionality to cause a multitude of native settings.
     
  13. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,556
    The trade screens are defined in the EuropeInfo XML file and not adding anything but the standard Europe screen will regain the vanilla approach. RaR has 3 trade screens though (Europe, Africa and Port Royale). M:C is much more advanced than RaR though as XML can control which units and yields to sell where and at what price. Also access plots can be either water or land. The colonization setup wouldn't need a land route and that is gained by setting bWater to 1 for all trade screens. (or is it bLand to 0?)

    The only major issue I can think of is the fact that M:C still has no network support. It broke long ago and I plan to fix it, but so far I only fixed issues when I looked at that part of the code anyway. A systematic going through the code to fix all issues is planned, but at a too low priority to actually do anything about it. That could change if there is a demand though.
     
  14. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,556
    No because each settlement provides ownership to 3x3 plots. To use this feature, the player has to own at least 3x5 plots. This mean players (natives and Europeans alike) will have to expand their borders to make use of this, which in turn makes it to a late game feature, which is unavailable for a while. Think about how long it takes to own 3x3 plots without any cities in it.

    But yeah, it should be playtested for long term effects when the AI can start using this feature. As I wrote, I haven't really done that, which is part of the reason why it is disabled by default. It is an experimental feature.
     
  15. Commander Bello

    Commander Bello Say No 2 Net Validations

    Joined:
    Sep 3, 2003
    Messages:
    3,858
    Location:
    near Koblenz, Germany
    Personally, I wouldn't make too much thoughts about network support now.
    After all, making a M:C-Colonization would take time anyway.

    Yes, but when native city placement starts, they do have all these plots. In general, the whole continent has been divided between the respective tribes. It is after the city placement, when they will lose excess plots.

    Anyway, I just mentioned my findings from reading the code.
     
  16. Diegozubi

    Diegozubi Chieftain

    Joined:
    Mar 5, 2013
    Messages:
    37
    Nightinggale, are the changes you named available somewhere?
    I would like the chance of use the old 1-plot radius city you entered.

    Ray was asking in the original RaR forum if somebody was still working on this.. I hope you are, I am unable to make any coding, but love to play this mods.

    Thanks!
     
  17. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,556
    https://sourceforge.net/p/religionandrevolutionextended/code/ci/master/tree/

    You will however have to compile yourself. I could make a compiled version available as well, but I know there is a bug in the transport system, which disables traderoute imports once in a while. Quite annoying and I don't like to release any compiled code before fixing that.

    I'm not overly active right now. I plan on looking into M:C again though.
     
  18. Diegozubi

    Diegozubi Chieftain

    Joined:
    Mar 5, 2013
    Messages:
    37
    That's great man. I can play with that issue until you fix it.

    I have not much idea about programming. I would really appreciate if you can compile the file and share it, as I am not being able to get it.

    Thank you very much!
     
  19. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,556
    Finally got around to look at that traderoute bug. I think I fixed it, but I need a bit more testing. Also I want to add min colony distance and colony screen zoom level to xml. It's already there, but I want a 1 plot and 2 plot radius setting. The DLL can then pick the right one at startup.

    Once this is done (hopefully in the near future), I will make a RaRE release on SourceForge. I'm thinking of releasing a minimal edition, where you need to copy graphics and audio from RaR as this saved several hundred MB in the filesize and RaRE is pure code changes.

    It will be released with two DLL files, one for 1 plot radius and one for 2 plot radius. Pick one file and copy it into Assets. Savegames will NOT load if you saved them with the other DLL. Also existing RaR savegames will not work either.
     
  20. Diegozubi

    Diegozubi Chieftain

    Joined:
    Mar 5, 2013
    Messages:
    37
    That's great man! I will wait for that. I will also need some instructions once you publish that on sourceforge, as I do not know what else is needed besides replacing my current dll with yours.

    Also, I am translating the last RaRE version to Spanish.. is there an easy way to insert my translations into another xml's?

    thanks!
     

Share This Page