So I finally got a chance to get started on BotFu Domination today! Actaully, if I'm being completely honest, I didn't have time to do much overall. But a start is a start right?
Wouldn't you know that the very first thing I started on for this project is already proving to be an interesting challenge. Before I get into my first challenge too much though, I think I need to dump a little inside knowledge.
BotFu domination is hopefully going to be a fun additional strategy based game for BotFu players. The game will more or less revolve around fighting with the point of building the most dominating Dojo, fight record, and things like that.
The first, and possibly most important, part of the game involves dominating other fighters. To dominate another fighter, you have to have KO'ed them at least five (5) times more than they've KO'ed you (which also means you have to have fought them at least 5 times as well).
Once you are dominating another player, you can start to earn pieces of wood based on how many players you are dominating and how long you have been dominating them. Once you collect enough wood you can start to build things like your own Dojo and such.
The game progresses from there, but that's enough information for now to talk about the first challenge. How do I determine who you are dominating?
Since the details of each knockout are stored in a table, this turns out to be pretty simple. Here's an example of the query that does this for me:
select * from (select count(attacked) kocount, attacked from knockouts where attacker = 'KEVIN' group by attacked) tmp, (select count(attacker) koed, attacker from knockouts where attacked = 'KEVIN' group by attacker) tmp1 where (kocount - koed) > 5 and tmp.attacked = tmp1.attacker order by (kocount - koed) desc
So that's all good, but it's not really everything I need for this first part. You see, in addition to knowing who you are dominating, I need to know just how long you've been dominating that person (ie. when you went 5 or more KO's up on the other person).
This will help to determine how many pieces of wood you get...the actual idea is to have you earn a percentage of a piece of wood for every hour you dominate someone (probably 1/12th of a piece of wood for every hour). Once you've dominated someone for 12 full hours you'll get your piece of wood. And to make it more user friendly, you should be able to earn those hours over time.
For example, let's say I am dominating Heath (which of course I am). Let's also say that I'm only 5 fights up on him, and that I stay 5 fights up on him for 11 hours. At that point, I should have earned 11/12ths of a piece of wood. Now let's say that (by some miracle) Heath beats me in a fight and I am no longer dominating him. Being that my ego couldn't handle that, I quickly go out and KO him two more times so that I'm once again dominating him.
Once I maintain that new domination for an hour, I should earn my last 12th of a piece of wood (and actually get said piece of wood). So basically, you don't have to dominate someone for a straight 12 hours, you can do it little by little until you've tallied a full 12 hours.
So to handle this, I need to know more than just who you are dominating (and by how much you are dominating them). I need to know how long you've been dominating them (or more technically, how long since you went 5 KO's or more above them)...so got any ideas?
I've got a few, but I haven't had a chance to fully work through it in my head just yet...so I'll reserve my answer until a future post. In the meantime, I would love to hear how you might try and tackle this issue...



