Branch "Challenge" - Candidate for Release 2.8.1. - for testing [OBSOLETE]

@Mr. ZorG

The error with the "Wrong Plot Selection of Units in Events" is corrected now. :)

This was actually a bit tricky because it was a bug in the original Event System ...
(It had nothing to do with my changes to remove the Asserts.)

The updated / corrected DLL is attached again to the starting post. :thumbsup:
 
Last edited:
A few minutes ago, I had an appcrash just the moment an armed slave conquered my third and unprotected Colony.

good evening and thank you for the great work :goodjob:
 
I had an appcrash just the moment an armed slave conquered my third and unprotected Colony.
I have a strong suspicion what causes this. :think:
If I am right, it is quite easy to fix.

I will take a look this evening. :thumbsup:


Update:

@3tag

I could not reproduce the CTD you reported. :dunno:
(Tried different combinations in WorldBuilder - and "Wild Animals" / "Revolting Slaves" could always capture my unprotected Cities without CTDs.)

However I suspected that "Wild Animals" might try to put a Unit in "Profession Settler" and that this might have caused the bug.
Thus I have now explicitly forbidden Civ ""Wild Animals" to use "Profession Settler".

My change (to forbid "Profession Settler" for "Wild Animals") is now commited to "Challenge" - because it makes sense anyways.
But since I could not reproduce the bug, I do not know if it acually fixes the bug you reported.

By the way:
If that was in fact really the solution / fix, it would only work if you started a new game.
(XML changes like the one I made are only applied when new games are started.)

Update 2:

@3tag

I also attached a new DLL to the starting post, that should also prevent the bug - if my suspicion is correct.
Please get that DLL and test by loading your save which caused the CTD and check if it happens again. :thumbsup:

If I am correct, it will not happen again.
(The DLL change I did will also not require to start a new game.)
 
Last edited:
@raystuttgart

Unfortunately my save is too far away from the crashing situation and the autosaves are lost because I already started a new game.
But I downloaded the DLL and try to reproduce the crash.
 
I really like the new settlers mechanic! By now, I am in midgame of a quite challenging marathon game without any obvious bugs.

But there is one thing: It has become even more difficult to eliminate an european AI player: Apparently, as long as there are units at the european port dock, the AI player will always get a new caravel with a settler (+dragoon) when killed, even if there are no more on-map units and no more ships left. This is almost impossible: I would have to allow the AI to build a new colony and intercept any units going there until the european port is empty (but meanwhile new crosses are accumulated and new units appear on the docks...
In my game, there are about 30 units waiting in Europe for this AI player. The 100 turns from start have long passed (I know AI will always respawn before that).

Suggestion: After turn 100, if an AI player loses all colonies, ships and settlers, it will be eliminated from the game. (So no more annoying searching for that one treasure hidden in a native village etc.)

Maybe this additional suggestion could be nice for QoL: After turn 100, if an AI player has only military ships left on the map, they will actively search for the player enemy and try to attack instead of fleeing each encounter. So the AI will fight until eliminated and not endlessly escape and reappear somewhere else on the map.
 
Hi Ray, it seems I may have found a bug as I cannot make a settler even though I have enough tools and horses.
 

Attachments

  • Louis de F 2020-09-24 AD-1526-January.ColonizationSave
    1.1 MB · Views: 72
Hi Ray, it seems I may have found a bug as I cannot make a settler even though I have enough tools and horses.

Did you check Food and Lumber as well?
(Profession Settler needs small amouts of 4 different Yields - as described in Colopedia entry for the Profession.)

Also, not every Unit is allowed to pick "Profession Settler".
(e.g. Petty Criminals or Slaves are not.)
 
Last edited:
quoting the message I wrote yesterday:
Suggestion: After turn 100, if an AI player loses all colonies, ships and settlers, it will be eliminated from the game. (So no more annoying searching for that one treasure hidden in a native village etc.)

I checked the code and realised the suggested behaviour is already in the code, but something does not work. I don't completely understand it, but there seems to be something going wrong in CvPlayer.cpp:7880
Code:
               if (!isNative() && !isHuman() && GC.getGameINLINE().getGameTurn() > 100 && getNumUnits() < 5 && AI_getNumAIUnits(UNITAI_SETTLER) == 0 && GC.getDefineINT("KI_RESPAWN_OFF") == 1)
Apparently afterwards only bKill is true but bRespawnDeactivated is false, so the code path after :8022 is taken and the player gets new units.
So I checked again and among the many units in Europe there is a Settler waiting (not the first unit in line though!), I imagine it has UNITAI_SETTLER and that is why AI_getNumAIUnits(UNITAI_SETTLER) >= 0?

Anything we can do about this? Could we check if the settler is still in Europe and if there are no transports left then still kill the Player and not respawn?

BTW If someone could help me set up the compilation environment, I might just try hacking the code myself a bit. But until now I could not get Visual Studio to compile the Mod, I have no experience with VS at all (long time linux user ...) and the Civ4 modding tutorials are apparently outdated and do not work anymore ...

As a side note, I do not understand the reason for code like this - is it just me? (CvPlayer.cpp:7866)
Code:
       bKill = false;
       if (!bKill) ...
 
Hi Ray,'


There seems to be a requirement for 60 horses, 60 tools, 90 lumber and 60 food, however there is no entry for Settler in the Civopedia - it goes from Seasoned scout to Settler Militia in the version I have.....:scan:
upload_2020-9-25_20-9-25.png
 
@Beetlebug

... however there is no entry for Settler in the Civopedia ...
You are looking at the wrong place. ;)

...- as described in Colopedia entry for the Profession.

"Professions Settler" is a Profession - so you need to look into Category "Professions" of Colopedia.
In your Screenshot you are looking into the Category "Units" of Colopedia - where you will not see it.

"Units" and "Professions" are 2 different Concepts.
(Concept "Professions" like in Civ4Col does not exist in Civ4BTS.)
 
Last edited:
Code:
if (!isNative() && !isHuman() && GC.getGameINLINE().getGameTurn() > 100 && getNumUnits() < 5 && AI_getNumAIUnits(UNITAI_SETTLER) == 0 && GC.getDefineINT("KI_RESPAWN_OFF") == 1)

Hm, you might be right.

With this logic a Colonial AI will always be respawned (by generating new "Staring Units) if it still has a Settler sitting in Europe.
(Which is in fact a problem for "eliminating another Colonial AI" if it does not transport it to the New World because the queue in Europe got too long and it has too few ship.)

Also, when I think about it the check for the UNITAI_SETTLER should be completely removed.
Because if AI has less then 5 Units after turn 100 it is chanceless anyways and should be removed from the game - even if it still has a Unit as "Settler" (in Europe or New World does not matter).

Also, the main problem is if AI does not have the Ship Capacity for transportation anymore to catch up with the other Players. Thus a check for "Transport Ships" still being available should be included as well.
Otherwise a Colonial AI with long queue in Europe will also never be eliminated if a player desimates its ships. (The check will allow to eliminate a Colonial AI by destroying its ships.)

So I think the piece of code we are talking about should be changed to this instead:
(Removing the "Settler Check" and instead including a "Transport Ship Check" with an OR.)
Code:
if (!isNative() && !isHuman() && GC.getGameINLINE().getGameTurn() > 100 && GC.getDefineINT("KI_RESPAWN_OFF") == 1 && (getNumUnits() < 5 || AI_getNumAIUnits(UNITAI_TRANSPORT_SEA) == 0))
 {
        bKill = true; // signals logic that player is dead
        bRespawnDeactivated = true; // deactivates respawning
}

Generally this will result in the 2 cases that can remove a Colonial AI from the game:
(Of course only after turn 100 and only for KI_RESPAWN_OFF - which is default setting though.)
  • Colonial AI lost all Cities and has less than 5 Units total
OR
  • Colonial AI lost all Cities and has no more Transport Ships (that can cross the Ocean) <--- New (to prevent AIs being kept alive simply because they can not properly transport Units from Europe to New World anymore)
Summary:

After turn 100 for a Colonial AI that lost all its Cities it would not matter anymore if that Colonail AI still has a "Settler".
(It is chanceless anyways, if it has either less than 5 Units or no Ships. Thus it would simply be removed from the game.)

Before turn 100, it will always respawn its Starting Units - which have a Settler - if it lost all its Cities and Settlers.
(The current normal behaviour.)

Still need to think about this potential change a bit because it is still early here in Germany and I just had my first coffee. :think:
(I usually try to think through such changes a bit before I implement them.)

----------

BTW If someone could help me set up the compilation environment, ...

@Raubwuerger , @devolution , @Nightinggale
Could one of you guys give @jooe a helping hand with setting up his IDE?
 
Last edited:
The respawning logic has been improved as described here.
It was tested and is working nicely. :)

So a Colonial AI Settler in Europe waiting in Europe without being transported to New World - due to lack of Transport Capacity - will not prevent a Colonial AI from being eliminated anymore.
That was actually a pointless check. (Because such a Colonial AI was chanceless anyways if it had less than 5 Units after turn 100.)

A new DLL is attached to the starting post.
(Code is also submitted to "Challenge".)

It is savegame compatible.

Summary:

It is now a bit easier to eliminate a Colonial AI if it has lost all its cities.
(Of course still only after turn 100. Before that it will still always be respawned.)
 
I really like this thread. I appreciate seeing code posted, without having to go to github.

I think this mod is in a great place just now. Almost bug free, and with talented new modders implementing QoL improvements.

I can't see any reason to delay putting out 2.8.1 officially, and then start a new thread for 2.9.

Nice work guys!
 
I think this mod is in a great place just now. Almost bug free, ...
I agree. :thumbsup:

The mod has never been in a better state so far. :)
(Except maybe the issues considering Multiplayer desyncs. :()

... and with talented new modders implementing QoL improvements.
Yes, I currently believe as well that there is a good chance that new modders will join the WTP team and it will grow again. :)
It would be really great for me to see WTP project continue for a long time. :thumbsup:

I can't see any reason to delay putting out 2.8.1 officially, and then start a new thread for 2.9.
Well, as far as I understood the remaining WTP team there are currently no plans to publish an official "small release" 2.8.1. (I had hoped so myself. :sad:)
That was basically the reason why I was continuously publishing updates in this thread. (Including small bugfixes and improvements.)

Reasons for not publishing officially now:
(@WTP team: Please correct if I summarize it incorrect.)

The WTP team does not like the idea to break save game compatibility to official 2.8 now with 2.8.1. and in a few months break it again with 2.9.
(Basically meaning to break save game compatibility twice in relatively short time - meaning a couple of months.)

Also a lot of small branches of WTP team members are currently still in work and it will need some time to finish these.
The current plan of the WTP team is to first finish as many of them as possible and only then publish official Release 2.9.

-------

Summary:

I currently have no idea when the next offical Release for WTP will be published. :dunno:
It is also not my decision anymore. A decision for an official Release needs to be made by the remaining WTP team.

Spoiler :

I am now confident that the "New Settler Mechanic" and the other stuff I had implemented since I had rejoined is working good enough. :)
Thus this thread has served its purpose (for me) - which was to get further feedback and quality control and to figure out if I still need to work on something before I retire again.

---------

I now need to make a finally make a cut though and retire again as planned.
I have delayed that for already more than 2 months to polish this "release - which simply does not want to be finished not even speaking of released". :rolleyes:
Every time I tried to finish and release it came back and whined "But I still have something that needs to be fixed ... you can not leave me now ..." :lol:

---------

The positive side effect for community was, of course the "continuous publishing" of new content (from other modders), bugfixes and internal improvements. :)
That way community could continuously get some new content (features and improvements) to play with - without having to wait further months for an official release.

Thanks for the play-testing. :thumbsup:
So I hope it was a win-win for both sides.
 
Last edited:
@nci

I had not updated the 1-Plot-City-Radius dll for a while because I simply forgot. :blush:
(Sorry. It is just in my focus because I myself only play the 2-Plot-City-Radius dll.)

But I have done so now, so you and other players who do not like to play 2-Plot-City-Radius can also play with most recent improvements. :thumbsup:
(Just follow the link to the 1-Plot-City-Radius from the starting post of this thread.)
 
Last edited:
Top Bottom