tnevolin / thinker-doer

Modifications to a SMACX Thinker mod to highlight more game features
GNU General Public License v2.0
27 stars 3 forks source link

foil probe teams return to landlocked coastal bases #65

Closed bvanevery closed 3 years ago

bvanevery commented 3 years ago

I find that when I have a landlocked base on a small inland lake, my foil probe teams inevitably end up being returned there when they accomplish their missions. Although it's 'nice' not to lose the unit completely, a foil probe team in a landlocked base is usually not very useful. I could swear that someone came up with a solution for this problem. Was it Scient?

tnevolin commented 3 years ago

It was me. Apparently I may not complete it 100%. Please send me a save. I'll check it out.

bvanevery commented 3 years ago

H'minee of the Caretakers, 2240.zip

Note foil probe team in Vinculum. When it got stuck there, that was one of my northeasternmost cities. It ran a mission on the Cultists to the northeast.

tnevolin commented 3 years ago

Hmm. I would like the save before that happens. Let me see if I can recreate it with editor.

tnevolin commented 3 years ago

I have tested it in my current code version and it work as designed. Probe returns to closest base in region (sea or coastal). If no such base exists it is destroyed. Would be interesting to see at the save before the action to debug it if it really happened like that.

bvanevery commented 3 years ago

It'll need to wait until it happens again. Scient gave me this nifty thing where I have continuous saves in order to track bugs. Unfortunately that's for the stock binary. I don't have continuous WTP saves.

tnevolin commented 3 years ago

Can it be integrated? I also tried to simulate it directly with editor and it works as designed - probe never appears in different region.

bvanevery commented 3 years ago

Scient actually gave me a version of OpenSMACX, I'm technically not running a stock binary. But he said all he added in, was this save feature. So I believe he could achieve this in a WTP binary or Thinker, in principle. In practice, it sounds like a chore and maybe he'd want some legwork / help with getting that code into your repo.

tnevolin commented 3 years ago

If he show me the patch I can reproduce it.

bvanevery commented 3 years ago

Here's a landlocked cruiser probe team. It infiltrated the University, way to the south. This was definitely the nearest base to where it did its action. But it's not reachable by sea. At least this time it'll actually have something to do, against the Hive. landlocked cruiser probe Cha Dawn of the Planet Cult, 2224.zip

tnevolin commented 3 years ago

That normally happens in unpatched version of the game. I suspect there could be something with your binaries based on your "Fusion Reactor" messed up too. I guess the only way to know for sure is either for you to install GOG SMACX + my mod in empty folder and then copy your saves and try again. OR to pack the whole game directory and send it to me either here or some other way.

bvanevery commented 3 years ago

Well I've got a clean install + WTP 228 on top of it now. So we'll see.

tnevolin commented 3 years ago

I am going to close it as I distinctly remember working on it and fixing it.

Version 179

bvanevery commented 3 years ago

Version 259. You didn't fix it. You may have tried to fix it, but... Santiago of the Spartans, 2219.zip stuck on a lake

I would note that completing a probe team mission against an enemy, is not the same circumstance as being sent home from a territory that one has a treaty with. Maybe your fix went down 1 code path and not another.

It would be appropriate to reopen this Issue, until it is verified by me as fixed. Although to some extent, that will be proving a negative. Then again, any "lake" city at the extreme of an empire, will produce the bug, so it may not be hard to check that in some game. As long as I remember to look for the behavior when doing a mission near a "lake".

tnevolin commented 3 years ago

260

You are right I have tried fixing it in the past and it passed test cases at the time. I have reanalyzed your case above and fixed it. Cannot guarantee other cases don't lurk around, obviously. It is too sloppy and convoluted programming. Check it out. You can turn editor on and create another cruiser probe there and try infiltrate network. Should return to ocean connected base.

bvanevery commented 3 years ago

Santiago of the Spartans, 2220.zip

to the capitol Huh, I got a dialog box saying it had been sent to Sparta Command, and indeed it is sent to Sparta Command. Not 100% sure if the target city was far enough away to be otherwise trying to go for the "lake" city. I will try a few more turns farther afield.

Santiago of the Spartans, 2222.zip Also went back to Sparta command.

Santiago of the Spartans, 2225.zip An extreme city, I think comparable to what I reported as the Issue, also sent me back to Sparta Command. My remaining question is whether I only get sent to Sparta Command, no matter where I do a mission. My team going in the other direction, hasn't made it far enough away from Sparta Command to be sure.

Well, I tested for yet more turns. That got boring. Teams always came back to Sparta Command, so this issue, of landlocked probe teams, seems to be fixed. However I am wondering if teams are always sent back to the capitol even when other coastal cities are closer. Also I wonder what happens when the capitol is landlocked. I will be on the lookout for those cases, and will file new Issues about them if they come up.

tnevolin commented 3 years ago

Is Sparta Command connected to the ocean probe was in? If so then it is the easiest hack I did for their sloppy development. They are sending probe to the nearest base. Then for sea probes they also check that this base is also a port. If it is - probe is sent there regardless whether this port is of the same ocean. I see a generic reasoning of this lazy development: at least it goes to some port and maybe can continue operations there. Then, if this base is not a port they scan all own bases from top and find the first one connected to this ocean. So it will be Sparta Command in your case.

I did a very simple fix - skip checking for nearest base is a port and instead just go directly to scan routine. At least this way probe stays in same ocean. Can get far from operation place, though.

bvanevery commented 3 years ago

Sparta Command is part of this ocean, but there are bases immediately in its vicinity that are closer. It's not a big deal in this part of the ocean. However, it's a big, worldwide ocean, and there's this whole side of the continent that is not directly accessible. Think like having to go around Cape Horn before the Suez Canal existed. It would not be at all fun to have probe teams sent all the way back to a city on the wrong side of a massive continent.

Also, tactically, if I make a forward base deeper into enemy waters, such as by taking over an enemy base, I should not be penalized for that. My team should be going back to my forward base, not all the way back to the 1st city I ever made, because it happened to be on a world accessible coastline.

Getting sent to the wrong side of a continent, when an opponent with a Treaty sends your probe team home, was ok because getting caught is supposed to be a penalty. I rationalized it as "got sent back to my embassy" or something. That's rather different from advancing in the field with probe teams to do harm.

tnevolin commented 3 years ago

261 Here.

bvanevery commented 3 years ago

Santiago of the Spartans, 2225.zip Instead of going back to Sparta Command, goes back to Training Camp, which is the closest city with ocean access. Doesn't go to the "lake" city. Congrats!