Delete poor quality trees / monthly auto uproot

Place for sharing your game modifications for Life is Feudal: Your Own

TwatHammer
 
Posts: 3
Joined: 29 Jun 2016, 18:58

Re: Delete poor quality trees / monthly auto uproot

Post by TwatHammer » 19 Aug 2016, 15:59

I've ran into a massive truckload of bugged stumps in my server and trying to figure out how to use HeidiSQL is a nightmare, Anyone have any tips for this nerd who has zero clue how to use SQL to fix my issue? Running a rented server.


Fodda
True Believer
 
Posts: 2
Joined: 09 Dec 2014, 02:16

Re: Delete poor quality trees / monthly auto uproot

Post by Fodda » 03 Dec 2016, 04:27

Does this still work with latest patch (v1.1.7.4)????


Eckister
 
Posts: 27
Joined: 01 Jul 2015, 20:29

Re: Delete poor quality trees / monthly auto uproot

Post by Eckister » 11 Dec 2016, 16:29

gentlemen, I have just wanted to say - YOU ROCK!!! Ive applied these changes to our server and they took over like a charm!

with that I confirm that this script is still viable, you just need to find the dump.sql file mentioned above (likely in the game directory under "SQL", if its the same as our server, dunno why it shouldnt though. :-)) and copy-paste the script with the tree quality value you want to the very end of the dump.sql file.

depending on your server you can either edit the file directly or use an alternate program. weve got a managed server so Ive first downloaded the file, deleted the one thats on the server with remote access, altered the downloaded one accordingly and uploaded it afterwards.


Wir3tap
 
Posts: 29
Joined: 07 Sep 2015, 21:36

Re: Delete poor quality trees / monthly auto uproot

Post by Wir3tap » 20 Jan 2017, 21:37

This not working since last patch now? This sends my server into boot loops now if added to dump.sql.
Image


Tobias0412
 
Posts: 32
Joined: 06 Dec 2016, 21:15

Re: Delete poor quality trees / monthly auto uproot

Post by Tobias0412 » 21 Jan 2017, 12:25

Wir3tap wrote:This not working since last patch now? This sends my server into boot loops now if added to dump.sql.


Put the following Code at the end of your Patch.sql

Code: Select all
DELETE forest, forest_patch
    FROM forest, forest_patch
  WHERE forest.GeoDataID = forest_patch.GeoDataID
    AND forest.Quality < 40;
  SET @c442 = 1;
  SET @c443 = 1;
  SET @c444 = 1;
  SET @c445 = 1;
  SET @c446 = 1;
  SET @c447 = 1;
  SET @c448 = 1;
  SET @c449 = 1;
  SET @c450 = 1;
  UPDATE forest_patch
  SET Version = @c442 := @c442 + 1
  WHERE TerID = 442;
  UPDATE forest_patch
  SET Version = @c443 := @c443 + 1
  WHERE TerID = 443;
  UPDATE forest_patch
  SET Version = @c444 := @c444 + 1
  WHERE TerID = 444;
  UPDATE forest_patch
  SET Version = @c445 := @c445 + 1
  WHERE TerID = 445;
  UPDATE forest_patch
  SET Version = @c446 := @c446 + 1
  WHERE TerID = 446;
  UPDATE forest_patch
  SET Version = @c447 := @c447 + 1
  WHERE TerID = 447;
  UPDATE forest_patch
  SET Version = @c448 := @c448 + 1
  WHERE TerID = 448;
  UPDATE forest_patch
  SET Version = @c449 := @c449 + 1
  WHERE TerID = 449;
  UPDATE forest_patch
  SET Version = @c450 := @c450 + 1
  WHERE TerID = 450;
  SET @c442 = (SELECT
      MAX(Version) AS max
    FROM forest_patch
    WHERE TerID = 442
    ORDER BY TerID);
  SET @c443 = (SELECT
      MAX(Version) AS max
    FROM forest_patch
    WHERE TerID = 443
    ORDER BY TerID);
  SET @c444 = (SELECT
      MAX(Version) AS max
    FROM forest_patch
    WHERE TerID = 444
    ORDER BY TerID);
  SET @c445 = (SELECT
      MAX(Version) AS max
    FROM forest_patch
    WHERE TerID = 445
    ORDER BY TerID);
  SET @c446 = (SELECT
      MAX(Version) AS max
    FROM forest_patch
    WHERE TerID = 446
    ORDER BY TerID);
  SET @c447 = (SELECT
      MAX(Version) AS max
    FROM forest_patch
    WHERE TerID = 447
    ORDER BY TerID);
  SET @c448 = (SELECT
      MAX(Version) AS max
    FROM forest_patch
    WHERE TerID = 448
    ORDER BY TerID);
  SET @c449 = (SELECT
      MAX(Version) AS max
    FROM forest_patch
    WHERE TerID = 449
    ORDER BY TerID);
  SET @c450 = (SELECT
      MAX(Version) AS max
    FROM forest_patch
    WHERE TerID = 450
    ORDER BY TerID);
  UPDATE terrain_blocks
  SET ForestVersion = @c442
  WHERE ID = 442;
  UPDATE terrain_blocks
  SET ForestVersion = @c443
  WHERE ID = 443;
  UPDATE terrain_blocks
  SET ForestVersion = @c444
  WHERE ID = 444;
  UPDATE terrain_blocks
  SET ForestVersion = @c445
  WHERE ID = 445;
  UPDATE terrain_blocks
  SET ForestVersion = @c446
  WHERE ID = 446;
  UPDATE terrain_blocks
  SET ForestVersion = @c447
  WHERE ID = 447;
  UPDATE terrain_blocks
  SET ForestVersion = @c448
  WHERE ID = 448;
  UPDATE terrain_blocks
  SET ForestVersion = @c449
  WHERE ID = 449;
  UPDATE terrain_blocks
  SET ForestVersion = @c450
  WHERE ID = 450;


Wir3tap
 
Posts: 29
Joined: 07 Sep 2015, 21:36

Re: Delete poor quality trees / monthly auto uproot

Post by Wir3tap » 22 Jan 2017, 21:32

I read earlier it was dump.sql has this been changed back to patch now?
Image


Tobias0412
 
Posts: 32
Joined: 06 Dec 2016, 21:15

Re: Delete poor quality trees / monthly auto uproot

Post by Tobias0412 » 23 Jan 2017, 12:31

Wir3tap wrote:I read earlier it was dump.sql has this been changed back to patch now?


I think it doesnt matter in which .sql u use it. It works with both. I have mine in patch.sql and its working fine, so i just can tell u: put it in patch.sql because i also use it there...


Estharos
 
Posts: 11
Joined: 29 Jan 2017, 16:18

Re: Delete poor quality trees / monthly auto uproot

Post by Estharos » 30 Jan 2017, 16:59

We implement the coding into our dump file and work ok, except there's no oak, maple or hazzel tree anywhere to be found. Any one else got this issue?

Cheers,


Estharos
 
Posts: 11
Joined: 29 Jan 2017, 16:18

Re: Delete poor quality trees / monthly auto uproot

Post by Estharos » 31 Jan 2017, 19:09

Is it possible to role back that coding, we are experimenting problem with it, we put the code in the dump.sql file and though it will role back if I put back the original dump file back but it didn't not.

Cheers,


Tobias0412
 
Posts: 32
Joined: 06 Dec 2016, 21:15

Re: Delete poor quality trees / monthly auto uproot

Post by Tobias0412 » 01 Feb 2017, 00:21

Estharos wrote:Is it possible to role back that coding, we are experimenting problem with it, we put the code in the dump.sql file and though it will role back if I put back the original dump file back but it didn't not.

Cheers,


No, u cant just roll back because the "code" deletes entrys in ur database (low quality trees) and when they are deleted....u cant just roll back.
But u can remove the code from ur dump.sql and all trees will grow again.


HahlgrimtheThane
 
Posts: 3
Joined: 17 Nov 2016, 07:23

Re: Delete poor quality trees / monthly auto uproot

Post by HahlgrimtheThane » 05 Jun 2017, 23:50

Hi, can any server admins confirm if this script still works with latest patch.

I have previously run this script using HeidiSQL and just run as a query on lif_1 database . But we ran into some problems with oaks, apples and some other trees disappearing.


So I was just wondering if the script still works.
Thanks.


Elgar
 
Posts: 46
Joined: 06 Dec 2016, 13:43

Re: Delete poor quality trees / monthly auto uproot

Post by Elgar » 06 Jun 2017, 11:57

HahlgrimtheThane wrote:Hi, can any server admins confirm if this script still works with latest patch.

I have previously run this script using HeidiSQL and just run as a query on lif_1 database . But we ran into some problems with oaks, apples and some other trees disappearing.


So I was just wondering if the script still works.
Thanks.


No, it's obsolete and harmful. It was clearly explained by devs when they introduced the new forest algorithm a few months ago.

It has been confirmed a few days ago by famous modder Nyuton :

I've done some simulations over the past couple of weeks to get a better understanding about the forest maintenance XML file to make an actual generator with UI for it.
Conclusion: This 'desert' issue can't be reproduced without the use of obsolete and possibly harmful forest cleanup sql scripts. You can hardly blame the devs for the ignorance of some server admins, honestly.


He also discovered that values above 999 shouldn't be used for trees max age and death border :

Values above 1000 for maxage/deathborder will result in fewer trees to be planted. Values above ~1500 will result in no trees being planted at all. Once all initial trees died, the server will be empty.

To be fair, I don't really see any reason why you would want to configure such sky high values for tree age. But since there is no upper limit mentioned in the XML comments, I would assume this is a bug indeed.


Source : forest-death-2-the-return-t23526/

Nyuton released two days ago a Forest maintenance XML generator in order to help your server admin to tweak this xml file if you don't want the vanilla settings.

He also released a Forestry Script which spawns trees on your server if it lacks trees or lacks a certain tree type.

Link : http://nyuton.net/terratool-forest-update-1-5-0/
"Life is Feudal punches you in the mouth and then laughs at you for bleeding." - Saxxon


Valvegas1
 
Posts: 7
Joined: 28 May 2017, 19:27

Re: Delete poor quality trees / monthly auto uproot

Post by Valvegas1 » 24 Jun 2017, 13:12

I was using this script on my server for a while and never experienced a single issue with it deleting anything it wasn't supposed to


Jor.hudson
 
Posts: 2
Joined: 01 Jan 2018, 11:38

Re: Delete poor quality trees / monthly auto uproot

Post by Jor.hudson » 01 Jan 2018, 11:42

I can use this code only to remove trees with quality <1. I would just be removing the roots from the trees .. Does it still work?


Teah
 
Posts: 26
Joined: 14 Jun 2016, 13:49

Re: Delete poor quality trees / monthly auto uproot

Post by Teah » 26 Apr 2019, 18:21

Still works beautifully. I rebooted my server two weeks ago and ran this to get rid of anything below 75q. Thank you


Three50freak
 
Posts: 1
Joined: 17 Nov 2017, 22:47

Re: Delete poor quality trees / monthly auto uproot

Post by Three50freak » 11 Nov 2023, 17:42

I know this is VERY VERY OLD. However, is there a way to do this for Single player game.

Return to Game mods