Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-15-2012, 11:45 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Up/Down Voting System

Sites like Reddit and the Stack Exchange network have seen tremendous success with the up/down voting model for selecting the best of a set of posts. I wanted to apply this to a suggestions window and allow players to submit ideas and vote on those ideas. And thus, I present you my implementation of an up/down voting system for Graal.



This system is fairly minimal and is lacking some features I'd like to have. I doubt if I'll ever have time to implement them, so I encourage anyone who is interested to take the source code and run with it.

Current Features
  • Ability to set topic/description (hardcoded constant at the top of the script)
  • Players can submit suggestions with a "title" and a "description".
  • Limits on the title and description (currently hardcoded).
  • Option to show or not to show the submitter's account (always shown to admins regardless of the option)
  • Ability for players to vote up and vote down suggestions.
  • Voting obfuscation system similar to the anti-cheating system in use on Reddit
  • Simple moderation system (ability for admins to delete posts)

Future Features?
Eventually, I'd like to make some improvements.
  • Create multiple voting "instances" or "topics" so that multiple voting sessions can be running at once, with different topics.
  • Add a better moderation system (e.g. banning people from using the system)

About the Anti-Cheating System
There are thresholds for most upvotes per hour, most downvotes per hour, and ratio of upvotes:downvotes. Votes may be "suppressed" (visible only to the voter) if the script thinks they're cheating. In addition, the vote count is randomly changed slightly each time it is refreshed to make it harder to game the system.

The defaults are tuned to encourage upvotes more than downvotes, with a low threshold for downvotes per hour (meaning a lot of them get suppressed). Instead, it relies on players to upvote the ideas that they support.

Installation
  1. Install at least these minimal func_sql and func_strings classes
  2. Copy the weapon script into a weapon on your server. Don't hit apply yet.
  3. Make sure you have a database configured with the name "default", or change the database used by the weapon script (todo: make this a constant).
  4. Change the constants at the top of the script to reflect your needs.
  5. Update the isAdmin function around line 240 to suit your server.
  6. Around line 106, adjust the manner in which messages are sent so that it matches your server.
  7. Add some way for openVotingWindow() to be called (e.g. by a chat command or pressing a key). Alternatively, you can un-comment the line in onCreated clientside to open the window on script add/login.
  8. Upload these images to your server. You might already have some of these downloaded if you use SQL explorer, but your players won't.
  9. Hit apply on the weapon script. Two tables should have been created: voting_votes and voting_responses. If you see errors in RC, something bad has happened.

The system should now be working . I welcome feedback and suggestions, but again, I probably won't have time to make any big changes. I encourage anyone interested to improve the code to add new features, especially the ones I mentioned about that were lacking.
__________________
Reply With Quote
  #2  
Old 06-15-2012, 12:34 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
dat sexy ui gj
__________________
Reply With Quote
  #3  
Old 06-15-2012, 12:45 PM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
*up vote*
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:20 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.