aliens

Author Topic: Bugs, crashes, typos & bad taste  (Read 1389708 times)

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: Bugs, crashes, typos & bad taste
« Reply #4200 on: June 26, 2024, 03:28:16 pm »
Thank you, I'd be very grateful for the help. (And scared of the results... This may well impact the entire game)

heya Solar, sorry but I don't feel quite up to it myself

but if some brave soul wants to ...

https://github.com/OpenXcom/OpenXcom/blob/db2d8275f522d1f7f2f10fe2ca4316924b89a746/src/Savegame/SavedBattleGame.cpp#L1290

[decipher that]

looks identical to the OXC/e code with only a slight refactor concerning unitsize. (if i got the right OXC/e repo... not sure)


I suspect it has something to do with the 'scout' variable ... first thing id do, for any interested, is find out how 'scout' is set ...
« Last Edit: June 26, 2024, 03:31:22 pm by kevL »

Offline Juku121

  • Commander
  • *****
  • Posts: 1798
  • We're all mad here.
    • View Profile
Re: Bugs, crashes, typos & bad taste
« Reply #4201 on: June 26, 2024, 06:04:19 pm »
The 'scout' flag is set here.

The lizards in the file have 'AIMode: 0', which I think is 'Patrol'.

I do suspect that it has to do with these being 'engineer' nodes, even though non-UFO maps are supposed to ignore that for patrol purposes. Didn't see this in the code, though. ???

Offline CrazedHarpooner

  • Colonel
  • ****
  • Posts: 101
    • View Profile
Re: Bugs, crashes, typos & bad taste
« Reply #4202 on: June 26, 2024, 06:44:34 pm »
I suspect it has something to do with the 'scout' variable ... first thing id do, for any interested, is find out how 'scout' is set ...
I believe your suspicions are true, by what I've seen here
https://github.com/MeridianOXC/OpenXcom/blob/4a98605e9fcb3f9a9ce8c43737d07e938b09bb00/src/Battlescape/AIModule.cpp#L589
It appears that all units are set to scouting initially, but this is changed inmedietly and a unit will be scouting ONLY under any of these conditions:
- Cheat Turn as been reached (comment in the code also mentions low alien morale)
- The node the unit started from has rank 0. Aliens don't seem to like to be on one of these meager nodes and will seek out another node.
- The tile the unit is standing on is on fire (doesn't seem to matter if they can resist fire or not in this case)

All other units will not be scouting. This will be rechecked every time a unit reaches their destination node and will change to scouting, not scouting according to the conditions. There's a different behaviour for scouting while in base defense missions, but that part is not relevant to the issue.

The key difference I can see between scouts and non-scouts is the destination node, scouts can pick from any node on the map that is valid after passing some filters. Non-scouts however limit their choices to nodes directly linked to their current origin node with similar filters. The next difference is that scouts will pick a node randomly from the list of valid destinations while non-scouts will choose the most 'desirable' destination that factors in node's rank and flags (I believe what mapview 2 calls 'patrol priority')

If I follow what might be happening is that the "engineer" rank aliens will NOT pick any of the connected nodes outside the kitchen because:
a) they are starting on a node that is not a rank 0 and none of the other conditions have been met for them to scout, and
b) the ouside nodes have both rank:0 and flag:0 making them undesireable.

It is very likely that they're each picking an engineer node that is occupied by another engineer and if there's enough of them, none will move because the space is always occupied. Do note that while the code does seem to prevent different aliens picking the same destination at the same time with an 'allocated' flag, it doesn't prevent them from occupying the space that another unit is heading for as they move or they happen to spawn there.

I believe a New Battle with debugging options and debug killing enough engineers should comfirm (or disprove) this conclusion.

Note: I'm referencing Meridian's repo but I believe there's minimal differences between OXC and OXCE here.
« Last Edit: June 26, 2024, 06:49:32 pm by CrazedHarpooner »

Offline Juku121

  • Commander
  • *****
  • Posts: 1798
  • We're all mad here.
    • View Profile
Re: Bugs, crashes, typos & bad taste
« Reply #4203 on: June 26, 2024, 07:09:34 pm »
If you look at my 'Reptoid kitchen save' and play a few turns, you'll see even the single Reptoid in its own kitchen is just circling around the three 'engineer' nodes. Note that these Reptoids are not 'engineers' themselves. ???

They won't even care about civilians invading their space, short of shooting them and then continuing to circle.

I thought this kind of rank-based behaviour was limited to UFO landings and crashes only, but apparently not?

Enabling 'traceAI' does say that they're just patrolling around.
« Last Edit: June 26, 2024, 07:11:29 pm by Juku121 »

Offline CrazedHarpooner

  • Colonel
  • ****
  • Posts: 101
    • View Profile
Re: Bugs, crashes, typos & bad taste
« Reply #4204 on: June 26, 2024, 07:38:05 pm »
Ah, right, they're AGENTS, which correspond to the vanilla rank of SOLDIERS as defined in the alienRaces.
However, for the issue, this appears irrelevant as long as the tile rank of the 'fromnode' is not 0 the patrol method they will use is 'guard' or 'non-scout' regardless of the unit's rank.

They key piece of code I believe is this (extra spacing removed for the post):
Code: [Select]
  && (n->getFlags() > 0 || n->getRank() > 0 || scout) // for non-scouts we find a node with a desirability above 0This indicates to me that patrolling units that are NOT scouting will NEVER pick a node that has rank:0 flags:0 (patrol priority)
Since all of the tiles in that block have flags:0 and only a few have a rank>0 it will always pick one of those 'higher' ranked nodes.

Offline CrazedHarpooner

  • Colonel
  • ****
  • Posts: 101
    • View Profile
Re: Bugs, crashes, typos & bad taste
« Reply #4205 on: June 26, 2024, 09:00:58 pm »
Here we go, the attached RMP file modifies 4 nodes outside the kitchen to have a slightly better attraction for patrolling units (patrol priority:1). It seems they can find the doors now. Backup the old one before making any replacements and give it a try if you like.

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: Bugs, crashes, typos & bad taste
« Reply #4206 on: June 26, 2024, 10:55:28 pm »
(I believe what mapview 2 calls 'patrol priority')

for reference ->

in Mv2 (c#)

Code: [Select]
Unit   =       (UnitType)bindata[19];
Rank   =                 bindata[20];
Patrol = (PatrolPriority)bindata[21];
Attack =     (AttackBase)bindata[22];
Spawn  =    (SpawnWeight)bindata[23];

in OXC (c++)

Code: [Select]
int type     = value[19];
int rank     = value[20];
int flags    = value[21];
int reserved = value[22];
int priority = value[23];

so yep.

notes:
- be careful how you read '0' in OXC code -- it could rather mean null/invalid
- 'dummy' nodes are simply nodes that OXC determines are invalid nodes in the RMP file (and hence they get discarded* when the RMP loads) IIRC
- personally id be tempted to create a mini-mapfile with just Solar's kitchen surrounded by blank module-blocks (with a few nodes trying to coax the aliens out) and see what happens, played via the InstantBattle generator

* flagged as dummy-nodes
« Last Edit: June 26, 2024, 10:59:41 pm by kevL »

Offline Juku121

  • Commander
  • *****
  • Posts: 1798
  • We're all mad here.
    • View Profile
Re: Bugs, crashes, typos & bad taste
« Reply #4207 on: June 26, 2024, 11:00:53 pm »
Well, the Reptoids do come out to play with the altered RMP, so that at least has a solution.

There's an implication of a massive RMP recheck for Solarius and probably Dioxine, though. :(

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: Bugs, crashes, typos & bad taste
« Reply #4208 on: June 26, 2024, 11:18:26 pm »
Well, the Reptoids do come out to play with the altered RMP, so that at least has a solution.

oh wow. I wish i had the (mental) fortitude to get into this more ... sounds good so far tho :)

Offline Aciruk

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Re: Bugs, crashes, typos & bad taste
« Reply #4209 on: June 27, 2024, 11:49:58 am »
flies out
« Last Edit: June 27, 2024, 12:57:23 pm by Aciruk »

Offline Juku121

  • Commander
  • *****
  • Posts: 1798
  • We're all mad here.
    • View Profile
Re: Bugs, crashes, typos & bad taste
« Reply #4210 on: June 27, 2024, 03:09:27 pm »
Can't reproduce. What exactly are the steps to get to that error message?

Offline psavola

  • Commander
  • *****
  • Posts: 832
    • View Profile
Re: Bugs, crashes, typos & bad taste
« Reply #4211 on: June 28, 2024, 12:24:31 am »
Red Dawn HQ research text is slightly inaccurate: "Here's the plan: we should locate Red Dawn's main base, located somewhere in Siberia, and snatch all personal data we can find. (...)". Similar in the mission briefing screen.

The HQ can also spawn elsewhere than just Siberia, at least in northernmost Canada (near Greenland). I'd suggest either changing the mission regions or changing Siberia to "the Arctic Area" or "Siberia or the Arctic Area", which would likely be pretty close to the regions as defined (see the map at https://en.wikipedia.org/wiki/Arctic).
« Last Edit: June 28, 2024, 07:09:33 am by psavola »

Offline Irismono

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: Bugs, crashes, typos & bad taste
« Reply #4212 on: June 28, 2024, 07:52:13 am »
Red Dawn HQ research text is slightly inaccurate: "Here's the plan: we should locate Red Dawn's main base, located somewhere in Siberia, and snatch all personal data we can find. (...)". Similar in the mission briefing screen.

The HQ can also spawn elsewhere than just Siberia, at least in northernmost Canada (near Greenland). I'd suggest either changing the mission regions or changing Siberia to "the Arctic Area" or "Siberia or the Arctic Area", which would likely be pretty close to the regions as defined (see the map at https://en.wikipedia.org/wiki/Arctic).

"Within the Arctic Circle" would probably work best.

Offline Chuckebaby

  • Colonel
  • ****
  • Posts: 408
  • Chrysalis are people too
    • View Profile
Re: Bugs, crashes, typos & bad taste
« Reply #4213 on: June 28, 2024, 07:37:14 pm »
Not sure if it was already mentioned but the Prowler suits backpack inventory screen looks a little strange.
There is no backpack inventory so not even sure why those 3 boxes are there, nothing can be placed into them.

Offline psavola

  • Commander
  • *****
  • Posts: 832
    • View Profile
Re: Bugs, crashes, typos & bad taste
« Reply #4214 on: June 28, 2024, 10:36:32 pm »
While I'm on nitpicking, I observe that Osiron Hacienda has a number of Capos armed with RPG launcher. The weird thing is that they only have anti-tank rockets. And because the hacienda is located in jungle terrain, attacking it with a tank is not feasible, and the Osiron should know it. I suppose they would be more fearsome if they had regular rockets.