As a French person I feel like it's my duty to explain strikes to you. - AdrienIer

Create an account  

 
Problems and bug

I am using the method changeCoastalTradeRoutes. At the time I didn't look at the actual implementation of this method. From the name I assumed that I just put in the new amount of tradeRoutes, so currentTraderoutes + 1. But the fact is that in this method the developer already take the current amount of traderoutes and add whichever value you put into that method on top of the current amount.
It would have been better if the method was named addCoastalTraderoutes, from that name I would have assumed that I'm just adding more trade routes on top of the current ones.
Mods: RtR    CtH

Pitboss: PB39, PB40PB52, PB59 Useful Collections: Pickmethods, Mapmaking, Curious Civplayer

Buy me a coffee
Reply

I keep getting these AP votes.

[attachment=18841]
Reply

I took the AP victory changes from RtR. The change does not get rid of the actual vote, but voting itself does no longer do anything
Mods: RtR    CtH

Pitboss: PB39, PB40PB52, PB59 Useful Collections: Pickmethods, Mapmaking, Curious Civplayer

Buy me a coffee
Reply

Ah, that makes sense. So you couldn't remove it altogether?
Reply

It was already implemented before I joined RtR on which CtH was built upon. I never bothered to check the implementation or even change it. Never touch a running system.
Mods: RtR    CtH

Pitboss: PB39, PB40PB52, PB59 Useful Collections: Pickmethods, Mapmaking, Curious Civplayer

Buy me a coffee
Reply

El Grillo managed to find a bug in the original game. For the whole detail please look here: Explanation

The summary is that there is a problem with war declaring between multiple parties and the teleportation of units. Consider this example by El Grillo:


(October 11th, 2020, 18:09)El Grillo Wrote: Alice is at war with Bob and has a stack in Bob's territory.
Charlie has open borders with Bob and a unit sharing the tile Alice's stack is on.
Charlie declares war on Alice, and Alice's units end up teleported out of Bob's territory.

I deem this a bug and would fix it in the following way:

1. If a player declares war, then their units are first looked at and teleported.
2. Only after the player will all other units be looked at and verified.

This fix would be applied to both CtH and RtR.

I also want to respond to Old Harry here:


(October 12th, 2020, 00:37)Old Harry Wrote: If Charlie declared war I'd expect his units to get teleported, not Alice's. Are you saying that isn't what happened?

If Alice declared then I'd expect her units to teleport, but would be surprised if they teleported out of Bob's territory.  popcorn

The first example would be guaranteed with my fix. With my fix Alice units would still be teleported. I would need to investigate further if they would leave Bobs territory.
Mods: RtR    CtH

Pitboss: PB39, PB40PB52, PB59 Useful Collections: Pickmethods, Mapmaking, Curious Civplayer

Buy me a coffee
Reply

(October 11th, 2020, 18:09)El Grillo Wrote: Alice is at war with Bob and has a stack in Bob's territory.
Charlie has open borders with Bob and a unit sharing the tile Alice's stack is on.
Charlie declares war on Alice, and Alice's units end up teleported out of Bob's territory.

(October 12th, 2020, 00:37)Old Harry Wrote: If Charlie declared war I'd expect his units to get teleported, not Alice's. Are you saying that isn't what happened?

If Alice declared then I'd expect her units to teleport, but would be surprised if they teleported out of Bob's territory.  popcorn

I did some more tests.

I implemented my fix and with that I noticed this behaviour:

If Charlie declared war, his units were both teleported as they should. Both were just moved one tile to the side, which is also the expected and wanted behaviour. Without my fix Alice units would have been moved outside Bob's territory.

Now with Alice I noticed a different behaviour. If Alice declared war her units will be teleported, which is the expected and wanted behaviour. The only problem here is that they are teleported outside of Bob's territory. I need to investigate a little bit more for that behaviour, but my fix is at least a step in the right direction.
Mods: RtR    CtH

Pitboss: PB39, PB40PB52, PB59 Useful Collections: Pickmethods, Mapmaking, Curious Civplayer

Buy me a coffee
Reply

(October 12th, 2020, 04:38)Charriu Wrote: Now with Alice I noticed a different behaviour. If Alice declared war her units will be teleported, which is the expected and wanted behaviour. The only problem here is that they are teleported outside of Bob's territory. I need to investigate a little bit more for that behaviour, but my fix is at least a step in the right direction.

I think I got a solution for this problem. I have some old code from the "Immediate Peace Game Option" that I can reuse here. Basically I need to count the turns of war. A teleportation from enemy territory towards outside of the enemies territory should only happen on the same turn of the war declaration. With my war turn counting I can check if the war is older and if it's an older war, then this teleporation is no longer possible.
Mods: RtR    CtH

Pitboss: PB39, PB40PB52, PB59 Useful Collections: Pickmethods, Mapmaking, Curious Civplayer

Buy me a coffee
Reply

So now do we have to try and make this situation happen in-game to justify the time you've taken to fix it? wink
Reply

Haha, no, but you should be especially careful and observing with every case of teleportation, when the fix is implemented. Of course there's also the question if the players of the current running PBs want this update immediately.
Mods: RtR    CtH

Pitboss: PB39, PB40PB52, PB59 Useful Collections: Pickmethods, Mapmaking, Curious Civplayer

Buy me a coffee
Reply



Forum Jump: