Orion's Grand Inquisition

Announcing the release of OGI 3.09

:dance::bounce::banana::woohoo:

The OGI309Setup.exe Installation file and the FPK art file have been posted for download.

Note: The mod won't run without the FPK file. :nope: So make sure you install it after you run the EXE file.

See first post for a detailed break down of all changes in this version.
 
The new manual control of citizen placement is a revolutionary update to OGI. If you make any adjustments whatsoever to the placement of citizens, whether plots or specialists, the citizen automation will be automatically turned off. When that happens, you must manually place any new citizens that show up after an increase in city population. If you turn on citizen automation, especially in a well established city, you will notice a big difference between the city governor settings and what you had previously set. Again: Any time you turn off citizen automation, you must manually set your plots and specialists for that city. The settings you make will all be retained between turns. The failure to retain previous turn settings was a major problem with BTS that is now fixed in OGI. The result is that OGI provides you with total control over the placement of your city citizens.
 
Congrats on the release! :)

Just saw you wrote that you fixed a Firaxis bug in the previous version.
After running through AI_bestPlotBuild, the only suspicious thing is that the GC.getBuildInfo(eBuild).getTime() can get 0 in some cases.
Or am I mistaken, and there are other possibly mistakes as well? Maybe the getTime function can get -1 in some extreme situations?
 
Congrats on the release! :)

Just saw you wrote that you fixed a Firaxis bug in the previous version.
After running through AI_bestPlotBuild, the only suspicious thing is that the GC.getBuildInfo(eBuild).getTime() can get 0 in some cases.
Or am I mistaken, and there are other possibly mistakes as well? Maybe the getTime function can get -1 in some extreme situations?

Thanks.

The function AI_bestPlotBuild is long and complicated. It is function that I have been considering on making major improvements.

Are you referring to this line?

Code:
iValue /= GC.getBuildInfo(eBuild).getTime();

There is another line that reads like this:


Code:
iValue /= (GC.getBuildInfo(eBuild).getTime() + 1);


I will have to study this code to understand it. Since this is one of the largest functions out there, it won't be easy to re-coded it.

OV
 
Yeah, I referred to these 2 lines :)
Was your fix for those?
 
I think there is a misunderstanding here
I'm not talking about your new changes of improving control over citizen assignment (those also sound great btw!), but of these lines from 3.08A:
"48. Fixed SDK Integer division by zero bug in CvCityAI: AI_bestPlotBuild, which causes CTD in all BTS mods. This is a huge accomplishment."
 
I think there is a misunderstanding here
I'm not talking about your new changes of improving control over citizen assignment (those also sound great btw!), but of these lines from 3.08A:
"48. Fixed SDK Integer division by zero bug in CvCityAI: AI_bestPlotBuild, which causes CTD in all BTS mods. This is a huge accomplishment."

Oh yea. I assumed you were referring to my latest changes. For the division by zero bug fix, open the CvCityAI: AI_bestPlotBuild function and look for:

Code:
// Start Fix for Integer division by 0 error - By Orion Veteran
// The error is prevented by making sure we don't divide by 0
if (aiFinalYields[iJ] > 0)
{
	aiFinalYields[iJ] /= 2;
}
if (aiDiffYields[iJ] > 0)
{
	aiDiffYields[iJ] /= 2;
}
// End Fix for Integer division by 0 error - By Orion Veteran

Now on line 10367 we have this line:

Code:
iValue /= (GC.getBuildInfo(eBuild).getTime() + 1);

On line 10466 we have this check:

Code:
if (iValue >= 0)

Then we have this at line 10516:

Code:
iValue += (aiDiffYields[YIELD_FOOD] * ((100 * iFoodPriority) / 100));
iValue += (aiDiffYields[YIELD_PRODUCTION] * ((60 * iProductionPriority) / 100));
iValue += (aiDiffYields[YIELD_COMMERCE] * ((40 * iCommercePriority) / 100));

iValue /= 2;

If iValue is zero or aiDiffYields[XXX] = 0, then we have a math problem at that point. Who knows what the source line is, without further testing? My goal was to stop the bug to prevent the CTD. It works on those rare times when the code returns a zero.
 
Hey Orion,

Got a serious problem with my current game.

Every few turns, it seems that my city governors (or whoever assigns my specialists) seem to constantly want to put all my specialists into farmers.

Jennvare,

We finally fixed your original BTS citizen automation issue with new SDK code released in OGI version 3.09. I think you will find OGI's total manual control over specialist placement is something BTS should have had since the beginning.
 
I have noticed some people have downloaded the installation file, but have not downloaded the art (FPK file). Due to an increase in the size of the mod, OGI 3.09 now exceeds the file size limitation on source forge. Therefore, I had to split the installation into 2 files. You need both files to run this version of OGI. However, if you can still get the entire mod in one file by downloading the Grand Inquisitions 309.rar file. The rar file is posted there for convenience and choice.
 
Oh yea. I assumed you were referring to my latest changes. For the division by zero bug fix, open the CvCityAI: AI_bestPlotBuild function and look for:

Code:
// Start Fix for Integer division by 0 error - By Orion Veteran
// The error is prevented by making sure we don't divide by 0
if (aiFinalYields[iJ] > 0)
{
	aiFinalYields[iJ] /= 2;
}
if (aiDiffYields[iJ] > 0)
{
	aiDiffYields[iJ] /= 2;
}
// End Fix for Integer division by 0 error - By Orion Veteran

Now on line 10367 we have this line:

Code:
iValue /= (GC.getBuildInfo(eBuild).getTime() + 1);

On line 10466 we have this check:

Code:
if (iValue >= 0)

Then we have this at line 10516:

Code:
iValue += (aiDiffYields[YIELD_FOOD] * ((100 * iFoodPriority) / 100));
iValue += (aiDiffYields[YIELD_PRODUCTION] * ((60 * iProductionPriority) / 100));
iValue += (aiDiffYields[YIELD_COMMERCE] * ((40 * iCommercePriority) / 100));

iValue /= 2;

If iValue is zero or aiDiffYields[XXX] = 0, then we have a math problem at that point. Who knows what the source line is, without further testing? My goal was to stop the bug to prevent the CTD. It works on those rare times when the code returns a zero.

Thanks for the detailed answer :)
I'm not sure why you added changes to the aiDiffYields and aiFinalYields though. Why would it be a problem if it's 0 in some cases? It just changes the iValue, I didn't find any place in the source files where we divide with those.
The only possible problem which I see is with the GC.getBuildInfo(eBuild).getTime() being 0 or -1
 
Thanks for the detailed answer :)
I'm not sure why you added changes to the aiDiffYields and aiFinalYields though. Why would it be a problem if it's 0 in some cases? It just changes the iValue, I didn't find any place in the source files where we divide with those.
The only possible problem which I see is with the GC.getBuildInfo(eBuild).getTime() being 0 or -1

The reason is: One of those two lines caused the CTD on a saved game (Forgot which one). For example: If aiFinalYields[iJ] returns a 0, then aiFinalYields[iJ] /= 2 would also return a 0. Once I made the SDK change, the game was able to proceed past that point. This is why the fix was so important. The change stabilized BTS to the point where I could finish games, even on a huge map.
 
For example: If aiFinalYields[iJ] returns a 0, then aiFinalYields[iJ] /= 2 would also return a 0.

I don't get this, exactly because of that. How would that be a difference if we are talking about a dividing by 0 bug?
But the Civ IV SDK can work in unexpected ways, that's for sure :)
 
I don't get this, exactly because of that. How would that be a difference if we are talking about a dividing by 0 bug?
But the Civ IV SDK can work in unexpected ways, that's for sure :)

Let me revise my remarks.

Its a simple python math rule:

The operator /= divides left operand aiFinalYields[iJ] with the right operand 2 and assigns the result to left operand.

if aiFinalYields[iJ] /= 2; returns 0, then we get the CTD.

So if aiFinalYields[iJ] = 0, then any number you divide 0 with will return 0.

Example: 0 / 2 = 0.

So the fix checks to make sure that aiFinalYields[iJ] is always greater than 0.

if (aiFinalYields[iJ] > 0)

Perhaps I could have chosen a better and more descriptive name for the BUG.

Hope this clears up your understanding.
 
Wow! The first few days, on Source Forge, has seen a lot of downloads of OGI 3.09. Thanks to everyone who has taken an interest in OGI. Our goal continues to provide the Civ4 community with an epic mod that is both reliable and fun to play. Version 3.09 is the best we have turned out yet. We hope it is extremely hard to find any bugs in this version. However, if you do find anything that isn't working right, please let us know so we can create a fix.

It is now time to play, while we dream up ideas for version 4.0. At the top of the wish list is the addition of the Advanced Cargo mod. :) Would you like that? :D
 
Well, lol, if your asking additions for a wish list, mine would still be a GEM TSL.

You have so many custom tweaks and peeks, that it is incredibly difficult for me to customize a map for your mod. I bow to yours and the Historians( right term?) wizardry :D.
 
Sry for derariling your thread further...
But now I'm very curious what's missing for me.

if aiFinalYields[iJ] /= 2; returns 0, then we get the CTD.

The thing I don't understand is why would this result in a CTD?
If I understand further parts of the code correctly, aiFinalYields[iJ] can be 0 otherwise.
The operator itself shouldn't result in a CTD either AFAIK.
 
Sry for derariling your thread further...
But now I'm very curious what's missing for me.

The thing I don't understand is why would this result in a CTD?
If I understand further parts of the code correctly, aiFinalYields[iJ] can be 0 otherwise.
The operator itself shouldn't result in a CTD either AFAIK.

I can't explain why aiFinalYields[iJ] = 0 resulted in a CTD. What I do know is that I pinpointed the SDK failure to one of those two lines. My SDK fix was the only thing that worked to allow the game to continue.
 
Well, lol, if your asking additions for a wish list, mine would still be a GEM TSL.

You have so many custom tweaks and peeks, that it is incredibly difficult for me to customize a map for your mod. I bow to yours and the Historians( right term?) wizardry :D.

I just downloaded the GEM for civ4 and placed the file in the My Games\Beyond the Sword\Saves\WorldBuilder folder. It works just fine as a scenario with OGI.

Link: http://forums.civfanatics.com/downloads.php?do=file&id=22120

Is this what you are looking for?

BTW: What does TSL stand for?
 
Top Bottom