need an algorythm

Discussion in 'Plugin Development' started by zipron, Jun 19, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    zipron

    (I don't know if "algorythm" is spelled correctly btw, so I'll just use "algo")

    I'm working on a plugin for creative server, fofering support to many many cool features players might need on a creative server. However, I need to figure out some kind of algo which determines a score for each player. this score (or points or whatever) will allow players to build on more chunks and allow them to buy titles etc.

    The score is given by a player in two ways:
    - by an admin, who rewards the player if built something cool
    - by the amount of blocks a player places

    Now I need some guidance with the second thing: The more a player builds, the more points he get's. Ofcourse, I don't want this to be "grindable". So I'm looking for some kind of algo which will award the player automatically with points if he's building, but not when grindin. I know this is probably very unlikely to be 100% accurate. I was thinking about working with these parametres:
    Code:
    - amount of blocks placed
      * saved in "chunks" of blocks: so you only get points if you've placed 100 blocks f.e.
    - divercity of blocks placed
    
    So, I have not figured it out pretty well as you can see =D so if you have any ideas/suggestions, please give them, I really appreciate all help =)

    zip

    ps: the way scores/amount of blocks placed etc. is saved is with a database.
     
  2. Offline

    Courier

    I would assign a point value to each material, so placing a diamond block yields many more points than a dirt block. That is much simpler than calculating diversity.

    What you need to do to prevent grinding is: after a player places a block, don't give him points for that block again. Keep track of that block in his database. So, if a player places three diamond blocks, then picks up two of the diamond blocks, his diamond block count will internally be -2. The next two times he places a diamond block, he won't get any points, but if he places a third one, he will. If you want, you could reset everybody's count and blocks-placed once a day or so.
     
    zipron likes this.
  3. Offline

    zipron

    I like the tracking part a lot, however, giving a score for each block isn't usefull because it's creative. But the tracking is indeed a very nice idea, maybe coordinate tracking is also usefull. However, I don't think I'll save the tracking in the database, because that'd mean for each blockplace/break I'd need the use the DB which is slower. So I think I'll keep track of block placing/breaking in the class itself, and use that number to calculate the score.
     
  4. You can't really give automated points for good building since the code doesn't know what good building is, you'd be better off manually giving players score and/or making players vote for certain buildings.
    And giving people score for just placing blocks will inevitably make them grief since they are aware that the code doesn't know what they actually built.

    Then you can multiply the score by building numbers so it can be fair for people that make a huge building and people that make alot of small houses... depends on scoring rules mainly.

    If you go on the voting method, you should allow people to score-vote more categories, stuff like: size, design, complexity, usefulness, environmental fit... and each category can have from 1 to 5 or 1 to 10...
     
    zipron likes this.
  5. Offline

    zipron

    Yea but the main idea is
    - "the more a player builds, the more points he earns so he can build on more chunks"
    - because of the creative aspect, I'll ofcourse add the vote idea, very nice of you to bring that up =)
     
Thread Status:
Not open for further replies.

Share This Page