1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

incremental patch discussion

Discussion in 'Civ4 - Dune Wars' started by davidlallen, Jul 6, 2009.

  1. davidlallen

    davidlallen Chieftain

    Joined:
    Apr 28, 2008
    Messages:
    4,743
    Location:
    California
    These asserts come using the 1.7.3.2 code, before the CTD. Which asserts come using a debug version of the 1.7.3 or 1.7.3.1 code? I know for sure that the religion asserts in the first spoiler come in any version, so those cannot be causing the CTD. If the asserts in the second spoiler also come in 1.7.3.1 without a CTD, then these are not the cause.

    The fact that the messages list espionagemissions.xml is also misleading. I am surprised that these feature and terrain messages would come; they could be caused by either sdk code, or xml, or python. The best way is to "grep" (search in multiple files) in all the sdk files, xml files, and python files. The python is several directory levels deep, be sure to get them all. It is possible that these could cause a crash on startup, but before being too hopeful, please investigate whether the same messages occur with 1.7.3/1.7.3.1.
     
  2. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    3,686
    Location:
    London, UK
    This seems highly likely to be the issue since AddsFreshWaterInRadius stuff for improvements is new in 1.7.3.2. Well done. Now, how to fix?

    From the "Access violation reading location" message it sounds like AddsFreshWaterInRadius is not properly initialized. I'm not sure why though, since there is a line setting a value for it in the constructor:
    Code:
    m_iAddsFreshWaterInRadius(-1),
    Reviewing the code around iAddsFreshWaterInRadius the only thing that looks obviously odd is that the parameter has a getter but not a setter. To add the setter there should be a line after line 3591 in CvInfos.h that reads:
    Code:
    void setAddsFreshWaterInRadius(int i);
    And after line 16185 in CvInfos.cpp:

    Code:
    void CvImprovementInfo::setAddsFreshWaterInRadius(int i)
    {
    	m_iAddsFreshWaterInRadius = i;
    }
    I'm not sure that not having a setter could cause the Access Violation error, but it is possible. At the least, it is inconsistent with the other variables anyway. I pretty much added this variable by copying m_iCultureControlStrength, but I obviously missed the setter. If it's not the absence of the setter causing the issue, then I'm really not sure what is...

    I use the tool Agent Ransack. It is a really quick and powerful way for searching a lot of files for a certain piece of text.
     
  3. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,134
    Location:
    israel
    hey guys,
    whats up?

    say, are you still having ctds over the latest version?

    ive finished working on my own mod, so now im free to do some dune work, anything i can do for you guys?
     
  4. Jester Fool

    Jester Fool Chieftain

    Joined:
    Apr 2, 2010
    Messages:
    1,181
    Location:
    Katy, TX
    I was able to make a debug version (includes all suggested code changes so far) and have started a game. However, in order to do so I had to make the following changes (in red) to CvPlot.cpp :
    Spoiler :
    // Remove fresh water from old improvement
    // original code - int oldFreshWaterRadius = GC.getImprovementInfo(eOldImprovement).getAddsFreshWaterInRadius();
    int oldFreshWaterRadius = -1; // JF - pretend to get value since at start of game this value should be -1 anyway
    if ((eOldImprovement != NO_IMPROVEMENT) && (oldFreshWaterRadius >= 0))
    {
    changeFreshWaterInRadius(-1, oldFreshWaterRadius);
    }

    // Add fresh water for new improvement
    // original code - int newFreshWaterRadius = GC.getImprovementInfo(eNewValue).getAddsFreshWaterInRadius();
    int newFreshWaterRadius = -1; // JF - disable for now
    if ((eNewValue != NO_IMPROVEMENT) && (newFreshWaterRadius >= 0))
    {
    changeFreshWaterInRadius(1, newFreshWaterRadius);
    }
    I don't know why the call to getAddsFreshWaterInRadius() during initialization crashes Vista but removing the call fixes the CTD. I'll let you know if any other problems come up in the debugger.
     
  5. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    3,686
    Location:
    London, UK
    Looking at that code, JF, I think perhaps the problem is calling getFreshWaterInRadius when the value is NO_IMPROVEMENT. I can see that causing a crash. I think the code should check that the value is not NO_IMPROVEMENT first like this:

    Code:
    // Remove fresh water from old improvement
    if (eOldImprovement != NO_IMPROVEMENT) {
    	int oldFreshWaterRadius = GC.getImprovementInfo(eOldImprovement).getAddsFreshWaterInRadius();	
    	if (oldFreshWaterRadius >= 0) {
    		changeFreshWaterInRadius(-1, oldFreshWaterRadius);
    	}
    }
    
    // Add fresh water for new improvement
    if (eNewValue != NO_IMPROVEMENT) {
    	int newFreshWaterRadius = GC.getImprovementInfo(eNewValue).getAddsFreshWaterInRadius();
    	if (newFreshWaterRadius >= 0) {
    		changeFreshWaterInRadius(1, newFreshWaterRadius);
    	}
    }
    Also, l noticed that line 5771 in CvPlot.cpp should read:

    changeFreshWaterInRadius(-1, 1);

    rather than:

    changeFreshWaterInRadius(1, -1);
     
  6. Jester Fool

    Jester Fool Chieftain

    Joined:
    Apr 2, 2010
    Messages:
    1,181
    Location:
    Katy, TX
    Thanks Deliverator. The cumulative changes you suggested worked. The dll now works fine under Vista (and still has all the new material - can't wait to try it all out). I have attached a zip file with the recompiled dll. View attachment CvGameCoreDLL.zip
     
  7. Ahriman

    Ahriman Tyrant

    Joined:
    Jun 8, 2008
    Messages:
    13,266
    Location:
    Washington, DC
    So; if I install the post #1159 files and then change this dll, it should work?
     
  8. Jester Fool

    Jester Fool Chieftain

    Joined:
    Apr 2, 2010
    Messages:
    1,181
    Location:
    Katy, TX
    This is what I did :
    1. uninstalled Dune Wars (to be safe)
    1. installed 1.7 exe
    2. installed 1.7.3 exe
    3. installed 1.7.3.2 exe
    4. replaced old dll with the new one
     
  9. Ahriman

    Ahriman Tyrant

    Joined:
    Jun 8, 2008
    Messages:
    13,266
    Location:
    Washington, DC
    It works! Great work guys.
     
  10. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    3,686
    Location:
    London, UK
    Excellent!

    Next time I make SDK changes I'll compile a debug dll and check thoroughly for any issues as Xienwolf suggests. I'm actually amazed that the code still worked in XP given the number of things that were wrong in the end...
     
  11. Jester Fool

    Jester Fool Chieftain

    Joined:
    Apr 2, 2010
    Messages:
    1,181
    Location:
    Katy, TX
    Just so you know, Vista IS quite picky.:crazyeye: However, the Dune Wars mod is too good to let Vista ruin the party!;)
     
  12. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,134
    Location:
    israel
    hey guys,

    im working on cleaning the sdk from revdcm, i got something ready, but, i keep getting an "error",

    when i start a game - in 1.7.3 and prior versions - we got on game start: mercenary mod :true, now, i keep getting the message after each autosave game,

    any ideas why guys?

    other then that its going well.
     
  13. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    3,686
    Location:
    London, UK
    Right folks, I have version 1.8 all bundled up. Let's consider it Beta until we have confirmed it works OK in Vista, etc. I can test Steam vs non-Steam myself.

    Changes in 1.8 since 1.7.3.2

    + Vista CTD should now (hopefully) be resolved, thanks to Jester Fool
    + Reverted main Ranged Bombardment calculation back to original Dale's Combat Mod code - this was completely over-tweaked by RevDCM it seems. Since Accuracy now seems to actually do what you'd expect I have revised the Accuracy values. Rocket Artillery can now do ranged bombardment with Range 2 and Accuracy 40%. Howitzer: Range 2, Accuracy 60%. Missile Launcher: Range 2, Accuracy 65%. Assault Cannon: Range 2, Accuracy 75%.
    + When a worm eats a harvester it will now break through the sand and disappear the following turn.
    + Reservoir and Catchbasin water penalty reduced to -2 water from -3.
    + Catchbasin now adds moisture in a 1-tile radius (down from 2).
    + Shallow Well now has a moisture radius of 1 (up from zero).
    + Wind Trap no longer adds moisture (this was redundant anyway).
    + Doubled Melting Lens build time to 800
    + Forest now gives 25% defense not 50%
    + Sayyadina, Instructress and Reverend Mother now have 100% more feminine order and select sounds.
    + Removed House Atomics project - this has been replaced by the Great Convention Breached! wonder
    + Lots of new Tech quotes for the Dune Encyclopedia
    + Added stub entries for Dune Encyclopedia where missing
    + Some other pedia-polishing, Staban Tuek replaces Sid Meier, etc.
    + Removed the Minor Civ Civilization and related Python code.
    + Replaced Dawn of Man text, RevolutionDCM popup no longer appears.
    + Default Land Percentage for Arrakis mapscript is now 24%
    + Slightly reduced the amount of Mesa placed by Arrakis
    + The worldpicker (the planet that appears if you start a game via Play Now!) now looks like Arrakis
    + Tweaked Goody Huts - be prepared for the occasional suprise
    + Removed NoBadGoodies from Scout Thopter and Fremen Scout. Seeing as it is unlikely that Goody Huts will be popped by any other unit that these two, you were highly unlikely to ever see bad Goody hut results.
    + Cymek (Technocracy), Fish Speaker (Qizarate), Commodities Exchange (CHOAM), Palmery (Shai-Hulud), Jihad Veterans Barracks (Mahdi) now all require their enabling religion to be present in the city.

    Dune Wars 1.8 Link
     
  14. Ahriman

    Ahriman Tyrant

    Joined:
    Jun 8, 2008
    Messages:
    13,266
    Location:
    Washington, DC
    Nice! We might want to remove the city attack bonus on siege units since we're making them bombardment units (which is good; the AI keeps using them instead of melee, which are supposed to be the assault units). And we need to make shallow wells give moisture range 1, otherwise the AI won't properly build cottages (it builds turbines instead).
     
  15. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    3,686
    Location:
    London, UK
    I'll fix the shallow wells radius for the final cut of 1.8.

    Agree with tweaking the Siege Units too, but that can wait.
     
  16. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    3,686
    Location:
    London, UK
    I've switched the link in the above post to a new dune-wars-1-8.exe that will hopefully be the final release.

    The only changes from before are that the Shallow Well now has a moisture radius of 1 and the installed shortcuts also work for Steam installs.

    I'll aim to release 1.8 properly in around 12 hours or so.
     
  17. Jester Fool

    Jester Fool Chieftain

    Joined:
    Apr 2, 2010
    Messages:
    1,181
    Location:
    Katy, TX
    :) Started new game with 1.8 beta - works just fine. The new intro text is absolutely fantastic! The desert will have a new master soon enough...:mischief:
     
  18. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    3,686
    Location:
    London, UK
    Hi Keldath. Unfortunately, I don't know much about how the code for mercenary mod and the homeworld screen works - it's all koma's stuff. I've downloaded the source for Better BUG AI and have been considering how to create a cleaned SDK myself. I thought the easiest way might be to remove all the Revolutions/RevDCM code from the current Dune Wars first, which might simplify the merge. Anyway, good luck with your efforts.
     
  19. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,134
    Location:
    israel
    Deliverator hey bro,

    well first of all, superb work with 1.8 and all of the cool stuff you added to the sdk, great work as usual.


    im extremely happy that you got better bug ai, since you are a programmer and im not, i am certain that you'll be able to work out a clean sdk code much better then i.

    i have tried over this weekend, but i stopped cause its too hard for me.

    so we need some stuff from our current revdcm code:

    - influence driven war.
    - parts of dale code - ranged bombardment/naval bombardment - and maybe air mission code.
    - bbai...
    - tga indexing - this is the hard part for me - we us it for the fonts - it will be too much work to
    re arrange the religions and bonuses fonts o match.

    i cant think of anything else right now, but,

    if your going to start - perhaps you can use my current code, which is merged with bbai 0.84 (revdcm 2.71), youll be able to compare it to better bug ai (latest), and then youll be able to see the different (updated) codes, along with revolution parts - thus the removing (of all the unneeded code) part much more easier for you.

    after this we will still have python code to scrutinize, but i suspect that is the easier part.

    i hope what ive made so far will help you, and i even more hoping that youll make a clean cut, that would be swell for dune wars.

    goodluck and thanks for writing me,

    again, great awesome work on 1.8.
     
  20. davidlallen

    davidlallen Chieftain

    Joined:
    Apr 28, 2008
    Messages:
    4,743
    Location:
    California
    I haven't tried 1.8 yet but it sounds great. When you want the final release, go ahead and put the release note onto the welcome thread; anybody can post there. It's also worthwhile to post in the modpack thread. (If we want to keep the modpack thread in the first page of results, we'll have to post something there every week or so.) Then I will update the first post on the welcome thread, and the first post on the modpack thread. I think those are the only two important things I "own", and it isn't important to "re-own" them right now.
     

Share This Page