Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging: There is no way to see road and rail type flags in game #8545

Closed
JGRennison opened this issue Jan 9, 2021 · 5 comments
Closed

Debugging: There is no way to see road and rail type flags in game #8545

JGRennison opened this issue Jan 9, 2021 · 5 comments

Comments

@JGRennison
Copy link
Contributor

@JGRennison JGRennison commented Jan 9, 2021

Version of OpenTTD

Current master

Expected result

There is some way to see road and rail type flags (and similar relevant information).

Actual result

There is no way to see road and rail type flags (and similar relevant information) in game.
This makes diagnosing many types of NRT and rail type issues/bugs effectively impossible.

Currently the debug inspector window is usable on rail tiles, but the actual information it shows is very limited and almost useless for debugging.

Users typically have to rely on NewGRF author provided documentation which is typically hard to find and not guaranteed to match the actual state of the GRF.

Anecdotally I get plenty of bug-reports/queries about NRT and rail type issues which would not be possible to usefully resolve using only the tools in trunk.

Steps to reproduce

Use any GRF which provides NRT road/tram types or rail types.

Suggestions

  • Add more relevant information to the debug inspector window.
  • Enable the NewGRF inspector window for road types as well as rail types.
  • Add other debugging mechanisms for information extraction such as console commands, etc.

Examples of possible solutions

Add more stuff to the debug inspector window.
From: trunk-debug-inspect
To: jgrpp-debug-inspect

Console commands to show useful information:

Example console output
] list_cmds dump
dumpbridgetypes
dumpcargotypes
dumpcommandlog
dumpcpdpstats
dumpdesyncmsgs
dumpgameevents
dumpinflation
dumplinkgraphjobs
dumploaddebugconfig
dumploaddebuglog
dumpmapstats
dumprailtypes
dumproadtypes
dumpstflowstats
dumpvehstats
‎] dumproadtypes
  00 Road ROAD, Flags: ---h-, Extra Flags: --, GRF: 00000000, Road
  01 Tram ELRL, Flags: cl---, Extra Flags: --, GRF: 55464989, Tram track no ballast (Electrified)
  02 Road HAUL, Flags: ---h-, Extra Flags: --, GRF: 00000000, Road
  03 Road OFFR, Flags: ---h-, Extra Flags: --, GRF: 00000000, Road
  04 Road ORD0, Flags: -lX--, Extra Flags: --, GRF: 55464989, Field road 
  05 Road ORD1, Flags: --X--, Extra Flags: --, GRF: 55464989, Forest dirt road 
  06 Road ORD2, Flags: -----, Extra Flags: --, GRF: 55464989, Dirt road
  07 Road ORD3, Flags: --X--, Extra Flags: --, GRF: 55464989, Gravel road
  08 Road ORD4, Flags: -lX--, Extra Flags: --, GRF: 55464989, Sandy road
  09 Road SRD0, Flags: -----, Extra Flags: --, GRF: 55464989, Paved stone road
  10 Road SRD1, Flags: --X--, Extra Flags: --, GRF: 55464989, Cement concrete road
  11 Road SRD2, Flags: --X--, Extra Flags: --, GRF: 55464989, Concrete slab of road
  12 Road ARD0, Flags: -----, Extra Flags: --, GRF: 55464989, Asphalt road
  13 Road ARD1, Flags: -----, Extra Flags: --, GRF: 55464989, Asphalt road w/ stripes
  14 Road ARD2, Flags: -----, Extra Flags: --, GRF: 55464989, Improved asphalt road
  15 Road ARD3, Flags: -----, Extra Flags: --, GRF: 55464989, Improved asphalt road w/ stripes
  16 Road ARD4, Flags: --X--, Extra Flags: --, GRF: 55464989, Modern asphalt road
  17 Road ARD5, Flags: -----, Extra Flags: --, GRF: 55464989, Modern asphalt road w/ stripes
  18 Road WRD0, Flags: -lX--, Extra Flags: --, GRF: 55464989, Highway
  19 Road WRD1, Flags: -lX--, Extra Flags: --, GRF: 55464989, Expressway
  20 Road URD0, Flags: -----, Extra Flags: --, GRF: 55464989, Urban asphalt road
  21 Road URD1, Flags: -----, Extra Flags: --, GRF: 55464989, Urban asphalt road w/ stripes
  22 Road IRD0, Flags: --X--, Extra Flags: --, GRF: 55464989, ISR road
  23 Road IRD1, Flags: --X--, Extra Flags: --, GRF: 55464989, Cement slab of road
  24 Road ELRD, Flags: c----, Extra Flags: --, GRF: 55464989, Asphalt road (Electrified)
  25 Road AER0, Flags: c----, Extra Flags: --, GRF: 55464989, Asphalt road w/ stripes (Electrified)
  26 Road AER1, Flags: c----, Extra Flags: --, GRF: 55464989, Improved asphalt road w/ stripes (Electrified)
  27 Road AER2, Flags: c----, Extra Flags: --, GRF: 55464989, Modern asphalt road w/ stripes (Electrified)
  28 Road UER0, Flags: c----, Extra Flags: --, GRF: 55464989, Urban asphalt road (Electrified)
  29 Road UER1, Flags: c----, Extra Flags: --, GRF: 55464989, Urban asphalt road w/ stripes (Electrified)
  30 Tram RAIL, Flags: -l---, Extra Flags: --, GRF: 55464989, Tram track no ballast
  31 Tram RAL0, Flags: -----, Extra Flags: --, GRF: 55464989, Tram track
  32 Tram ERL0, Flags: c----, Extra Flags: --, GRF: 55464989, Tram track (Electrified)
  33 Tram RAL1, Flags: -----, Extra Flags: --, GRF: 55464989, Modern tram track 
  34 Tram ERL1, Flags: c----, Extra Flags: --, GRF: 55464989, Modern tram track (Electrified)
  35 Tram RAL2, Flags: -----, Extra Flags: --, GRF: 55464989, Urban Tram track 
  36 Tram ERL2, Flags: c----, Extra Flags: --, GRF: 55464989, Urban Tram track (Electrified)
  37 Tram RAL3, Flags: -----, Extra Flags: --, GRF: 55464989, Modern Urban Tram track 
  38 Tram ERL3, Flags: c----, Extra Flags: --, GRF: 55464989, Modern Urban Tram track (Electrified)
  39 Tram RAL4, Flags: -----, Extra Flags: --, GRF: 55464989, ISR Tram track 
  40 Tram ERL4, Flags: c----, Extra Flags: --, GRF: 55464989, ISR Tram track (Electrified) 
  GRF: 55464989 = u_ratt-0.2a/uratt.grf
‎] dumprailtypes
  00 RAIL, Flags: --h---, Ctrl Flags: --, GRF: 00000000, Railway
  01 ELRL, Flags: --h---, Ctrl Flags: --, GRF: 00000000, Electrified railway
  02 MONO, Flags: -l-s-d, Ctrl Flags: --, GRF: 00000000, Monorail
  03 MGLV, Flags: -l-s-d, Ctrl Flags: --, GRF: 00000000, Maglev
  04 SAAN, Flags: ---s-d, Ctrl Flags: --, GRF: 55464990, Branch line
  05 SABN, Flags: ---s-d, Ctrl Flags: --, GRF: 55464990, Main line
  06 SABE, Flags: c--s-d, Ctrl Flags: --, GRF: 55464990, Main line (Electrified)
  07 SBBN, Flags: ---s-d, Ctrl Flags: --, GRF: 55464990, Modern main line
  08 SBBE, Flags: c--s-d, Ctrl Flags: --, GRF: 55464990, Modern main line (Electrified)
  09 SCBN, Flags: ---s-d, Ctrl Flags: --, GRF: 55464990, Highspeed line
  10 SCBE, Flags: c--s-d, Ctrl Flags: --, GRF: 55464990, Highspeed line (Electrified)
  11 SDBE, Flags: cl-s-d, Ctrl Flags: --, GRF: 55464990, Modern highspeed line (Electrified)
  12 SEBE, Flags: cl-s-d, Ctrl Flags: --, GRF: 55464990, Very highspeed line (Electrified)
  13 SUBE, Flags: c--s-d, Ctrl Flags: --, GRF: 55464990, Urban main line (Electrified)
  14 SAB3, Flags: ---s-d, Ctrl Flags: --, GRF: 55464990, Metro line (3rd rail powered)
  15 SBB3, Flags: ---s-d, Ctrl Flags: --, GRF: 55464990, Modern metro line (3rd rail powered)
  16 SUB3, Flags: ---s-d, Ctrl Flags: --, GRF: 55464990, Urban metro line (3rd rail powered)
  17 dAAN, Flags: ---s-d, Ctrl Flags: --, GRF: 55464990, Normal + narrow gauge line
  18 NAAN, Flags: ---s-d, Ctrl Flags: --, GRF: 55464990, Narrow gauge line
  19 NAAE, Flags: c--s-d, Ctrl Flags: --, GRF: 55464990, Narrow gauge line (Electrified)
  20 NBAN, Flags: ---s-d, Ctrl Flags: --, GRF: 55464990, Modern narrow gauge line
  21 NBAE, Flags: c--s-d, Ctrl Flags: --, GRF: 55464990, Modern narrow gauge line (Electrified)
  22 NCAN, Flags: ---s-d, Ctrl Flags: --, GRF: 55464990, Highspeed narrow gauge line
  23 NCAE, Flags: c--s-d, Ctrl Flags: --, GRF: 55464990, Highspeed narrow gauge line (Electrified)
  24 NDAE, Flags: c--s-d, Ctrl Flags: --, GRF: 55464990, Modern highspeed narrow gauge line (Electrified)
  25 NUAE, Flags: c--s-d, Ctrl Flags: --, GRF: 55464990, Urban narrow gauge line (Electrified)
  26 NAA3, Flags: ---s-d, Ctrl Flags: --, GRF: 55464990, Narrow gauge line (3rd rail powered)
  27 NBA3, Flags: ---s-d, Ctrl Flags: --, GRF: 55464990, Modern Narrow gauge line (3rd rail powered)
  28 LFTD, Flags: ------, Ctrl Flags: --, GRF: FBFB0A01, Lifted Track
  29 PLAN, Flags: ------, Ctrl Flags: --, GRF: FBFB0A01, Planning Track
  GRF: FBFB0A01 = useless_tracks-0.1.0/uselesstracks.grf
  GRF: 55464990 = u_rermm_2-1c/urermm2.grf

(Anecdotally I've got similar to the above in many other areas as well, as trying to debug things without being able to see what is going on is quite difficult).

@James103
Copy link
Contributor

@James103 James103 commented Jan 9, 2021

When you say "Current master", do you mean the nightly version dated 2021-01-08?

@andythenorth
Copy link
Contributor

@andythenorth andythenorth commented Jan 9, 2021

+1, would have been useful when diagnosing / testing #8466

@Eddi-z
Copy link
Contributor

@Eddi-z Eddi-z commented Jan 9, 2021

the dump commands sound like a great idea, except there should be some explanation for the flags

@Eddi-z
Copy link
Contributor

@Eddi-z Eddi-z commented Jan 9, 2021

to put a little structure in it, i would propose:
grfdump <feature>

JGRennison added a commit to JGRennison/Upstream-OpenTTD that referenced this issue Jan 9, 2021
This currently includes:
* Rail types
* Road/tram types
* Cargoes

See: OpenTTD#8545
JGRennison added a commit to JGRennison/Upstream-OpenTTD that referenced this issue Jan 9, 2021
This currently includes:
* Rail types
* Road/tram types
* Cargoes

See: OpenTTD#8545
JGRennison added a commit to JGRennison/Upstream-OpenTTD that referenced this issue Jan 11, 2021
This currently includes:
* Rail types
* Road/tram types
* Cargo types

See: OpenTTD#8545
@frosch123
Copy link
Member

@frosch123 frosch123 commented Jan 13, 2021

#8548 adds a console command for this.

@frosch123 frosch123 closed this Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.