Author Topic: Bad nodes in RMP files  (Read 6620 times)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Bad nodes in RMP files
« on: February 16, 2017, 04:25:42 pm »
Hi Warboy, all,

I made a small tool to check the correctness of RMP files.

Statistics:

xcom1: 0 bad nodes  8)
xcom2: 21 bad nodes ... would be nice to fix those in a "universal patch" before 2.0, see list below

Terrain:
Code: [Select]
Bad node in RMP file: ROUTES/MU03.RMP Node #2 is outside map boundaries at X:255 Y:255 Z:3. Culling Node.
Bad node in RMP file: ROUTES/MU03.RMP Node #3 is outside map boundaries at X:255 Y:7 Z:3. Culling Node.
Bad node in RMP file: ROUTES/MU03.RMP Node #4 is outside map boundaries at X:255 Y:255 Z:3. Culling Node.
Bad node in RMP file: ROUTES/GAL01.RMP Node #9 is outside map boundaries at X:12 Y:20 Z:3. Culling Node.
Bad node in RMP file: ROUTES/GAL03.RMP Node #12 is outside map boundaries at X:20 Y:16 Z:3. Culling Node.
Bad node in RMP file: ROUTES/GAL05.RMP Node #4 is outside map boundaries at X:10 Y:6 Z:3. Culling Node.
Bad node in RMP file: ROUTES/GAL05.RMP Node #5 is outside map boundaries at X:6 Y:10 Z:3. Culling Node.
Bad node in RMP file: ROUTES/ALART00.RMP Node #0 is outside map boundaries at X:255 Y:9 Z:3. Culling Node.
Bad node in RMP file: ROUTES/PORT05.RMP Node #7 is outside map boundaries at X:255 Y:5 Z:2. Culling Node.
Bad node in RMP file: ROUTES/PORT17.RMP Node #19 is outside map boundaries at X:20 Y:6 Z:3. Culling Node.
Bad node in RMP file: ROUTES/PORT20.RMP Node #30 is outside map boundaries at X:20 Y:11 Z:1. Culling Node.
Bad node in RMP file: ROUTES/ISLAND12.RMP Node #3 is outside map boundaries at X:254 Y:5 Z:3. Culling Node.
Bad node in RMP file: ROUTES/XBASES06.RMP Node #10 is outside map boundaries at X:255 Y:7 Z:1. Culling Node.
Bad node in RMP file: ROUTES/GRUNGE12.RMP Node #28 is outside map boundaries at X:246 Y:254 Z:1. Culling Node.
Bad node in RMP file: ROUTES/LINERT01.RMP Node #81 is outside map boundaries at X:13 Y:52 Z:1. Culling Node.
Bad node in RMP file: ROUTES/LINERT02.RMP Node #81 is outside map boundaries at X:13 Y:52 Z:1. Culling Node.
Bad node in RMP file: ROUTES/ALSHIP02.RMP Node #17 is outside map boundaries at X:252 Y:4 Z:1. Culling Node.
Bad node in RMP file: ROUTES/LEVEL07.RMP Node #1 is outside map boundaries at X:20 Y:4 Z:0. Culling Node.
Bad node in RMP file: ROUTES/LEVEL07.RMP Node #2 is outside map boundaries at X:20 Y:3 Z:0. Culling Node.

USOs:
Code: [Select]
Bad node in RMP file: ROUTES/UFO05.RMP Node #22 is outside map boundaries at X:9 Y:20 Z:3. Culling Node.

Xcom Craft:
Code: [Select]
Bad node in RMP file: ROUTES/TRITON.RMP Node #2 is outside map boundaries at X:10 Y:9 Z:1. Culling Node.



EDIT: @modders:
I checked also some modded files... still having problems checking Z levels, but here are X,Y issues I found n PirateZ as example

Code: [Select]
Bad node in RMP file: ROUTES/GAL01.RMP Node #9 is outside map boundaries at X:12 Y:20 Z:3. Culling Node.
Bad node in RMP file: ROUTES/GAL03.RMP Node #12 is outside map boundaries at X:20 Y:16 Z:3. Culling Node.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #2 is outside map boundaries at X:255 Y:255 Z:3. Culling Node.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #3 is outside map boundaries at X:255 Y:7 Z:3. Culling Node.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #4 is outside map boundaries at X:255 Y:255 Z:3. Culling Node.
Bad node in RMP file: ROUTES/PORTURBAN08.RMP Node #30 is outside map boundaries at X:20 Y:11 Z:1. Culling Node.

There will probably be more Z level problems, but I need to first make sure I don't find any false positives.
Thanks to Hobbes for checking the original post and pointing them out.

PS: I will add such check to OXCE+ in a separate test screen and probably start adding more tests for typical modding mistakes.
« Last Edit: February 18, 2017, 04:35:31 pm by Meridian »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Bad nodes in RMP files
« Reply #1 on: February 16, 2017, 05:43:05 pm »
Hi Meridian,

You might need to recheck the settings that you've used to generate the list of bad nodes.

As an example, the AREA51BASE197RMP file lists the following:

Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #0 is outside map boundaries at X:18 Y:7 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #1 is outside map boundaries at X:18 Y:18 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #10 is outside map boundaries at X:16 Y:17 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #11 is outside map boundaries at X:4 Y:7 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #12 is outside map boundaries at X:4 Y:12 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #13 is outside map boundaries at X:2 Y:17 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #14 is outside map boundaries at X:5 Y:4 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #15 is outside map boundaries at X:12 Y:4 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #16 is outside map boundaries at X:17 Y:2 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #2 is outside map boundaries at X:7 Y:18 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #3 is outside map boundaries at X:18 Y:0 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #4 is outside map boundaries at X:0 Y:0 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #5 is outside map boundaries at X:0 Y:18 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #6 is outside map boundaries at X:13 Y:7 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #7 is outside map boundaries at X:7 Y:7 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #8 is outside map boundaries at X:13 Y:11 Z:4. Culling Node.
Bad node in RMP file: ROUTES/AREA51BASE197.RMP Node #9 is outside map boundaries at X:10 Y:14 Z:4. Culling Node

All of these nodes are located on level 0 of the AREA51BASE197.RMP map, which has 5 levels instead of the vanilla 4, but your tool shows them as in level 4.  And from the rest of the 'bad nodes' related to the Area 51 terrain, it seems your tool is considering that all nodes in level 0 are wrong.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: Bad nodes in RMP files
« Reply #2 on: February 16, 2017, 06:18:14 pm »
Z:4 is the fifth level from the top (https://www.ufopaedia.org/index.php/MAPS)... if the map has 5 levels, this would correspond to "ground level".

I used the same algorithm to detect bad nodes as is used in vanilla, so my guess is:
- I really made a mistake somewhere... checking now
- PirateZ uses old version of the RMP/MAP/... files?
- MapBlock sizes are defined incorrectly?
- something else?

I asked Dioxine/Solar to check randomly for false positives... waiting for feedback.

I don't have MapView or anything similar to check the files, but I will try generating a few maps and see if vanilla xcom also produces these errors.
« Last Edit: February 16, 2017, 07:03:14 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: Bad nodes in RMP files
« Reply #3 on: February 16, 2017, 08:41:20 pm »
OK, I have filtered out all Z-level issues, many of them (not all) were indeed false positives.
I'll continue working on that.

In the meantime, I updated the first post with X/Y-level issues only... those should all be real.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Bad nodes in RMP files
« Reply #4 on: February 16, 2017, 09:13:23 pm »
Code: [Select]
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #2 is outside map boundaries at X:255 Y:255 Z:3. Culling Node.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #3 is outside map boundaries at X:255 Y:7 Z:3. Culling Node.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #4 is outside map boundaries at X:255 Y:255 Z:3. Culling Node.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #2 is outside map boundaries at X:255 Y:255 Z:3. Culling Node.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #3 is outside map boundaries at X:255 Y:7 Z:3. Culling Node.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #4 is outside map boundaries at X:255 Y:255 Z:3. Culling Node.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #2 is outside map boundaries at X:255 Y:255 Z:3. Culling Node.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #3 is outside map boundaries at X:255 Y:7 Z:3. Culling Node.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #4 is outside map boundaries at X:255 Y:255 Z:3. Culling Node.
Bad node in RMP file: ROUTES/PORTURBAN08.RMP Node #30 is outside map boundaries at X:20 Y:11 Z:1. Culling Node.
Bad node in RMP file: ROUTES/PORTURBAN08.RMP Node #30 is outside map boundaries at X:20 Y:11 Z:1. Culling Node.

PORTURBAN maps aren't used anymore on the latest version of the Terrain Pack/Area 51 (been replaced with the PORTUFO maps). On MUJUNGLE03 I found a bad node on a location not mentioned on the list above. And from what I'm seeing on MapView, it seems technically impossible for .MAP/RMP files to have dimensions of 255x255, so I have doubts if the info listed above about the coordinates is correct.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: Bad nodes in RMP files
« Reply #5 on: February 16, 2017, 09:30:04 pm »
PORTURBAN maps aren't used anymore on the latest version of the Terrain Pack/Area 51 (been replaced with the PORTUFO maps). On MUJUNGLE03 I found a bad node on a location not mentioned on the list above.

These are not from terrain pack/area51 though... I mean, originally yes, but they've most likely been changed by others until they got into piratez, where I took them from.
Also, Solar has been fixing them recently, that's why you could have found something that wasn't listed, as one possible reason.

I've downloaded latest area 51 now and this is the result I got:

EDIT: removed duplicates from the list

Code: [Select]
Bad node in RMP file: ROUTES/ISLANDURBAN12.RMP Node #3 is outside map boundaries at X:254 Y:5 Z:3. Found using OXCE+ test cases.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #2 is outside map boundaries at X:255 Y:255 Z:3. Found using OXCE+ test cases.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #3 is outside map boundaries at X:255 Y:7 Z:3. Found using OXCE+ test cases.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #4 is outside map boundaries at X:255 Y:255 Z:3. Found using OXCE+ test cases.
Bad node in RMP file: ROUTES/PORTUFO05.RMP Node #7 is outside map boundaries at X:255 Y:5 Z:2. Found using OXCE+ test cases.
Bad node in RMP file: ROUTES/PORTUFO21.RMP Node #30 is outside map boundaries at X:20 Y:11 Z:1. Found using OXCE+ test cases.

And from what I'm seeing on MapView, it seems technically impossible for .MAP/RMP files to have dimensions of 255x255, so I have doubts if the info listed above about the coordinates is correct.

I'm pretty sure this time, but I'll double check anyway.
And if the file is corrupt, there's no reason why the coordinates could not be 255, it's represented by 1 byte in the file, so anything between 0 and 255.

Also, if for example X:20 doesn't seem suspicious, on 20x20 map block you should have only X between 0 and 19.
« Last Edit: February 17, 2017, 03:26:10 pm by Meridian »

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Bad nodes in RMP files
« Reply #6 on: February 17, 2017, 02:33:27 pm »
0 - 254 and 1 - 256

Where do you start to count?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: Bad nodes in RMP files
« Reply #7 on: February 17, 2017, 03:09:36 pm »
All byte numbers in the MAP/RMP files are between 0 and 255.
All internal representations in openxcom for these things also count from 0.
All log outputs are also 0-based.

X is from left to right, Y from top to bottom, Z from top floor to bottom floor.



PS: I have found and fixed the earlier issue with checking Z dimension... I used correct algorithm, but slightly incorrect input (for Z only). Once I have it fully tested, I'll update the bad nodes list (for some mods).

PS2: Added a GUI too... would look something like this.

EDIT: found only 4 bad nodes in the latest Hardmode Expansion

Code: [Select]
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #2 is outside map boundaries at X:255 Y:255 Z:3. Found using OXCE+ test cases.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #3 is outside map boundaries at X:255 Y:7 Z:3. Found using OXCE+ test cases.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #4 is outside map boundaries at X:255 Y:255 Z:3. Found using OXCE+ test cases.
Bad node in RMP file: ROUTES/POLARMOUNT05.RMP Node #4 is outside map boundaries at X:5 Y:10 Z:0. Found using OXCE+ test cases.
« Last Edit: February 17, 2017, 03:54:44 pm by Meridian »

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Bad nodes in RMP files
« Reply #8 on: February 17, 2017, 06:23:18 pm »
EDIT: found only 4 bad nodes in the latest Hardmode Expansion

Code: [Select]
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #2 is outside map boundaries at X:255 Y:255 Z:3. Found using OXCE+ test cases.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #3 is outside map boundaries at X:255 Y:7 Z:3. Found using OXCE+ test cases.
Bad node in RMP file: ROUTES/MUJUNGLE03.RMP Node #4 is outside map boundaries at X:255 Y:255 Z:3. Found using OXCE+ test cases.
Bad node in RMP file: ROUTES/POLARMOUNT05.RMP Node #4 is outside map boundaries at X:5 Y:10 Z:0. Found using OXCE+ test cases.

Only four? ok i will correct them also. Hm.. that POLARMOUNT05 slipped through my quality checkin damn...
Did you use the version 0.99.2d i presume?

The GUI looks very nice great work indeed!!!

EDIT: Fixed all the wrong nodes.
« Last Edit: February 18, 2017, 09:27:58 pm by hellrazor »