Workaround / Improvement of the durability loss problem

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

Schpidi
 
Posts: 21
Joined: 26 Apr 2015, 20:17

Workaround / Improvement of the durability loss problem

Post by Schpidi » 09 May 2015, 23:47

Hi there,

I just digged around and found a workaround which improves the fun again a little bit.

Crafting stations will not break so fast and additionally the will be "repaired" at each server restart.

I know they way I did it is not the best, but we all put our pants on one leg at a time... and it seems to work ;-)

I won´t call it a "solution" because I can´t change the game server code NOT to cause the damage taken.
But I managed to avoid the permanent writing of the durability loss.

For me that worked:
    * database trigger BEFORE UPDATE: if dura goes down, set it to old value or lower the impact by a configurable percentage setting
    * database trigger BEFORE INSERT: if a crafting station is build highten the durability from 5000 to 65535
    * update all your existing crafting stations to durability 65535
    * do all your actions only for children of object type 64

I wrote an detailled description of the workaround in my new blog (see signature), where I will post more and more database additions and scripts in the near future.

If sth. is unclear there, please post your questions.

Thanks,
schpidi
Visit my new blog about LiF:YO LIVE-Map, database modding, additions and scripts:
http://lif-tools.blogspot.com/

User avatar
HolyCrusader
Beta Tester
 
Posts: 251
Joined: 24 Nov 2014, 15:47

Re: Workaround / Improvement of the durability loss problem

Post by HolyCrusader » 11 May 2015, 02:24

If you turn off object decay on the server, does this turn off the durability loss of structures used in manufacturing?

User avatar
HolyCrusader
Beta Tester
 
Posts: 251
Joined: 24 Nov 2014, 15:47

Re: Workaround / Improvement of the durability loss problem

Post by HolyCrusader » 11 May 2015, 03:15

This seems like a very well thought out work around. I'll be implementing it on my server overnight and I'll be sharing feedback tomorrow!

Thanks for your work mate!

User avatar
HolyCrusader
Beta Tester
 
Posts: 251
Joined: 24 Nov 2014, 15:47

Re: Workaround / Improvement of the durability loss problem

Post by HolyCrusader » 11 May 2015, 04:35

Make sure you add the two triggers and the function before running the query (3rd on the list on the site)

User avatar
HolyCrusader
Beta Tester
 
Posts: 251
Joined: 24 Nov 2014, 15:47

Re: Workaround / Improvement of the durability loss problem

Post by HolyCrusader » 11 May 2015, 04:39

I've implemented it on my server. So far it works great! Thank you


Schpidi
 
Posts: 21
Joined: 26 Apr 2015, 20:17

Re: Workaround / Improvement of the durability loss problem

Post by Schpidi » 11 May 2015, 07:06

hi twiztedmike,

thank you very much for your reply!
I will add your comment on the blog site.

Nice, that it also works for you :-)

hopefully we will get some kind of access to some script-exits / overloading or whatever later to have also the opportunity to change game server functionality.

cheers
schpidi
Visit my new blog about LiF:YO LIVE-Map, database modding, additions and scripts:
http://lif-tools.blogspot.com/

User avatar
HolyCrusader
Beta Tester
 
Posts: 251
Joined: 24 Nov 2014, 15:47

Re: Workaround / Improvement of the durability loss problem

Post by HolyCrusader » 13 May 2015, 16:38

Hey Schpidi

Can these scripts be modified to include buildings like warehouses/large keeps?

The reason is that trebuchets are OP right now and currently destroy these building 1 or 2 hits.


I guess we just find the Parent ID of ALL buildings and use that eh? I'll have a look when I get home today and test it out!


Schpidi
 
Posts: 21
Joined: 26 Apr 2015, 20:17

Re: Workaround / Improvement of the durability loss problem

Post by Schpidi » 13 May 2015, 21:39

I think so :)

For keeps I found the parent ID 130 that should improve it.
But be aware, that 65535 is currently the maximum possible value the game server will accept. This is because of integer type SMALLINT in the game-server I think.

I also tested to put higher values for durability, but then the game-server will only use the modular value from it: eg. 1000000 will become 16975 after server restart. So putting 65535 is definitely the best option.

If you change it, you should be aware of your own balancing, that means Large Keep should be better than small keep ;)
Visit my new blog about LiF:YO LIVE-Map, database modding, additions and scripts:
http://lif-tools.blogspot.com/

User avatar
HolyCrusader
Beta Tester
 
Posts: 251
Joined: 24 Nov 2014, 15:47

Re: Workaround / Improvement of the durability loss problem

Post by HolyCrusader » 13 May 2015, 21:57

Schpidi wrote:I think so :)

For keeps I found the parent ID 130 that should improve it.
But be aware, that 65535 is currently the maximum possible value the game server will accept. This is because of integer type SMALLINT in the game-server I think.

I also tested to put higher values for durability, but then the game-server will only use the modular value from it: eg. 1000000 will become 16975 after server restart. So putting 65535 is definitely the best option.

If you change it, you should be aware of your own balancing, that means Large Keep should be better than small keep ;)

Maybe its possible to put your Query that modifies the max durability in the patch.sql to modify the Stronger buildings durability to be higher than 65535 & if implemented with a nightly auto-restart we never have to worry about it.


Schpidi
 
Posts: 21
Joined: 26 Apr 2015, 20:17

Re: Workaround / Improvement of the durability loss problem

Post by Schpidi » 13 May 2015, 22:11

Yep but I also tried with restarting the server.

One problem remains: the game-server interprets a too big value wrong and the result is the remaining value of a modulo division.

Better solution would be to adjust the damage of the siege weapon, but I think we are not able to change that yet.
Visit my new blog about LiF:YO LIVE-Map, database modding, additions and scripts:
http://lif-tools.blogspot.com/

User avatar
HolyCrusader
Beta Tester
 
Posts: 251
Joined: 24 Nov 2014, 15:47

Re: Workaround / Improvement of the durability loss problem

Post by HolyCrusader » 05 Jun 2015, 02:47

Schpidi wrote:Yep but I also tried with restarting the server.

One problem remains: the game-server interprets a too big value wrong and the result is the remaining value of a modulo division.

Better solution would be to adjust the damage of the siege weapon, but I think we are not able to change that yet.

Would it be possible to add a before update trigger to add durability to the building before the siege damages a structure?

User avatar
Razoreqx
 
Posts: 91
Joined: 06 Oct 2014, 13:13

Re: Workaround / Improvement of the durability loss problem

Post by Razoreqx » 05 Jun 2015, 13:08

Read your blog. Nice work btw. Could you summarize the procedure a bit more for durability loss?

I assume you create a function.sql file and then add a procedure call to call the function in the patch.sql file but unclear as to what goes where....

Thanks!
Razors Edge
A Life is Feudal Persistent World
http://razors-edge.org
22 Custom MODS / Custom Graphics models Planned. Visit our Gallery.

User avatar
HolyCrusader
Beta Tester
 
Posts: 251
Joined: 24 Nov 2014, 15:47

Re: Workaround / Improvement of the durability loss problem

Post by HolyCrusader » 05 Jun 2015, 14:30

Razoreqx wrote:Read your blog. Nice work btw. Could you summarize the procedure a bit more for durability loss?

I assume you create a function.sql file and then add a procedure call to call the function in the patch.sql file but unclear as to what goes where....

Thanks!

1) Procedure to get Parent ID: This procedure basically gets the parent ID that comprises ALL the Crafting Structures - so that the rest of the scripts that get run are done against ALL the crafting structures
2) Query that takes all EXISTING crafting structures & raises max durability to 65535
3) Trigger that makes any NEW crafting structures built & raises max durability to 65535
4) Trigger that refunds a % of durability back to the structure after durability loss once the server gets restarted

User avatar
Razoreqx
 
Posts: 91
Joined: 06 Oct 2014, 13:13

Re: Workaround / Improvement of the durability loss problem

Post by Razoreqx » 05 Jun 2015, 16:28

Twiztedmike wrote:
Razoreqx wrote:Read your blog. Nice work btw. Could you summarize the procedure a bit more for durability loss?

I assume you create a function.sql file and then add a procedure call to call the function in the patch.sql file but unclear as to what goes where....

Thanks!

1) Procedure to get Parent ID: This procedure basically gets the parent ID that comprises ALL the Crafting Structures - so that the rest of the scripts that get run are done against ALL the crafting structures
2) Query that takes all EXISTING crafting structures & raises max durability to 65535
3) Trigger that makes any NEW crafting structures built & raises max durability to 65535
4) Trigger that refunds a % of durability back to the structure after durability loss once the server gets restarted



Many many thanks!
Razors Edge
A Life is Feudal Persistent World
http://razors-edge.org
22 Custom MODS / Custom Graphics models Planned. Visit our Gallery.


Schpidi
 
Posts: 21
Joined: 26 Apr 2015, 20:17

Re: Workaround / Improvement of the durability loss problem

Post by Schpidi » 05 Jun 2015, 23:40

hi razor, sorry for beeing to late and mike thanks for helping out ;)

about the question with siege weapons.
for sure it is also possible to change the database values for keeps/walls etc. when attacked (dura loss).
BUT please don´t forget : this would only have an effect after restarting the server.
Visit my new blog about LiF:YO LIVE-Map, database modding, additions and scripts:
http://lif-tools.blogspot.com/

Return to Game mods

cron