[Mod] Bounty [bounty] [idea]

User avatar
Bas080
Member
 
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080

[Mod] Bounty [bounty] [idea]

by Bas080 » Wed May 28, 2014 04:11

So I was thinking.

Griefing is sometimes an issue on some servers. It's considered a horrible deed in most cases, but what if it could be fun in some of the cases.

It is more a tool for server moderators than a mod.

A bounty system in which certain deeds raise the prize on the players head(bounty). The moderator decides what the height of the prize is for a bounty hunter that kills or imprisons the thief, griefer and/or killer. Bountyhunters could be given "minegeld" or (randomized) precious materials.

If there are many players with a bounty, then the prize is equally distributed across them all. (Avoids that everyone starts griefing for points)

Usecases

increase bounty on offender's head
When offender commits something "offensive". (server moderator determines what offensive is by placing a piece of code like this bounty.increasebounty(player, amount));

decrease bounty on offenders head
When player with bounty captures an other with a bounty.
When player is /forgiven <player>. Requires forgive priv.

get notified about offenders and their bounty
When the prize for capturing the offender rises or lowers.

Handcuffs would allow the capturing of offenders. Only offenders can be handcuffed.
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

Re: [Mod] Bounty [bounty][idea]

by philipbenr » Wed May 28, 2014 04:43

That sounds like a REALLY good idea. Banning isn't serious enough. Getting sent to prison or banishment (get off the server). Wow. That probably would spice up some survival servers. Also, it would be nice for BrandonReese's Adventuretest server, or any adventuretest server. You could gain exp and money for doing it... To reiterate, great idea Bas080.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: [Mod] Bounty [bounty][idea]

by kaeza » Wed May 28, 2014 05:05

I think this could encourage people to grief to raise their prize "just for the lulz". Plus most griefers don't bother to come back to the server anyway (probably assuming they are already banned).
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Bounty [bounty][idea]

by 4aiman » Wed May 28, 2014 09:11

To extend the idea:
- wild west;
- automatically increase bounty on violation of any rule;
- poster autoplacement on buildings with bounty notices and a picture of a player (skins needed) but w/o name;
- if anyone manages to find such a poster and to use command like /poster x,y,z playername and it's really the name of a criminal, then some mobs like "sheriff" and "horsed mans" will start to hunt that criminal
- but only if you /tell_sherif x,y,z about it

It's possible to monitor what players are "seeing" and to create smth like The Elder Scrolls IV: Oblivion crime system: haven't been seen = is not a criminal :)
 

User avatar
Bas080
Member
 
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080

Re: [Mod] Bounty [bounty][idea]

by Bas080 » Thu May 29, 2014 02:44

This is a start

Has
* An api. server admins can already increase bounty for players automatically by placing bounty.increase(<player_name>, <amount>) on certain events
* bounty.decrease(...) does the opposite.
* Saves the bounty per person to a file
* Some examples for chatcommands

Will do
* List all offenders and their bounty (chatcommand)
* Implement a mechanism for claiming/granting prizes automatically
* Apply a penalty to offender once he/she is captured. (penalty is determined by server admin. Needs a default to show an example on how to implement)

Still needs
* Chatcommands and some privs. Any ideas?
* Give me more suggestions on how to capture the offender and
how to claim your prize. The sherrif idea is good.

Code
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
bounty = {}
bounty.file = minetest.get_worldpath()..'/bounty.txt'
bounty.data = {}
--bounty.prizes = false --determines if prizes or amount per points game-mechanic is used
if false then
  bounty.prizes = 'default:steel_ingot'
  bounty.points_per_prize = 100 --per 100 points you get a default:steel_ingot
else
  bounty.prizes = {
    [20] = 'default:wood 50', -- for bounties that are higher then 100 iron ingots are given
    [50] = 'default:cobble 50', -- for bounties that are higher then 150 gold ingots are given
    [70] = 'default:stone 40', -- for bounties that are higher then 150 gold ingots are given
    [100] = 'default:steel_ingot 2', -- for bounties that are higher then 150 gold ingots are given
    [200] = 'default:steel_ingot 5'  -- etc...
  }
end

bounty.penalize = function(player_name) --set the penalty
  --example of a penalty (revoke all privs ecept interact)
  minetest.set_player_privs(player_name, {shout=true})
  bounty.unregister(player_name)
  --end of example
end

bounty.load = function()
  local data_file = io.open(bounty.file, 'r')
  if data_file then
    local data_stri = data_file:read();
    bounty.data = minetest.parse_json(data_stri)
    if bounty.data == nil then
      bounty.data = {}
    end
    data_file:close()
  end
end
bounty.load()

bounty.save = function()
  local data_stri = minetest.write_json(bounty.data)
  local data_file = io.open(bounty.file, 'w')
  data_file:write(data_stri)
  data_file:close()
end

bounty.increase = function(player_name, amount)
  if bounty.data[player_name] then
    bounty.data[player_name] = bounty.data[player_name] + amount
  else
    bounty.register(player_name, amount)
  end
  bounty.save()
  bounty.notify(player_name, amount)
end

bounty.decrease = function(player_name, amount)
  if bounty.data[player_name] then
    if bounty.data[player_name] - amount < 0 then
    else
      bounty.data[player_name] = bounty.data[player_name] - amount
    end
  end
  bounty.notify(player_name, -amount)
  bounty.save()
end

bounty.register = function(player_name, amount)
  bounty.data[player_name] = amount
  bounty.save()
  return
end

bounty.unregister = function(player_name)
  if bounty.data[player_name] then
    bounty.data[player_name] = nil
    bounty.save()
  end
end

bounty.notify = function(player_name, amount)
  if bounty.data[player_name] + amount <= 0 then
    minetest.chat_send_all(player_name.." no longer has a bounty")
  end
  if type(bounty.prizes) == 'string' then
    minetest.chat_send_all(player_name.."'s bounty is equal to "..bounty.get_player_bounty(player_name))
  else
    for key, value in pairs(bounty.prizes) do
      if bounty.data[player_name] > key and bounty.data[player_name] - amount < key then
          minetest.chat_send_all(player_name.."'s bounty has changed to "..bounty.get_player_bounty(player_name))
        break
      end
    end
  end
end

bounty.drop_prize = function(player)
  local player_name = player:get_player_name()
  local prize = bounty.get_player_bounty(player_name)
  print(prize)
  minetest.item_drop(prize, player, player:getpos())
  print(prize)
  bounty.penalize(player_name)
end

bounty.get_player_bounty = function(player_name)
  prize = ' has griefed a little bit'
  if type(bounty.prizes) == 'string' then
    local amount = math.floor(bounty.data[player_name]/bounty.points_per_prize)
    if bounty.data[player_name] >= bounty.points_per_prize then
      prize = bounty.prizes..' '..amount
    end
  else
    local order = 0
    for key, value in pairs(bounty.prizes) do
      if order < key and bounty.data[player_name] > key then
        order = key
        prize = bounty.prizes[key]
      end
    end
  end
  return prize
end

--chatcommands for testing purposes
minetest.register_chatcommand('bounty', {
  params = '',
  description = 'show all offenders and their bounty',
  privs = {interact=true},
  func = function(name, params)
    bounty.increase(name, 28)
  end
})

minetest.register_chatcommand('forgive', {
  params = '',
  description = 'show all offenders and their bounty',
  privs = {interact=true},
  func = function(name, params)
    bounty.decrease(name, 28)
  end
})

minetest.register_chatcommand('bounties', {
  params = '',
  description = 'show all offenders and their bounty',
  privs = {interact=true},
  func = function(name, params)
    for key, value in pairs(bounty.data) do
      minetest.chat_send_player(name, key..' - '..bounty.get_player_bounty(key))
    end
  end
})

minetest.register_on_dieplayer(function(player)
  if bounty.data[player:get_player_name()] then --check if is perpetrator
    bounty.drop_prize(player)
  end
end)


edited code
Last edited by Bas080 on Thu May 29, 2014 06:48, edited 1 time in total.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Bounty [bounty][idea]

by 4aiman » Thu May 29, 2014 06:44

I think that the notice on increase of bounty should be optional or better - group/permissions based. Some dedicated servers may benefit from letting criminals be stealth. Auto chat_send_all would ruin that. HOwever admins probably should receive such a message.

Maybe it would be cool to add /complain chat command. It'll be like "The Mafia" game but with consequences of accusing the innocent: you complain and if you're right you get bounty. If you're wrong - you have to pay some % of the bounty (up to 100-200% if you just like to accuse everyone).
 

User avatar
Bas080
Member
 
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080

Re: [Mod] Bounty [bounty][idea]

by Bas080 » Thu May 29, 2014 07:00

4aiman, I like your idea. It removes the hassle of having to kill someone. Plus it makes it more like a detective story.
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

Re: [Mod] Bounty [bounty] [idea]

by Calinou » Thu May 29, 2014 17:46

Bas080 wrote:Bountyhunters could be given "minegeld" or (randomized) precious materials.


I suggest not relying on randomness unless you can't avoid it.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Bounty [bounty] [idea]

by 4aiman » Sun Jun 01, 2014 11:48

Calinou wrote:
Bas080 wrote:Bountyhunters could be given "minegeld" or (randomized) precious materials.


I suggest not relying on randomness unless you can't avoid it.

I agree with Calinou and suggest that:
- "value" of every item should be configurable;
- player who receives bounty would receive it in some virtual money, not the items (see AdvancedMarket mod discussion);
- player with some positive balance would be able to exchange his/her money for a variety of items at the evidence_storage (A cunning sheriff grabs all the goods that imprisoned people had with them and says that those are "evidences". Someone may call it double-stealing);
- do not reward anyone until he/she would meet sheriff (make ppl suffer some long walks!);
- mailing system: you can write a mail to the sheriff. You'll need to meet a postman/caravan/whatever to do this. Just right-click on it and fill in the form with your "mail". Probably can use a name, checkbox "I want to get my stuff by mail" and (arbitrary) coordinates/action for accusal. Then, regardless of the entity's location, the mail starts to make 1 node per second to the nearest sheriff. Once it was delivered, a player can ether visit a sheriff or to wait for his mail.
- This would cause lags, but there can be an entity which have lots of HP and your reward mailed to you. So it'll be possible to attack those entities to collect other peoples rewards. But entity should force load the world then;
 

User avatar
Bas080
Member
 
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080

Re: [Mod] Bounty [bounty] [idea]

by Bas080 » Sun Jun 01, 2014 17:00

4aiman, "Someone may call it double-stealing", that's funny.

I agree that random items should be out of the question. My current code shows the type of prize is dependent on the amount of bountypoints an offender has. However you are proposing something different. If I understand you correctly this would mean that the mod would work like this:

1. Offenders that offend show some kind of visual feedback that shows that they are offending. (what visuals exactly I don't know yet)
2. One can accuse a player by notifying the sheriff about the offender. This can be done threw mail or by going to the sheriff personally. Mailing takes some time. (one sec per node) Mailmen can be intercepted.
3. Once sheriff is notified the sheriff starts to arrest the player by physically going to the offender.
4. Once the sheriff so much as touches the offender her/his possessions are confiscated for "evidence". And the player gets a fitting penalty.
5. A fitting reward is sent to the accuser, threw the mailman, which can also be intercepted. "Advanced Market money" or some other reward can be given. A false accusation increases the accusers bounty level.
6. The currency can be exchanged for materials at the evidence room or in the market.

For the sake of keeping things modular I think:
1. The bounty mod should not depend on the advanced market mod. An admin can however make the reward an "Advanced Market currency".
2. Mailmen should not be part of this mod by default. Mailmen should be a separate mod. This does remove the "intercepting" gameplay element.

How your post has changed my ideas about this mod:
1. The sheriff is a good alternative instead of capturing the bad guy yourself.
2. The evidence room is a great idea. I do wonder how the price of an item can be determined automatically. I think a player or admin is required for this.
3. If the sheriff did the dirty work then the prize can be claimed by going to the sheriff

In my eyes the essence of this mod is to get a reward for "doing the right thing", which can be snitching or taking matters into your own hands. Both should be possible and profitable. Most importantly it adds the role-playing element thief and vigilante.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Bounty [bounty] [idea]

by 4aiman » Tue Jun 03, 2014 09:04

Bas080, so far you got me right :) *Phew, /me was to exited to pay attention to grammar*

I'm not going to pursue my views on your mod, I just want to suggest as much as I can. If you'll find something fitting - I'll be glad that my *sacred precious idea* is spreading :)

Some more thoughts:
1. Maybe sheriff can have some % of stolen stuff, e.g. give only X% of the reward to a player who had blamed the offender? If you want all the money/reward - go help the sheriff and capture the offender by yourself.

2. If 1st is to be approved, then, maybe notification sent to a sheriff can include a field like "I'm gonna catch that bastard by myself"? Then the sheriff would chase the offender only if he has nothing to do ATM.

3. If the 2nd is to be approved, then, maybe, sheriff should have some queue/schedule? Every new /complain would be revised when sheriff is done with previous cases.

4. If 3rd is to be approved, then, maybe, sheriffs should have some area to protect. Smth like 1 sheriff per X chunks. Then any sheriff won't chase the offender infinitely. I'd also suggested that there should be places where sheriff won't chase after the offender - like higher than 50 nodes or lower than 10.

5. if 4th is to be approved, then, there obviously would be some skyscrapers and mines in which thieves live. What if they would be able to form a gang? To do so they'll /sethome to any point inside the building. If the spots are close enough, then players are considered connected. If one of them is offender (or even punished offender) then the others have some chance to get caught as an offender while they're not.

I'll explain. Joe is offender. He lives with Sue and Henry. Neither Sue nor Henry is aware of Joe's secret affairs. But one day sheriff comes to their place and... arrests Sue! Chances are low, like 1% per every criminal around, but still... Justice's eyesight is not the way it used to be :)

6. If 5th then: /sethome would be used as a way to shift one's blame. So, I think there should be a chat command like /neighbors that'll show who lives within the X nodes. If someone'll find a name that shouldn't be there - he or she can /complain right away, 'cause it's very likely to be some criminal. Not necessarily, though :)

7. Back to the sheriffs. What if sheriffs had a way to communicate? If there a sheriff who has nothing to do, he can go to the adjacent area to get info. Or get killed. If the sheriff returned successfully - he'll be aware of crimes and criminals in the area he visited. If he got killed - a new sheriff would take the place of the first one, but no new info would be added.

8. Maybe sheriff would be able to ignore some places with the number of criminals higher then the number of sheriff's assistants. This will lead to strongholds of crime as well as to creation of some patrols from those who checked "I'll catch this bastard by myself".

9. But even with the sheriff around, only 1 criminal can be caught at time. To catch another one you'll need to go hinting one more time.

10. to fix 9th, some players may volunteer to became CPU-driven assistants. Than means player controls are blocked (can be achieved by attaching a player to some entity which player can't control and can't get detached on his own) and a player acts like the sheriff - he/she can catch thieves.

11. But there are downsides. Players who has volunteered to become assistant are bound to:
* stay on-line for X in-game hours;
* be unable to control themselves, only watch;
* be not as protected as the sheriff (even with the best armour on);
* not be able to run away.

There can be a contract on some hours or, say, job contract. A contract on some hours is like "I'll help you if you're going to catch the criminal within X hours". A job contract means that every in-game day from X to Y hours your player will become a mob. Every time this happens a player can refuse doing to his/her job, thus increasing his own bounty.

All above may be inconsistent, but, hey, It's around a quarter past one where I am :)

I'm anxious for comments.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 15 guests

cron