aliens

Author Topic: [(Non critical) bug] Soldiers can walk through walls!  (Read 4843 times)

Offline grzegorj

  • Captain
  • ***
  • Posts: 87
  • grzegorj and Sherlock are my nicknames...
    • View Profile
    • X-COM
[(Non critical) bug] Soldiers can walk through walls!
« on: October 02, 2014, 02:08:03 am »
Inspired by the latest nightly (openxcom_git_master_2014_09_30_0211.zip) with a patch to the Firestorm route file, I have looked through all three 2nd-generation Xcom ships.

[For confused ones: Firestorm is available in the game when you swich an option to use it for transporting soldiers too. This idea comes from the old good times of XcomUtil.]


1. There is no reason for the terrain files of Firestorm to differ from the terrain for Lightning. Both vessels use exactly the same tiles. However, there is a new, corrected version of LIGHNIN MCD/PCK/TAB files in the Universal Patch. But the same errors have not been corrected in FIRES MCD/PCK/TAB! The game adds these files during installation - but these should be just copies of LIGHTNIN files from the patch. Please correct it!

Btw., there is a simpler solution. I suggest to change Firestorm tilesets from FIRES into LIGHTNIN in the Ruleset. As far as I know, nobody has ever changed FIRES to make it different from LIGHTNIN, and there is not a single mod which uses FIRES, so this is completely safe.


2. Both LIGHTNIN and AVENGER terrain files contain errors, not patched yet. Southern and eastern walls of all three ships look and feel like sothern and eastern walls of UFOs, so they should be assigned as northern and western wall tiles in the data files, respectively. Some other tricks, like adding a patch for BigWall attribute in the Ruleset is used instead. It is not a real solution. Other errors have been corrected in the Universal Patch - why not to correct this as well?

If a tile is marked as object, the BigWall attribute is very important - if set (to 1, even if there are also other possibilities), the tile is impassable and does not generate mistakes in path finding.

But if the same tile is marked as northern wall or western wall, the BigWall becomes of no importance and is set to 0 (in all genuine tiles marked as walls). Soldiers (and aliens) should not pass through walls in any case.

I have made all needed corrections (I mean errors I have found... perhaps there are other errors too), and the result is in the attachment. Check it, test it, and if you feel they are OK, add them to the Universal Patch. To emphasize: they are not mods, they are patches.

There was an unused frame for the human ship Power Source (in LIGHTNIN terrain files); I have also added it to the animation (and it is no longer unused in the file). Now the power source pulses slower and switches off for a second. Just install the corrected version and observe it yourself. I feel using/activation an unused PCK is a patch, not a mod as well.

To forewarn: these changes have nothing to do with the problem described below. I have tested the game's behaviour with old and new tilesets, and it is exactly the same.

I have used the AVENGER tileset version with a patched door. It is not applied in the normal game (so both patched (in this point) and unpatched versions of the tileset will work exactly the same) but modders have created a special Avenger type with door. The mod uses the corrected door, and my version of the tileset will work with the updated Avenger without problems.


3. Then was the turn for checking maps. Avenger appeared not to have one needed "wedge" (a bit of wall to plug the hole in the corner) in its north-western corner. Btw., in human ship maps, such wedges should always be added externally: at the convex side of the angle and also by skew walls. In UFOs, pillars should be inserted to corners and to the places where two skew wall tiles touch one another (or there will be holes in walls).


4. The existing trial to eliminate gaps in walls of Firestorm and Lightning is to add wedges that block lines of view (and firing) but are invisible. They form last 4 tiles (43-46) in the LIGHTNIN tileset. Such a solution looks very temporary...

I have reverted the wedges into a visible form like in the AVENGER tileset (however, one of them is NOT the same like in AVENGER, it fits to the Lightning graphics instead) - btw., thanks to Volutar's MCD Edit! A great program indeed! (Even if the built-in PCK Editor not very comfortable - but still great).

It appeared that the Lightning and Firestorm maps look ugly with the corrected graphic. It is quite probable that the previous patchers did not know were to put the gap-filling edges, and they used them on the inner side of walls. I have corrected it as well, removed unnecessary wedges from the inner sides, and add necessary wedges in the outer sides.

Now at last the door of Firestorm looks normal (it is so because the edges are no longer invisible). You can have a look at the attached screenshots (or add my patches into the game, and test them in-game).


5. The Firestorm map that the game installs looks strange as it has two Power Sources stacked on two navigations (all other existing squares inside the ship are to be used for soldiers, so no moving of navigations / Power sources is possible). It looks very ugly! I have removed one navigation and one power source. Now the vessel is no more ideally symmetrical but looks normal, without engines growing from control tables. See the attached screenshots. I hope my idea will appear fine, and the corrected map will replace the existing one in the game (unless somebody finds a yet smarter solution). Once again, it is not a mod. It is a patch.


6. Soldiers in Firestorm look north even if the door is on the eastern side. It is a game error and it needs a correction in the Ruleset. Look at screen000 in the attached archive with screenshots.


7. And, finally, the most interesting! I have found a bug in the game. Namely, the wall tiles on the maps are all placed as objects and not walls. It contrasts with UFO walls: the ones which form southern and eastern external UFO walls, are placed on the map as northern and western walls (on adjacent squares), and it all works.

But if we correct the placement of walls in maps to make them be placed in the same way as on UFO maps, it will not work!

SOLDIERS WILL WALK THROUGH WALLS. See the attached screenshots with arrows showing planned movement of a soldier. The soldiers will actually cross the walls if we made them move. It looks very strange.

They do not cross edges or tile borders. They cross wall tiles. It should never happened...

Nothing helps: marking the tiles as objects again in the MCD, setting the BigWall attribute, etc. The game stops allowing crossing the walls only when the walls are placed as objects again on the map. Their assignation in MCD has nothing to do.

It is sounds strange - soldiers can walk through walls and cannot walk through some objects...


I do not understand how this bug could emerge. But UFO maps are constructed in EXACTLY the same way as the human ships maps corrected by me. There are tiles assigned to be northern and western walls, they form UFO southern and eastern walls, they have (nearly) the same attributes as Firestorm / Lightning / Avenger tiles - but soldiers cannot enter the UFO through them. So, why they can go through walls of corrected human ships which are marked EXACTLY the same?

Is it true that the game, instead of reading properties of tiles, has them hard coded inside? It seems to me to be the only explanation...

If yes, the situation is very uncomfortable for modders. Even now there are mods which use LIGHTNIN or AVENGER tilesets, and not the walls are not always used as objects (which is generally incorrect even if exists on unpatched maps because of an error) - sometimes they are correctly placed on maps as walls (of course, I mean only walls on southern and eastern borders of ships, so northern and western walls - all the others should be objects indeed).


I strongly suggest that the game should check tile attributes, and should not let soldiers pass through any walls, instead of using some inner database. It would drastically help modders.


One of OXC features is that a unit can stand on a square where a wall or an object is placed. The original game does not allow walking just by northern and western sides of UFOs - OXC does allow it. Perhaps it is a patch, perhaps it is a mod... it does not matter. I like this feature.

However, the possibility to stand just by the wall / object should not allow the unit to cross it. For example, if a unit stands on a square, and there is a tile placed as northern wall on the square adjacent south of the unit, the possibility to go south should be always blocked. It should not depend on what kind of map it is.

It does not so for now. This is why soldiers can go through Firestorm / Lightning / Avenger walls (if the maps are corrected, and the walls are placed as such, and not as objects).

See the attached screenshots. I have also added fpslooks - their numbers correspond to screenshots numbers. Perhaps it'll help with further analysing the problem.


8. Avenger / Lightning / Firestorm walls are not the only passable walls. It appears that wall navigations (the pink objects in UFOs) not always block passing through. They are assigned to be walls (northern or western ones). If they are placed as walls (on a used-made maps), they sometimes do not block passing.

The problem is of the same kind as the problem with Avenger / Lightning / Firestorm walls.

Once again, the game should not rely on its own inner database, and should not allow passing through some walls but block passing through other walls with the same attributes. If it was so, it could stop modding... A new tile made by a modder could always be passable even if marked as wall! It would not be fair, the most simply speaking.

Hence an appeal to the coders: correct the procedure checking the possibility of passing to the adjacent square. And make it always impossible if there is a wall blocking the passage. Any wall. Any tile marked as a wall and put on a map as wall.
« Last Edit: October 02, 2014, 02:25:26 am by grzegorj »

Offline grzegorj

  • Captain
  • ***
  • Posts: 87
  • grzegorj and Sherlock are my nicknames...
    • View Profile
    • X-COM
Re: [(Non critical) bug] Soldiers can walk through walls!
« Reply #1 on: October 02, 2014, 02:08:47 am »
PS. Thanks in advance!

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: [(Non critical) bug] Soldiers can walk through walls!
« Reply #2 on: October 13, 2014, 10:38:09 am »
i think i may have just inadvertently fixed this in the latest nightly

Offline grzegorj

  • Captain
  • ***
  • Posts: 87
  • grzegorj and Sherlock are my nicknames...
    • View Profile
    • X-COM
Re: [(Non critical) bug] Soldiers can walk through walls!
« Reply #3 on: October 17, 2014, 12:58:05 pm »
Warboy, thanks, now it is OK with walls. But there are still problems with Firestorm...

1. The map file is incorrect, power sources and navigation panels (?) are stacked, and this prevents some soldiers from going out of the ship. One soldier cannot pass between the ship wall and the stacked power source/navigation and there is no way to get him/her out. Check and use my patch instead (in the attachment), at least the map file.

2. I still strongly suggest using the terren file I have patched (I mean adding them to the installation package) - it does not contain invisible "wall wedges" anymore, and the ship door looks correct now. With the mcd from the universal patch, the door is ugly-looking. It is so because LIGHTNIN.MCD/PCK/TAB were a temporary solution to problems noticed before, and they were not finished at all. The patch does affect Lighning as well but it does not change its look in practice. Just check it.

3. The deployment is still incorrect: if you take a tank and 6 soldiers to Firestorm, the tank will not appear at all. Perhaps it is so because the game engine should use first four items in the deployment for the tank - but for unknown reasons it does not.

Moreover, I do not like soldiers looking at various directions, do you? It was an idea of XComUtil creators, and it was good as long as you can have looked through walls. Now the walls are patched and no look through them is possible, so it would be much better if the soldiers looked in the same direction - towards the exit from the ship.

Note that in the cfg files of XCU there are TWO deployments for Firestorm, one for 10 soldiers, and another for 1 tank + 6 soldiers. You have used the one for 10 soldiers. With this pattern, the tank has little chance to appear :-).

I have corrected the suitable section of XcomUtil_Fighter_Transports.rul this way:

    deployment:
      - [3, 4, 1, 2]
      - [3, 5, 1, 2]
      - [4, 4, 1, 2]
      - [4, 5, 1, 2]
      - [2, 3, 1, 2]
      - [5, 3, 1, 2]
      - [3, 2, 1, 2]
      - [4, 2, 1, 2]
      - [2, 4, 1, 2]
      - [5, 4, 1, 2]

Now soldiers look at the exit door (which, in my opinion, looks far better) - but the tank does not still generate, just like before. See the attached screenshot showing, in how strange places 6 soldiers are deployed in the ship. They are not the first six entries listed above...

I think the game engine should be corrected. It should use the first four entries for the tank. I cannot guess the algorithm. But it is different than in XComUtil so the deployment patterns made for it will not work with OXC.

Offline grzegorj

  • Captain
  • ***
  • Posts: 87
  • grzegorj and Sherlock are my nicknames...
    • View Profile
    • X-COM
Re: [(Non critical) bug] Soldiers can walk through walls!
« Reply #4 on: October 17, 2014, 03:22:32 pm »
I think I have managed to solve this tank-less issue!

Either there is an error in the deployment pattern in XCU (copied to OXC), or OXC interprets the data in different way.

Anyway, a working deployment is:

Code: [Select]
# Based on XcomUtil by Scott Jones and BladeFireLight
crafts:
  - type: STR_INTERCEPTOR
    soldiers: 6
    vehicles: 1
    battlescapeTerrainData:
      name: INTERC
      mapDataSets:
        - BLANKS
        - PLANE
      mapBlocks:
        - name: INTERC
          width: 10
          length: 10
  - type: STR_FIRESTORM
    soldiers: 10
    vehicles: 1
    battlescapeTerrainData:
      name: FIRES
      mapDataSets:
        - BLANKS
        - LIGHTNIN
      mapBlocks:
        - name: FIRES
          width: 10
          length: 10
    deployment:
      - [5, 3, 1, 2]
      - [5, 4, 1, 2]
      - [4, 3, 1, 2]
      - [4, 4, 1, 2]
      - [4, 2, 1, 2]
      - [4, 5, 1, 2]
      - [3, 2, 1, 2]
      - [3, 5, 1, 2]
      - [2, 3, 1, 2]
      - [2, 4, 1, 2]

(This is the whole contents of XcomUtil_Fighter_Transports.rul (also in attachment)

With this deployment pattern both 10 soldiers and 6 soldiers + a tank work all right. I have just found the solution by investigating effects of hashing individual lines in the ruleset, and next experimenting with correcting them.