September 2nd, 2020, 00:42
Posts: 7,602
Threads: 75
Joined: Jan 2018
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.
September 6th, 2020, 14:46
Posts: 2,062
Threads: 4
Joined: Aug 2020
I keep getting these AP votes.
[attachment=18841]
September 6th, 2020, 14:54
Posts: 7,602
Threads: 75
Joined: Jan 2018
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
September 6th, 2020, 14:56
Posts: 2,062
Threads: 4
Joined: Aug 2020
Ah, that makes sense. So you couldn't remove it altogether?
September 6th, 2020, 15:09
Posts: 7,602
Threads: 75
Joined: Jan 2018
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.
October 12th, 2020, 03:52
(This post was last modified: October 12th, 2020, 03:57 by Charriu.)
Posts: 7,602
Threads: 75
Joined: Jan 2018
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.
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.
October 12th, 2020, 04:38
Posts: 7,602
Threads: 75
Joined: Jan 2018
(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.
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.
October 12th, 2020, 05:21
Posts: 7,602
Threads: 75
Joined: Jan 2018
(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.
October 12th, 2020, 07:11
Posts: 8,784
Threads: 40
Joined: Aug 2012
So now do we have to try and make this situation happen in-game to justify the time you've taken to fix it?
Completed: RB Demogame - Gillette, PBEM46, Pitboss 13, Pitboss 18, Pitboss 30, Pitboss 31, Pitboss 38, Pitboss 42, Pitboss 46, Pitboss 52 (Pindicator's game), Pitboss 57
In progress: Rimworld
October 12th, 2020, 07:20
Posts: 7,602
Threads: 75
Joined: Jan 2018
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.
|