• Civilization 7 has been announced. For more info please check the forum here .

Bug Reporting

Spoiler :
Did you make sure to initialize that field with NO_PROMOTION while parsing the XML?

I could tell you if I knew what that meant. :hammer2:

I remember that everything I did was from instructions given by you, if that helps. :mischief:.

Anyway, for the time being I have put that problem aside as I am trying to start clean from either BULL itself or Fuyu's Better BULL merge.

With BULL, I got all the source files and put them in a folder R:\PIG2\CvGameCoreDLL.

This is what the top of my makefile looks like.
Spoiler :
Code:
## BUG DLL MAKEFILE
##
## Based on Refar's makefile


### Tool Paths

TOOLKIT = C:\Program Files\Microsoft Visual C++ Toolkit 2003
PSDK = C:\Program Files\Microsoft Platform SDK


### Civ4 SDK Paths

CIV = G:\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword
SDK = $(CIV)\CvGameCoreDLL
BOOST = $(SDK)\Boost-1.32.0
PYTHON = $(SDK)\Python24


### Tool Executables

RM = del
CPP = "$(TOOLKIT)/bin/cl.exe"
LINK = "$(TOOLKIT)/bin/link.exe"


### Compiler Options

# /EHsc		catch C++ exceptions only; assume that extern C functions never throw a C++ exception
# /Gd		Use the __cdecl calling convention (x86 only). 
# /GR		enable run-time type information (RTTI)
# /G7		only 1 and 2 are valid; no idea what 7 does
# /MD		multithreaded normal DLL with MSVCRT.dll
# /MDd		multithreaded debug DLL with MSVCRTD.dll
# /O2		optimize for speed
# /W3		warning level 3

[B]MODFLAGS = /D_MOD_FRACTRADE /D_MOD_SENTRY /D_MOD_GOVWORKERS /D_MOD_AIAUTOPLAY /D_MOD_GWARM [/B]

# Optional BULL Components
#   _MOD_FRACTRADE
#   _MOD_SENTRY
#   _MOD_GOVWORKERS
#   _MOD_AIAUTOPLAY
#   _MOD_GWARM

CFLAGS = /EHsc /Gd /GR /G7 /W3 /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS [b][COLOR="Red"]$(MODFLAGS)[/COLOR][/b]
DEBUG_CFLAGS = $(CFLAGS) /MDd /D_DEBUG
RELEASE_CFLAGS = $(CFLAGS) /MD /O2 /DNDEBUG /DFINAL_RELEASE


### Linker Options

It compiles successfully.

I copy the created CvGameCoreDLL.dll into the assets directory of "PIG Mod v0.9".
The PIG Mod v0.9 folder at the moment contains only everything from a BUG 4.2 mod install as well as the necessary optional extra from BULL merged in. There is nothing else in the mod folder.

The disappointing thing is, I run the game and go to start a custom game, but before it tells me anything about "Iinitializing" or "setup map" it blinks away in a sudden crash to desktop.

Any ideas what I can try?


EDIT As often seems to be the case with this sort of thing, as soon as you post a report of a problem it solves itself. I was able to use the DLL I compiled myself working with the BUG+BULL assets in a mod folder.

Please disregard the problem report for now. :)

EDIT2 It seems one of the errors I made was leaving off the $(MODFLAGS) from the CFLAGS line, now added in red.
 
I've looked a bit at the Fractional Trades component and I noticed a small problem.



The total commerce before rounding is often being truncated to remove the :commerce: icon, even removing the last decimal place.

EDIT
Also, under BULL SVN, there is this right at the bottom of GlobalDefinesAlt.xml
Code:
<Define>
		<DefineName>ACO_SHOW_SHIFT_INSTRUCTIONS</DefineName>
	</Define>
		<iDefineIntVal>1</iDefineIntVal>
 
Bizarre. I just fixed that XML file. I have no idea how that happened or why that file continues to work for me. :confused: Civ4 obviously doesn't use the schemas to validate the XML files. :rolleyes:

As for the truncation, I have been wrestling with that since I made that area a table control. For some reason it insists on having very large gaps between columns. Yet on the CDA it will gladly squish text very close together. I could truncate the decimal value there since it gets truncated in the total anyway. The only downer would be if you have both foreign and domestic trade both over "x.5". The total would be off by 1:commerce: from adding up manually.

Which is preferable?
 
I see PieceOfMind's commerce subtotals behaving properly. Did that save from this post still work properly for you?

Yes, sorry. I think I forgot to reply. That save you posted worked fine for me. I meant to double-check it with Fractional Trade Routes compiled off in BULL, but I've been a bit busy getting ready for the 1.1 release.

If 1.1 doesn't solve the problem for you, please ping me again to take another look.
 
Yes, sorry. I think I forgot to reply. That save you posted worked fine for me. I meant to double-check it with Fractional Trade Routes compiled off in BULL, but I've been a bit busy getting ready for the 1.1 release.

If 1.1 doesn't solve the problem for you, please ping me again to take another look.

Understood. Not trying to make you more work, just trying to use this as a learning experience for myself.

I'm still confused by this, however. This problem persists even without BULL at all when using the 3.19 DLL. You may be on to something regarding the fractional trade routes option which means this problem could show for anyone not recompiling the DLL on their own with this option set.

I'll check this out for you. May come in handy before your next release.
 
You need no makefile for VC++, you just click build (after adding all the new files, of course). Those cflags belong to Project -> Properties: C/C++ -> Preprocessor -> Preprocessor Definitions (see picture #1)

Turning off Precompiled Headers can also prove useful (#2), just as not using any of the Program Database options (#3).
 

Attachments

  • VC-PreProcessorDefinitions.png
    VC-PreProcessorDefinitions.png
    20.8 KB · Views: 56
  • VC-NoPrecompiledHeaders.png
    VC-NoPrecompiledHeaders.png
    9.4 KB · Views: 47
  • VS-NoDebugProgramDatabase.png
    VS-NoDebugProgramDatabase.png
    10.7 KB · Views: 48
Thanks Fuyu. I edited my post a couple minutes later (but before you posted) because I found PieceOfMind's sample makefile in previous posts which connected the dots for me.

I recompiled my DLL with the fractional trade routes and the problem is corrected. This means my initial report needs revision: Trade (neither foreign or domestic) doesn't add into the raw commerce subtotals when playing without fractional trade routes.
 
Thank you, _alphaBeta_, for your report and further testing. There was indeed a bug. I originally stored non-fractional trade "times 100" so trade was tracked the same whether or not it was fractional, but I must have changed this back. The problem was that I was still always dividing the trade total by 100 before adding it to the total.

I've fixed the problem and was hoping you could test a few variations for me as I'm trying to get BULL merged with the latest UP right now.

The fix is in Python/BUG/RawYields.py. Line 187 gets replaced with these four highlighted lines:

Code:
		# Trade
		for eType in (DOMESTIC_TRADE, FOREIGN_TRADE):
			iValue = self.getYield(eYield, eType)
			if iValue != 0:
				self.appendTable(screen, table, False, BugUtil.getPlainText(LABEL_KEYS[eType]), eYield, iValue, TradeUtil.isFractionalTrade())
[B][COLOR="Red"]		iValue = self.getYield(eYield, DOMESTIC_TRADE) + self.getYield(eYield, FOREIGN_TRADE)
		if TradeUtil.isFractionalTrade():
			iValue //= 100
		iTotal += iValue[/COLOR][/B]
		
		# Buildings, Corporations, Specialists
		for eType in (BUILDINGS, CORPORATIONS, SPECIALISTS):

Thanks again!
 
Awesome. I committed it earlier, and I also changed it so the fractions are dropped from the Raw Yields :commerce: display. Better to have people wonder where 1:commerce: went than have it look bad. ;)
 
This might be a bug with BULL/BUG or it might be my own doing. Pretty sure it's due to a mix between using AI autoplay with BULL/BUG.

Anyway, here's the report:

Code:
Traceback (most recent call last):

  File "CvScreensInterface", line 906, in handleInput

  File "CvInfoScreen", line 2954, in handleInput

  File "CvInfoScreen", line 959, in drawGraphs

  File "CvInfoScreen", line 1116, in drawGraph

  File "CvInfoScreen", line 901, in getHistory

IndexError: list index out of range
ERR: Python function handleInput failed, module CvScreensInterface

Spoiler :


I was using AI autplay and the civ I put under control of the AI died after a while. Afterwards, I was lookig at the info graphs, clicking on the right arrow and I guess I ended up out of bounds. My naive guess would be that because the game was continiuing beyond where my graph ended, because AI autoplay kept playing turns, this exception was not accounted for? :confused:

Sorry, no gamesave.

More details:
It was being played under my latest build of PIG Mod which is pretty much Fuyu's merge of BULL + Better AI, plus BUG, plus the various XML tweaks that have made it into PIG.
 
I was using AI autplay and the civ I put under control of the AI died after a while. Afterwards, ...
The civ you can put under control of the AI with AI autoplay is the active player. Active player being dead could cause all sorts of unintended behaviour, you could try to change player (ctrl+shift+p iirc), maybe then you have an active player again, fixing that problem?

That said, are you using my init.xml and and do you even have ChangePlayer.py and AIAutoPlay.py in Python\Contrib folder?
 
The civ you can put under control of the AI with AI autoplay is the active player. Active player being dead could cause all sorts of unintended behaviour, you could try to change player (ctrl+shift+p iirc), maybe then you have an active player again, fixing that problem?
Yep well playing on after the active player is dead to get this means it isn't exactly worrying me too much, but I was assuming that an exception like this might indicate a logical error somewhere in the python code and it ought be mentioned.

Making another player the active player might work, but it doesn't worry me. It was only a python exception and the circumstances were unusual enough that I don't need to seek a fix.

That said, are you using my init.xml and and do you even have ChangePlayer.py and AIAutoPlay.py in Python\Contrib folder?
Yes, yes and yes.
 
I'll take a look. Maybe there's a simple fix I can make in CvInfoScreen. I like to have the code handle all situations, even the unusual ones.

Edit: It looks like a civ dying off shouldn't affect the score cache that's being accessed there. It builds a list of score for every player you've met for all game turns. It doesn't stop prematurely when that player dies.

I'd have to replicate what happened here to see why it broke because it is in a loop. I'd need to know exactly what values caused it.
 
Saw this reported a couple of times but there didn't seem to be any further information.

When running BAT 2.1.1a picking Exit to Main Menu causes the game to crash and quit to desktop, this doesn't happen when I run BUG 4.2

Running Windows 7, installed to C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword BAT in C:\Users\xxxxxxx\Documents\My Games\Beyond The Sword\Mods\BAT Mod 2.1

Any idea why this happens, wouldn't be so annoying but everytime I have to restart after this the game forgets I want it in a window and it can take a few minutes of starting and changing the option and quitting before it remembers which can be frustrating.

Apologies if I missed some info on this.
 
When running BAT 2.1.1a picking Exit to Main Menu causes the game to crash and quit to desktop.

I think this started with the inclusion of VD 7.5. We'll be working to eliminate the problem in the next BAT release.

That it forgets your Windowed Mode setting is very strange. Does it forget your other INI settings as well?
 
I honestly couldn't tell you, I don't change too many settings tbh but I've not noticed it forget anything else.

EDIT: Thanks a lot for the speedy answer, I guess I'll live with it till then.
 
Instead of exiting to the main menu, you might try exiting to the desktop in the hope that it won't crash or revert your settings. Please let me know if that works or not.
 
Top Bottom