[ECON/FUN] HeavenActivity v0.3.1 - Activity based iConomy income [1000]

Discussion in 'Inactive/Unsupported Plugins' started by Sevenos, May 5, 2011.

  1. Offline


    Track player activity and give iConomy income based on it.

    v0.3.1 (iConomy 5): HeavenActivity.zip (including annotated config) or jar only
    v0.1-beta (iConomy 4.6): HeavenActivity.jar
    Source: GitHub

    HeavenActivity tracks the player's activity of the last minutes (default: 15) by tracking block place/break, movement, chat and command usage. Everything is configurable (points per event, delays, timeframe, notification cycle etc).
    It can give iConomy income based on activity AND player balance.

    • Track player activity by block place/break, movement, chat and command usage
    • Extremely configurable
    • Individual activity modifiers per group/player (optional)
    • Give players iConomy income based on activity (optional)
    /activity <target> - Your or <target>'s current activity ("activity.view.other" permission to show <target>'s activity)
    /activity list - Shows activity of all online players ("activity.view.list" permission)
    /activity admin <stats|reload|resetstats> - Admin commands to see stats, reload config or
     reset the stats ("activity.admin" permission)
    • iConomy 5
    • Permissions (optional, 2.7.2 - 3.1.6 should work)
    How does it work?

    The tracking is based on sequences, those sequences have a configurable length (in seconds) and a configurable max amount. By default, there are 15 sequences with a length of 60 seconds each. This results in tracked activity for the last 15 minutes. Each tracked event is added to the current sequence, the activity is the average point value of all available sequences. One sequence can have more than 100 points, but the average activity is capped at 100 points/percent.

    How does the income work?

    Let me just give the actual calculation for now, feel free to ask if you have questions (and remember +- = -):
    + (((ACTIVITY - target_activity) / activity_modifier) * base_value)
    + (PLAYER_BALANCE * balance_multiplier)
    Config Examples (open)

    Default: 50% activity = 100% of base_value, 1% activity = 35% of base_value, 100% activity = 135% of base_value
    target_activity: 50
    activity_modifier: 75
    Linear income: 50% activity = 50% of base_value, 1% activity = 1% of base_value, 100% activity = 100% of base_value
    target_activity: 100
    activity_modifier: 100

    Complete annotated config.yml (included in zip download) (open)

    # The comments will be gone after first reload/disable of the plugin
        # The time (in seconds) one sequence lasts
        sequence_interval: 60
        # Multiplier for all points, if you want more activity for all activities, rise this
        point_multiplier: 1.0
        # Sequence(s) in which the income is given
        # (max_sequences % income_sequence == 0)
        income_sequence: 15
        # Sequence(s) in which the players are notified about their activity, 6 means in sequence 6, 12(, ...)
        # (max_sequences % notification_sequence == 0)
        notification_sequence: 6
        # Max sequences which are stored, default 15 * 60 = 15 minutes
        max_sequences: 15
        # iConomy income enabled?
        enabled: true
        # Minimum activity to get income
        min_activity: 1
        # Allow negative income? (e.g. because of a negative balance_multiplier)
        allow_negative: true
        # Multiplies the current balance of the players and adds/subtracts it to/from the income
        balance_multiplier: 0.0
        # How much the activity affects the income, less is more (read documentation!)
        activity_modifier: 75
        # Base income value, this is the value the players get at target_activity
        base_value: 8.0
        # Target activity for the base_value, everything above will give more income
        # everything below will give less income
        target_activity: 50
        # Enable tracking of block break/place events?
        tracking: true
        # Points per tracked broken block event
        break_points: 1.95
        # Points per tracked placed block event
        place_points: 3.75
        # Minimum delay between 2 tracked block place/break events (ms)
        delay: 950
        # Enable tracking of move events?
        tracking: true
        # Points per tracked move event
        points: 0.58
        # Minimum delay between 2 tracked move events (ms)
        delay: 1100
        # Enable tracking of chat?
        tracking: true
        # Points per character on chat
        char_points: 0.49
        # Points per chat use (adds on the char value)
        points: 1.0
        # Enable tracking of commands?
        tracking: true
        # Points per character on commands
        char_points: 0.53
        # Points per command use (adds on the char value)
        points: 1.0
    # This tree is just used for statistic and doesn't affect anything
        move_points: 0.0
        block_break_points: 0.0
        chat_points: 0.0
        chat_char_points: 0.0
        command_char_points: 0.0
        block_place_points: 0.0
        command_points: 0.0

    Group/Player multipliers:

    You can set individual multipliers for each group/player using the Permissions "info" node. The following example would give 20% more activity for breaking blocks and 20% less activity for chatting:
        # prefix etc is here too
                block_break: 1.2
                block_place: 1.0
                move: 1.0
                chat_char: 0.8
                command_char: 1.0
    How it looks ingame:
    This may look spammy, but it's normally split to about 50 minutes. Messages and colors will get configurable at some point.

    • Fixed a bug which caused only one player to get income, please update if you use the income feature!
    • Added configurable minimum activity to get income (config node income.min_activity, default: 1)
    • Added config node to (dis)allow negative income (income.allow_negative, default: true)
    • Added config nodes to disable specific trackings (e.g. move.tracking, by default all are enabled)
    • Refactored permission handling, Permissions plugin is now optional (OP always has all permissions, admin commands OP only without Permissions plugin)
    • No longer ignore every y changing move events, instead check if x and z have changed
    • Changed default config to enable income and disable balance_multiplier (0.0)
    • Added ability to log commands to console (config node general.log_commands, default: false)
    • Some refactoring
    Old versions (open)

    • Fixed config overwrite on reload/stop and only adding most important config nodes if they aren't set (no more auto-generation of all config nodes)
    • Fixed iConomy error on startup (skipping income on startup)
    • Added permission nodes "activity.view.list" and "activity.view.other"
    • Reformatted list of online players' activity (now it's only one row for all players)
    • Upgraded iConomy support to 5.0 (just use the "older" Version if you're still on iConomy 4.6)
    • Better method to hook into Permissions and iConomy (ServerListener)
    • First public release
    Rollese and Phaedrus like this.
  2. Offline


    Any chance to add a mob killing activity? I give monetary rewards to players for kills and I would like to be able to give them a bonus if they have kill streaks. For example, they could get a 15 coins bonus if they killed 5 mobs in 5 or less minutes.

    That would be absolutely great.
    Thanks for this wonderful plugin.
  3. Offline


    Hey, I have done some calculations and something is wrong with my server or your plugin according to my calculations and your calculation preset.
    Here is your preset:
    base_value + (((ACTIVITY - target_activity) / activity_modifier) * base_value) + (PLAYER_BALANCE * balance_multiplier)
    My server's custom set:
    balance_multiplier: 0,00025
    activity_modifier: 75
    base_value: 8,0
    target_activity: 50
    + ( ( ( Activity - 50 ) / 75 ) * 8)
    + ( Balance * 0.00025 )
    Lets say my money was 50000,00
    According to this calculation I should get: $24,02
    Yet I gained money arround -0,73 (not sure, my money was a bit over 50k)
    Aka I lost $ -0,73 however my calculation said I would gain like 24,02.
    Even if I had 100% activity I should in total have recieved $20,61
    This troubles me greatly as almost only 100% activity all the time will allow me to get an increase and recently I even lost $0,73 at 100% activity wich makes me go "WTH!???"
    Quite some of my players complained loss of money and now I am kinda stuck with the massive mess.
    So tell me please, what did I do wrong? Or did you do something wrong?
    For the moment I have no real choice but to deactivate it, no matter what I do, we keep losing money unless 100% activity is obtained.
    Any help? Cause this is weiiird.
  4. Offline


    with bukkit 818 my log file is growing like crazy

  5. Offline


    So I take it this is yet again another dead plugin?
  6. Offline


    i got negative active money.
    [Activity] You got -1,184.60 Curency income for being 100% active
    But not everyone got negative payments
    How can i fix this?
  7. Offline


    Just curious, proably a silly question, but.

    enabled: false

    Set that to true, for activity based payments?
  8. Hmm, I think the formula is kinda wrong... since I get weird results...

    Well, I made another test with 3 players total, and the results:
    - 18 silver (0.18) for 7%
    - 6 silver (0.06) for 19%
    - 38 silver (0.38) for 63%

    And the income config:
    As you see, ballance doesn't modify the results so it's because of the other values...

    Can you generate the values for me so that it gives 0.10 money or less if activity is 50% or less and after 50% increase dramatically until 0.75 at 100% ? :} I really suck at math :))
  9. Offline


    i get the same thing on Permissions 3.x
  10. Offline


    Sorry for the inactivity, I'm quite busy at the moment. But I still run it on my own server and can confirm it works perfectly with CB 860. It probably won't work with Permissions 3 yet.

    I will try to release a version with an alot easier default configuration soon, probably even with permissions 3 support (haven't looked at it yet). This plugin probably won't grow alot in terms of features, but I will at least maintain it to run with new versions of CB, iConomy and Permissions for my server.
  11. Offline


    heh, it started working with permissions 3
  12. Offline


    It's going to be a linear scale with the activity formula as it is now. If you have a return of .1 at 50% activity and a return of .75 at 100% activity, you will have a return of -.55 at 0%.

    So if you don't want players to ever lose money the best you can do is 0% = 0 50% = .375 100% = .75.

    On the other hand if losing money is okay then these values will return 0% = -.525 50% = .1 100% = .725.

    enabled: true
    balance_multiplier: 0.0
    activity_modifier: 24
    base_value: 0.3
    target_activity: 66

    Your results confuse me a little the values should have been:
    7% = -.18
    19% = -.06
    63% = .38

    The first two are correct. The last one should have been a gain of 38 silver.
  13. No they're not negative, I got the 18 silver (0.18) and I'm sure it wasn't negative.

    Anyway, I got this setup now, it has good income but it sometimes gives weird values... like 1 silver (0.01) for 27% and sometimes it gives 50silver for 20%, looks like it's not much different from yours =) but it doesn't give negative values tough :}
    I'll ask the players to make screenshots the next time we're getting weird values.

    Also, I don't know what iConomy format you're testing on, it might be displayed wrong from iConomy, try them out when you next get a chance to test :}
  14. Offline


    To be honest the current configuration values were the easiest way to reach the goal for my server and is probably not as flexible as some would like them too and too complex for others. I probably have to redo most of that configuration and just give 3 modes with the possibility to fine tune them if you know what you do.

    @Digi: I have no clue how that can happen as you deactivated the balance modifier.
  15. Disabling balance modifier should provide accurate results compared to it enabled, where every income would reflect on player's income.... but it doesn't so, everybody should receive exacly the same income for the same activity, less for less and more for more, but it obviously doesn't.
  16. Offline


    Do I have to install ermissions to get this work? (I don't use permissions, now and do not want to use it...)
  17. Offline


    @Digi It sounds like for whatever reason your players are being credited for values that OUGHT to be negative. So that's why people apparently gain more money when they have a low activity. I'm almost positive that during my initial setup when I was adjusting values, people WERE being debited when they had low activity. I suppose I can test this again to see if it is still the case.
  18. Well, I can test that myself by checking my /money before and after :}

    And like I said, *could* be a display issue... I also never seen silver values like 10, 20, 30, 40, etc, I only saw 31, 45, 24, 1, 3, 5 etc, so those 1, 3, 5 could actually be 10, 30 and 50.

    Still... I remember quite clearly negative values working, I tested alot of values and I got to the point where I got negative values.
  19. Can you give items instead of icon money? Say gold or dia
  20. Offline


    @Digi There could well be a bug where fractional values are added instead of debited. I typically work with larger numbers on my server where the fractional money is mostly from random chance or calculated rewards (like HeavenActivity) and not used much in server economy.

    And no, due to the way it works, .01 is 1. and .1 would be 10. When you claimed getting 1 silver or any other single digit outcome, the math said the value should be .013 or something that would essentially round to .01.
  21. Offline


    @Digi - The values make perfect sense if -.01 through -.99 is, for some reason, being credited rather than debited. Thus the split would be whatever values, say -.20 for 0% up to 0.00 at 25% .20 at 50%, .40 at 75% and .60 at 100%. But because the all of these values are entirely fractional (there is no whole number), there may well be a bug (either in HeavenActivity or iConomy, not really sure) that is always granting that value even if it is negative. Thus you gain 20 silver at 0%, nothing at 25%, 20 again at 50% up to 60 at 100%.
  22. Yeah that makes sense.

    Still, what do I have to change to have 0.00 at 0% ? :}

        balance_multiplier: 0.0
        activity_modifier: 50
        base_value: 0.3
        target_activity: 75
    I think target activity should be 50 ?
  23. Offline


    this would be awesome for my server, any news on an update?
  24. Offline


    Sadly no, I have alot to do and the little time left I have to spent for my server. But I can confirm this works with CB 953.

    And no, it can't give items and never will ;)
  25. Offline


    I am sad to see you stopped working on the plugin as this is exactly what I was looking for with my server. Please consider adding in more options as I know this will be widely used to promote server dedication based off of playtime.
  26. Offline


    He stated previously he would keep it working and has said it works with the newest version. I am running it on 953 with no issues.

  27. Offline


    How much stress does this plugin add to a server? I want to add this but one of our server admins is worried about the lag that this might cause...
  28. Offline


    Totally love this plugin but it seems to be a resource hog, i get major lag spikes.
    Without it my cpu clocks down to the lowest possible setting.
    Also it seems to lag worse than ever when i use /jumpto (traveling long distances)

    Is it my server that is way too underpowered or is it the plugin itself that eats all cpu power it can?

    AMD Athlon II x645 3,1ghz and 8ghz
    Win 7 Ultimate (x64)

    the plugin performancetweaker did wonders.
    only freezes for 1-2 seconds about every 30 minutes.
    good enough for me :)
  29. Offline


    The performance impact is quite low as it doesn't do much more than updating a Hashmap, however the move tracking needs quite some time compared to the rest, which I already work on.

    I'm currently very busy because of relocating and a new job, but will proceed this more actively as soon as I get some free time ;)

    Version 0.3.0 is out!

    • Added configurable minimum activity to get income (config node income.min_activity, default: 1)
    • Added config node to (dis)allow negative income (income.allow_negative, default: true)
    • Added config nodes to disable specific trackings (e.g. move.tracking, by default all are enabled)
    • Refactored permission handling, Permissions plugin is now optional (OP always has all permissions, admin commands OP only without Permissions plugin)
    • No longer ignore every y changing move events, instead check if x and z have changed
    • Changed default config to enable income and disable balance_multiplier (0.0)
    • Added ability to log commands to console (config node general.log_commands, default: false)
    • Some refactoring
    There are still alot of things in this thread which aren't done yet, but I hear all of you and will try to include ideas when I get the time for it.

    I know I answer quite late, but at least I do xD
    Setting balance_multiplier to 0.0 or a positive value should "fix" it, or setting allow_negative: false in 0.3.0

    Couldn't reproduce it, probably just the balance_modifier? I use double for everything balance related, as iConomy does too. Try it with balance_multiplier: 0.0

    You probably had no Permissions plugin, you might want to try 0.3.0 as Permissions should be optional now.

    0.3.0 makes Permissions optional
    Yes, and it's default since 0.3.0

    @Digi: I still couldn't reproduce the weird results you get sometimes. However, for a linear income set target_activity: 100 and activity_modifier: 100. I've added examples (and will extend them) to OP now too.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 15, 2016
    Mitsugaru likes this.
  30. Offline


    can you set it so players get money everytime they kill a player/mob?

Share This Page