Sign in to follow this  
Mthec

[FINAL] Upkeep Costs

Recommended Posts

@MthecMod has been working great the exploit is fixed! I still have one small problem with the guards, I would like players making a new deed to get 2 free guards, but pay for more guards. Also they cant add guards using "manage guards" when making a deed with upkeep off because we get message "There was not enough upkeep to increase the number of guards. Please make sure that there is at least one month of upkeep left after you hire the guards." only way to buy new guards is to use resize deed because it takes the money from the bank instead of upkeep but with new players they can't buy any guards during the making of a new deed because they have no money in the bank..

 

basically: I just want players to get 2 free guards during creation of new deed and to "buy" new guards with managed guards while upkeep is turned off.

Edited by Darkness1990

Share this post


Link to post
Share on other sites

Update and fix

Download

 

Fix for "Manage guards" when not using upkeep.  Select the new checkbox at the bottom to take money from your bank instead (if there is enough money).
Added free_guards option (default 0), deeds will be able to hire the specified number of guards without initial cost or added upkeep. Any further guards will cost as normal.
Updated some mechanics I missed from the last WU update.
Added epic_upkeep_scaling option (default true), epic guards now hire on a scaling upkeep system (initial hiring costs are unaffected) which I missed before. Now you can choose between the scaling option or "standard" on epic servers.

 

Don't forget to check your settings on the per server .properties file.

On 6/25/2019 at 5:46 PM, Darkness1990 said:

@MthecMod has been working great the exploit is fixed! I still have one small problem with the guards, I would like players making a new deed to get 2 free guards, but pay for more guards. Also they cant add guards using "manage guards" when making a deed with upkeep off because we get message "There was not enough upkeep to increase the number of guards. Please make sure that there is at least one month of upkeep left after you hire the guards." only way to buy new guards is to use resize deed because it takes the money from the bank instead of upkeep but with new players they can't buy any guards during the making of a new deed because they have no money in the bank..

 

basically: I just want players to get 2 free guards during creation of new deed and to "buy" new guards with managed guards while upkeep is turned off.

Hopefully this will sort things out for you.

Share this post


Link to post
Share on other sites

@MthecI just noticed that since the new version, the irons per tile upkeep portion is not working. I have it set to 10 iron per tile, but we're still being charged 20 iron.  All the other settings we have seem to be working fine, so the mod is definitely active.  We also have deedmod (by@Keenan), which controls max deed size and number of deeds per Steam ID, as well as GM deedmaker (by@Cuddles) that allows GMs to create multiple deeds, but I'm not aware of any conflicts with either of these.

 

In the server log, it shows settings that look incorrect to me, and don't match what we configured in the properties file.  

Here are our configs:

Spoiler

classname=mod.wurmonline.mods.upkeepcosts.UpkeepCosts
classpath=upkeepcosts.jar

# Upkeep costs - in irons
# Costs per deeded tile
tile_cost=0
tile_upkeep=10
# Costs per perimeter tile
perimeter_cost=5000
perimeter_upkeep=5000
# Minimum value for upkeep
minimum_upkeep=1000
# Extra money added to the founding charge that goes into upkeep
into_upkeep=0
# Cost for changing deed name during Resize
name_change=50000

# Values vary depending on server type:
# Normal
# Epic/Challenge
normal_guard_cost=10000
normal_guard_upkeep=10000
epic_guard_cost=30000
epic_guard_upkeep=10000
epic_guard_upkeep_scaling=true

# Number of free tiles
free_tiles=0
# Number of free perimeter tiles
# The 5 minimum "layers" are always free
free_perimeter=0
# Number of free guards
free_guards=0

# Minimum amount drained
min_drain=7500
# When draining a deed the amount drained increases with every drain.  This sets the maximum this increase can reach. (decimal)
max_drain_modifier=5.0
#The amount the drain modifier increases with every successful drain. (decimal)
drain_modifier_increment=0.5

 

And here's what shows up in the server log:

Spoiler

[02:52:58 PM] INFO mod.wurmonline.mods.upkeepcosts.UpkeepCosts: Upkeep costs are as follows: Tile 10 iron, 20 iron, 0 free tiles - Perimeter 50 copper, 50 copper, 0 free tiles - Guards 0 irons, 1 silver, use Epic guard upkeep scaling false, 0 free guards - Minimum 1 silver - Into Upkeep 3 silver - Name change 5 silver

 

I should clarify that even though the serverlog seems to be saying it is charging 10 iron per tile to deed, we're actually not getting charged.  And I just noticed "Guards 0 irons, 1 silver" but it's costing us 1 silver to hire, 1 silver upkeep in reality, which is what we wanted.

 

Edited by Batta

Share this post


Link to post
Share on other sites

Hmm, that doesn't look right at all @Batta.  Some of the other values are off according to the message.  That looks like the main .properties, does the per server file have the same values (WurmServerLauncher/<server-name>/mods/upkeepcosts/upkeepcosts.properties)?

 

Also, to help narrow it down, at what stage does this happen, founding, resizing/expanding, just hiring extra guards or all of the above?

Share this post


Link to post
Share on other sites
On 9/13/2019 at 3:41 PM, Mthec said:

Hmm, that doesn't look right at all @Batta.  Some of the other values are off according to the message.  That looks like the main .properties, does the per server file have the same values (WurmServerLauncher/<server-name>/mods/upkeepcosts/upkeepcosts.properties)?

 

Also, to help narrow it down, at what stage does this happen, founding, resizing/expanding, just hiring extra guards or all of the above?

We're on a server host and have just one server.  The mod is in the mods folder in the root directory.

So it's <numerical name of root directory>/mods/upkeepcosts  with no mods folder within the server file.  Is it supposed to go in there?  I've never put any mods into the actual server folder.  Maybe that's the problem?

 

Nothing really is happening, exactly.  Just when players try to deed it's telling them the vanilla price and charging it.  But it is getting some of it right -- 1s to hire a templar, 1s per month.   50c per upkeep tile. 

 

EDIT:  OH.  I didn't realize there is an auto-generated folder inside the server mods folder!  And yes, the figures there were off in exactly the ways that were causing me problems.  Are they supposed to automatically follow what we put in the other properties file (in the main mods folder)?  Or are we meant to manually do it.  Anyway, this fixes the issue for me.  🙂

Edited by Batta
  • Like 1

Share this post


Link to post
Share on other sites
10 hours ago, Batta said:

*snip*

 

EDIT:  OH.  I didn't realize there is an auto-generated folder inside the server mods folder!  And yes, the figures there were off in exactly the ways that were causing me problems.  Are they supposed to automatically follow what we put in the other properties file (in the main mods folder)?  Or are we meant to manually do it.  Anyway, this fixes the issue for me.  🙂

Yeah, the original intention behind it was if people wanted different prices per server.  I also did it back when mods were still somewhat new and didn't know if server specific options would be a thing.  They do need copying manually, although I will probably add an option to the main .properties file that will allow automatic overriding for single server setups, as it's not typical behaviour and can be easily forgotten when changing values at a later date.

 

Anyway, glad it's resolved for you.

  • Like 1

Share this post


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

Yeah, the original intention behind it was if people wanted different prices per server.  I also did it back when mods were still somewhat new and didn't know if server specific options would be a thing.  They do need copying manually, although I will probably add an option to the main .properties file that will allow automatic overriding for single server setups, as it's not typical behaviour and can be easily forgotten when changing values at a later date.

 

Anyway, glad it's resolved for you.

I notice that the format of the in-server version is quite different than the main version.  It might help with copying if they could be the same format, so we could just copy and paste.  Is that doable?

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, Batta said:

I notice that the format of the in-server version is quite different than the main version.  It might help with copying if they could be the same format, so we could just copy and paste.  Is that doable?

The reason the order is all jumbled is because the file was generated by the mod, and the only way I found to make it preserve order seemed a bit involved at the time.  But it doesn't actually matter which order the entries are in, so you can copy and paste as you like.

 

The only important bit is the "classname" and "classpath", they must be in the main .properties file for ago's modlauncher to find the mod.  It wouldn't matter if they were copied into the per server file though, they would be ignored.

  • Like 1

Share this post


Link to post
Share on other sites

Update

Download

 

Added use_per_server_settings to the .properties file.  If true it will use a .properties file in the individual server folders, if false it will only use the main mod file.  Default is true, to keep it in-line with previous behaviour.  Changing the value will not delete the old per server files, so you can switch back and forth at will.

 

Also took the time to refresh the mod a little.  It was one of my first and I've learnt a lot since then.  May have found (and fixed) a bug with disband warnings along the way.

Share this post


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

Added use_per_server_settings to the .properties file.  If true it will use a .properties file in the individual server folders, if false it will only use the main mod file.  Default is true, to keep it in-line with previous behaviour.  Changing the value will not delete the old per server files, so you can switch back and forth at will.

 

Also took the time to refresh the mod a little.  It was one of my first and I've learnt a lot since then.  May have found (and fixed) a bug with disband warnings along the way.

Great!  Thank you very much.  🙂

Share this post


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

Added use_per_server_settings to the .properties file.  If true it will use a .properties file in the individual server folders, if false it will only use the main mod file. 

@Mthec There appears to be a problem.  I had to delete the upkeepcosts folder from the server folder, or else setting "use_per_server_settings=false" didn't work, and it still used the settings from the server mods folder.  As soon as I started the server it created a new upkeepcosts folder in the server mods folder, with the same settings as I have in the main mods folder.

 

I then tested by changing the settings in the server mods folder only, still keeping "use_per_server_settings=false" in the main mods folder, but it used the server mod instead of the main mod.

Share this post


Link to post
Share on other sites

Fix

Download

 

Fixed use_per_server_settings option.

15 hours ago, Batta said:

@Mthec There appears to be a problem.  I had to delete the upkeepcosts folder from the server folder, or else setting "use_per_server_settings=false" didn't work, and it still used the settings from the server mods folder.  As soon as I started the server it created a new upkeepcosts folder in the server mods folder, with the same settings as I have in the main mods folder.

 

I then tested by changing the settings in the server mods folder only, still keeping "use_per_server_settings=false" in the main mods folder, but it used the server mod instead of the main mod.

So sorry@Batta, I must have broke it when I was cleaning things up.

 

Thank you for your continued feedback.

  • Like 1

Share this post


Link to post
Share on other sites
Quote

# Minimum value for upkeep
minimum_upkeep=10000

@Mthec I seem to have found another little glitch, with this setting.  Is it supposed to mean that if players found a tiny deed, they will still be charged at least 1 silver upkeep?  That was my intention, but we're getting players being charged just a few coppers per month.

Edited by Batta

Share this post


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

@Mthec I seem to have found another little glitch, with this setting.  Is it supposed to mean that if players found a tiny deed, they will still be charged at least 1 silver upkeep?  That was my intention, but we're getting players being charged just a few coppers per month.

That's what it is supposed to do.  It seems to be working fine on my end so I am not sure what the problem is.

 

When the deed owners check their upkeep does it show the correct cost per month, or is that wrong too?

Share this post


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

When the deed owners check their upkeep does it show the correct cost per month, or is that wrong too?

Oh good, you are right.  Thanks again!

Share this post


Link to post
Share on other sites

Hi, I have a question about your Upkeep mod. Actually a few questions.

 

Im trying to set up the server to allow players a free deed of 21x21 with 1 free Guard. [Works]

I limited the Deed size allowed by a specific MAX size as well as Max Tile amount Via a Different mod. [Works]

I have Deed cost turned ON so any deed higher then 21x21 will cost Money to make. [works]

 

So here is the problem. I lowered the Minimal Upkeep Costs to 0s. [Which works]

And when i Toggle ON upkeep cost with Server, even though it costs 0s, it still disbands after the 8min Tick.

If i toggle OFF the Server upkeep it makes deeds that are higher then 21x21 have 0 Upkeep as well.

 

What am I trying to do?

Well I want to allow free deeds up to the size of 21x21 with 0 Upkeep. But if they decide to expand bigger then that, I want it to cost money to MAKE as well as an Upkeep. Is this possible with the current mod? Is there something in the settings i'm missing?

 

classname=mod.wurmonline.mods.upkeepcosts.UpkeepCosts
classpath=upkeepcosts.jar
sharedClassLoader=true

# Upkeep costs - in irons
# Costs per deeded tile
tile_cost=100
tile_upkeep=20
# Costs per perimeter tile
perimeter_cost=50
perimeter_upkeep=5
# Minimum value for upkeep
minimum_upkeep=0
# Extra money added to the founding charge that goes into upkeep
into_upkeep=0
# Cost for changing deed name during Resize
name_change=50000

# Values vary depending on server type:
# Normal
# Epic/Challenge
normal_guard_cost=20000
normal_guard_upkeep=10000
epic_guard_cost=30000
epic_guard_upkeep=10000
epic_guard_upkeep_scaling=true

# Number of free tiles
free_tiles=441
# Number of free perimeter tiles
# The 5 minimum "layers" are always free
free_perimeter=0
# Number of free guards
free_guards=1

# Minimum amount drained
min_drain=7500
# When draining a deed the amount drained increases with every drain.  This sets the maximum this increase can reach. (decimal)
max_drain_modifier=5.0
#The amount the drain modifier increases with every successful drain. (decimal)
drain_modifier_increment=0.5

use_per_server_settings=false

 

Any help with this would be greatly appreciated. Also, the "Settlement > Manage Guard" option doesnt work for me. Its spiting out an error in Console.

[12:57:45 PM] INFO com.wurmonline.server.creatures.Communicator: Ozpin- communication failed:
org.gotti.wurmunlimited.modloader.classhooks.HookException: java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: com/wurmonline/server/questions/ParseGuardRentalQuestion
        at org.gotti.wurmunlimited.modloader.classhooks.HookManager.invoke(HookManager.java:394)
        at com.wurmonline.server.questions.QuestionParser.parseGuardRentalQuestion(QuestionParser.java)
        at com.wurmonline.server.questions.GuardManagementQuestion.answer(GuardManagementQuestion.java:28)
        at com.wurmonline.server.creatures.Communicator.reallyHandle_CMD_BML_FORM(Communicator.java:3504)
        at com.wurmonline.server.creatures.Communicator.reallyHandle(Communicator.java:2403)
        at com.wurmonline.communication.SocketConnection.tick(SocketConnection.java:618)
        at com.wurmonline.communication.SocketServer.tick(SocketServer.java:172)
        at com.wurmonline.server.Server.run(Server.java:2527)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)
Caused by: java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: com/wurmonline/server/questions/ParseGuardRentalQuestion
        at mod.wurmonline.mods.upkeepcosts.UpkeepCosts.lambda$preInit$14(UpkeepCosts.java:505)
        at org.gotti.wurmunlimited.modloader.classhooks.InvocationTarget.resolveInvocationHandler(InvocationTarget.java:45)
        at org.gotti.wurmunlimited.modloader.classhooks.HookManager.invoke(HookManager.java:384)
        ... 9 more
Caused by: java.lang.NoClassDefFoundError: com/wurmonline/server/questions/ParseGuardRentalQuestion
        ... 12 more
Caused by: java.lang.ClassNotFoundException: com.wurmonline.server.questions.ParseGuardRentalQuestion
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at javassist.Loader.delegateToParent(Loader.java:431)
        at org.gotti.wurmunlimited.modloader.classhooks.HookManager$1.delegateToParent(HookManager.java:174)
        at javassist.Loader.loadClass(Loader.java:311)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 12 more

To get around this I have to "Settlement > resize" to adjust guard count there.

Share this post


Link to post
Share on other sites

Fix

Download

 

Fixed missing class file.

0 upkeep deeds should not disband.

55 minutes ago, Sprigor said:

Hi, I have a question about your Upkeep mod. Actually a few questions.

 

Im trying to set up the server to allow players a free deed of 21x21 with 1 free Guard. [Works]

I limited the Deed size allowed by a specific MAX size as well as Max Tile amount Via a Different mod. [Works]

I have Deed cost turned ON so any deed higher then 21x21 will cost Money to make. [works]

 

So here is the problem. I lowered the Minimal Upkeep Costs to 0s. [Which works]

And when i Toggle ON upkeep cost with Server, even though it costs 0s, it still disbands after the 8min Tick.

If i toggle OFF the Server upkeep it makes deeds that are higher then 21x21 have 0 Upkeep as well.

 

What am I trying to do?

Well I want to allow free deeds up to the size of 21x21 with 0 Upkeep. But if they decide to expand bigger then that, I want it to cost money to MAKE as well as an Upkeep. Is this possible with the current mod? Is there something in the settings i'm missing?

 

*snip*

 

Any help with this would be greatly appreciated. Also, the "Settlement > Manage Guard" option doesnt work for me. Its spiting out an error in Console

*snip*

Sorry about that, not sure what happened there but Manage Guards should be fixed now.

 

Also changed when disbanding occurs so the free deeds should be fine now.

 

Share this post


Link to post
Share on other sites

Update

Download

 

Added options (free_tiles_upkeep, free_perimeter_upkeep, free_guards_upkeep), if true it re-enables upkeep for their respective option, leaving only the initial cost as free.  Default false.

Added upkeep_grace_period, the number of (real) days following new village creation during which no upkeep will be charged.  Whole numbers only.  Default 0 (off).

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