Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make autochop estimate the number of logs you get from a tree #876

Closed
expwnent opened this issue Mar 20, 2016 · 7 comments · Fixed by #2064
Closed

Make autochop estimate the number of logs you get from a tree #876

expwnent opened this issue Mar 20, 2016 · 7 comments · Fixed by #2064
Labels
idea Suggestions, etc.
Projects

Comments

@expwnent
Copy link
Member

Instead of periodically designating all trees in the selected burrows, designate enough trees to produce enough wood to get to max_logs, or all of them if there aren't enough.

@RogueYun
Copy link

If autochop can estimate how much wood a tree can produce, would it be possible set it to prioritize cutting the oldest trees (or the ones that are not likely to grow anymore) first?

@lethosor lethosor added the idea Suggestions, etc. label Apr 12, 2016
@expwnent
Copy link
Member Author

Sure.

@aljohnston112
Copy link

I could work on this one. It's a feature I was looking for.

@aljohnston112
Copy link

aljohnston112 commented Jul 8, 2021

I was able to get the right amount of logs for a willow tree with the following code.

                    df::plant_tree_tile** tiles = plant->tree_info->body;
                    df::plant_tree_tile* tilesRow;
                    int trunks = 0;
                    for (int i = 0; i < plant->tree_info->body_height; i++) {
                        tilesRow = tiles[i];
                        for (int j = 0; j < plant->tree_info->dim_y*plant->tree_info->dim_x; j++) {
                            trunks += tilesRow[j].bits.trunk;
                        }
                    }
                    out << "Trunks: " << trunks << std::endl;;

@lethosor
Copy link
Member

Cool! Do you have other plans or questions, and/or do you plan on putting up a PR?

If it helps, feel free to get in touch at any of these places as well.

@Moth-Tolias
Copy link
Contributor

if @aljohnston112 is otherwise unable to make a pr, i'd like to look into implementing this.

@ab9rf
Copy link
Member

ab9rf commented Aug 24, 2021

if @aljohnston112 is otherwise unable to make a pr, i'd like to look into implementing this.

Go for it.

@lethosor lethosor added this to To Do in 0.47.05-r5 via automation Apr 3, 2022
@lethosor lethosor moved this from To Do to In Progress in 0.47.05-r5 Apr 3, 2022
@lethosor lethosor moved this from In Progress to Done in 0.47.05-r5 Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Suggestions, etc.
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

6 participants