Delete poor quality trees / monthly auto uproot

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

KevlarBR
True Believer
 
Posts: 20
Joined: 10 Jun 2016, 12:05

Re: Delete poor quality trees / monthly auto uproot

Post by KevlarBR » 28 Jun 2016, 18:46

Damn lol!

If I put it in the dump, it will run every time I restart the server?


Gchristopher
 
Posts: 33
Joined: 20 Apr 2016, 21:58

Re: Delete poor quality trees / monthly auto uproot

Post by Gchristopher » 28 Jun 2016, 19:14

It's a little more work, but here's discussion of a better option for cleaning up excessive tree growth.


Silvazar
 
Posts: 2
Joined: 18 Jun 2016, 21:14

Re: Delete poor quality trees / monthly auto uproot

Post by Silvazar » 29 Jun 2016, 05:43

KevlarBR wrote:
Silvazar wrote:I am in the exact same predicament. did you have any luck with it?


I didn't have the balls yet to run it, but I think I will. Trees are getting on my nerves, man... But I think it is, yes.


TheZar wrote:It needs to be put at the end of Dump.sql


Dump.sql or Patch.sql? I'm not sure. Anyways, what I think I'll do is shut down the server, back it up, run a query with the code to remove the trees, add the tree spawn removal code and start the server again...


I hate to let you be the one to try first KevlarBR but did it work out? I am spooked that it will end up corrupting my database and all the poeple on my server will lose all their work.


KevlarBR
True Believer
 
Posts: 20
Joined: 10 Jun 2016, 12:05

Re: Delete poor quality trees / monthly auto uproot

Post by KevlarBR » 30 Jun 2016, 18:19

Silvazar wrote:
KevlarBR wrote:
Silvazar wrote:I am in the exact same predicament. did you have any luck with it?


I didn't have the balls yet to run it, but I think I will. Trees are getting on my nerves, man... But I think it is, yes.


TheZar wrote:It needs to be put at the end of Dump.sql


Dump.sql or Patch.sql? I'm not sure. Anyways, what I think I'll do is shut down the server, back it up, run a query with the code to remove the trees, add the tree spawn removal code and start the server again...


I hate to let you be the one to try first KevlarBR but did it work out? I am spooked that it will end up corrupting my database and all the poeple on my server will lose all their work.


Stilll haven't done it, hahaha!! I'm afraid it will fook up my archives as well, and I don't understand much about programing... So far, I've only downloaded HeidiSQL and learned to make backups... When I'm confident with that I'll try the script... Unless you wanna go first! hahaha


Gchristopher
 
Posts: 33
Joined: 20 Apr 2016, 21:58

Re: Delete poor quality trees / monthly auto uproot

Post by Gchristopher » 30 Jun 2016, 19:14

If you can make a backup and restore from it, you'll definitely be okay.

The code posted by Machine in the second post of this thread definitely works for the current version of LiF. (Though his removes under quality 80 and you probably don't want to remove that many.)

Running the code once against the database via HeidiSQL (or mysql) is probably a good idea.

Here is some code you can add to the main.cs file on the server file to slow down tree growth dramatically.

Again, that thread also contains a much cleaner way to reset your trees without losing player-planted ones than deleting everything under a certain quality.


Woundedcern
 
Posts: 2
Joined: 29 May 2016, 18:07

Re: Delete poor quality trees / monthly auto uproot

Post by Woundedcern » 04 Jul 2016, 15:09

cant seem to get this working, does it work with patch 1.1.1.15 if so then would someone please help me get it up and running.


Woundedcern
 
Posts: 2
Joined: 29 May 2016, 18:07

Re: Delete poor quality trees / monthly auto uproot

Post by Woundedcern » 04 Jul 2016, 17:16

this mod works fine but the problem i was haveing was everyone keeps saying to mod wrong file, the file that needs to be moded is the dump.sql file. mod is a one time use mod so doesnt run while game is running only on restarts.


TheZar
 
Posts: 108
Joined: 20 Jan 2015, 01:50

Re: Delete poor quality trees / monthly auto uproot

Post by TheZar » 05 Jul 2016, 13:00

Woundedcern wrote:this mod works fine but the problem i was haveing was everyone keeps saying to mod wrong file, the file that needs to be moded is the dump.sql file. mod is a one time use mod so doesnt run while game is running only on restarts.


It used to be patch.sql, but it's now dump.sql


KevlarBR
True Believer
 
Posts: 20
Joined: 10 Jun 2016, 12:05

Re: Delete poor quality trees / monthly auto uproot

Post by KevlarBR » 05 Jul 2016, 23:35

OK, it worked fine.

For all the noobs in server stuff like me out there, heres a quick step by step:

1. Shut down your server. THIS IS VERY IMPORTANT!!!
2. Copy Machine's code (second post on this thread: delete-poor-quality-trees-monthly-auto-uproot-t8393/). Make sure you copy THE WHOLE code... If you leave lines out, it will fail
3. Paste it on HeidiSQL and run it as query
4. Restart the server

I also added Alakarsiann's code to avoid random tree spawn on main.cs. I downloaded it, added it to the end of the file and uploaded the new version. You can find it in this thread: tree-modifications-for-the-rented-server-part-1-t15928/

hope it helps!


KevlarBR
True Believer
 
Posts: 20
Joined: 10 Jun 2016, 12:05

Re: Delete poor quality trees / monthly auto uproot

Post by KevlarBR » 06 Jul 2016, 11:58

Also, first I did it with Quality < 6. That deleted all trees with quality 5 and below (6s were still there). This deleted like 25% of the trees. It was better, but you would still eventually see some trees bunched up in a way you couldn't pass through them or would make hard-to-ride-a-horse-here areas.

I shut down the server again and I ran the script again, this time with Quality < 8. That deleted the 6s and 7s too.

Perfection! I have a server with significantly less trees (I would say around 50% less), no trees bunched up, but at the same time, there was barely any change in the scenery and lots of trees in the map (no near clears or bald spaces in the map).

:Yahoo!:


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