Why don't large UFO's ever land on the AI's tracks?
Moderator: OpenTTD Developers
Why don't large UFO's ever land on the AI's tracks?
Maybe they do, but I've never seen them do it, since I have the newspaper tell me about disasters, whenever the "UFO lands near Wossname!" article comes up the damn thing has always picked my track to land on even though I generally always play with the AI. Not only that but it always seems to land on the exact same section of track (having rebuilt it the last time). Once, I even completely reshaped the land and moved the entire track into a tunnel thinking it would fly right over the top of it. You know what it did? It changed direction and landed at the mouth of the tunnel!
Couldn't it be made to land on any random bit of track regardless of who owns it? It would probably be a bit much to ask for it to randomly land anywhere since on larger maps it would probably keep landing in the middle of nowhere and I expect some would argue "where's the fun in that".
I know I could just turn disasters off but I like to have a bit of disaster every now and then to give me something to quickly fix or what have you (seeing as most of the other disasters are somewhat benign and involve you just replacing a destroyed vehicle or bit of track/road), however the LUFO's seem to be too predictable and repetitive... Landing on the same bit of my track over and over...
Couldn't it be made to land on any random bit of track regardless of who owns it? It would probably be a bit much to ask for it to randomly land anywhere since on larger maps it would probably keep landing in the middle of nowhere and I expect some would argue "where's the fun in that".
I know I could just turn disasters off but I like to have a bit of disaster every now and then to give me something to quickly fix or what have you (seeing as most of the other disasters are somewhat benign and involve you just replacing a destroyed vehicle or bit of track/road), however the LUFO's seem to be too predictable and repetitive... Landing on the same bit of my track over and over...
Re: Why don't large UFO's ever land on the AI's tracks?
It doesn't land on AIs tracks because the AI can't handle it. About it being predictable, seems you just have bad luck, as the tile chosen is random.
Re: Why don't large UFO's ever land on the AI's tracks?
Well now you have NoAI surely the AI developers could accommodate in their code for the AI to rebuild destroyed track?
And are you sure the code for making it random isn't broken, I really doubt the UFO landing on exactly the same piece of track every single time it spawns is just down to my bad luck.
And are you sure the code for making it random isn't broken, I really doubt the UFO landing on exactly the same piece of track every single time it spawns is just down to my bad luck.
Re: Why don't large UFO's ever land on the AI's tracks?
It's still hard, it probably comes down to storing every piece of track you ever build, so when it's destroyed you can rebuild it.Xandros wrote:Well now you have NoAI surely the AI developers could accommodate in their code for the AI to rebuild destroyed track?
Can you show a savegame where the UFO lands on the same piece of track every time?And are you sure the code for making it random isn't broken, I really doubt the UFO landing on exactly the same piece of track every single time it spawns is just down to my bad luck.
Re: Why don't large UFO's ever land on the AI's tracks?
Well, if it were too difficult to implement it that way you could just make it so AI's know when a vehicle is lost or in negative profit and simply deletes the problem vehicle long with any stations tied to that vehicle assuming any other vehicles also tied to it aren;'t also in negative profit or lost. At least then it doesn't have to save every track location into a reference file.Yexo wrote:It's still hard, it probably comes down to storing every piece of track you ever build, so when it's destroyed you can rebuild it.
I could have done, had I not deleted all the autosaves all and started fresh the other day. I never thought this was a bug I just thought it was by design otherwise I would have kept a save. I'll run another game and post back with it.Can you show a savegame where the UFO lands on the same piece of track every time?
Re: Why don't large UFO's ever land on the AI's tracks?
So if the AI had constructed a small network, and 10 from it's total of 20 trains couldn't find a route anymore, it should just remove half it's trains?Xandros wrote:Well, if it were too difficult to implement it that way you could just make it so AI's know when a vehicle is lost or in negative profit and simply deletes the problem vehicle long with any stations tied to that vehicle assuming any other vehicles also tied to it aren;'t also in negative profit or lost. At least then it doesn't have to save every track location into a reference file.Yexo wrote:It's still hard, it probably comes down to storing every piece of track you ever build, so when it's destroyed you can rebuild it.
Re: Why don't large UFO's ever land on the AI's tracks?
Well, yea, if they go into negative profit for a few years consecutively. Would you leave half your trains running forever more if they were lost and kept procuring negative profits?
Edit: alternatively, if a UFO lands on the AI's tracks when it gets blown up the coordinates of any track/road owned by an AI competitor that was destroyed could be recorded and the AI could then be fed those coords so it could rebuild the lost track/road.
Therefore no need for the AI to memorize every track placement, just the ones that got destroyed by the UFO, or for that matter any other possible disaster that would cause destruction of surround area like mine subsidence. No need for it to go into complex decisions about what to do with negative income vehicles (although to be honest that is something it should still deal with but, that's a topic for the NoAI forum I figure).
Edit: alternatively, if a UFO lands on the AI's tracks when it gets blown up the coordinates of any track/road owned by an AI competitor that was destroyed could be recorded and the AI could then be fed those coords so it could rebuild the lost track/road.
Therefore no need for the AI to memorize every track placement, just the ones that got destroyed by the UFO, or for that matter any other possible disaster that would cause destruction of surround area like mine subsidence. No need for it to go into complex decisions about what to do with negative income vehicles (although to be honest that is something it should still deal with but, that's a topic for the NoAI forum I figure).
Re: Why don't large UFO's ever land on the AI's tracks?
back when i played with disasters (long time ago... something 0.4-ish) i also had the ufos repeatedly land on the same spot... maybe the chosen destination is not as random as you'd like it to be.Yexo wrote:About it being predictable, seems you just have bad luck, as the tile chosen is random.
i don't know how the tile is chosen, but given that only a minority of tiles is rail, there must be some correction going on to weed out "empty" tiles, maybe that one is broken (e.g. if it choses a random tile, and then searches for the "nearest" rail tile, that would very likely hit the same border tile if only a minority of the map is connected.)
Re: Why don't large UFO's ever land on the AI's tracks?
In a lot of my games, I've seen this "feature" - even there was a record UFO has landed at the same place six times in a row...
Also, I've noticed that UFO have some special places/points for it to land and it just choose randomly to land between those points (with repeat) - they are always the same (if the tracks aren't changed)... For example:
UFO1 has choosed point 1 (it is making a long trip to it, by a random (is some way) flying)... During this period UFO2 has choosed point 6... UFO3 has choosed point 4... UFO4 has choosed point 2... UFO5 has choosed point 1... UFO6 has choosed point 7... UFO7 has choosed point 5... UFO8 has choosed point 3... etc. The bigger quantity of lines means the bigger quantity of these points...
P.S. UFOs are more like to land near the station entry/exit, then on the usual track... The UFO landing statistics has told/shown me so...
Also, I've noticed that UFO have some special places/points for it to land and it just choose randomly to land between those points (with repeat) - they are always the same (if the tracks aren't changed)... For example:
UFO1 has choosed point 1 (it is making a long trip to it, by a random (is some way) flying)... During this period UFO2 has choosed point 6... UFO3 has choosed point 4... UFO4 has choosed point 2... UFO5 has choosed point 1... UFO6 has choosed point 7... UFO7 has choosed point 5... UFO8 has choosed point 3... etc. The bigger quantity of lines means the bigger quantity of these points...
P.S. UFOs are more like to land near the station entry/exit, then on the usual track... The UFO landing statistics has told/shown me so...
Life is the moving train on the tracks...
(Transport Tycoon Deluxe for the real)
(Transport Tycoon Deluxe for the real)
Re: Why don't large UFO's ever land on the AI's tracks?
Where are those games? Please upload one (and if possible, indicate those locations with signs).RAMMAR wrote:In a lot of my games, I've seen this "feature" - even there was a record UFO has landed at the same place six times in a row...
Also, I've noticed that UFO have some special places/points for it to land and it just choose randomly to land between those points (with repeat) - they are always the same (if the tracks aren't changed)... For example:
UFO1 has choosed point 1 (it is making a long trip to it, by a random (is some way) flying)... During this period UFO2 has choosed point 6... UFO3 has choosed point 4... UFO4 has choosed point 2... UFO5 has choosed point 1... UFO6 has choosed point 7... UFO7 has choosed point 5... UFO8 has choosed point 3... etc. The bigger quantity of lines means the bigger quantity of these points...
P.S. UFOs are more like to land near the station entry/exit, then on the usual track... The UFO landing statistics has told/shown me so...
Re: Why don't large UFO's ever land on the AI's tracks?
Well, AI can receive events, like "first train arrived in station X" or "Vehicle X is not making profit", perhaps adding "Ufo landed at coordinates X,Y" would be sufficient (AI can then examine the area to remember the tracks there and rebuild them once the UFO explodes)
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Re: Why don't large UFO's ever land on the AI's tracks?
The problem is that AI events are asynchronous, so by the time the AI reads the event the ufo may already have been exploded.Bilbo wrote:Well, AI can receive events, like "first train arrived in station X" or "Vehicle X is not making profit", perhaps adding "Ufo landed at coordinates X,Y" would be sufficient (AI can then examine the area to remember the tracks there and rebuild them once the UFO explodes)
Re: Why don't large UFO's ever land on the AI's tracks?
But there is quite large delay before ufo landing down and ufo actually exploding, so AI have quite a big chance to know about it before it is "too late".
In worst case (AI finds out after ufo explosion) it can at least try to repair by examining surroundings of the explosion and re-connecting the track (would work fine for straight line, could be worse for junction).
Well, the original aim of NoAI is to be fair and have same condition for humans and for AI's - so I think we should be fair with disasters too.
In worst case (AI finds out after ufo explosion) it can at least try to repair by examining surroundings of the explosion and re-connecting the track (would work fine for straight line, could be worse for junction).
Well, the original aim of NoAI is to be fair and have same condition for humans and for AI's - so I think we should be fair with disasters too.
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Re: Why don't large UFO's ever land on the AI's tracks?
It might be a 'large time' for you, but if the AI just started pathfinding it might take a while before it checks the events. So let's consider the worst case:Bilbo wrote:But there is quite large delay before ufo landing down and ufo actually exploding, so AI have quite a big chance to know about it before it is "too late"
Now we are back to were we were originally, it's very hard for the AI to repair the damage (straight lines are doable, junctions are not).In worst case (AI finds out after ufo explosion) it can at least try to repair by examining surroundings of the explosion and re-connecting the track (would work fine for straight line, could be worse for junction).
At this moment the only way to be fair is disable this disaster (so all disasters, since you can't disable them individually).Well, the original aim of NoAI is to be fair and have same condition for humans and for AI's - so I think we should be fair with disasters too.
Of course, if someone can prove me wrong (by writing a squirrel function that repairs the damage after an ufo explosion), I'll be happy to enable this disaster for AIs.
Re: Why don't large UFO's ever land on the AI's tracks?
Correct. The choosen tile is random, but the probability is by far not the same for every tile.Eddi wrote:back when i played with disasters (long time ago... something 0.4-ish) i also had the ufos repeatedly land on the same spot... maybe the chosen destination is not as random as you'd like it to be.Yexo wrote:About it being predictable, seems you just have bad luck, as the tile chosen is random.
i don't know how the tile is chosen, but given that only a minority of tiles is rail, there must be some correction going on to weed out "empty" tiles, maybe that one is broken (e.g. if it choses a random tile, and then searches for the "nearest" rail tile, that would very likely hit the same border tile if only a minority of the map is connected.)
It just picks a random tile and then lineary scans the map for the first railtile. I.e. if you have a 2048x2048 map with only two rail tiles which are next to each other in a NW-SE direction, it will prefer the NW tile above the SE tile with a chance of (2048*2048):1
If someone cares, provide a patch that makes it scan the map non-lineary, maybe like the tileloop.
Btw. I would suggest AIs to build dummy tracks in NW direction of the real track to make ufos prefer to land there

⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
-
- Tycoon
- Posts: 1829
- Joined: 10 Jul 2006 00:43
- Location: Spain
Re: Why don't large UFO's ever land on the AI's tracks?
Some time ago, I discovered that if You open the cheats menu, and manages other company when the UFO is destroyed, your rails will remain untouched, but... this is a cheat. 

Sorry if my english is too poor, I want learn it, but it isn't too easy.
- [list][*]Why use PNG screenshots in 8 bpp games.
[*]Caravan site New Industry. · Spain set. · Some spanish trains for locomotion[*]Favourites:GRVTS · ECS · FIRS
Re: Why don't large UFO's ever land on the AI's tracks?
Could the AI system be changed to use some interrupt mechanism for the events? AI would set which events are so important, that they would be handled as "interrupt" - like Save() is called as interrupt, no matter where the code is currently running - and AI then would be able to quickly react for important events. This could pose some problems (what if the interrupt handler is interrupted by a Save()? ) but could solve the problem nicely - if human is doing some long job (building large route), he can interrupt it and do something else if he receive some news message that requires the attention somewhere else. AI's would be able to do the same (without having to explicitly check events every moment in the pathfinder).Yexo wrote:It might be a 'large time' for you, but if the AI just started pathfinding it might take a while before it checks the events. So let's consider the worst case:Bilbo wrote:But there is quite large delay before ufo landing down and ufo actually exploding, so AI have quite a big chance to know about it before it is "too late"
For AI that remember everything it builds, then it is easy. For AI that does not - you can write function that will guess what was there and try to re-create it, in most cases it could work, but it will never be 100%.Yexo wrote:Of course, if someone can prove me wrong (by writing a squirrel function that repairs the damage after an ufo explosion), I'll be happy to enable this disaster for AIs.
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Re: Why don't large UFO's ever land on the AI's tracks?
The library pathfinders are written in such a way that it's easy for the caller to specify the number of tiles searched before the pathfinder returns. After that you can easily resume pathfinding. By using this, AIs can check their events during pathfinding wihtout too much work. I'm not sure which AIs use this mechanism at the moment, but it certainly is possible.Bilbo wrote:Could the AI system be changed to use some interrupt mechanism for the events? AI would set which events are so important, that they would be handled as "interrupt" - like Save() is called as interrupt, no matter where the code is currently running - and AI then would be able to quickly react for important events. This could pose some problems (what if the interrupt handler is interrupted by a Save()? ) but could solve the problem nicely - if human is doing some long job (building large route), he can interrupt it and do something else if he receive some news message that requires the attention somewhere else. AI's would be able to do the same (without having to explicitly check events every moment in the pathfinder).Yexo wrote:It might be a 'large time' for you, but if the AI just started pathfinding it might take a while before it checks the events. So let's consider the worst case:Bilbo wrote:But there is quite large delay before ufo landing down and ufo actually exploding, so AI have quite a big chance to know about it before it is "too late"
The memory requirements for remembering are way too high. There are already people complaining that the AIs are too slow, let's not make the problem worse by also using a lot of memory.For AI that remember everything it builds, then it is easy. For AI that does not - you can write function that will guess what was there and try to re-create it, in most cases it could work, but it will never be 100%.Yexo wrote:Of course, if someone can prove me wrong (by writing a squirrel function that repairs the damage after an ufo explosion), I'll be happy to enable this disaster for AIs.
Re: Why don't large UFO's ever land on the AI's tracks?
i have thought a little about this, and i have 4 possible solutions, that could provide more uniform distribution.frosch wrote: If someone cares, provide a patch that makes it scan the map non-lineary, maybe like the tileloop.
- Variant 1
chose a rail tile monte-carlo-style (i.e. repeatedly try until you hit one)
problem with this is that this performs worse on practically empty map, so if you limit it to something like 1000 tries, there might not have been found a target, even though one exists - Variant 2
when a UFO appears, scan the whole map for rail tiles, make a list of those tiles, and then randomly choose an index in that list.
problem with that approach is that scanning the whole map may take very long, so this must be broken up into small chunks similar to the tile loop, which might be difficult to implement (values must be stored somewhere, tiles can change before the loop is finished, second UFO may appear, etc.) - Variant 3
in the tile loop, when touching a rail tile, there is a chance to set "make this the next target for a possible UFO"
problem here is that the tile loop is run much more often than UFO generation, so this might create some overhead - Variant 4
choose a station, and then use variant 1 limited to the area around this station. (fixed radius?)
problem with this variant is that rail tiles far away from stations would be "secure"
Re: Why don't large UFO's ever land on the AI's tracks?
Regarding the fixing/repairing of the track, why not just let the AI get away with no damage, because surely enough, when a solution is found, every AI will use it. This would just save the CPU/Memory problems it would otherwise run in to.
formerly known as seandasheep
Who is online
Users browsing this forum: Ahrefs [Bot] and 5 guests