Tree Modifications for the rented server Part 1

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

Larainan
 
Posts: 83
Joined: 08 Sep 2015, 15:19

Tree Modifications for the rented server Part 1

Post by Larainan » 10 Dec 2015, 03:34

First let me start by saying that this is going to be a long winded post but I will include the edits I used and will do my best to spell out each step for inexperienced users like myself. Modifying LIFYO files is a completely new experience for me. While I have considerable computer knowledge and experience, I never was a gamer nor was I interested in the inner workings of the files that make them possible.

That aside, I came to modifying LIFYO files because in two months time I had been on 5 different servers that all just vanished into thin air without so much as a thank you for playing.

I loved the people on my last server and enjoyed my short time there very much. When it went poof on the day of the last hotfixes for the new release I like many in my group was very frustrated at having to start over again.

We decided to pay for server space with PingPerfect. This after considerable time of trying unsuccessfully to get Maria Database 5.5 and LIFYO dedicated server to run and actually allow people into my game.

So began my quest for modifications to the game. As much as I loved all the work the Devs put into the changes for the release I hated that our little island world was full of dead trees so I went in search of a tree modification file created by other users.

I found one by user Machine from an older post in january 2015 on the Life is Feudal Forums.

After traveling through my little world and noticing there were many many trees of poor quality, I decided that I would try using this but that I would change quality 80 to 10.

I recommend changing it to 6 or 8 because when I finally ran this at 10 it wiped out 3/4s of the trees on our new server.

So the first thing I ran into was that for the life of me no matter how hard I tried I could not get Heidi SQL to work on my computer or to communicate with my server...took me a few minutes to figure out I didn't actually need it.
Ping Perfect has its own server console that allows me to download and upload files directly. But I actually used FileZilla FTP to do my uploads and Microsoft Visual Studio which is free to use to do my editing. I first attempted to open the files in Notepad but I hate scrolling side to side and Visual Studio is a much better option for me.

I started looking through all the files on our server only to find that many files had the cs.dso extension that I couldnt open for anything. There are very few files that do not have this dso extenstion on my Ping Perfect server or even in the LIFYO dedicated server files stored locally on my computer.

DSO files are from my understanding a Torque 3D specific extension. All my edits have been successful without having to open any DSO files at all.

There were only 4 main files that I actually had access to on my server that I could open that are the heartbeat of my server. They are the World _Config.xml file, New.SQL Patch.SQL and Dump.SQL. The three SQL files are found in an SQL folder on the server. There are also a couple other xml files as well that we will be discussing here that should be in the data folder on your server.

So on to the tree mod by Machine, it looks like this, with my change from 80 to 8 already in it.

DO NOT TRY AND USE THIS FILE WITH YOUR SERVER RUNNING!


DELETE forest, forest_patch
FROM forest, forest_patch
WHERE forest.GeoDataID = forest_patch.GeoDataID AND
forest.Quality < 8;

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;

It was said that I could put this at the end of my Patch.SQL file since I had no query or ability to use Heidi SQL with my rented server.

I did this after downloading a copy of Patch.SQL from my server to my computer. I scrolled all the way to the end of Patch SQL and pasted it just above the last word in the file which is END. That word must stay there as you find it in the file.Then I went into my server and renamed the old Patch SQL file to Patch.old and uploded my modified Patch.SQL file.

Then I restarted my server.....no tree removal was evident after a quick visit to our island.
So, I took the server down again, that is when it dawned on me that there is a NEW SQL file on my server and I said to myself could that be for adding new commands to the server I wonder? So I downloaded a copy of it to my computer and again scrolled to the end and pasted this code in there the same way as I did in the Patch SQL file.

This time however instead of just starting my server back up I ran a repair on it and then I ran the steam update program that also is located in my server console.

I fired her up and waited patiently for my server to come back online and I'll be damned it worked this time! We had bald spots all over the place no more dead trees!

Then after a day or two I started to notice new tree regrowth....to my horror it was the same dead trees coming back to life and regrowing and no no no this will not do!

It was this that started my fever to understand all I could about the programming of my favorite game, and in these last few weeks I learned a lot.

I started reading through the hundreds of thousands of lines of code stored in the patch, new and dump sql files and a pattern started to show itself to me.

There are three levels of tree health in our game 0 being sickly or low quality. 1 being average to mid quality trees and 2 being high quality above average trees. There were thousands of trees listed in the new sql file and the dump sql file that had O tree health. There are actually 2 sections of trees with this in it. The first one you do not want to edit. The second set however is tied to the map positions in which they sprout.

For my next discussion I will walk you through those entries and explain to the best of my ability how these entries work and where in the files they are located so that you can correct your regrowth as well.

In the meantime you can always start planting new trees so the dead ones don't have the ability to take hold!...I promise i'll post again very quickly so you don't have to fly around in gm mode like I have been. replanting trees while I learned to edit my files.

Larainan
PingPerfect:KIN.KillerClan.Com Feudal Renaissance
http://kinkillerclan.enjin.com/home


Larainan
 
Posts: 83
Joined: 08 Sep 2015, 15:19

Re: Tree Modifications for the rented server Part 2

Post by Larainan » 10 Dec 2015, 15:28

So, now lets talk about the trees that regrow after you wipe out your dead ones. In the New. SQL file there are several forestry sections to go through. Again I use Microsoft visual studio to view my files so I will start with Line # 552 which looks like this; /*!40000 ALTER TABLE `forest` DISABLE KEYS */;
INSERT INTO `forest` (`ID`, `GeoDataID`, `TreeType`, `SubcellMask`, `AgeTime`, `Quality`) VALUES

here is the next couple lines so you can match the numbers up with the information given in the Insert statement above.

(150266, 115943337, 5, 6, 40, 32),
(150267, 115943338, 2, 2, 40, 64),
(150268, 115943845, 7, 9, 40, 53),

The last number in the string is the number you will be most concerned with when editing this file it's your Tree Quality. If you don't want to run someone elses tree mod and prefer to do things the long way you can go through these lines in the forest sections and manually edit the lines of code to make your tree quality better.

The majority of trees from line 552 to about line 2018 are of decent quality then its all down hill from there.
You won't see another tree above quality 10 until Line # 6119 so if you edit the quality on these trees then you can skip down to Line items 8800 to 16149.

For me I decided to leave all the trees of quality 10 along and concentrated on the single digits like changing qual 5 to 55 or 25

The qualities drop again to below 10 at line 16817 to 18551
then from 21035 to 27953

As you can see there are massive sections all over the map of very ill trees which I am sure the Dev's intended considering the intro video statements but I like my world green!

So after editing all the lines with poor quality between 552 and 67494 I moved on to the tree health section at 67515 in the forest_patch section.

You want to edit your tree health here '0=Ill; 1=Normal; 2=Great; 3=Stump', it's the second to last number in the string.

I also changed these.

Then I uploaded those changes to my server renaming my original file New SQL to New.old and replacing it with this edited one.

Again I had to run the repair function and steam update functions on my server before I saw the changes when I restarted my server.


Durgrim
 
Posts: 42
Joined: 24 Nov 2015, 19:51

Re: Tree Modifications for the rented server Part 1

Post by Durgrim » 10 Dec 2015, 17:54

okay, that being said...for changing the storage capacity i just had to modify client wise objects and server adding some lines to dump.sql.

For killing all trees below quality 10 and to have only those remaining trees regrow, what would your solution be? (We would like to have a nice plain island and regrow the best trees ourselves)
Image


Larainan
 
Posts: 83
Joined: 08 Sep 2015, 15:19

Re: Tree Modifications for the rented server Part 1

Post by Larainan » 10 Dec 2015, 20:09

Well the regrowth pattern is very slow I managed to replant 30k trees myself while I was editing the tree health in the almost 100k of tree lines. I was also just planting trees on my server in gm mode so I could carry thousands of them at a time and of course where I did that there was no dead regrowth.

I personally wish I would have just gone through the line items I listed above and changes all the dead tree quality down the whole line but again you can change the mod by machines number back up to 80 if you want and your world will only keep 80 and above trees so you can start replanting what you want...I just made my own life easier by changing the qualities to what I want instead....it took me days to replant 30k trees and it did not even begin to touch all the bareness in my world


Durgrim
 
Posts: 42
Joined: 24 Nov 2015, 19:51

Re: Tree Modifications for the rented server Part 1

Post by Durgrim » 19 Dec 2015, 20:13

assuming that i add the first posted lines to new and patch.sql and do not want ANY tree regrowth at all....what should i do then?
Image


Larainan
 
Posts: 83
Joined: 08 Sep 2015, 15:19

Re: Tree Modifications for the rented server Part 1

Post by Larainan » 21 Jan 2016, 07:30

Well short of doing what I said by going through the lines of tree code and changing the qualities and the tree health the only other option would be to delete the lines that contain bad trees from the file all together..I DO NOT Recommend this at all. The day cycle timers that control your tree regrowth are set up from what I can see for all the various map positions for the trees so that you have a renewable resource. We don't have full access to those timers or map positions without access to the cs.dso files locked up by torque. Now if you do have access to the full forestry database and know how to use it then I guess you could stop tree regrowth for certain map positions. If you just go through and willy nilly delete these map positions from your files you may not even be able to plant new trees in the dead spaces. As I have not tested this it is just my theory based on what I see the files doing and what I have learned about the day cycle timers etc. You could just have the tree mod run when the server does its restart like they do with the stump mod and that would continually clear out the dead trees as well I would think. just once or twice a month re add the tree mod to a new patch and new sql file and repair your server just as you would if the devs sent us an update for the game.

The trees really do grow back very very slowly so once a month would probably be sufficient.

User avatar
Airco
 
Posts: 698
Joined: 02 Apr 2015, 12:41

Re: Tree Modifications for the rented server Part 1

Post by Airco » 03 May 2016, 06:59

for the players that do not run dedicated and just on your own pc its almost the same
go to steam folder and go to the lif server map and op the sql map there.
(in my case C:/Program Files(x86)/steam/steamapps/common/life is feudal your own/server/sql )
if u take the standerd installation folders you wil end up same as me.

open te file new.sql whit notepad (or simular programs like notepad++ bhut the basic notepad also works)
and from here its the same deal, scroll all the way to the bottom (i advise useing the sidebar, it can be quit some distance to the bottom)
and just above the last "END" place the same text
no need to modify any other files, modding new.sql wil clear all the tree's of the sertain quality ( forest.Quality <= 8; ) each time u start it up
thx for the help larainan :)
DELETE forest, forest_patch
FROM forest, forest_patch
WHERE forest.GeoDataID = forest_patch.GeoDataID AND
forest.Quality <= 8;

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;
os: Win10N
Motherboard: Asus Sabertooth Z97 Mark2
Cpu: intel I5-4690 3.5Ghz
Cpu cooler: thermaltake Frio Extreme Silent 14 Dual
Mem: Corsair 16gb, Cmy16gx3m2a2133c11r
Gpu: Geforce 970, Asus STRIX GTX970 DC2OC 4GD5
Soundcard: Creative Soundblaster Z
HD: SAMSUNG 75E250RW SSD 850 EVO 250 GB


Alakar
Beta Tester
 
Posts: 202
Joined: 23 Jan 2015, 07:39

Re: Tree Modifications for the rented server Part 1

Post by Alakar » 04 May 2016, 03:04

Modified tree regrowth on Arkhaya:
( don't recall original value of spawnchance think it was at 0.01 )

Code: Select all
$Forest::maintenance::lookRadius = "5";
$Forest::maintenance::spawnChance = "1e-005";
$Forest::maintenance::tooNearRadius = "3";


The above value will suffice for almost no random trees spawning.

-Alakar


Larainan
 
Posts: 83
Joined: 08 Sep 2015, 15:19

Re: Tree Modifications for the rented server Part 1

Post by Larainan » 06 May 2016, 03:08

Thanks for the addition Alakar i'll have to give it a try.

Airco you are very welcome...I know the feeling scrolling through new and dump and individually changing lines one by one its a major pain especially after every update lol.


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

Re: Tree Modifications for the rented server Part 1

Post by Gchristopher » 06 May 2016, 04:51

Alakarsiann wrote:Modified tree regrowth on Arkhaya:
( don't recall original value of spawnchance think it was at 0.01 )

Code: Select all
$Forest::maintenance::lookRadius = "5";
$Forest::maintenance::spawnChance = "1e-005";
$Forest::maintenance::tooNearRadius = "3";


The above value will suffice for almost no random trees spawning.

-Alakar

Trying that too! Thanks! So far it appears to have slowed tree spawning significantly.

Alternate Tree Deletion Script

I'm trying a different approach to cleaning up trees that seems to work very well. Instead of deleting all trees below a certain quality and artificially inflating the value of the remaining trees as a result, I took a look at comparing the trees present in a server after a year of growth vs. the trees present in a fresh install.

It turned out that there were roughly 20,000 new trees under quality 20, and 137 new trees above quality 90, all of which were easily attributed to player plantings. So it looks like new, naturally grown saplings are nearly always very low quality.

Another way to clean up trees would be to delete all trees that have grown in positions not occupied at the start of the game, except for higher quality trees that were probably planted by players.

Here's the procedure that was used. The server seems stable afterwards.

Step 1: Shut down the server and back up your database.

Step 2: Assuming your current database is LIF_1, install a new world as database LIF_2, to load in a fresh copy of the trees.

Here's a query to inspect how many low quality trees have appeared on your server vs. the brand new install.

Code: Select all
SELECT COUNT(DISTINCT(f_1.GeoDataID))
  FROM forest f_1 LEFT JOIN lif_2.forest f_2
    ON f_1.GeoDataID = f_2.GeoDataID
 WHERE f_2.GeoDataID IS NULL
   AND f_1.Quality < 20;


At 20,000 extra trees, the server was becoming notably cluttered with limited line-of-sight in forests.

Step 3: With LIF_1 as the current database, run the following code:

Code: Select all
create temporary table forest_fire_temp ( `GeoDataID` int(10) unsigned DEFAULT NULL );
CREATE INDEX forest_fire_temp_GeoDataID ON forest_fire_temp (GeoDataID);
CREATE INDEX forest_GeoDataID ON forest(GeoDataID);
CREATE INDEX forest_patch_GeoDataID ON forest_patch(GeoDataID);

INSERT INTO forest_fire_temp (GeoDataID) SELECT f_1.GeoDataID
                                           FROM forest f_1 LEFT JOIN lif_2.forest f_2
                                             ON f_1.GeoDataID = f_2.GeoDataID
                                          WHERE f_2.GeoDataID IS NULL
                                            AND f_1.Quality < 20;

DELETE forest, forest_patch, forest_fire_temp
  FROM forest, forest_patch, forest_fire_temp
 WHERE forest.GeoDataID = forest_patch.GeoDataID 
   AND forest.GeoDataID = forest_fire_temp.GeoDataID;


Step 4: Use Machine's code, reposted by Laranian above, to renumber and clean up the forest-related tables, starting with "SET @c442 = 1;" and all code following it.

Copied here for completeness:
Spoiler


Alternate code:

With a severely overgrown server, the deletion might run very very slowly. To be safe, you can add a limit to the insert statement, which lets you get a quick response, and run the INSERT and DELETE repeatedly until all trees are gone. If you added the indices above, it should run quickly and using this limited query should not be necessary.

Code: Select all
INSERT INTO forest_fire_temp (GeoDataID) SELECT f_1.GeoDataID
                                           FROM forest f_1 LEFT JOIN lif_2.forest f_2
                                             ON f_1.GeoDataID = f_2.GeoDataID
                                          WHERE f_2.GeoDataID IS NULL
                                            AND f_1.Quality < 20
                                           LIMIT 100;


Run the INSERT and then the DELETE repeatedly until all new trees are gone. Raise the LIMIT as much as you feel comfortable without risking an overly long-running statement.

Thanks for the cleanup code, Laranian!
Last edited by Gchristopher on 15 Jun 2016, 02:17, edited 1 time in total.


Larainan
 
Posts: 83
Joined: 08 Sep 2015, 15:19

Re: Tree Modifications for the rented server Part 1

Post by Larainan » 17 May 2016, 12:45

WOW thank you for the addition to the code I put out here for people to use. While I don't take credit for the code there were many people on that didn't know how to use it so I thought I would spell it out a bit better. I have tried what you added and what a difference it makes.

Thanks so much for the work and sharing it!


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

Re: Tree Modifications for the rented server Part 1

Post by Gchristopher » 19 May 2016, 05:13

Thanks! Glad to help. It occurred to me that it probably would run a lot faster if there were indexes to help out.

Something like:

Code: Select all
CREATE INDEX forest_fire_temp_GeoDataID ON forest_fire_temp (GeoDataID);
CREATE INDEX forest_GeoDataID ON forest(GeoDataID);
CREATE INDEX forest_patch_GeoDataID ON forest_patch(GeoDataID);


That might make things a lot faster if trees have really gotten overgrown. I'll restore a backup with the 20,000 extra trees and see if that has better performance.

I noticed that the developers mentioned work on a new tree growth algorithm, so this might be a moot point soon, or at least require a different tree-thinning approach.
Last edited by Gchristopher on 15 Jun 2016, 00:50, edited 1 time in total.


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

Re: Tree Modifications for the rented server Part 1

Post by KevlarBR » 14 Jun 2016, 15:40

Well, shit... After spending a lot of time building our base in a server, we found out that the GM was helping some dudes by giving them stuff and completing buildings for them. So I decided to get my own server where i would make sure shit like this wouldnt happen. I also chose PingPerfect as they were the only ones who had a host here in Brazil, and besides, their servers are good!

Server runs smooth most of the time, but it still lags eventually, specially when day changes and we have tree growing period. Also, its nearly impossible riding a horse at the forest as there are a shitload of trees in your way and server loading times when you log in are long.

My server runs 20-30 players at peak hours and I think that removing low quality trees will improve server stability significantly and also make navigating easier, but Im scared shitless to screw up something and loose all my players, so I want to make sure Im doing it right.

Do you think running this script would make lag better? Would I have to run it along with the no more regrowing script to make it work? Otherwise the trees will regrow and it wont matter.


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

Re: Tree Modifications for the rented server Part 1

Post by Gchristopher » 15 Jun 2016, 02:10

I didn't notice a lot of lag even after leaving the game running for an in-game year with the default, fast forest growth.

Try getting a count of how many trees you have:
Code: Select all
select count(*) from forest;


A fresh install will have a little under 67,000 trees. When it got up to around 90,000 trees, it became noticeably harder to see through forests and ride horses, but the game didn't seem to lag.

Regardless, I recommend the mod posted by Alakarsiann to reduce tree growth. There's no benefit to having tons of crappy trees cluttering the world, and reducing the tree growth rate seems harmless.


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

Re: Tree Modifications for the rented server Part 1

Post by Gchristopher » 15 Jun 2016, 02:12

Gchristopher wrote:Thanks! Glad to help. It occurred to me that it probably would run a lot faster if there were indexes to help out.

Something like:

Code: Select all
CREATE INDEX forest_fire_temp_GeoDataID ON forest_fire_temp (GeoDataID);
CREATE INDEX forest_GeoDataID ON forest(GeoDataID);
CREATE INDEX forest_patch_GeoDataID ON forest_patch(GeoDataID);


That might make things a lot faster if trees have really gotten overgrown. I'll restore a backup with the 20,000 extra trees and see if that has better performance.

I noticed that the developers mentioned work on a new tree growth algorithm, so this might be a moot point soon, or at least require a different tree-thinning approach.

So far leaving the indices above in place has appeared harmless after a few wees of the game running, and speeds up tree deletion immensely. I'm adding those lines to my original post with a tree cleanup procedure.


DarthLurtz
 
Posts: 4
Joined: 21 Jun 2016, 16:26

Re: Tree Modifications for the rented server Part 1

Post by DarthLurtz » 21 Jun 2016, 19:06

Hi guys,

I'm a bit confused. I tried pasting your script into sql, but it returns errors on lines 1 and 52-60.

Line 1 has this error:
Unexpected token. (near *)

Lines 52-60 have these errors:
Unexpected token. (*near forest)
Unexpected token. (near ,)
Unexpected token. (near forest_patch)

Any ideas?


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

Re: Tree Modifications for the rented server Part 1

Post by KevlarBR » 06 Jul 2016, 12:00

DarthLurtz wrote:Hi guys,

I'm a bit confused. I tried pasting your script into sql, but it returns errors on lines 1 and 52-60.

Line 1 has this error:
Unexpected token. (near *)

Lines 52-60 have these errors:
Unexpected token. (*near forest)
Unexpected token. (near ,)
Unexpected token. (near forest_patch)

Any ideas?


Which script did you run? Could you copy and paste it here?

Also, you did turn the server off before running it, right?


DarthLurtz
 
Posts: 4
Joined: 21 Jun 2016, 16:26

Re: Tree Modifications for the rented server Part 1

Post by DarthLurtz » 06 Jul 2016, 13:59

Larainan's very first post on this thread.


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

Re: Tree Modifications for the rented server Part 1

Post by KevlarBR » 06 Jul 2016, 18:54

DarthLurtz wrote:Larainan's very first post on this thread.


Well, it looks the same, but I don't know. I copied mine from the original post by Machine and I didn't have any problems. Post is second one in this thread: post79284/#p79284

Its the same Larainan used, but who knows...


Kilgrados
 
Posts: 2
Joined: 02 Jul 2016, 17:01

Re: Tree Modifications for the rented server Part 1

Post by Kilgrados » 08 Jul 2016, 14:53

Just wanted to say thanks to those who've contributed to this thread. I was curious, however, if the steps regarding editing the lower Q trees in new.sql indicated in Larainan's second post are necessary if using Alakarsiann's adjusted tree regrowth settings. Also, am I placing Alakarsiann's code in main.cs (where I have it now), or is there somewhere better to put it in?


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

Re: Tree Modifications for the rented server Part 1

Post by KevlarBR » 11 Jul 2016, 18:25

Kilgrados wrote:Just wanted to say thanks to those who've contributed to this thread. I was curious, however, if the steps regarding editing the lower Q trees in new.sql indicated in Larainan's second post are necessary if using Alakarsiann's adjusted tree regrowth settings. Also, am I placing Alakarsiann's code in main.cs (where I have it now), or is there somewhere better to put it in?


Alakar's regrowth settings do go on main.cs. Download it, add the lines at the end of it and upload the new version.

If you run Machine's code and add Alakar's script there is no need to use Larainan's code from the second post. The first step will remove all the trees from the quality you choose from the map and the second will make sure they don't regrow.

I think all Larainan did was to give a second option in case someone wanted to change the quality of trees instead of deleting them. So you take a tree with qual 6 and edit it to become qual 80, for example.


Gms0012
 
Posts: 166
Joined: 23 Feb 2015, 08:49

Re: Tree Modifications for the rented server Part 1

Post by Gms0012 » 12 Jul 2016, 09:32

Do i miss anything?

download it?

what to download?

you just have to add 3 lines to the main.cs..

there is no download..

or did i miss a post?!
Image

User avatar
Cattoaster
 
Posts: 110
Joined: 03 Nov 2014, 16:13
Location: Medieval Germany

Re: Tree Modifications for the rented server Part 1

Post by Cattoaster » 12 Jul 2016, 11:07

in context: download = download main.cs, edit and upload it or
download = copy Alakar's regrowth settings and paste it, remotely


Gms0012
 
Posts: 166
Joined: 23 Feb 2015, 08:49

Re: Tree Modifications for the rented server Part 1

Post by Gms0012 » 12 Jul 2016, 16:19

ah ok...

thanks...

that i already did..

the "download" confused me a little bit
Image


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

Re: Tree Modifications for the rented server Part 1

Post by TheZar » 23 Nov 2016, 10:44

I broke my server and had to delete all my trees to fix it, is it possivle to grow them?

Return to Game mods