NotRoadTypes
Moderator: OpenTTD Developers
- stefino_cz
- Transport Coordinator
- Posts: 268
- Joined: 02 Jul 2015 08:05
- Location: Czech Republic
- Contact:
Re: NotRoadTypes
Hi, I wanted to code road vehicle for specific roadtype but vehicle properties like road_type or current_roadtype doesn't work. So how to code vehicle what has to go only on XY label roadtype? Thanks
- stefino_cz
- Transport Coordinator
- Posts: 268
- Joined: 02 Jul 2015 08:05
- Location: Czech Republic
- Contact:
Re: NotRoadTypes
that's trunk OTTD behavior, if a tram track alone crosses a railroad track, then the crossing has a road on it.
Something goes here, hell if I know.
- stefino_cz
- Transport Coordinator
- Posts: 268
- Joined: 02 Jul 2015 08:05
- Location: Czech Republic
- Contact:
Re: NotRoadTypes
Yes, but if I switch off NRT, it works good. When I turn on NRT, it doesn't display tram track on crossing like in the picture above. In the picture below you can see "old" version without NRT.
Re: NotRoadTypes
wallyweb on tt-forums: Screenshots - Wallyweb World - Projects & Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018 - May 2019
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018 - May 2019
- andythenorth
- Tycoon
- Posts: 5658
- Joined: 31 Mar 2007 14:23
- Location: Lost in Music
Re: NotRoadTypes
In super exciting news, the newgrf docs for NRT are now done https://wiki.openttd.org/NewGRF_Specification_Status
NFO is done and GRFCodec should just work (did when I tested).
NML docs are done. If you want to build NML yourself, the source is on Github: https://github.com/openTTD/nml Otherwise it's patience until NML 0.5 to be released, track progress of that here https://github.com/OpenTTD/nml/issues/43
OpenGFX support is in progress https://github.com/OpenTTD/OpenGFX/issues/9
NFO is done and GRFCodec should just work (did when I tested).
NML docs are done. If you want to build NML yourself, the source is on Github: https://github.com/openTTD/nml Otherwise it's patience until NML 0.5 to be released, track progress of that here https://github.com/OpenTTD/nml/issues/43
OpenGFX support is in progress https://github.com/OpenTTD/OpenGFX/issues/9
FIRS Industry Replacement Set (released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (finished)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Re: NotRoadTypes
Why is it that the "catenary_back" in the graphics block of NML doesn't actually draw the catenary under the road vehicle? The rear poles are showing up over the road vehicles. I thought this was implemented specifically to fix the rear catenary being drawn on top of the road vehicle?
I have Asperger's, please be easy on me about stuff. My apologies if I've been a problem for you in the past.
Re: NotRoadTypes
So apparently it was an issue with JGRPP 0.34.3, I'll go to JGR before asking here next time.Gadg8eer wrote: ↑25 May 2020 20:07 Why is it that the "catenary_back" in the graphics block of NML doesn't actually draw the catenary under the road vehicle? The rear poles are showing up over the road vehicles. I thought this was implemented specifically to fix the rear catenary being drawn on top of the road vehicle?
I have Asperger's, please be easy on me about stuff. My apologies if I've been a problem for you in the past.
Re: NotRoadTypes
Hello,
I'm trying to use NRT with a GS, but I don't see dedicated functions.
Right now, "RoadType" is " ROADTYPE_ROAD", "ROADTYPE_TRAM", "ROADTYPE_INVALID".
How could I get the complete list of roads, their max speed and other data if existing (is it for general vehicles, trucks, cities, country, express roads, etc.?) and use them with GSRoad ?
I'm trying to use NRT with a GS, but I don't see dedicated functions.
Right now, "RoadType" is " ROADTYPE_ROAD", "ROADTYPE_TRAM", "ROADTYPE_INVALID".
How could I get the complete list of roads, their max speed and other data if existing (is it for general vehicles, trucks, cities, country, express roads, etc.?) and use them with GSRoad ?
Re: NotRoadTypes
You should be able to just create a GSRoadTypeList to get all the valid type id's, then you can query each of them for properties.
Re: NotRoadTypes
Ok thank you, so the RoadType enum is updated by the NewGRF.
Re: NotRoadTypes
Hello, I still have some problems with this feature.
I'm trying, from the GS, to find the list of the current available road types.
I do this:
But I get all roadtypes, even types that are still not available in game.
In the documentation of GSRoad.IsRoadTypeAvailable(roadType) is said that the current company it taken as context.
But GS doesn't have a company !
So I changed to :
But:
1/ I still get all the road types (?)
2/ In the Init() of my GS it might fail or return invalid roads as company 0 still not exists.
How to get the available roads based on the current game year ?
Also, I can query GetName() and GetMaxSpeed() but I would like also get some other information like presence of stripes, or any extended feature.
Edit: I moved my code from Init() to the main loop (after a Sleep(1)) and the company #0 now exists. It works fine. But I'm still convinced the GS should get a more general IsRoadTypeAvailable() that only check introduction year of the road, without needing to request a company RoadType list
I'm trying, from the GS, to find the list of the current available road types.
I do this:
Code: Select all
local roadTypeList = GSRoadTypeList(GSRoad.ROADTRAMTYPES_ROAD);
roadTypeList.Valuate(function(roadType) { return GSRoad.IsRoadTypeAvailable(roadType) ? 1 : 0; });
roadTypeList.KeepValue(1);
In the documentation of GSRoad.IsRoadTypeAvailable(roadType) is said that the current company it taken as context.
But GS doesn't have a company !
So I changed to :
Code: Select all
local company_zero = GSCompanyMode(0);
local roadTypeList = GSRoadTypeList(GSRoad.ROADTRAMTYPES_ROAD);
roadTypeList.Valuate(function(roadType) { return GSRoad.IsRoadTypeAvailable(roadType) ? 1 : 0; });
roadTypeList.KeepValue(1);
company_zero = null;
1/ I still get all the road types (?)
2/ In the Init() of my GS it might fail or return invalid roads as company 0 still not exists.
How to get the available roads based on the current game year ?
Also, I can query GetName() and GetMaxSpeed() but I would like also get some other information like presence of stripes, or any extended feature.
Edit: I moved my code from Init() to the main loop (after a Sleep(1)) and the company #0 now exists. It works fine. But I'm still convinced the GS should get a more general IsRoadTypeAvailable() that only check introduction year of the road, without needing to request a company RoadType list
Re: NotRoadTypes
BTW, seems that many AI are not compatible with NRT (they throw messages like 'can't build road stop' etc).
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Re: NotRoadTypes
Yeah, I noticed that too. There's no NRT compatibility in any of the AIs.
I have Asperger's, please be easy on me about stuff. My apologies if I've been a problem for you in the past.
Re: NotRoadTypes
Not many AIs have had any active development in the last 9 months, so its not much of a surprise none of them support such a new feature That being said, many of them seem to handle it okay, they just don't know how to use it to their advantage.
Re: NotRoadTypes
I didn't found any AI which can handle it - they just stuck in dead loop, can't build anything.
Any idea how to fix it?
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Re: NotRoadTypes
The issue is that NRT newgrfs remove the default road type. This means the AIs are selecting nonexistent road type and building road precondition fails on not selected road. To fix this, the AIs need to get the list of all road types and chose one of them. As this did not exist at their time, they wont work until updated, which is unlikely.
I think there could be a fallback to a road when the AI tries to select the default one. The problem is which road, because some vehicles cant use some roads. Or the newgrf authors could mark a road as default.
I think there could be a fallback to a road when the AI tries to select the default one. The problem is which road, because some vehicles cant use some roads. Or the newgrf authors could mark a road as default.
Re: NotRoadTypes
Two which I know work for sure are NotPerfectAI and AdmiralAI. I'm not sure what makes them different from the other AIs, but they seem to be quite capable of building road and tram networks.
Obviously they can't actually use different roadtypes, so everything just runs on e.g. dirt roads or whatever, but it works
Not exactly true, most (all?) roadtype sets still define a 'default' road using the ROAD label. The roads which the above AIs build are not using this label however, the AIs just seem to pick whatever's first in the list. The fact that a 10+ year old AI is successful at building roads and tramtracks while almost all others are not, leads me to believe some other assumptions are causing them to fail. But I know nothing about AIs so that's just speculation
Re: NotRoadTypes
I gave it a try and you are correct, the AdmiralAI can build roads using CZTR roads and Timberwolf roads. However when using RattRoads 1.0.2 and U&RaTT 0.2a, the AI fails to build any road, only some discontinuous tram tracks. From what I observed, the road they are using is the one that is selected at the start of the game, but RattRoads and U&RaTT has no road selected. I guess the issue is with your RattRoads set, sorry As I know only about the AI part and nothing about the NewGRF part, I think you will know better what is causing it.Andrew350 wrote: ↑03 Jan 2021 20:44Two which I know work for sure are NotPerfectAI and AdmiralAI. I'm not sure what makes them different from the other AIs, but they seem to be quite capable of building road and tram networks.
Obviously they can't actually use different roadtypes, so everything just runs on e.g. dirt roads or whatever, but it works
Not exactly true, most (all?) roadtype sets still define a 'default' road using the ROAD label. The roads which the above AIs build are not using this label however, the AIs just seem to pick whatever's first in the list. The fact that a 10+ year old AI is successful at building roads and tramtracks while almost all others are not, leads me to believe some other assumptions are causing them to fail. But I know nothing about AIs so that's just speculation
Re: NotRoadTypes
As someone who has (re)coded multiple roadtype newgrfs (using other's graphics), I have to say I don't think it's the fault of the GRF coder any more than it is the fault of NRT, because roadsets from multiple authors are not compatible with AIs. It seems that the game itself, outside of NRT, does not select a default roadtype for AIs to use. That, or using ROADTYPE_FLAG_HIDDEN on the ROAD label like Ufiby seems to have done screws with the AIs.Firrel wrote: ↑04 Jan 2021 09:29I gave it a try and you are correct, the AdmiralAI can build roads using CZTR roads and Timberwolf roads. However when using RattRoads 1.0.2 and U&RaTT 0.2a, the AI fails to build any road, only some discontinuous tram tracks. From what I observed, the road they are using is the one that is selected at the start of the game, but RattRoads and U&RaTT has no road selected. I guess the issue is with your RattRoads set, sorry As I know only about the AI part and nothing about the NewGRF part, I think you will know better what is causing it.Andrew350 wrote: ↑03 Jan 2021 20:44Two which I know work for sure are NotPerfectAI and AdmiralAI. I'm not sure what makes them different from the other AIs, but they seem to be quite capable of building road and tram networks.
Obviously they can't actually use different roadtypes, so everything just runs on e.g. dirt roads or whatever, but it works
Not exactly true, most (all?) roadtype sets still define a 'default' road using the ROAD label. The roads which the above AIs build are not using this label however, the AIs just seem to pick whatever's first in the list. The fact that a 10+ year old AI is successful at building roads and tramtracks while almost all others are not, leads me to believe some other assumptions are causing them to fail. But I know nothing about AIs so that's just speculation
I have Asperger's, please be easy on me about stuff. My apologies if I've been a problem for you in the past.
Who is online
Users browsing this forum: No registered users and 10 guests