Create ghosts for destroyed trains
Moderator: ickputzdirwech
Create ghosts for destroyed trains
Hello all
I hope its the right topic and my idea isnt so old. I searched for it but didnt find anything
1. Set a train as a blueprint to replace destroyed trains on the map. But also there is fuel added in the bp. So i can start the train again from far away.
Thx for reading
I hope its the right topic and my idea isnt so old. I searched for it but didnt find anything
1. Set a train as a blueprint to replace destroyed trains on the map. But also there is fuel added in the bp. So i can start the train again from far away.
Thx for reading
Last edited by ickputzdirwech on Fri May 07, 2021 9:06 am, edited 1 time in total.
Reason: changed title
Reason: changed title
- ickputzdirwech
- Filter Inserter
- Posts: 794
- Joined: Sun May 07, 2017 10:16 am
- Contact:
Re: Create ghosts for destroyed trains
[ick] Changed title to make clear what this suggestion is about.
In general I like this idea. I see some problems however. Right now when a part of a train gets destroyed, it is set to manual mode and continues rolling. If you wanted to replace the destroyed rolling stock with a ghost the train would therefore either have to make a full stop, or the ghost would have to move with the train. If a rolling stock in the middle of the train gets destroyed things get really complicated.
Even if the problem described above would be solved it wouldn't really have a huge benefit if you still have to manually set the train to automatic again.
In general I like this idea. I see some problems however. Right now when a part of a train gets destroyed, it is set to manual mode and continues rolling. If you wanted to replace the destroyed rolling stock with a ghost the train would therefore either have to make a full stop, or the ghost would have to move with the train. If a rolling stock in the middle of the train gets destroyed things get really complicated.
Even if the problem described above would be solved it wouldn't really have a huge benefit if you still have to manually set the train to automatic again.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Re: Create ghosts for destroyed trains
Unfortunately i see too many obstacles to reasonably implement this. One is mentioned above: when one stock is destroyed, remainder of train is still moving. What if a train with 3 rolling stocks would have its middle stock destroyed? should the ghost stay where it was destroyed, should is snap to first stock, should it snap to third stock, or should it keep first and third stock at a constant distance making those outer stocks to still be part of a single train. First 3 solutions are not working and third is outside of any reasonable implementation.
- ickputzdirwech
- Filter Inserter
- Posts: 794
- Joined: Sun May 07, 2017 10:16 am
- Contact:
Re: Create ghosts for destroyed trains
[ick] Moved to Outdated/Not implemented then.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Re: Create ghosts for destroyed trains
Dude, take your finger off that mod button and let people talk about things before you go sorting every thread into oblivion.
Re: Create ghosts for destroyed trains
Kinda agree. Although boskid didn't see any realistic chance, maybe somebody has a genius idea to this...
IMO It feels a bit fast, to have a chance to wrap my head around the topic..
- ickputzdirwech
- Filter Inserter
- Posts: 794
- Joined: Sun May 07, 2017 10:16 am
- Contact:
Re: Create ghosts for destroyed trains
As far as I am concerned you are still free to discuss the idea. Moving it to Outdated/Not implemented doesn't mean you have to forget about it. And in case you do come up with a good solution, feel free to make new suggestion. Boskids answer was quite clear. Topics got moved because of less clear answers from the devs in the past.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Re: Create ghosts for destroyed trains
"free to discuss the idea"ickputzdirwech wrote: ↑Fri May 07, 2021 12:54 pm As far as I am concerned you are still free to discuss the idea. Moving it to Outdated/Not implemented doesn't mean you have to forget about it. And in case you do come up with a good solution, feel free to make new suggestion. Boskids answer was quite clear. Topics got moved because of less clear answers from the devs in the past.
The sign is a bit different, and I guess it will scare off some people to contribute, I fear. It's not like a bug, which has to be squished asap.
Other than that, I'm happy that you are helping getting order in the ideas & suggestions hell
- eradicator
- Smart Inserter
- Posts: 5210
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Create ghosts for destroyed trains
But usually that takes weeks, not 20 minutes - unless the answering dev did it themselfs. Just because a devs initial reaction is negative that doesn't mean that a healthy discussion is useless.ickputzdirwech wrote: ↑Fri May 07, 2021 12:54 pm Topics got moved because of less clear answers from the devs in the past.
Like a true ghost train it should just continue driving around even when all locos and wagons have been destroyed .
I just tried in-game: Both parts of the cut-in-half train keep moving. Ghosts are stationary and snap onto the nearest train when they're built - regardless of what train they were originally planned for. So before even deciding which part of the train to attach the ghosts to the ghosts would need to be made movable in the first place.
Other than that the only usability-wise reasonable solution I can think of would be a "restore train" button in the trains gui, but technically that would require each carriage to store the state of the full train, which I doubt will happen.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
- ickputzdirwech
- Filter Inserter
- Posts: 794
- Joined: Sun May 07, 2017 10:16 am
- Contact:
Re: Create ghosts for destroyed trains
I had a lot of fun implementing this as a mod: Automatic train repair
This is what it does:
If any locomotive or wagon is destroyed the train it belongs to is brought to an immediate halt and a ghost is created. This ghost contains by default requests for all fuel and equipment that was inside the destroyed rolling stock. Inventory filters and limits are saved and restored as well. As soon as the train is complete again it will be set to automatic mode, if it was in that mode originally.
Alternative solution
I might work on an alternative solution where destroyed rolling stock is replaced with some kind of placeholder wagon. The train would then be forced to go to a specific station next, where it can be repaired. This is required so that trains don't get stuck all over the place, because some schedule conditions are impossible to fulfil with one less cargo wagon for example. The placeholder wagons also need to be able to move the train, since all locomotives might be destroyed. This brings some potential for exploits. Another big issue might be trains continuously crashing into each other.
This is what it does:
If any locomotive or wagon is destroyed the train it belongs to is brought to an immediate halt and a ghost is created. This ghost contains by default requests for all fuel and equipment that was inside the destroyed rolling stock. Inventory filters and limits are saved and restored as well. As soon as the train is complete again it will be set to automatic mode, if it was in that mode originally.
Alternative solution
I might work on an alternative solution where destroyed rolling stock is replaced with some kind of placeholder wagon. The train would then be forced to go to a specific station next, where it can be repaired. This is required so that trains don't get stuck all over the place, because some schedule conditions are impossible to fulfil with one less cargo wagon for example. The placeholder wagons also need to be able to move the train, since all locomotives might be destroyed. This brings some potential for exploits. Another big issue might be trains continuously crashing into each other.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Re: Create ghosts for destroyed trains
Oh, I would like it, especially when the replacement looked like the reserve tire version of a locomotive. Because I tend to make really big rail networks and they can’t be covered with roboports all over. I would need some hundreds. Too expensive, too much useless power. No, I would like it much better with reserve tires. The train max speed reduces to 10%. Ah, If there is no specific train station, what’s then? Aiming for any station near to it? Could make things make even worse... hm. Difficult.ickputzdirwech wrote: ↑Sat May 15, 2021 4:23 pm ... destroyed rolling stock is replaced with some kind of placeholder wagon. The train would then be forced to go to a specific station next, where it can be repaired. This is required so that trains don't get stuck all over the place, because some schedule conditions are impossible to fulfil with one less cargo wagon for example. The placeholder wagons also need to be able to move the train, since all locomotives might be destroyed. This brings some potential for exploits. Another big issue might be trains continuously crashing into each other.
What potential for exploits?
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Create ghosts for destroyed trains
What would happen if a substitute-stock would get destroyed even further? which fuel a locomotive substitute-stock would take? How would that combine with mods that are script inserting fuel to simulate electric powered trains? Those mods would have to become aware that their locomotive may turn into some substitute-stock with some random parameters, maybe different joint-distance and connection-distance (since they can be modded). Or every rolling stock prototype would have to have a counterpart - exact replica with all parameters the same except of graphics where it is destroyed and made slightly worse, and maybe have operational parameters turned into useless. So a locomotive would have only one fuel slot for a garbage fuel? cargo wagon would have no inventory? cargo wagon, fluid wagon and artillery wagon would have to take a substitute which is not usable. But then where would the cargo wagon inventory filters be stored to be revived when a cargo wagon would be "repaired" ?
What should happen if a train would hit itself and destroy partially? Immedaitely stop because now instead of a cargo wagon there is subsistute-stock which is indestructible? Should it immediately stop and leave a stock ghost? How would that stock ghost become buildable if it would collide with train's front stock which destroyed it?
What should happen if a train would hit itself and destroy partially? Immedaitely stop because now instead of a cargo wagon there is subsistute-stock which is indestructible? Should it immediately stop and leave a stock ghost? How would that stock ghost become buildable if it would collide with train's front stock which destroyed it?
- ickputzdirwech
- Filter Inserter
- Posts: 794
- Joined: Sun May 07, 2017 10:16 am
- Contact:
Re: Create ghosts for destroyed trains
I think the train would just have "no path" and the plyer has to deal with it.
A slow moving train with free fuel. Ideally the player can't use it in any other way than letting it drive to the next repair station.
A lot of problems to solve. That's why I choose the other implementation first. The biggest issue to solve is probably two trains crashing into each other since they always require player interaction.
Storing the info shouldn't be to difficult. I can use register_on_entity_destroyed() and then use the registration_number as an index in a global table.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Re: Create ghosts for destroyed trains
I think the alternate solution is to much.
The already modded solution is very good.
How complicated is it to get rid of the instant breaking thing?
Can we delay the destroying of wagons and Locomotives till the train Stopps?
Suggestion:
Check if destruction event was a head on collision.
If yes Stopp train and destroy what needs to be destroyed.
If no send automated trains in emergency break mode and pop dense smoke on destroyed entities.
Trains in emergency break mode keep their intended direction but break as fast as they can.
When train has stopped destroy what needs to be destroyed and replace wagons etc with ghosts.
If a player driven train has not stopped within 5? seconds destroy wagons and don't place ghosts.
The already modded solution is very good.
How complicated is it to get rid of the instant breaking thing?
Can we delay the destroying of wagons and Locomotives till the train Stopps?
Suggestion:
Check if destruction event was a head on collision.
If yes Stopp train and destroy what needs to be destroyed.
If no send automated trains in emergency break mode and pop dense smoke on destroyed entities.
Trains in emergency break mode keep their intended direction but break as fast as they can.
When train has stopped destroy what needs to be destroyed and replace wagons etc with ghosts.
If a player driven train has not stopped within 5? seconds destroy wagons and don't place ghosts.
- ickputzdirwech
- Filter Inserter
- Posts: 794
- Joined: Sun May 07, 2017 10:16 am
- Contact:
Re: Create ghosts for destroyed trains
For that we need the placeholder wagons. The issue is that if a rolling stock in the middle of the train gets destroyed the two parts can move at different speed (because of their different weight) and if the train was halfway over a split, the two new trains might even move in entirely different directions. Telling the new trains to move the same way at the same speed would be a nightmare (if even possible). Using some kind of placeholder wagon that holds the train together would be by far the easiest option.
As far as I know there is no way to tell a train it should break, except changing it's speed every tick. Just assume the trains have very good emergency breaks which allow them to stop immediately. I think there are even some rare cases in vanilla where this might happen.
I like the idea of some extra smoke
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Re: Create ghosts for destroyed trains
Let me rephrase that:
How many modding interface requests do we need to get that working?
OR
How difficult would that be for a dev to implement in to the base game
I was thinking of using the original wagon as placeholder.
Intercept the destruction event - don't let it happen. Instead pop some smoke to show its gone but make it indistructible until the train has stopped.
- ickputzdirwech
- Filter Inserter
- Posts: 794
- Joined: Sun May 07, 2017 10:16 am
- Contact:
Re: Create ghosts for destroyed trains
I wouldn't mind either of that
I spent some time recreating the smoke a locomotive emits when coming to a full stop so that all rolling stock have this effect. I definitely lack some imagination and art skills to create something more convincing.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write