Page 5 of 5

Re: Friday Facts #113 - Better rail building

Posted: Thu Mar 17, 2016 7:10 am
by Trev_lite
I thought that the great things about the A* algorithm is that the first solution it finds is optimal (given that some constraints on the heuristic it uses). The only reason that A* search will find a curved path before a curved path that is just as good is if the curves are tied in cost of rails (assuming that the rails used is the cost function). One way to make it prefer straight paths is to set the cost for curves used in the A* heuristic to be infinitesimally greater (1 millionth might work) than the plain cost in rails. The devs have probably all ready thought of everything I am saying but I would like more details on the rail A* algorithm to satisfy my curiosity.

Re: Friday Facts #113 - Better rail building

Posted: Thu Mar 17, 2016 11:18 am
by ratchetfreak
Trev_lite wrote:I thought that the great things about the A* algorithm is that the first solution it finds is optimal (given that some constraints on the heuristic it uses). The only reason that A* search will find a curved path before a curved path that is just as good is if the curves are tied in cost of rails (assuming that the rails used is the cost function). One way to make it prefer straight paths is to set the cost for curves used in the A* heuristic to be infinitesimally greater (1 millionth might work) than the plain cost in rails. The devs have probably all ready thought of everything I am saying but I would like more details on the rail A* algorithm to satisfy my curiosity.
Actually the curve cost would need to be larger by a decent factor, 4 curves can span the length of 12 straight pieces (if I got the math right) so curves need to be at least 3 times as expensive. Then you can add a small offset to make the algorithm prefer the straights

Re: Friday Facts #113 - Better rail building

Posted: Fri Apr 15, 2016 3:07 pm
by slindenau
Please don't remove the option to manually place curved rails entirely...i can already see myself fighting against the algorithm that is not doing what i want it to do.

Make it a config option or something, power users will want to manually place curved rails in some cases.

Re: Friday Facts #113 - Better rail building

Posted: Fri Apr 15, 2016 3:36 pm
by Klonan
slindenau wrote:Please don't remove the option to manually place curved rails entirely...i can already see myself fighting against the algorithm that is not doing what i want it to do.

Make it a config option or something, power users will want to manually place curved rails in some cases.
I don't see any cases where this will happen,
The system is very robust, and... well you will see ;)

Re: Friday Facts #113 - Better rail building

Posted: Fri Apr 15, 2016 9:02 pm
by CodAv
Just a small fact which left me wondering: in the FFF you state that the algorithm takes a lot of iterations for long and complicated paths, which don't really fit inside a single 1/60s game tick. As Factorio already supports multithreading, wouldn't it make sense to calculate the path fully asynchronous instead of a few steps per tick and update the interface in the next frame after the calculation has finished? Even if it takes a few ticks, the probability that anything changes in the given area which could possibly obstruct the rails is quite low. Since Factorio seemingly already creates a (fixed, small) thread pool, there is no real overhead for creating and joining the worker thread.

Re: Friday Facts #113 - Better rail building

Posted: Sat Apr 16, 2016 12:04 pm
by slindenau
Klonan wrote:
slindenau wrote:Please don't remove the option to manually place curved rails entirely...i can already see myself fighting against the algorithm that is not doing what i want it to do.

Make it a config option or something, power users will want to manually place curved rails in some cases.
I don't see any cases where this will happen,
The system is very robust, and... well you will see ;)
I trust your skills, i won't judge this change until i've actually played with it in 0.13.
If i find any problems, i'll let you guys know :).

Re: Friday Facts #113 - Better rail building

Posted: Thu Jun 02, 2016 6:06 pm
by AlexTheNotsogreat
How would you build the rails without robots?

Edit: guess I missed this!
kovarex wrote:The work I'v shown there was mainly WIP.
I will make some note about it in the next FFF when the feature is finished completely.

There are basically two modes:
  • Manual mode (normal build), the planner length is limited to small rail distance (around 20), and it builds rails directly from the inventory. In this mode, the closest point to the cursor is used. No collisions are checked in this mode, so you don't build strange paths because of the one tree that was in the way. It is intended to be used to build small paths segments, while the overall plan of the path is planned by the player.
  • Ghost mode (shift build the same as when building ghosts), the planner length is (almost) unlimited, it builds rail ghosts. It searches path to the exact point specified by cursor. It also allows to user to specify exact ending rotation if he wants to. It checks for collisions and it is intended to be used to build longer paths.
Thanks for the notes about the double rail. Building double rail is very common thing, so I will probably try to find a way to make even double rail building possible.

Re: Friday Facts #113 - Better rail building

Posted: Thu Jun 02, 2016 6:13 pm
by brunzenstein
AlexTheNotsogreat wrote:How would you build the rails without robots?

Edit: guess I missed this!
kovarex wrote:The work I'v shown there was mainly WIP.
I will make some note about it in the next FFF when the feature is finished completely.

There are basically two modes:
  • Manual mode (normal build), the planner length is limited to small rail distance (around 20), and it builds rails directly from the inventory. In this mode, the closest point to the cursor is used. No collisions are checked in this mode, so you don't build strange paths because of the one tree that was in the way. It is intended to be used to build small paths segments, while the overall plan of the path is planned by the player.
  • Ghost mode (shift build the same as when building ghosts), the planner length is (almost) unlimited, it builds rail ghosts. It searches path to the exact point specified by cursor. It also allows to user to specify exact ending rotation if he wants to. It checks for collisions and it is intended to be used to build longer paths.
Thanks for the notes about the double rail. Building double rail is very common thing, so I will probably try to find a way to make even double rail building possible.
Isn't Ghost mode for robot build tracks only?

Re: Friday Facts #113 - Better rail building

Posted: Thu Jun 02, 2016 6:40 pm
by searker
brunzenstein wrote:
AlexTheNotsogreat wrote:How would you build the rails without robots?

Edit: guess I missed this!
kovarex wrote:The work I'v shown there was mainly WIP.
I will make some note about it in the next FFF when the feature is finished completely.

There are basically two modes:
  • Manual mode (normal build), the planner length is limited to small rail distance (around 20), and it builds rails directly from the inventory. In this mode, the closest point to the cursor is used. No collisions are checked in this mode, so you don't build strange paths because of the one tree that was in the way. It is intended to be used to build small paths segments, while the overall plan of the path is planned by the player.
  • Ghost mode (shift build the same as when building ghosts), the planner length is (almost) unlimited, it builds rail ghosts. It searches path to the exact point specified by cursor. It also allows to user to specify exact ending rotation if he wants to. It checks for collisions and it is intended to be used to build longer paths.
Thanks for the notes about the double rail. Building double rail is very common thing, so I will probably try to find a way to make even double rail building possible.
Isn't Ghost mode for robot build tracks only?
Thats what it sounds like.
I guess you could use the Ghost mode to plan a length of track (like using a blueprint without robots) and then use the Manual mode to build it in smaller segments.

Re: Friday Facts #113 - Better rail building

Posted: Thu Jun 02, 2016 6:44 pm
by brunzenstein
searker wrote:
brunzenstein wrote:
AlexTheNotsogreat wrote:How would you build the rails without robots?

Edit: guess I missed this!
kovarex wrote:The work I'v shown there was mainly WIP.
I will make some note about it in the next FFF when the feature is finished completely.

There are basically two modes:
  • Manual mode (normal build), the planner length is limited to small rail distance (around 20), and it builds rails directly from the inventory. In this mode, the closest point to the cursor is used. No collisions are checked in this mode, so you don't build strange paths because of the one tree that was in the way. It is intended to be used to build small paths segments, while the overall plan of the path is planned by the player.
  • Ghost mode (shift build the same as when building ghosts), the planner length is (almost) unlimited, it builds rail ghosts. It searches path to the exact point specified by cursor. It also allows to user to specify exact ending rotation if he wants to. It checks for collisions and it is intended to be used to build longer paths.
Thanks for the notes about the double rail. Building double rail is very common thing, so I will probably try to find a way to make even double rail building possible.
Isn't Ghost mode for robot build tracks only?
Thats what it sounds like.
I guess you could use the Ghost mode to plan a length of track (like using a blueprint without robots) and then use the Manual mode to build it in smaller segments.
Not so easy as the Ghost print vanishes after a few minutes - but...
soon we know...

Re: Friday Facts #113 - Better rail building

Posted: Thu Jun 02, 2016 6:53 pm
by Ojelle
brunzenstein wrote:
searker wrote:
brunzenstein wrote:
AlexTheNotsogreat wrote:How would you build the rails without robots?



Thats what it sounds like.
I guess you could use the Ghost mode to plan a length of track (like using a blueprint without robots) and then use the Manual mode to build it in smaller segments.
Not so easy as the Ghost print vanishes after a few minutes - but...
soon we know...

I can build a lot of track in 5Min!

Re: Friday Facts #113 - Better rail building

Posted: Wed Jun 29, 2016 4:36 pm
by Maja153
How do you use it?

Re: Friday Facts #113 - Better rail building

Posted: Wed Jun 29, 2016 4:38 pm
by Klonan
Maja153 wrote:How do you use it?
Check the entry on it here:
http://guide.factorio.com/new-features-013.html

Re: Friday Facts #113 - Better rail building

Posted: Wed Jun 29, 2016 4:53 pm
by Zeblote
Klonan wrote:
Maja153 wrote:How do you use it?
Check the entry on it here:
http://guide.factorio.com/new-features-013.html
That's great :D

However... can you remove or reduce this huge header?

Image

Or maybe make it not static on the page?

Re: Friday Facts #113 - Better rail building

Posted: Wed Jun 29, 2016 5:30 pm
by Drury
Zeblote wrote:However... can you remove or reduce this huge header?

Image

Or maybe make it not static on the page?
Yeah this is taking up a solid half of my screen.

Re: Friday Facts #113 - Better rail building

Posted: Wed Jun 29, 2016 7:00 pm
by Mion
Zeblote wrote: However... can you remove or reduce this huge header?

Image

Or maybe make it not static on the page?
Bump it up :D

Re: Friday Facts #113 - Better rail building

Posted: Fri Jul 01, 2016 6:43 am
by taylorwilson
i like it :)