Hey guys,
Recently we had a community "Race to the Edge" event organized by JD Plays. The idea was to get to the edge of a ribbon 1000 tiles high world with some extreme modded biter settings. The edge is 1 mil tiles away. This event took us 25 days and 500+ hours for the whole community to get there.
This race was a perfect candidate for recursive blueprints mod. So, I decided to give it a try.
Challenges of the original playthrough:
- kill all biters to reduce the number of active chunks and ups usage
- refueling stations. 3x nuclear fuel in a loco can get it to 500k max
- file size and memory limitations. need to regularly remove all ore and trees from the map
- travel times. every 100k tiles increase the travel time by 20 minutes in each direction. roundtrip to 1mil is about 7 hours long.
Goal of the project:
Automate getting to the edge of the map with recursive blueprints mod.
To deal with the challenges from the above, especially the ups related ones, 2 extra goals were added:
- automate the killing of every single biter on the map
- make it a small gliding front unit that self deconstructs while moving further, leaving only rail track with big power poles behind.
What was done
To kill every single biter artillery was not enough. Arty is doing well when destroying biter bases, but leaves lots of homeless biters behind. It was decided to build a wall of lasers of the map height. And to implement gliding, while building a next section of the wall with 30 tiles offset, remove the rear one.
High level algorithm is following:
1. wait for all the conditions for new iteration, including materials delivery
2. remove rear section of the wall
3. build a front section of the wall
4. repeat 2-4 for N times
5. build a new machine and station closer to the front
6. send the parked train away
7. remove current machine and station
The above algorithm involved switching between different construction and deconstruction orders based on some conditions, which was beyond any implementations that I found in community archives for recursive bps mod.
So I had to build some “Turing machine” algorithmic framework that would let me:
- have some global “memory”. constants and variables
- implement step logic with custom output per step to either send commands to recursive bps mod or modify global variables
- each step has its own advancement conditions (enough materials, less than 100 bots in the air etc.)
- ability to create loops. like iterate steps 2-4 for N times.
- step timer. for time based conditions
- stop/reset button for debugging
When framework was done, implementing the algorithm was a question of time.
The result
After fixing all the bugs (it’s an algorithm, it has bugs) until about 200k tiles, I managed to let it run flawlessly until 560k. Since it’s stable, and since the map gets more memory intensive and ups gets lower, I see no point in pushing further towards the edge.
It took 167 hours to get to 560k, so it will be about 300 hours total to get to 1mil. Out community effort took 500+ hours.
A test save file (https://drive.google.com/file/d/10mywNXJDFcZf4PWDzLnmv1rPyJilrXf_/view?usp=sharing).
To let it start, just turn on the white constant combinator. I’m not sharing the 560k one, since it will not work without custom mods from our community map.
JD was kind enough to record his video review of the attempt. https://youtu.be/s7RWq5fHiDk
I’ve recorded a quick video showcasing how it works. Sorry for my editing skills, it’s my first time with video editing. https://www.youtube.com/watch?v=B4GMNaC_5lY
JD’s community discord: https://discord.gg/xZTdJP. I’m active there.
Reddit post with the discussion around: https://www.reddit.com/r/factorio/comments/9wot7d/gliding_wall_of_lasers_race_to_the_edge_with/
Thanks for reading and let me know if any questions.