JGR's Patch Pack

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: JGR's Patch Pack

Post by kamnet »

So, after hosting my own server for a day or two, I've got a request for a feature development, if you're up for it.

It would be incredibly helpful if the server admin could have access to the cheat menu in multiplayer, and be able to control what cheat menu features players can have access to.
User avatar
JGR
Tycoon
Tycoon
Posts: 2557
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

kamnet wrote: 01 Apr 2020 15:56 So, after hosting my own server for a day or two, I've got a request for a feature development, if you're up for it.

It would be incredibly helpful if the server admin could have access to the cheat menu in multiplayer, and be able to control what cheat menu features players can have access to.
At the moment the cheat mechanism/GUI isn't multiplayer safe.
Some of the cheats ought to be simple enough to get working in multiplayer. These would probably include: money, magic bulldozer, crossing tunnels, and jet planes crashes.
Production value editing and changing the date would be somewhat problematic.
Changing the max map height wouldn't be a good idea in multiplayer.
The company switch cheat isn't required.

Whether you've used/enabled a cheat is currently a client global rather than associated with a company.

Letting unauthenticated users have access to (for example) the magic bulldozer and the money cheat could create a significant griefing risk.

Which cheats in particular did you have in mind?
Ex TTDPatch Coder
Patch Pack, Github
User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: JGR's Patch Pack

Post by kamnet »

JGR wrote: 01 Apr 2020 16:55 Which cheats in particular did you have in mind?
Money, bulldozer, tunnels and jets. :)

And, really, money is the only one that I would be interested in seeing specifically controlled by the admin account. In the server I've set up, I currently loaded myself up with $11 trillion (maybe billion, I lost count) so I can dole it out to other players as I choose. It would be nice to have an option to either cheat that money just to myself, or let players cheat it to themselves.

The other three would be good to have as features in the game settings that you can configure before you start a new game. It would save me the pain of having to start a single player game, enable the features, save it and then launch the save from multiplayer.
_dp_
Transport Coordinator
Transport Coordinator
Posts: 277
Joined: 18 Dec 2013 12:32

Re: JGR's Patch Pack

Post by _dp_ »

kamnet wrote: 01 Apr 2020 17:55 Money, bulldozer, tunnels and jets. :)
It's possible to use all this even in vanilla. Though money isn't particularly convenient.
User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: JGR's Patch Pack

Post by kamnet »

_dp_ wrote: 01 Apr 2020 21:15
kamnet wrote: 01 Apr 2020 17:55 Money, bulldozer, tunnels and jets. :)
It's possible to use all this even in vanilla. Though money isn't particularly convenient.
As of now (AFAIK) the only way to enable these is to start a single player game, enable it there, save the game and then use the save to start a multiplayer game. You cannot enable or disable them from inside multiplayer.
User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: JGR's Patch Pack

Post by kamnet »

I'm running a server, a player has tried to log in to create a new company twice now, and crashes the server with this:

Assertion failed at line 187 of /home/jgr/openttd/cross-win64/src/tile_map.h. !IsTileType(tile, MP_HOUSE) && !IsTileType(tile, MP_INDUSTRY) tile: 0x 182C1B (3)

I've got a save that's got 255 NewGRFs loaded into it. Let me know if you need it.
Attachments
crash.txt
(70.28 KiB) Downloaded 107 times
User avatar
JGR
Tycoon
Tycoon
Posts: 2557
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

kamnet wrote: 03 Apr 2020 14:30 I'm running a server, a player has tried to log in to create a new company twice now, and crashes the server with this:

Assertion failed at line 187 of /home/jgr/openttd/cross-win64/src/tile_map.h. !IsTileType(tile, MP_HOUSE) && !IsTileType(tile, MP_INDUSTRY) tile: 0x 182C1B (3)

I've got a save that's got 255 NewGRFs loaded into it. Let me know if you need it.
The savegame would be useful, mainly to see what exactly is at/near that tile.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: JGR's Patch Pack

Post by kamnet »

JGR wrote: 03 Apr 2020 16:57
kamnet wrote: 03 Apr 2020 14:30 I'm running a server, a player has tried to log in to create a new company twice now, and crashes the server with this:

Assertion failed at line 187 of /home/jgr/openttd/cross-win64/src/tile_map.h. !IsTileType(tile, MP_HOUSE) && !IsTileType(tile, MP_INDUSTRY) tile: 0x 182C1B (3)

I've got a save that's got 255 NewGRFs loaded into it. Let me know if you need it.
The savegame would be useful, mainly to see what exactly is at/near that tile.
Attachments
crash.sav
(5.7 MiB) Downloaded 49 times
User avatar
2TallTyler
Route Supervisor
Route Supervisor
Posts: 495
Joined: 11 Aug 2019 18:15
Contact:

Re: JGR's Patch Pack

Post by 2TallTyler »

kamnet wrote: 03 Apr 2020 14:30 I'm running a server, a player has tried to log in to create a new company twice now, and crashes the server with this:

Assertion failed at line 187 of /home/jgr/openttd/cross-win64/src/tile_map.h. !IsTileType(tile, MP_HOUSE) && !IsTileType(tile, MP_INDUSTRY) tile: 0x 182C1B (3)

I've got a save that's got 255 NewGRFs loaded into it. Let me know if you need it.
I'm the player who crashed the server both times. It happened when I tried to change my company color from the one randomly assigned to my new company (cream) to a different color (green). The crash seemed to happen when I selected the new color. I had not built anything, just changed my company name and portrait.

There is a slight chance that it could be coincidence, since it was the first thing I did after joining thus it occurred the same short length of my time in the server. But I joined a third time, left the color alone, and did not experience a crash.
User avatar
JGR
Tycoon
Tycoon
Posts: 2557
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

2TallTyler wrote: 03 Apr 2020 19:41
kamnet wrote: 03 Apr 2020 14:30 I'm running a server, a player has tried to log in to create a new company twice now, and crashes the server with this:

Assertion failed at line 187 of /home/jgr/openttd/cross-win64/src/tile_map.h. !IsTileType(tile, MP_HOUSE) && !IsTileType(tile, MP_INDUSTRY) tile: 0x 182C1B (3)

I've got a save that's got 255 NewGRFs loaded into it. Let me know if you need it.
I'm the player who crashed the server both times. It happened when I tried to change my company color from the one randomly assigned to my new company (cream) to a different color (green). The crash seemed to happen when I selected the new color. I had not built anything, just changed my company name and portrait.

There is a slight chance that it could be coincidence, since it was the first thing I did after joining thus it occurred the same short length of my time in the server. But I joined a third time, left the color alone, and did not experience a crash.
The crash log is clear that it's definitely caused by the colour change operation.
The crash occurs when trying to recolour all of the NewGRF Objects that the company owns.
It appears that there's a NewGRF Object registered to a tile which actually has a house (small square) on it.
The tile is 0x182C1B, near the "Bird Sanctuary".
It's not clear how it ended up like that. I'll do some digging.

In the meantime, I'd suggest not doing any company colour scheme changes.

Edit: I've added a workaround, which will be in the next release.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: JGR's Patch Pack

Post by kamnet »

Same game as above, I'm getting desync errors and logs generated now. Here's a few.
Attachments
desync-server-20200405T082139Z.zip
(6.89 MiB) Downloaded 63 times
desync-server-20200405T090232Z.zip
(6.77 MiB) Downloaded 31 times
desync-server-20200405T095209Z.zip
(6.93 MiB) Downloaded 24 times
User avatar
JGR
Tycoon
Tycoon
Posts: 2557
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

kamnet wrote: 05 Apr 2020 10:07 Same game as above, I'm getting desync errors and logs generated now. Here's a few.
"Kurokawa Denki Electric Tram and Trailer" from "Mop Generic NRT Vehicles 0.6.5" seems to be doing something to trigger desyncs, I'll investigate.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
JGR
Tycoon
Tycoon
Posts: 2557
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

JGR wrote: 05 Apr 2020 10:27
kamnet wrote: 05 Apr 2020 10:07 Same game as above, I'm getting desync errors and logs generated now. Here's a few.
"Kurokawa Denki Electric Tram and Trailer" from "Mop Generic NRT Vehicles 0.6.5" seems to be doing something to trigger desyncs, I'll investigate.
This GRF is definitely implemented incorrectly.
It changes the value of the custom cargo ageing period (RV property 22 via callback 36) depending on how full the vehicle is (vehicle variables BA and BC).
I haven't found anything in the spec which explicitly states that this is not allowed, but it is not a good idea and will cause desyncs in this patchpack and in trunk.

I could detect and smooth over this particular case, but I'm a bit reluctant to start accumulating hacky workarounds for individual faulty NewGRFs. That would be creating a never-ending stream of work for myself.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: JGR's Patch Pack

Post by kamnet »

JGR wrote: 06 Apr 2020 18:55 I could detect and smooth over this particular case, but I'm a bit reluctant to start accumulating hacky workarounds for individual faulty NewGRFs. That would be creating a never-ending stream of work for myself.
Agreed, it's easier to just not use a faulty NewGRF and expect the author to fix it.
Olympus593
Engineer
Engineer
Posts: 9
Joined: 07 Apr 2020 17:55

Re: JGR's Patch Pack

Post by Olympus593 »

I need some help. I've compiled a dedicated server only binary on Ubuntu server 18.04LTS. However when i run

Code: Select all

openttd -D
The debug console stops at

Code: Select all

dbg: [net] Map generated, starting game
No IP address is shown after that. Do I have to manually assign an IP?
User avatar
JGR
Tycoon
Tycoon
Posts: 2557
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

Olympus593 wrote: 07 Apr 2020 18:00 I need some help. I've compiled a dedicated server only binary on Ubuntu server 18.04LTS. However when i run

Code: Select all

openttd -D
The debug console stops at

Code: Select all

dbg: [net] Map generated, starting game
No IP address is shown after that. Do I have to manually assign an IP?
No, the IP address is that of your machine. OpenTTD listens on all interfaces.
Try `ifconfig`.
Ex TTDPatch Coder
Patch Pack, Github
Olympus593
Engineer
Engineer
Posts: 9
Joined: 07 Apr 2020 17:55

Re: JGR's Patch Pack

Post by Olympus593 »

JGR wrote: 07 Apr 2020 18:17
Olympus593 wrote: 07 Apr 2020 18:00 I need some help. I've compiled a dedicated server only binary on Ubuntu server 18.04LTS. However when i run

Code: Select all

openttd -D
The debug console stops at

Code: Select all

dbg: [net] Map generated, starting game
No IP address is shown after that. Do I have to manually assign an IP?
No, the IP address is that of your machine. OpenTTD listens on all interfaces.
Try `ifconfig`.
Well I can thank my dumb ass for not recognizing my error. Thanks guess my server was running perfectly.
User avatar
ColdIce
Transport Coordinator
Transport Coordinator
Posts: 306
Joined: 25 Apr 2006 10:22
Location: Bucharest

Re: JGR's Patch Pack

Post by ColdIce »

Hy JGR,

Thank you for your effort in this patchpack. I will, again, raise the feature of drag & drop objects. Now that we have various new objects and big maps, it's very time consuming (and discouraging to continue with the game*) to create highways, big fields etc with the actual system click-by-click. I know the restriction is to protect the multiplayer game from abuses and maybe there can be a setting to enable/disable this feature.

*graphics artists change or improve their grf files and when you update the grf files, if something is changed, you must start all over again to delete and place newobjects. Take Auz* development for example. It will be much easier for us to replace newobjects with a drag and drop option.

Thank you again for this patchpack. It's a gift to all of us who use it.
The rest is confetti!
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: JGR's Patch Pack

Post by wallyweb »

ColdIce wrote: 08 Apr 2020 09:21 I will, again, raise the feature of drag & drop objects.
Back in 2010 when rubidium added the newobjects specification to OTTD there was considerable discussion around dragging and dropping.
One question was how to implement it (e.g. stations vs industries).
Unfortunately the property was never added.
I echo ColdIce's request.
A simple Action 0 property setting (default=off ?) could determine whether an object should be draggable.
stb
Engineer
Engineer
Posts: 40
Joined: 20 Sep 2013 20:26

Re: JGR's Patch Pack

Post by stb »

Hi there,

I got a couple of crashes with the last version. The previous ones were much stable.
Here's log (zipped):
Attachments
crash.zip
(272.07 KiB) Downloaded 50 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 12 guests