Sign in to follow this  
Mthec

[FINAL] Upkeep Costs

Recommended Posts

8 minutes ago, Mthec said:

Update

Fixed Epic guard costs not applying.

Added further comments.

 

Download

 

Sorry, I couldn't think up a name that was short but descriptive enough.  If anyone has a suggestion let me know.

 

So I've added extra comments to the .properties files to hopefully make things clear.  The per server files that are saved don't keep line comments and the order isn't set, so I've added a comment block to the top that explains the values.

I hadn't tested Epic severs, sorry about that.  It seems the value used to set Epic guard costs are hard coded rather than taking the value I expected.  I've fix it now.

Tested, works.

Thanks everyone!
Thanks Mthec!

Share this post


Link to post
Share on other sites

I have noticed that when launching the servers application your mod is generating a class in the servers root. D:\...\Wurm Unlimited Dedicated Server\com\wurmonline\server\villages\GuardPlan.class

 

Is this unexpected behavior? Or is this some thing you had planned and is a needed process?

Share this post


Link to post
Share on other sites

Update

Stopped unnecessary file being written to server root.

 

Download

 

47 minutes ago, Crustyfoot said:

I have noticed that when launching the servers application your mod is generating a class in the servers root. D:\...\Wurm Unlimited Dedicated Server\com\wurmonline\server\villages\GuardPlan.class

 

Is this unexpected behavior? Or is this some thing you had planned and is a needed process?

Ah, I misunderstood something from the tutorial, thought it did something else and missed the file being put there.  I've updated so it won't do that now.

 

Thanks for the catch, and sorry for the inconvenience.  You can safely delete that file.

Share this post


Link to post
Share on other sites

I don't know whom to blame, but look at this...
You'll see that I have 10 coppers, monthly upkeep is less than 2 copper, yet I have only 5 days of upkeep left???
EAB82CCB7DE8F45D1FF700F703AC6BAC612861E3

 


Also how do I destroy that Ebony Wand? I was trying to give me back my own money after my deed was instantly deleted.

I set the "into_upkeep" to 0.
At deed creation my upkeep money is 0.
Withdrawn from the new deed all my money to deposit them into upkeep.
Changed bank to my own deed.
Discovered that I can only add money to upkeep from my bank account.
Discovered that my bank account will take 24h to transfer.
The deed was deleted before I could think what to do (probably go to my old bank would have worked).
So I first trying by becoming an admin, then I managed with sqlite.
I removed myself from admin, but I still have that wand, and I want it to be eradicated from the server. Will it burn?
Sorry for offtopic!
------------------------------------------------------------------------------------------------------------------

I managed to remove the wand with sqlite.

Edited by Dzhalagash
Solved 1 out of 2 issues.

Share this post


Link to post
Share on other sites
53 minutes ago, Dzhalagash said:

I don't know whom to blame, but look at this...
You'll see that I have 10 coppers, monthly upkeep is less than 2 copper, yet I have only 5 days of upkeep left???

------------------------------------------------------------------------------------------------------------------

I managed to remove the wand with sqlite.

That is almost 6 days of upkeep time and it is approximate.

10.14/1.51 = 6.71 so this looks like you should have close to 7 days of upkeep but I think that maybe the game rounds irons to the nearest? perhaps to the games favor. It really is not a huge difference though.

A good way to think of it perhaps is that it wont drain your bank dry if you were ever worried about having two irons to rub together. :-)

I am pretty sure it is not Mthec plugin that is causing this. I bet there is some thead even in the WO sections that had someone really get in up to there elbows in math and have figured out the formula.

Share this post


Link to post
Share on other sites
12 hours ago, Crustyfoot said:

That is almost 6 days of upkeep time and it is approximate.

10.14/1.51 = 6.71 so this looks like you should have close to 7 days of upkeep but I think that maybe the game rounds irons to the nearest? perhaps to the games favor. It really is not a huge difference though.

A good way to think of it perhaps is that it wont drain your bank dry if you were ever worried about having two irons to rub together. :-)

I am pretty sure it is not Mthec plugin that is causing this. I bet there is some thead even in the WO sections that had someone really get in up to there elbows in math and have figured out the formula.

You forget that 1c50i is the MONTHly upkeep, not daily.
Even then, your calculation (that I already did anyway) is wrong and therefore can't be the answer to the question.
EDIT: The calculation is correct, but 6,71 != 5.83. This is still not a viable answer even after you consider that for Wurm a month is 28 days long.
Also, mind that currently my deed is the minimum size acceptable. 1 tile (both perimeter and deed) is 1i, and guards (3 of them) are 10i each.
That means that with a non modded game, daily upkeep would be several silvers… Daily? That's not even possible/sustainable!

EDIT: The default monthly cost for a minimal deed without mod would be 1s for the deed plus 8.242 for 3 guards. Not even a group of 8 people (11 max citizens - 3 guards) can manage to consistently cover that if it was daily.

Edited by Dzhalagash
I was a tad ashamed by my grammar.

Share this post


Link to post
Share on other sites
1 hour ago, Dzhalagash said:

You forget that 1c50i is the MONTHly upkeep, not daily.
And even then your calculation (that I already did anyway), is wrong and therefore can't be the answer to the question.
Also mind that currently my deed is the minimum size acceptable. 1 tile (both perimeter and deed) is 1i, and guards (3 of them) are 10i each.
This means that with a non modded game, daily upkeep would be several silver… daily? That's not even possible/sustainable.

DOH! (*Crustyfoot* gives hia calculator a dirty look)

Your right, Dang that is rather messed up

Share this post


Link to post
Share on other sites
23 hours ago, Dzhalagash said:

I don't know whom to blame

...

 

I hadn't looked deep enough into the code.  The upkeep is polled around once every 8 minutes, when this happens it takes the appropriate amount of money out of the upkeep fund.  Unfortunately the upkeep deals in whole numbers only, meaning with very small levels of upkeep it rounds it up to the smallest amount possible, 1 iron.  The number of days left in your screenshot adds up when this is taken into account.

 

So what I've done is created a sort of upkeep buffer, whenever the amount to take out is lower than 1i it stores this amount in a variable, then once this variable goes over 1i it processes a normal turn taking out 1i and leaving the remainder in the buffer.  So that this value isn't lost I've created a new table in the database to keep track of this value. 

 

Although this seems to work I haven't had time to test it thoroughly, and it should probably be run for a while when I do.  Unless there is some way to increase the poll interval without knocking other things out of balance, possibly hiding some problem that will turn up later.  So for the moment I've created a "beta" release, feel free to use it if you wish, but it may cause some issues.  Download

 

I'm very sorry for the inconvenience.

Share this post


Link to post
Share on other sites
14 hours ago, Mthec said:

...

 

I hadn't looked deep enough into the code.  The upkeep is polled around once every 8 minutes, when this happens it takes the appropriate amount of money out of the upkeep fund.  Unfortunately the upkeep deals in whole numbers only, meaning with very small levels of upkeep it rounds it up to the smallest amount possible, 1 iron.  The number of days left in your screenshot adds up when this is taken into account.

 

So what I've done is created a sort of upkeep buffer, whenever the amount to take out is lower than 1i it stores this amount in a variable, then once this variable goes over 1i it processes a normal turn taking out 1i and leaving the remainder in the buffer.  So that this value isn't lost I've created a new table in the database to keep track of this value. 

 

Although this seems to work I haven't had time to test it thoroughly, and it should probably be run for a while when I do.  Unless there is some way to increase the poll interval without knocking other things out of balance, possibly hiding some problem that will turn up later.  So for the moment I've created a "beta" release, feel free to use it if you wish, but it may cause some issues.  Download

 

I'm very sorry for the inconvenience.

Mthec when  I said "whom to blame" I was thinking in a playful tone.

I appreciate your mod and your work.

(And actually I really didn't even knew if it was a bug of the game or what)
I like your solution, I will install the update tonight and I'll let you know.
Thanks for the help again!

  • Like 1

Share this post


Link to post
Share on other sites
4 hours ago, Dzhalagash said:

Mthec when  I said "whom to blame" I was thinking in a playful tone.

I appreciate your mod and your work.

(And actually I really didn't even knew if it was a bug of the game or what)
I like your solution, I will install the update tonight and I'll let you know.
Thanks for the help again!

Sorry, I was just blaming myself.  I didn't think you meant anything bad by it, I've just been a little self-critical lately.

 

Thank you for the feedback.

Edited by Mthec
  • Like 1

Share this post


Link to post
Share on other sites
21 minutes ago, Mthec said:

Sorry, I was just blaming myself.  I didn't think you meant anything bad by it, I've just been a little self-critical lately.

 

Thank you for the feedback.

Don't be too hard on yourself, your doing great. It is not easy doing what your doing. I know, and even though I have steered clear of even looking at the code of Rolf's Frankensteinish monster. I can guess at the horrors you must face. ;-)

  • Like 1

Share this post


Link to post
Share on other sites

Update

Changes now tested.
Fixed edge case where changing upkeep cost could have caused the wrong amount to be charged.
Output of charges now available with ui version. (upkeep_output=true)
Verified working with next Wurm Unlimited release (2015-12-21 beta release).

 

Download

 

The fixes worked for the most part, there was just an edge case where if you were charging less than 1i upkeep per poll (~8 mins) and then changed the values or changed the deed size/guard amount to go over that 1i, you could end up with free upkeep.  The output was just something I added to aid testing.

On 11/12/2015 at 6:18 PM, Crustyfoot said:

Don't be too hard on yourself, your doing great. It is not easy doing what your doing. I know, and even though I have steered clear of even looking at the code of Rolf's Frankensteinish monster. I can guess at the horrors you must face. ;-)

It's alive!

 

Ahem, I mean it's done.  ;)

 

Thank you for the feedback, and sorry it took so long.

Share this post


Link to post
Share on other sites

hello =)

is it possible that you have like 3200 free deed tiles and all tiles more will cost upkeep?

 

lg Eject

Share this post


Link to post
Share on other sites

Hello,

 

May i suggest you also allow to change the minimum drain for PVP servers.

 

@ Eject : I don't know how Mthec's code is written but I think it could be easily done.

I think the method to change is getMonthlyCost from com.wurmonline.server.villages.GuardPlan

It does not take arguments and return the value of the upkeep as a long.

So you can pretty much replace it with whatever formula you desire.

 

Regards

 

Albibak

 

Share this post


Link to post
Share on other sites

Sorry for the late response, I missed it until last Tuesday when reading the forums, then since I've been a little engrossed in another game.

 

On 19/02/2016 at 8:29 AM, Eject said:

ello =)

is it possible that you have like 3200 free deed tiles and all tiles more will cost upkeep?

 

lg Eject

Update

Added two new options, free_tiles and free_perimeter.

 

The number of tiles specified will be removed from the cost and upkeep calculations.

 

Download

 

I've given it a little test run and it seems to work fine, just let me know if anything comes up.

On 20/02/2016 at 2:16 PM, Albibak said:

Hello,

 

May i suggest you also allow to change the minimum drain for PVP servers.

 

*snip*

Haven't started on this one yet, but will work on it next.  With a quick look it seems like getting that to work will also allow other values related to draining to be changed.

Share this post


Link to post
Share on other sites
On 20/02/2016 at 2:16 PM, Albibak said:

Hello,

 

May i suggest you also allow to change the minimum drain for PVP servers.

 

*snip*

Update

Draining options added.

min_drain - The minimum amount taken on a successful drain.

max_drain_modifier - The drain modifier increases the amount gained on a successful drain.  This value sets its maximum.

drain_modifier_increment - The amount the drain modifier increases on a successful drain.

 

Was easier than I expected.  Although I haven't done extensive testing on it due to drain timers.  Should probably get to creating a test server environment specifically deal with these changes.

 

Download

 

Thanks for the suggestion.

Edited by Mthec
Changed link to hotfix.

Share this post


Link to post
Share on other sites
19 hours ago, Mthec said:

Update

Draining options added.

min_drain - The minimum amount taken on a successful drain.

max_drain_modifier - The drain modifier increases the amount gained on a successful drain.  This value sets its maximum.

drain_modifier_increment - The amount the drain modifier increases on a successful drain.

 

Was easier than I expected.  Although I haven't done extensive testing on it due to drain timers.  Should probably get to creating a test server environment specifically deal with these changes.

 

Download

 

Thanks for the suggestion.

This does not seem compatible with WurmServerLauncher 0.16.1

the servers console and server gui fails to load. This is your non gui version of this mod. I can not attest to the functionality of the other.

Share this post


Link to post
Share on other sites

thanks mthec for the free tiles option.

what will happen with the deeds if you dont pay the upkeep for the tiles you have more then the free tiles?

 

Eject

Share this post


Link to post
Share on other sites
2 hours ago, Crustyfoot said:

This does not seem compatible with WurmServerLauncher 0.16.1

the servers console and server gui fails to load. This is your non gui version of this mod. I can not attest to the functionality of the other.

Sorry about that.  I changed the location of the translation files before making these changes, and didn't test them on the non-ui version.  Should all work fine now.

 

Download

24 minutes ago, Eject said:

thanks mthec for the free tiles option.

what will happen with the deeds if you dont pay the upkeep for the tiles you have more then the free tiles?

 

Eject

It will act the same as if you had no free tiles, and start the disband process.  The King wants his coin.  Was there another way you like it to behave?

Share this post


Link to post
Share on other sites

hello mthec

i believe its not possible that just the additional tiles will be disbanded but i have another idea.

if the upkeep runs out, it would be awesome that the mayor get an info at login like "please pay for the upkeep or shrink your deed down to the free tiles until 2 weeks (time can you set in the mod) otherwise your deed will completely disbanded, the number of free tiles you can have is xxxx tiles"

 

maybe this is a good idea for you :)

Eject

Edited by Eject

Share this post


Link to post
Share on other sites

Need help getting this mod to run.

 

1- I am running wurm Unlimited on a hosted server

2- They have Ago's modloader set up on the server ( Wurm Modloader 0.18)

3- I have checked the command line and it is set to start wurm using modlauncher.jar (server hosts set that up)

4- I downloaded the upkeepcosts zip un zipped it and placed it in the mods folder under a folder I created upkeepcosts

5- both the jar file and the properties file are in the /mod/upkeepcosts folder

6- one extra note this is a server that was been running for 3 months with no deed upkeep

7- So my question is have I missed a step as when I start the game with deed upkeep checked it uses the default settings

Share this post


Link to post
Share on other sites

the properties file needs to be in the ../mods folder.

Share this post


Link to post
Share on other sites

Thanks that was it moved up one so it was in ../mods and not in ../mods/upkeepcosts/

Now I have a new issue with the mod. It has the deed drain set to 75 copper. I have tried changing it in the upkeepcosts property file. both in the ../mods folder even went into the adventure.c folder and changed then deleted it from there. Still the drain says 75 copper.

 

I even went so far as to delete folders except for the adventure.c and my backup folder I then went into the adventure.c folder deleted the mod folder and everything in it. I then re-uploaded the server files from steam to the server. installed the modloader added the correct upkeepcosts file with min_drain set to 25. And started the server and all settings where what the file was set to except drain is still set at 75 copper. This is way to much as it can drain a town in a few days.

 

Any suggestions on how to fix this.

Edited by CCSLider

Share this post


Link to post
Share on other sites
On 23/05/2016 at 11:36 PM, CCSLider said:

Any suggestions on how to fix this.

Apologies for not being around lately.

 

Sorry you've been having difficulties, I've given it a quick test and don't seem to have any problems on my end.  I set min_drain to 2500 (25c) and drained a deed and got 35c something.

 

Can I just verify, you've changed the min_drain in Wurm Folder/Adventure/mods/upkeepcosts/upkeepcosts.properties and in Wurm Folder/mods/upkeep.properties and when you launch the server you should get a line in the console that says something like:

INFO: Upkeep costs are as follows: Tile 1 copper, 20 iron, 10 free tiles - Perimeter 50 iron, 5 iron, 100 free tiles - Guards 10 iron, 10 iron - Minimum 0 irons - Into Upkeep 0 irons - Name change 5 silver
Draining values are as follows: Minimum drain 25c, Maximum drain modifier 5.0, Drain modifier increment 0.5

And all the values have changed correctly, except "Minimum drain"?  No "WARNING"s show in the console?

Share this post


Link to post
Share on other sites

Okay I saw you had yours set to min 25 copper (2500) so I adjusted mine from 25 iron (25) to 2 copper (200) in case it was having a issue with the smaller numbers. And then ran it I received this in the command line when restarting

 

"INFO mod.wurmonline.mods.upkeepcosts.UpkeepCosts: Upkeep costs are as follows: Tile 10 iron, 1 iron, 0 free tiles - Perimeter 5 iron, 1 iron, 0 free tiles - Guards 3 copper, 3 copper - Minimum 1 copper - Into Upkeep 3 copper - Name change 50 iron

Draining values are as follows: Minimum drain 2c, Maximum drain modifier 2.0, Drain modifier increment 0.5"

 

 

And I see this:

upkeep%20image.png

 

 

I even went and adjusted the min_drain up to 2000 just to sse if it changed it.

 

"

INFO mod.wurmonline.mods.upkeepcosts.UpkeepCosts: Upkeep costs are as follows: Tile 10 iron, 1 iron, 0 free tiles - Perimeter 5 iron, 1 iron, 0 free tiles - Guards 3 copper, 3 copper - Minimum 1 copper - Into Upkeep 3 copper - Name change 50 iron

Draining values are as follows: Minimum drain 20c, Maximum drain modifier 2.0, Drain modifier increment 0.5"

 

you can see it increased to 20 on the command line. Yet no change in the settlement Upkeep windows it stayed the same at 75 copper.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this