Single Player bugs and crashes v37 plus (SVN) - After the 24th of December 2016

An old issue has re-arisen in which all civilizations are getting Native Culture (Neanderthal), including the -20% food bonus to each city and allowing construction of the stronger/more expensive neanderthal units, as well promotions being available that ordinarily wouldn't be (e.g. ground weather reports, among others that are normally only added to units under special circumstances).

This was fixed back in 9280 but presumably some change since I last played (it has been some months) and the current SVN (9680) re-implemented the problem.

It is a simple fix, changing ERA_PREHISTORIC for TECH_DUMMY and TECH_DUMMY_NEANDERTHAL back to ERA_FUTURE. However, they appear to have been set to PREHISTORIC in 9655 as a solution to neanderthal cities art being futuristic:
9655
  • Fixed neanderthal cities havinng futuristic structure art.

For now I'm going to change this back to FUTURE for my personal use, because I never see neanderthal cities anyway (and probably wouldn't even notice that they look futuristic if I did). It seems like one thing or another will need to be decoupled from the ERA prerequisites somehow: either regular players (including AI) are prevented from getting techs set to ERA_PREHISTORIC for free, or the neanderthal city art applied by some means other than TECH_DUMMY/TECH_DUMMY_NEANDERTHAL.
 
I'll figure it out, it isn't a problem in my modmod where I've set the dummy techs to prehistoric so I guess I've already figured it out once. (Edit: I never noticed the bug as I never tested later starting era than prehistoric.)
 
Last edited:
An old issue has re-arisen in which all civilizations are getting Native Culture (Neanderthal), including the -20% food bonus to each city and allowing construction of the stronger/more expensive neanderthal units, as well promotions being available that ordinarily wouldn't be (e.g. ground weather reports, among others that are normally only added to units under special circumstances).

This was fixed back in 9280 but presumably some change since I last played (it has been some months) and the current SVN (9680) re-implemented the problem.

It is a simple fix, changing ERA_PREHISTORIC for TECH_DUMMY and TECH_DUMMY_NEANDERTHAL back to ERA_FUTURE. However, they appear to have been set to PREHISTORIC in 9655 as a solution to neanderthal cities art being futuristic:


For now I'm going to change this back to FUTURE for my personal use, because I never see neanderthal cities anyway (and probably wouldn't even notice that they look futuristic if I did). It seems like one thing or another will need to be decoupled from the ERA prerequisites somehow: either regular players (including AI) are prevented from getting techs set to ERA_PREHISTORIC for free, or the neanderthal city art applied by some means other than TECH_DUMMY/TECH_DUMMY_NEANDERTHAL.
Does this bug only occur when you start a game in a starting era later than prehistoric?
That's the only way I can think of that could explain why you get the tech even though the tech is disabled and cost (-1 :science:).

@TB: can you influence what techs civs start with on "later era starts" in the dll or is this all in the .exe.
If it's in the exe this can only be fixed by removing the need for the Neanderthal dummy tech altogether and setting the other dummy tech to future era.
Well, it may also be possible to change the city art for Neanderthal to look prehistoric for all eras in some way.
 
Last edited:
Looking it up in the code, it assigns all techs from all previous eras.

It looks like we need a bDummy exception tag on tech info. I'll whip that right up.

EDIT: The new tag coming soon to an SVN near you, is bDummy and will allows a dummy tech that can be assigned to specific playertypes, as this one works, AND be assigned to any era (so as to protect the integrity of what 'era' the game things the player is in for things like visual effects) without being assigned to all players simply because you started the game after the era that dummy tech was placed in.

The code paints the logic quite clearly as to what problem we were having there. Very easy to make this tag as an exception and the code is compiling for that now.
 
Last edited:
Can't you just use the bDisabled tag that already exist?
See the above edit.

I considered that but figure there's not only probably more unintended meanings there than just this, but the terminology doesn't fit the purpose very well. The amount of memory this cuts into to add such a basic tag does depend on the kind of Info we're dealing with. It could be significant on Buildings or Units but not really on Techs. We just don't have THAT many techs - even if C2C does have the record for all Civ IV mods (and possibly ALL CIV mods period) on that front.
 
See the above edit.

I considered that but figure there's not only probably more unintended meanings there than just this, but the terminology doesn't fit the purpose very well. The amount of memory this cuts into to add such a basic tag does depend on the kind of Info we're dealing with. It could be significant on Buildings or Units but not really on Techs. We just don't have THAT many techs - even if C2C does have the record for all Civ IV mods (and possibly ALL CIV mods period) on that front.
Perhaps, still, no bDisabled techs should ever be given to a civ based on starting era.
 
Perhaps, still, no bDisabled techs should ever be given to a civ based on starting era.
Yeah, I'm not sure if that has ever been a concern for any reason. I'm not sure what the bDisabled tag is for actually... lemme take a look.

EDIT: yeah, you're right - it does allow a bDisable tech to be assigned directly at game setup if the tech is assigned due to its era or being set to be assigned to the player specifically, even though I don't think that's the purpose of the tag to be valid for either case. Correcting.
 
Last edited:
EDIT: yeah, you're right - it does allow a bDisable tech to be assigned directly at game setup if the tech is assigned due to its era or being set to be assigned to the player specifically, even though I don't think that's the purpose of the tag to be valid for either case. Correcting.
If a specific civ has been defined to specifically have a bdisabled tech as a free tech, I see no reason to restrict it.
 
If a specific civ has been defined to specifically have a bdisabled tech as a free tech, I see no reason to restrict it.
Ok, well, that's the opposite of what you just said so... let's see if there's any issues with that tag. The point, so far as I can see, is to be able to basically use this tag as a proxy comment-out of the whole tech.
 
Does this bug only occur when you start a game in a starting era later than prehistoric?
That's the only way I can think of that could explain why you get the tech even though the tech is disabled and cost (-1 :science:).

@TB: can you influence what techs civs start with on "later era starts" in the dll or is this all in the .exe.
If it's in the exe this can only be fixed by removing the need for the Neanderthal dummy tech altogether and setting the other dummy tech to future era.
Well, it may also be possible to change the city art for Neanderthal to look prehistoric for all eras in some way.

You are right, I did start in ancient; I didn't think to check if it was a problem solely from that. I do apologize, I would not have reported it if I had known that was the case and would have simply fixed it for myself, since I know prehistoric start is the preferred gameplay. Thank you for looking into the solution despite this.
 
Perhaps, still, no bDisabled techs should ever be given to a civ based on starting era.
If a specific civ has been defined to specifically have a bdisabled tech as a free tech, I see no reason to restrict it.
Ok, well, that's the opposite of what you just said so... let's see if there's any issues with that tag. The point, so far as I can see, is to be able to basically use this tag as a proxy comment-out of the whole tech.
Those are not opposites statements, they can both exist side by side. The bDisable is, as I understand it, more about restricting it from being on the tech tree, so that it can only be used, or given out, in special circumstances.
Starting era is not a special circumstance it is a general rule.
Maybe the nature of the code that deals with free techs defined by civs, and free techs defined by starting era, is more intertwined than I think, and that is the reason why you feel my statements are opposites?
 
Last edited:
Maybe the nature of the code that deals with free techs defined by civs, and free techs defined by starting era, is more intertwined than I think, and that is the reason why you feel my statements are opposites?
It is.
The algorythm is:
1) Loop through all techs at game setup:
2) if the player is in the game, NPC OR PC then:
3) Establish the tech as invalid
4) if the tech is established as free in the handicap info OR (the player's team is not human AND the tech is established as free to AIs in the handicap info) OR (The tech's era is less than the starting era AND (I established this) the tech is NOT a dummy tech)) then the tech is valid.
5) if the tech is STILL not valid then:
6) if the civilization type of this player gets this tech for free then this tech is valid
7) if the tech is valid, give it to them, otherwise remove it if by some strange reason it already had this tech given to them up to now.

At this point, bDisable wasn't included so my adjustment was to add a check before steps 4 that ensures the tech is not Disabled. If it is, ignore anything that could make it valid. The only other real application of this I saw in the code was to make it impossible for a civ to see or select a disabled tech for researching. Maybe that screws us up? Are any techs currently using this tag and assuming the tech will be assigned by civilization or handicap?
 
It is.
The algorythm is:
1) Loop through all techs at game setup:
2) if the player is in the game, NPC OR PC then:
3) Establish the tech as invalid
4) if the tech is established as free in the handicap info OR (the player's team is not human AND the tech is established as free to AIs in the handicap info) OR (The tech's era is less than the starting era AND (I established this) the tech is NOT a dummy tech)) then the tech is valid.
5) if the tech is STILL not valid then:
6) if the civilization type of this player gets this tech for free then this tech is valid
7) if the tech is valid, give it to them, otherwise remove it if by some strange reason it already had this tech given to them up to now.

At this point, bDisable wasn't included so my adjustment was to add a check before steps 4 that ensures the tech is not Disabled. If it is, ignore anything that could make it valid. The only other real application of this I saw in the code was to make it impossible for a civ to see or select a disabled tech for researching. Maybe that screws us up? Are any techs currently using this tag and assuming the tech will be assigned by civilization or handicap?
Point 4 and 6 doesn't look intertwined at all, couldn't we just have it like so:
1) Loop through all techs at game setup:
2) if the player is in the game, NPC OR PC then:
3) Establish the tech as invalid
4) if the tech is established as free in the handicap info OR (the player's team is not human AND the tech is established as free to AIs in the handicap info) OR (The tech's era is less than the starting era AND the tech is NOT a bDisabled tech)) then the tech is valid.
5) if the tech is STILL not valid then:
6) if the civilization type of this player gets this tech for free then this tech is valid
7) if the tech is valid, give it to them, otherwise remove it if by some strange reason it already had this tech given to them up to now.
 
Maybe. Then do away with bDummy and just mark dummy techs as invalid... Do we have any techs using the bDisabled tag now?
bDisable techs:
TECH_DUMMY & TECH_DUMMY_NEANDERTHAL ▬ The two dummy techs have always been bDisable.

TECH_RELIGION ▬ I have no idea why this exist, maybe it's required by the exe for some reason.

TECH_COLD_FUSION ▬ Probable a loose end in peppers work... meaning a WIP.
TECH_GLOBAL_GOVERNANCE ▬ . - - || - -
 
Last edited:
bDisable techs:
TECH_DUMMY & TECH_DUMMY_NEANDERTHAL ▬ The two dummy techs have always been bDisable.

TECH_RELIGION ▬ I have no idea why this exist, maybe it's required by the exe for some reason.

TECH_COLD_FUSION ▬ Probable a loose end in peppers work... meaning a WIP.
TECH_GLOBAL_GOVERNANCE ▬ . - - || - -
Last 3 techs were in Rise of Mankind.
Religion is for prophets option, that allows prophets to fund religion, cold fusion used to be actual tech but it was dummied for not making sense and global governance never was used.
 
Ok, it seems like bDisabled is pretty much for dummy techs anyhow. I can probably get rid of the bDummy and just replace its use with bDisable.
 
Back
Top Bottom