collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Raid system suggestions  (Read 13779 times)

0 Members and 3 Guests are viewing this topic.

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
Raid system suggestions
« on: December 15, 2005, 07:34:34 am »
Id like to suggest some changes to the standard raid system and hear your opinion

- Keep track of all auctions in a separate table, item, points, who got it
- Keep track of raids and attendance, who started
- Keep track of who gave points to who... if in a raid or not, and the reason
  something like !raid addpoints 3 <reason>, with optional reason
  and !addpoints 3 <player> <reason>
- Use names for raids (same as IGN raid system, its a good system)
  !startraid Mercs
  !startraid Pande
  !startraid Uber Leet
- Make the raid yell its open every 5 minutes and stop when you lock it
- Use timed point system with a different "startraid" command, or maybe use a different name for it
  !startmission Towers
  !startduty Spawn Otacustes
- Account history command to check points / auctions won, or use the membership module to check how many points total, spent and all time points, auctions won, raids attended, etc
- Command to check last raids, time and how long raid took
  !raids

I couldnt make this without major changes in the database, and it would be a waste of time if someone else had better ideas and implemented it... So im suggesting them for public ovation, or not.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Raid system suggestions
« Reply #1 on: December 15, 2005, 09:39:36 am »
Im gonna comment on these point for point, and i'll reveal that a lot of it is part of my own "would like to do" list
Id like to suggest some changes to the standard raid system and hear your opinion

- Keep track of all auctions in a separate table, item, points, who got it
Yes please :)
Also a command to show min, max and average points on items that are posted by itemref.

Quote
- Keep track of raids and attendance, who started
Yes please again :)

Quote
- Keep track of who gave points to who... if in a raid or not, and the reason
  something like !raid addpoints 3 <reason>, with optional reason
  and !addpoints 3 <player> <reason>
Hrm, id like to keep points management to !points. It can differenciate between non raid and raid points simply by checking if there currently is a raid in progress.
So !points add/rem|del <player> <points> <optional reason>
I also think the reason should be given an option to be made mandatory.

Quote
- Use names for raids (same as IGN raid system, its a good system)
  !startraid Mercs
  !startraid Pande
  !startraid Uber Leet
Keep it to !raid start <type> and let the type be optional.
Also have an option for guildbots to announce on gc, pgroup or both. Second option to send a tell to any guildmember that logs on telling them there is a raid, and if a type is set, tell them the type.

Quote
- Make the raid yell its open every 5 minutes and stop when you lock it
Make it an on/off option aswell as with a configurable interval. Also an option on what channels to announce in if a guildbot (gc/pgroup/both)

Quote
- Use timed point system with a different "startraid" command, or maybe use a different name for it
  !startmission Towers
  !startduty Spawn Otacustes
Id opt for having the default raid type configurable. Either time based or not.
Most raid bots will use only one type of raid, i do recognize that there might be convenient to be able to select the type of raid using a different command however.
As such im not sure what would be the best approach to start the non default type of raid, or if there should be no default.
The approaches i can think of is either
!raid startalt/startpoints/starttime <raidcomment>  <-- Toggle in first parameter
!raid start <optional raid type or comment> <comment if no raidtype> <-- This would check the first word of the reason to check if it is either "points" or "time" to determine what raidtype is started. Default would be decided by the default setting for bot
!raidpoints/!raidtime start <raidcomment> <-- Different commands for the different raid types, with !raid start starting the default raid type.

Personally i like the two latter best, but im not sure which i like best of them.
In any case, the two current raid modules should be merged into one.

Quote
- Account history command to check points / auctions won, or use the membership module to check how many points total, spent and all time points, auctions won, raids attended, etc
- Command to check last raids, time and how long raid took
Again, yes please.

Quote
I couldnt make this without major changes in the database, and it would be a waste of time if someone else had better ideas and implemented it... So im suggesting them for public ovation, or not.
Great minds think alike. Youve included most of the things i had in mind myself, and some i hadnt thought of. Overall i would say go ahead.
BeBot Founder and Fixer Kingpin

Offline Naturalistic

  • Contributor
  • *******
  • Posts: 221
  • Karma: +0/-0
Re: Raid system suggestions
« Reply #2 on: December 15, 2005, 09:44:20 am »
I can't really post any of my raid modules :) It's branched off Bebot too much, it doesn't really look the same anymore.

But a lot of those ideas are used, so I can say it works :)
220/25 Eternalist Doctor
-----------------------------
Campalot Coding Co-ordinator and Super Admin
http://www.campalot.info/index.php

Offline craized

  • Contributor
  • *******
  • Posts: 165
  • Karma: +0/-0
    • http://www.craized.net
Re: Raid system suggestions
« Reply #3 on: January 07, 2006, 10:33:38 pm »
Naturalistic, please post your module. If part of the work is already done, other people can develop off of it (if you're willing to let us), and save the rest of the devs some work.

Thanks
Trailin [213/14][ADVENTURER][RK2]
Bigburtha [216/17][NT][RK2][FROZEN]
Abeham [199/7][TRADER][RK2][FROZEN]


Offline Solerna

  • BeBot User
  • **
  • Posts: 21
  • Karma: +0/-0
Re: Raid system suggestions
« Reply #4 on: January 09, 2006, 05:47:38 am »
since we atleast are on the subject of the bid module. I've done a few changes to the one that was suplied with the bot.

!bid start <item>
  Has been changed too:
  !bid start <minlevel> <item>
  Have not made min level optional. However I have added a check to see if there curently is an auction running. Before if u ran a !bid start while an auction was running it simple cleared the old one with the new one, not necesarily a good thing.

Added

!bid cancel to stop a running auction

I also made the info shown during an auction and with the !bid info command look the same, and made it work in pgmsg. The decision to make it work in pgmsg was to give the raidleaders a way to quickly show all info about bidding.

If this is of interest to any there is a copy at www.och.nu/serenity/Bid.phps

I will most likely not do any more changes, as I had a radileader meeting earlier to day and let's just say they didn't like how the bidding works.  ;) I will try to make something that works as they wanted, totaly blind bids, rolling between equal bids and so on. So if someone has something like that pls let me know >.<

« Last Edit: January 09, 2006, 06:06:39 am by Solerna »

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Raid system suggestions
« Reply #5 on: January 09, 2006, 07:58:53 am »
I will try to make something that works as they wanted, totaly blind bids, rolling between equal bids and so on. So if someone has something like that pls let me know >.<
Wrote a RK2 omni mercbot style raidplugin for org use. Haven't gotten around to use it often yet, and haven't finished most administrative functions yet (history for raids/loot can't be checked yet in bot, you can't add raidtypes, you can't give a specific amount of points to specific users outside of raids). And I got a few settings too many still, added some twice under similar names while coding (at least I'm always only using one of them).
You can set if you want hidden rolling (just name of bidders show), open rolling (names and points show), allow only increasing bids. If two or more bid the same amount of points, there is a roll between all highest bidder. And you can set the cost for bidding.

Offline Nesi

  • BeBot User
  • **
  • Posts: 55
  • Karma: +0/-0
Re: Raid system suggestions
« Reply #6 on: January 19, 2006, 04:54:04 pm »
Well, about the different raidtypes.
I just made it so a menu will popup asking to choose what type of raid the raidleader wants to start.
Each has it's own ppm (points per minute) depending on the effort it takes, rarity of the raid and optional Max runtime (anticampish).  Everything is configurable through a !raid setup command where the leaders can add, delete & edit the list, since im not always playing actively.



If you are going to make the bot log every raid and other details, you should remember to optimize and create proper indexes for the database or your selects would slow down. Maybe not in the beginning but in time stuff will start to accumulate.
Got about 300k entrys in the apfbot database on who joins and leaves a raid at what time and without properly setup indexes searching though that would take a good deal of cputime.

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
Re: Raid system suggestions
« Reply #7 on: January 19, 2006, 11:29:36 pm »
im working on a raid system based on my message in this topic. im not sure yet if leaders should have the freedom to choose how many points to give on a raid, or make it like the IGN bot where points are predefined. it will have a mission mode, where you choose how many points players will get every 10 minutes. also will have account history, raid history, and whatever else i can come up with.

dunno when it will be ready, gonna take my sweet time with it. im open to suggestions.

Offline mesa

  • BeBot Rookie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: Raid system suggestions
« Reply #8 on: June 01, 2006, 02:51:04 pm »
These are exactly the things my org has been looking for in our raidbot :)

Would be glad to help code where i can but my php is a little rusty and usually comes out as a spaggetti of procedural stuff ;)

but if there is a function you havent started on maybe i can have a look otherwise i may just dig into where ever i can.  we already have RaidTime and RaidSingle being loaded simultaneously to allow for different types of raids but all i did there was to rename the raid variable and command as raidsingle.

let me know :)

Offline Landcast

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Raid system suggestions
« Reply #9 on: November 01, 2006, 09:06:28 pm »
this would be so nice to have

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: Raid system suggestions
« Reply #10 on: November 02, 2006, 06:47:09 am »
I can't really post any of my raid modules :) It's branched off Bebot too much, it doesn't really look the same anymore.

It would be easier to list the modules we haven't changed than to list all those we have. However, changes to Bot.php have been minimal. I think we can at least share some of the useful stuff we've done. Neither Nat or myself would want to post the entire Campalot. It's a support nightmare, but hopefully these ideas help in development of the official BeBot.

At the moment we've got everything stuffed into user_history and raid_history tables. We added function addHistory() to Bot.php. The purpose of addHistory() is to basically log any and all changes in someone's points in a manner that makes reporting easy. We defined the likely events, and by agreement only use those events when calling addHistory() for our modules.

The EventTypes are:
ADDPTS - Points Added to the account
REMPTS - Points Removed from the account
RAIDKICK - User was kicked from a raid.
BOTKICK - User was kicked from the bot.
BAN - User was banned from the bot.
LOOT - User looted (won at auction or raffle, whatever.) an item.
Plus a couple other special use cases...

The raid_history table isn't anything more than a log file in the database.
Code: [Select]
CREATE TABLE IF NOT EXISTS raid_history (raidid INT NOT NULL, event TEXT, date TIMESTAMP);

1141428693 | Stillian has started a raid for apf           | 2006-03-03 17:31:33
1141428693 | Oddwuaya joined the raid                      | 2006-03-03 17:31:36
1141428693 | Stillian kicked Stillian from the raid        | 2006-03-03 17:36:50
1141428693 | Stillian added Stillian to the raid           | 2006-03-03 17:36:56
etc.

addHistory() is the first thing I ever wrote for BeBot, and I was still discovering PHP and MySQL at the time. It can be done much better and I've got a whole list of things to change/fix when I have time...

Code: [Select]
    /*
        Logs a user history event
        Added by Glarawyn for Omnicom/Campalot
    */
    function addHistory ($UserID, $LeaderID, $EventType, $PointVal, $Info)
    {
        $this -> db -> query("CREATE TABLE IF NOT EXISTS user_history
                 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
                  UserID VARCHAR(12),
                  LeaderID VARCHAR(12),
                  EventType VARCHAR(12),
                  PointVal SMALLINT,
                  Info TEXT,
                  Timestamp TIMESTAMP)");

        // Sanitize UserID & LeaderID strtolower & ucfirst
        // These should be no loger than 12 characters, but that's a limit imposed by FunCom so no need to check.
        $UserID = ucfirst(strtolower($UserID));
        $LeaderID = ucfirst(strtolower($LeaderID));

        // Sanitize EventType (strtoupper)
        $EventType = strtoupper($EventType);

        // PointVal should be negitive if $EventType is LOOT or REMPTS
        if (($EventType == "REMPTS") || ($EventType == "LOOT"))
            if ($PointVal > 0)
                $PointVal = $PointVal * -1;

        // Info is a text block. We need to remove stuff we don't want to deal with, like double quotes. htmlentities() will convert characters with special meanins in HTML to HTML equivlents, ie: & becomes &amp. Use html_entity_decode to get back to the original string.
        if ($EventType != "LOOT")
            $Info = htmlentities($Info, ENT_QUOTES);
        else
            $Info = preg_replace("/<a href=\"(.+)\">(.+)<\/a>/sU", "<a href='$1'>$2</a>", $Info);

        $this -> db -> query("INSERT INTO user_history (UserID, LeaderID, EventType, PointVal, Info, Timestamp) VALUES ('" . $UserID . "','" . $LeaderID . "','" . $EventType . "'," . $PointVal . ",'" . addslashes($Info) . "'," . gmdate (YmdHis) .")");
    }

So now that we have the needed info in the database, reporting can be done...


Show history for a user (Wolfbiter did this function, with latter edits by Nat and myself):
Code: [Select]
    function getHistory($name,$list=30) {
        //$list=30;
        $id = $this->bot->aoc->get_uid($name);
        $sql = "Select EventType,Timestamp,LeaderID,PointVal,Info from user_history where UserID=".$id." ORDER BY Timestamp DESC limit 0,".$list;
        $result = $this->bot->db->select($sql);
        $return = "History for $name<br>";
        if (!empty($result)) {
            foreach ($result as $event) {
                $return.= "<br><br><font color=#FF00FF>".$event[1]."</font><br> ";
                switch($event[0]) {
                    case "ADDPTS":
                        $return.="<font color=#cccc00>".$event[3]."</font> points added by <font color=#0088FF>".$event[2]."</font> for ".$event[4];
                        break;

                    case "RAIDKICK":
                        $return.="Kicked from raid by <font color=#0088FF>".$event[2]."</font>. Reason- ".$event[4];
                        break;

                    case "LOOT":
                        $event[4] = preg_replace("/<a href=\"(.+)\">(.+)<\/a>/sU", "<a href=$1>$2</a>", $event[4]);
                        $return.="Won <font color=#ffff00>".$event[4]."</font> for ".$event[3]*(-1)." points";
                        break;

                    case "REMPTS":
                        $return.="<font color=#cccc00>".($event[3] * (-1))."</font> points removed by <font color=#0088FF>".$event[2]."</font>. Reason- ".$event[4];
                        break;

                    case "BAN":
                        $return.=$event[3]." banned by <font color=#0088FF>".$event[2]."</font>. Reason- ".$event[4];
                        break;

                    case "ADD_XFER":
                        $return.="<font color=#cccc00>".$event[3]."</font> points added. Transfered from: <font color=#0088FF>".$event[2]."</font>";
                        break;

                    case "REM_XFER":
                        $return.="<font color=#cccc00>".($event[3]*(-1))."</font> points removed. Transfered to: <font color=#0088FF>".$event[2]."</font>";
                        break;
                    case "PTADJ":
                        $return.="<font color=#cccc00>".$event[3]."</font> points added by <font color=#0088FF>".$event[2]."</font> for last active raid.";
                        break;

                    default:
                        $return.="Unknown entry: ".$event[0];
                }
            }
            return $return;
        }
    }


Basic Last 25 items won:
Code: [Select]
    function show_report()
    {
        // Find last record in total members
        $sql = "SELECT UserID,Info,PointVal,Timestamp from user_history WHERE EventType = 'LOOT' ORDER BY Timestamp DESC LIMIT 0,25";
        $result = $this -> bot -> db -> select($sql);

        $output = "<font color=CCInfoHeader>Last 25 items won on <botname></font><br>";

        foreach ($result as $info)
        {
//            preg_match("/^(.+) has ended the raid for (.+)$/i", $raiddata[0], $info);
            $sql = "SELECT nickname FROM members where id = ".$info[0];
//            $nickname = $this -> bot -> aoc -> get_uname($info[0]);
            $res = $this -> bot -> db -> select($sql);
            $nickname = $res[0][0];
            $output .= "<font color=CCInfoText>";
            $output .= $nickname;
            $output .= " won ";
            $output .= $info[1];
            $output .= " </font><font color=#7ce2ec> for ";
            $output .= $info[2]*-1;
            $output .= " points on ";
            $output .= $info[3];
            $output .="</font><br>";
        }
        return $this -> bot -> make_blob("Last 25 Items Won", $output);
    } // End function show_report()


Getting info out of raid_history is done via regexp SQL queries. It does work, hopefully someday we'll maybe do something better.

Display last 40 raids (broken up by timeblocks)
Code: [Select]
    function show_report()
    {
        // Find last record in total members
        $sql = "SELECT event,date,UNIX_TIMESTAMP(date) FROM raid_history WHERE event REGEXP \"^(.+) has ended the raid for (.+)$\" ORDER BY date DESC LIMIT 0,40";
        $result = $this -> bot -> db -> select($sql);

        $output = "<font color=CCInfoHeader>Last 40 raids on <botname></font>\n\n";
        $output .= "<font color=CCInfoText>It is currently ";
        // Need to use gmdate with time()
             if (gmdate(G, time()) >= 1 AND gmdate(G, time()) <= 6)
            $output .= "UTC Late Night (USA Evening)";
        else if (gmdate(G, time()) >= 7 AND gmdate(G, time()) <= 12)
            $output .= "UTC Morning (USA Late Night)";
        else if (gmdate(G, time()) >= 13 AND gmdate(G, time()) <= 18)
            $output .= "UTC Afternoon (USA Morning)";
        else if (gmdate(G, time()) >= 19 AND gmdate(G, time()) <= 23)
            $output .= "UTC Evening (USA Afternoon)";
        else if (gmdate(G, time()) == 0)
            $output .= "UTC Evening (USA Afternoon)";

        $output .= "</font>\n\n";
        // MySQL timestamps are in local time, not UTC. So use date() not gmdate() here
        foreach ($result as $raiddata)
        {
            preg_match("/^(.+) has ended the raid for (.+)$/i", $raiddata[0], $info);
            if (date(G, $raiddata[2]) >= 0 AND date(G, $raiddata[2]) <= 5)
                $output_latenight .= "<font color=CCInfoText>".$info[2]."</font><font color=#7ce2ec> by ".$info[1]." on ".$raiddata[1]."</font>\n";
            else if (date(G, $raiddata[2]) >= 6 AND date(G, $raiddata[2]) <= 11)
                $output_morning .= "<font color=CCInfoText>".$info[2]."</font><font color=#7ce2ec> by ".$info[1]." on ".$raiddata[1]."</font>\n";
            else if (date(G, $raiddata[2]) >= 12 AND date(G, $raiddata[2]) <= 17)
                $output_afternoon .= "<font color=CCInfoText>".$info[2]."</font><font color=#7ce2ec> by ".$info[1]." on ".$raiddata[1]."</font>\n";
            else if (date(G, $raiddata[2]) >= 18 AND date(G, $raiddata[2]) <= 23)
                $output_evening .= "<font color=CCInfoText>".$info[2]."</font><font color=#7ce2ec> by ".$info[1]." on ".$raiddata[1]."</font>\n";
        }

        $output .= "UTC Morning (USA Late Night) Raids:\n";
        $output .= $output_morning;
        $output .= "\n";
        $output .= "UTC Afternoon (USA Morning) Raids:\n";
        $output .= $output_afternoon;
        $output .= "\n";
        $output .= "UTC Evening (USA Afternoon) Raids:\n";
        $output .= $output_evening;
        $output .= "\n";
        $output .= "UTC Late Night (USA Evening) Raids:\n";
        $output .= $output_latenight;
        $output .= "\n";
       
        return $this -> bot -> make_blob("Last 40 Raids", $output);
    } // End function show_report()

And then LootSearch (attached) which displays info for the items in APF with average points and links to view more info on that item. Some of this module is good code, some of it is ugly and repetitive. Loot search can also just search the history db for items that are and are not defined in the click windows.

LootSearch updates it's average number of points and item won count every 6 hours and keeps the info in an array so queries don't have to be done every time someone views the basic history (!loot).
« Last Edit: November 02, 2006, 06:51:57 am by Glarawyn »

Offline Naturalistic

  • Contributor
  • *******
  • Posts: 221
  • Karma: +0/-0
Re: Raid system suggestions
« Reply #11 on: November 02, 2006, 07:09:24 am »
Yes, but I didn't feel like hearing "it doesn't work, help!". ;)

I've already spent a hell and a half doing the code, I don't wanna have to explain it to others >_>



220/25 Eternalist Doctor
-----------------------------
Campalot Coding Co-ordinator and Super Admin
http://www.campalot.info/index.php

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: Raid system suggestions
« Reply #12 on: November 02, 2006, 07:16:18 am »
Yes, but I didn't feel like hearing "it doesn't work, help!". ;)

I've already spent a hell and a half doing the code, I don't wanna have to explain it to others >_>

That's why I didn't post anything that would work. :) Everything above is all real world examples. If you want to implement the functionality, you'll have to figure out how to implement it on your own. The code posted does not imply we offer support to make it work. This is a discussion on the future of bebot, not a hey here's this code copy and paste and get instant results. :)

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Re: Raid system suggestions
« Reply #13 on: February 17, 2007, 01:45:21 am »
Trying to get something similar to work, taking much of your posted code. One thing that puzzles me:
in addHistory, you do a
Code: [Select]
        $UserID = ucfirst(strtolower($UserID));
        $LeaderID = ucfirst(strtolower($LeaderID));
which looked to me like you are intending to save nicknames in these two fields.
In getHistory, you do a
Code: [Select]
$this->bot->aoc->get_uid before you select from the user_history table. That implies that you store UIDs. The tables use carchar(12) columns, not integer(11) ones. So it isn't exactly perfect for storing the return values of the get_uid function. What would be a sane way to do this? Store UIDs in UserID and LeaderID or store nicknames?
Luuv  Bot-Keeper of Vengeance ^^*

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: Raid system suggestions
« Reply #14 on: February 17, 2007, 02:14:54 am »
The code went though a few different revisions before it went live. It was my intention to store usernames, but Nat or Wolfbiter decided to store character ids. ;)

When we finished support for alts sharing the same account, we modified userid to be mainid, the character id of the main character, which is what is used to tie alts and raid_points together, and we added activename to tack which alt was actually active...

Coding is evolutionary process. ;)

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 82
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal