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

Merging Better AI with BUG 3.5

Discussion in 'Civ4 - Better AI' started by Dresden, Oct 23, 2008.

  1. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    WinMerge, never even tried anything else. But I have to admit, some files simply require me to check SVN diffs because of the huge number of differences, I wouldn't know where the real changes are otherwise. But once I know where they are, I still use WinMerge for the process itself.
     
  2. EmperorFool

    EmperorFool Deity

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    Okay, I can imagine that is a huge PITA. Subversion itself has a merge function (whenever you do an update that's what happens) that will let you apply the differences between two revisions to yet a third revision.

    What you'd do is put BULLAI into an SVN and then track the revision # of the last sync with BULL and BAI separately. When it comes time to release, you apply the diffs from each SVN to the BULLAI SVN--all done by SVN.

    The trick comes when both BULL and BAI modify the same lines of the same file, but if that happens now you still need to manually figure out how to merge them.

    In any case, I've been doing this for BUFFY and it's worked well so far, but it does help that I control both repos and know what's going in to each one (usually ;)). If you are ever curious to try something new, I could go into more detail.
     
  3. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    It's not like there are many changes between revisions, it can be a PITA but only when code clashes. In those cases I have to merge manually anyway (and even there I'm likely to fail), the simple stuff is added easily even with WinMerge.
    I can see how SVN Merge could be useful if either you or jdog decide to start spending 24/7 on coding for your respective mods or if I was away for a year but since neither is likely, and because I don't just merge when "it comes time release" - I generally try to keep up with every revision - the number of changes, and teh time spent to merge them in, is just too small to make any automation really feasable, imho. And I really like being able to see what I'm doing, that way if something breaks I at least have a chance of knowing why it happened.
     
  4. EmperorFool

    EmperorFool Deity

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    Yeah, I hate merging code as I said, so I always left it until it was time to release BUFFY. :mischief: I'm glad that's working for ya and that you're still maintaining the merge. It's been frequently requested since I first released BUG and then BULL.
     
  5. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    Is it possible to use the tortoise svn to "checkout" the SVN for your BULLAI?

    I tried it using the address: http://bullai.svn.sourceforge.net/viewvc/bullai/trunk

    but it came up with an error: Repository moved temporaririly to '/viewvc/bulla/trunk/'

    I am guessing that it is locked for some reason. Is that right?

    Alternatively, is there a simple zip download or something like that with the source files? I'm hoping to use the source to help with the next PIG release.
     
  6. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    I don't think so .. honestly I have no clue but I know I didn't lock anything, I wouldn't even know how.
    For svn checkout you need the address "https://bullai.svn.sourceforge.net/svnroot/bullai/trunk/" - viewvc is only for webbrowsers and will not work in any SVN client.
     
  7. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    Ah thank you. I don't know much about how this stuff works but with the correct address you've supplied, it's now downloading the files.

    I didn't even think to get rid of the viewvc.

    EDIT
    Can you possibly give a heads up to which files are the ones you put your own changes in? Are they flagged with your name or some such?
     
  8. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    I think I marked most lines I changed with "//Fuyu" at the end, except for places with lots of changes: CvCityAI.cpp is the file that contains my "anti-shrink" code for the building evaluation function AI_buildingValueThreshold() (to counter city shrinking from unhealthiness caused by industrial age buildings, see 1 game 4 suicides thread), CvGameTextMgr.cpp has my own version of getOtherRelationsString() (see the discussion in Questions about The BUG Mod), and related to that there was a not completely trivial merge in CvDLLWidgetData.cpp for parseContactCivHelp() (getOtherRelationsString() is called upon there) where BetterAI and BULL clashed because jdog and EF both changed the scoreboard.

    edit: doMeltdown() scaling to gamespeed (as posted to Unofficial Patch thread) in CvCity.cpp is unique to my mod too but not commented correctly, I simply copy-pasted jdog's gamespeed scaling code along with the comment sections.
     
  9. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    Thanks Fuyu. I'll have a look now.
     
  10. EmperorFool

    EmperorFool Deity

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    I'm quite happy to look at merging in jdog's changes to make BULL and BAI more uniform in the contact civ widget. I moved things around to minimize the number of blank lines added by adding the other relations and trade info without rewriting too much code to remove them as I usually do.

    What did jdog add there? I'll be merging in the latest UP today for the 1.1 release of BULL, so I'll be working on it already.
     
  11. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    Apart from merging otherRelations lines there's only debug stuff (special info that is shown with cheatcode + alt or ctrl), I think.
     
  12. _alphaBeta_

    _alphaBeta_ King

    Joined:
    Dec 28, 2005
    Messages:
    976
    Location:
    NJ, USA
    @Fuyu-Is this your official thread for the bullai SVN? If so, question: Are you omitting BULL assets from the SVN for a reason? I see they're including in your RAR drop, but it would make things easier to track if they were also in the SVN. You have one included, shown in green below.

    Code:
    [COLOR="Red"]\Assets\Art\ACO
    \Assets\Art\ACO\green_bar_1.dds
    \Assets\Art\ACO\green_bar_2.dds
    \Assets\Art\ACO\green_bar_3.dds
    \Assets\Art\ACO\green_bar_4.dds
    \Assets\Art\ACO\green_bar_5.dds
    \Assets\Art\ACO\green_bar_6.dds
    \Assets\Art\ACO\green_bar_7.dds
    \Assets\Art\ACO\green_bar_8.dds
    \Assets\Art\ACO\green_bar_9.dds
    \Assets\Art\ACO\green_bar_10.dds
    \Assets\Art\ACO\green_bar_left_end.dds
    \Assets\Art\ACO\green_bar_right_end.dds
    \Assets\Art\ACO\red_bar_1.dds
    \Assets\Art\ACO\red_bar_2.dds
    \Assets\Art\ACO\red_bar_3.dds
    \Assets\Art\ACO\red_bar_4.dds
    \Assets\Art\ACO\red_bar_5.dds
    \Assets\Art\ACO\red_bar_6.dds
    \Assets\Art\ACO\red_bar_7.dds
    \Assets\Art\ACO\red_bar_8.dds
    \Assets\Art\ACO\red_bar_9.dds
    \Assets\Art\ACO\red_bar_10.dds
    \Assets\Art\ACO\red_bar_left_end.dds
    \Assets\Art\ACO\red_bar_right_end.dds
    \Assets\Art\ACO\yellow_bar_1.dds
    \Assets\Art\ACO\yellow_bar_2.dds
    \Assets\Art\ACO\yellow_bar_3.dds
    \Assets\Art\ACO\yellow_bar_4.dds
    \Assets\Art\ACO\yellow_bar_5.dds
    \Assets\Art\ACO\yellow_bar_6.dds
    \Assets\Art\ACO\yellow_bar_7.dds
    \Assets\Art\ACO\yellow_bar_8.dds
    \Assets\Art\ACO\yellow_bar_9.dds
    \Assets\Art\ACO\yellow_bar_10.dds
    \Assets\Art\ACO\yellow_bar_left_end.dds
    \Assets\Art\ACO\yellow_bar_right_end.dds
    \Assets\Res\Fonts
    \Assets\Res\Fonts\GameFont.tga
    \Assets\XML\Text
    \Assets\XML\Text\AdvancedCombatOdds_CIV4GameText.xml[/COLOR]
    [COLOR="SeaGreen"]\Assets\XML\Text\BULL_CIV4GameText.xml[/COLOR]
    [COLOR="Red"]\Assets\XML\GlobalDefinesAlt.xml[/COLOR]
    
     
  13. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    Yes that was for the tiny amount of time where the file from the BULL repository would NOT have worked because I added something before it was even in BULL. Now that BULL is updated I can (and soon will) remove it again.
    As you said, everything is in the rar. Also everything is in in the respective repositories for BBAI, BULL and BUG. I see no reason to make it all available at a third place, so only files that are both necessary AND not already in another repository will ever be added to bullai.
     
  14. _alphaBeta_

    _alphaBeta_ King

    Joined:
    Dec 28, 2005
    Messages:
    976
    Location:
    NJ, USA
    The advantage of putting the files in a third place is that someone who wants BetterAI & BULL only has to track one SVN to get the latest merge. Right now if
    Code:
    \Assets\XML\Text\AdvancedCombatOdds_CIV4GameText.xml
    changes over in BULL I'd have no idea by just looking at the bullai SVN. I'd still have to check the other SVNs manually. If I have to do that, then what's the point?

    You're doing an awesome job of keeping track of several moving targets. Adding a couple more files to your SVN would make it that much more useful if it was a one-stop shop. From what I can tell you're tracking these files anyway in you RAR for the public's benefit, which the developers would also need since these files are missing from the SVN.

    Just my two cents. :)
     
  15. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    Let me try to explain my position: I have no interest in SVN, I just thought it was a good place to keep the SDK since I didn't want to include it in the rar because that would increase filesize by ~50%. bullai is there because I wanted things seperate, making it the main place for my merge was never my intention.

    I could abolish bullai svn and include the SDK files in the rar though, if the "one-stop shop" thing is so important...... nah, I really doubt I will.

    edit: Do you honestly think the rest of the merge is just "a couple more files"?

    I think I can see the point (for updates: easy visibility and diff creation for changes) but I'm still torn. bullai sounds like just BULL + Better AI, my merge also includes BUG though. BUG has no dll part, so the name fits perfectly for a place I only keep the SDK.

    edit2: Reading your posts a bit more carefully it looks like you think there a chance in hell I'd add BULL assets only. There is none. If anything I could upload my whole merge there which would include all of BUG too, and would not include BULL assets I don't need or use (namely BULL's GlobalDefines, and Global Warming stuff).
     
  16. _alphaBeta_

    _alphaBeta_ King

    Joined:
    Dec 28, 2005
    Messages:
    976
    Location:
    NJ, USA
    I think this is the main point we weren't seeing eye to eye on. You're thinking of these SVN files differently from how I was.

    What's important is that you have a system working for you, and everyone else enjoying your merge. My initial question has been answered.
     
  17. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    I've been successful in building the next version of PIG using your merge so thanks a lot Fuyu!

    I also haven't been able to get GW working by the way.
     
  18. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    It's not so much not working, it would with the right xml files (not included in my merge), only BULL is still not updated to the last GW mod version and even that wouldn't really turn this feature into something satisfying for me. Long story short, I thought about how I'd like GW and nuclear winters to work, and realized just how much work that would be and how that GW mod doesn't even come close. So no GW for me at all.

    αB: You wanted it, EF talked me into it, so I did it: bullai SVN now contains all of Better BUG AI (444 files added in r23). Have fun.

    Anyway, new version is there. Download there or there
    Took me a while, lots of BUG changes this time. EF is on a roll.
    Added fixed?improved PerfectWorld2 mapscript too :)
     
  19. Melhisedek

    Melhisedek Prince

    Joined:
    Jun 21, 2005
    Messages:
    374
    Location:
    Sweden
    /hugs Fuyu
    Keep up the great work mate!
     
  20. ecc

    ecc Warlord

    Joined:
    Dec 17, 2003
    Messages:
    136
    I second the /hugs

    :goodjob:
     

Share This Page