Wood

Some mods, made by Bob. Basically streaks every Factroio-area.

Moderator: bobingabout

Post Reply
Morlow
Inserter
Inserter
Posts: 23
Joined: Wed Dec 23, 2015 9:10 am
Contact:

Wood

Post by Morlow »

Hi guys, I just started playing Bob's mods and I was wondering about the long-term viability of hand-chopping all the wood my factory needs. Is there a tech later that allows you to create wood or farm it or something? I haven't found anything yet and I think my factory will definitely use wood faster than I can chop it down the road.

Supercheese
Filter Inserter
Filter Inserter
Posts: 841
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: Wood

Post by Supercheese »

You can make synthetic wood from heavy oil once you get to oil processing techs.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Wood

Post by bobingabout »

I'm out of tune with my own mod, it's been so long >.<

Anyway, yes, you can make synthetic wood from heavy oil. I think it comes under Plastics research.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
Buggi
Fast Inserter
Fast Inserter
Posts: 100
Joined: Wed May 27, 2015 6:23 am
Contact:

Re: Wood

Post by Buggi »

I updated Treefarm Lite to work with 12.20.

You can find it here:
https://forums.factorio.com/forum/viewtop ... 20&t=18870
- Buggi -
Here's my Humble YouTube channel: https://www.youtube.com/c/FlexibleGames

SpeedDaemon
Fast Inserter
Fast Inserter
Posts: 124
Joined: Fri May 22, 2015 3:31 pm
Contact:

Re: Wood

Post by SpeedDaemon »

I also wrote a very simple greenhouse mod to produce wood.

It's not as pretty as Tree Farm, but far less laggy if you're going big.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Wood

Post by bobingabout »

SpeedDaemon wrote:I also wrote a very simple greenhouse mod to produce wood.

It's not as pretty as Tree Farm, but far less laggy if you're going big.
I think I was going to take a similar approach for wood manufacture in my mod. well, actually I had a couple of options, for example crafting seedlings from wood, then wood from seedlings with a net gain, but the end result is wood from nothing.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

roy7
Filter Inserter
Filter Inserter
Posts: 337
Joined: Fri Dec 12, 2014 4:24 pm
Contact:

Re: Wood

Post by roy7 »

Buggi is researching ways to speed Treefarm up, note if you make lots of them it will lag your game. Greenhouse works like a normal factory and so has no major performance concerns.

User avatar
Buggi
Fast Inserter
Fast Inserter
Posts: 100
Joined: Wed May 27, 2015 6:23 am
Contact:

Re: Wood

Post by Buggi »

Yeah, I really dug through the treefarm code and there is very little that can be done to optimize the backend.

The fact it has to scan the farm to check for trees that need to grow, plant seeds, or harvest is kind of intensive.

Currently it has a 60 tick delay on any sort of processing it does. The number of treefarms your game can support before experiencing lag is solely dependent on your computer. I could increase the delay.

The last game I played had 35 treefarms and was doing pretty well, but I have 32 gigs of ram and a beefy processor.

Also keep in mind the trees from treefarm once harvested give 5 wood instead of the vanilla 4 and they grow pretty fast.
- Buggi -
Here's my Humble YouTube channel: https://www.youtube.com/c/FlexibleGames

Koub
Global Moderator
Global Moderator
Posts: 7203
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Wood

Post by Koub »

Hi,

I know absolutely nothing to LUA, mods, and stuff, but I might have an idea for a lighter aglorithm CPU-wise.

Every time something happens to a farm (tree growth, seed plant, dunno ...) the farm could calculate when will be next event for that particular item that had an event in a sorted table of all future events. Like that, every tick, you wouldn't have to cycle through all the farms and all the farm items, but just check "I'm at that tick into the game, what are the events my treefarm mod has to process this tick" ? Then every time each is processed, it can calculate easily when will be the next event for that ressource, and add it to the aforementionned sorted table.

No more scanning, should avoid a lot of work. Would this help ?
Koub - Please consider English is not my native language.

SpeedDaemon
Fast Inserter
Fast Inserter
Posts: 124
Joined: Fri May 22, 2015 3:31 pm
Contact:

Re: Wood

Post by SpeedDaemon »

bobingabout wrote:
SpeedDaemon wrote:I also wrote a very simple greenhouse mod to produce wood.

It's not as pretty as Tree Farm, but far less laggy if you're going big.
I think I was going to take a similar approach for wood manufacture in my mod. well, actually I had a couple of options, for example crafting seedlings from wood, then wood from seedlings with a net gain, but the end result is wood from nothing.
Well, not exactly nothing. The greenhouses don't take modules, and they run at 100kW 100% of the time. On my current map, they are tied for #1 power hog with roboports. :)

To add to Koub's idea for Tree Farm, perhaps it would be possible to trade increased memory usage for increased performance. If each plot (where an individual tree would grow), added its next scheduled/timestamped action to the end of a queue, you would only ever have to check the head of the queue, process those items that are past due, and add another item to the back of the queue. That would avoid any iteration whatsoever. At worst, if each farm had its own queue, you'd only have to look once at each farm.

User avatar
Buggi
Fast Inserter
Fast Inserter
Posts: 100
Joined: Wed May 27, 2015 6:23 am
Contact:

Re: Wood

Post by Buggi »

The queue idea I've thought of. Unfortunately some things take much less time than others, so adding to the bottom of a queue wouldn't really work.

Take harvesting for example. Once the tree growth event is triggered on the tree to the max level, that tree can be immediately harvested. Even though there might be 48 other trees with tick delays. So adding to the bottom would delay the harvest. Then once harvested, a new seed could be planted right away (maybe, depending on collision).

At best you'd have to check the entire queue for any past-due events. Worse would be a resort method every time the queue is modified.

I'll look into it some more.
- Buggi -
Here's my Humble YouTube channel: https://www.youtube.com/c/FlexibleGames

jonathanpaulson
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Mar 21, 2015 10:23 pm
Contact:

Re: Wood

Post by jonathanpaulson »

Buggi: You can use a priority queue for this, which can find the next (i.e. lowest-time event for you). I don't know Lua, but it should be easy to find an implementation online (or in the Lua libraries), for example https://rosettacode.org/wiki/Priority_queue#Lua

Then your main loop can look something like:

Code: Select all

Q = PriorityQueue()
on_tick():
  while not Q.empty():
    (time, event) = Q.pop()
    if time < now(): # in the past
      # do event
      # push new events at their appropriate times
    else:
      Q.insert((time, event)) # oops, this isn't ready yet
      break
This should be fast because you only need to look at the events that are actually ready.

Post Reply

Return to “Bob's mods”