[WIP] Road vehicles and level crossings
Moderator: OpenTTD Developers
[WIP] Road vehicles and level crossings
Oki i developed a patch that stops road vehicles in front of a level crossing and not on the rail if they have to wait.
Currently i'm trying to get it working with the overtaking function together, so that not every vehicle is checked twice (first time the overtake function, the other time if it has to stop before a level crossing) and that vehicles continue driving and do not stop befor a crossing, if the vehicle in front of it drives over the crossing rail.
edit1: added diff/patch file
Here are some screenshots
Currently i'm trying to get it working with the overtaking function together, so that not every vehicle is checked twice (first time the overtake function, the other time if it has to stop before a level crossing) and that vehicles continue driving and do not stop befor a crossing, if the vehicle in front of it drives over the crossing rail.
edit1: added diff/patch file
Here are some screenshots
- Attachments
-
- Only a test if it works with road stops, too
- Ilsenmünster Transport, 25th Dec 1950.png (37.5 KiB) Viewed 7816 times
-
- only a quick test if all vehicles are doing their job right, and have a look at the CPU usage (there are 103 vehicles on the screen, if somebody wants to know)
- Freudenberg Transport, 20th May 1952.png (64.96 KiB) Viewed 7817 times
-
- rv_crossings_1.diff
- (5.04 KiB) Downloaded 318 times
Last edited by gigajum on 03 Sep 2006 15:54, edited 2 times in total.
I don't get it... what exactly does this patch change?
Creator of the Openttd Challenge Spinoff, Town Demand patch
After action reports: The path to riches, A dream of skyscrapers
After action reports: The path to riches, A dream of skyscrapers
-
- Tycoon
- Posts: 11501
- Joined: 20 Sep 2004 22:45
so its impossible to kill other players vehicles, right?
but will it be possible that a vehicle breaks down while exiting the level crossing and another vehicle closing up to it by going on the level crossing to get killed probably?
btw:
maybe you can check the behavior of trains killing vehicles too - there should be really a chance of derailment if a train crashes a bus/truck - for example 10%
but will it be possible that a vehicle breaks down while exiting the level crossing and another vehicle closing up to it by going on the level crossing to get killed probably?
btw:
maybe you can check the behavior of trains killing vehicles too - there should be really a chance of derailment if a train crashes a bus/truck - for example 10%
No, it is still possible to kill road vehicles. If they break down over the rail or if the can't drive fast enough over the crossing / train is fast enough.suit wrote:so its impossible to kill other players vehicles, right?
but will it be possible that a vehicle breaks down while exiting the level crossing and another vehicle closing up to it by going on the level crossing to get killed probably?
btw:
maybe you can check the behavior of trains killing vehicles too - there should be really a chance of derailment if a train crashes a bus/truck - for example 10%
Yeah great idea, but that should be a bit more realistic. 10% is a fix value, maybe calculate it is better. Ok i do not have an idea what formula to use there, but a train with 20+ coal or iron waagons will in all probability not derail, because it is too heavy. But a Small train with 5 passenger waggons will react different as a freight train (imo)
I'll add one it if i find some free time todayBjarni wrote:good idea. A diff would be nice, then people can give constructive feedback and also bugreports.
tip: add numbers to your diffs, so the first one is named _1.diff and so on. This is good if/when you update. People will be able to figure out if they are looking at the newest version
oh I see now, it checks if there is a train in the signal block, not just the crossing tile, right? great, this was needed for a long time.
the other thing that occurs is that if you have a double track, the road vehicles will drive across the first crossing, then stop at the second because of a train and then get hit by a train on the first track while waiting. Is that fixable?
the other thing that occurs is that if you have a double track, the road vehicles will drive across the first crossing, then stop at the second because of a train and then get hit by a train on the first track while waiting. Is that fixable?
Creator of the Openttd Challenge Spinoff, Town Demand patch
After action reports: The path to riches, A dream of skyscrapers
After action reports: The path to riches, A dream of skyscrapers
No, it has nothing to do with the trains. It simply stops road vehicles from queueing on the actual track square, and therefore getting cleaned up by trains while waiting for the road to clear. Wont do anything for moving or broken down ones. Still a nice patch though; every little bit helps.oh I see now, it checks if there is a train in the signal block, not just the crossing tile, right?
-
- Tycoon
- Posts: 11501
- Joined: 20 Sep 2004 22:45
good point - there is a rule, that a driver is only allowed to enter a crossing or level crossing if its possible to leave it before it gets redddream wrote:In real life most of collisions of trucks with trains have been caused by breakdown of truck, not because truck had to stay on crossing because there were cars standing in the way preventing truck from leaving it.
most people ignore this rule and place their cars right on the level crossing to get hit by car
maybe truck-drivers in ottd are smart enough dont do that
but crashes and desasters are part of the game and make it more challenging
but there should be a factor like "human fault" - a truck driver can simply nap a bit and/or ignore the traffic light at the level crossing (for example with 5% chance) if a train comes through right at this moment they will crash (allmost impossible in early game, but very likely in later game with lots of trains and vehicles)
---
according to my upper post: there should be a chance of derailment for the train - 10% als fixed value is bad
but the calculation based on weight suggested by gigajum is good
a small and light loco can easier derail than a heavy train - a fast train can also easier derail then a slow one
for calculating the chance of derailment following factors should be important
- weight of the road vehicle (empty = derailment is unlikely)
- speed of the train (slow = unlikely)
- weight of the train (heavy = unlikely)
- length of the train (short = unlikely) <- not sure about that
It has more to do with the weigth of a train. Sure if you have a train which is a half kilometre long it wont derail complete. But a short one will derail completely. But there is one problem: What to do with the remaining not derailed waggons? In normal life you can send a new lok, but in openttd that is not possible. So i have to code that the complete train gets destroyed?suit wrote:- length of the train (short = unlikely) <- not sure about that
The problem is that only trains have a declaration of weight. So i only can calculate the weigth of their cargo and not of the whole vehicle. I'm glad, if anyone is able to figure out what's the weight of each road vehicle used in the game.suit wrote:- weight of the road vehicle (empty = derailment is unlikely)
Please note: That feature will become an extra patch, because it has more to do with the disasters and it need no code from this patch.
Who is online
Users browsing this forum: Semrush [Bot] and 18 guests