Server Help

Trash Talk - Bounty multiplier

Cyan~Fire - Sat Sep 10, 2005 6:01 pm
Post subject: Bounty multiplier
I fully don't expect anybody to know this, but does SubSpace use a short or int for the bounty * Flag:FlaggerKillMultiplier on a player death? Just curious, because MERV's using a short right now, which could roll over. Just wondering if I should fix it.
Smong - Sat Sep 10, 2005 6:52 pm
Post subject:
The setting uses a short, but since register size is typically 32bits I think it's going to get extended when used in math (in ss).
Cyan~Fire - Sun Sep 11, 2005 12:40 am
Post subject:
Well, it'll get extended, but is it still stored as a short? You wouldn't think so, but hey, these are the guys that stored score as a signed value.
Mine GO BOOM - Sun Sep 11, 2005 4:56 am
Post subject:
Cyan~Fire wrote:
.. these are the guys that stored score as a signed value.

Thats because you could originally get negative scores. Ever wonder why people with low bounties are neg killers? You used to start with negative bounty. So some people would have an average kill of -10, which were refered to as negative bounty hunters. Later on, after they realised that people would still kill small bountied players, they had them start at 0 again, to remove the goal of getting the smallest score. The neg killer term still stuck.

The way most C compilers work, if you do a short * short -> int, it will extend it as if it was int * int. Tested on GCC and MSVC 6.0
Code: Show/Hide
int main()
{
        short a, b;
        int c;

        a = 30000;
        b = 100;

        c = a * b;

        printf("%d * %d -> %d [%d]\n", a, b, c, a * b);
}

Code: Show/Hide
30000 * 100 -> 3000000 [3000000]

Cyan~Fire - Sun Sep 11, 2005 2:57 pm
Post subject:
OK, the way it was happening was something like
Code: Show/Hide
short bounty = pkt.bounty;
if (killer->flags > 0)
   bounty *= settings.FlaggerKillMultiplier + 1;   //possible loss

but I've changed it to use an int now.

And that makes sense about the negatives, but I'd think it would just be better to have the score unsigned and the bounty signed, then "negative bounty hunters" would just have a score of 0. Haha.
Maverick - Mon Sep 12, 2005 6:18 am
Post subject:
Woo! You are "fixing" Mervbot, Cyan? biggrin.gif
Cyan~Fire - Mon Sep 12, 2005 9:03 pm
Post subject:
In a way. I'm doing it at just the wrong time though. First I though MERV was cool, then I realized it sucked (compared to how cool it could be), then I figured it's useless with asss, then I figured it might still be useful, then I decided that since I started I mightn't as well finish.

What I'm wondering about, though is plugin changes. I would have to make sure old plugins would work, but I'm thinking of adding a whole new callback type interface instead of this messaging thing. Basically what it would do is search for a specific function name (like "handlePlayerMove") in the plugin, and call it if it finds it. That way, it completely automatically calls only the functions you need. Kinda cool, right?
Maverick - Tue Sep 13, 2005 2:48 am
Post subject:
Sounds cool.
But make sure its backward-compatible as you already said or alot of coders are going to be mad at you (including me) sa_tongue.gif .

What's so sucky about Mervbot btw? (specific points if you can name them)
Only thing I can mention is the lacking feature of registering commands (so you can't ever catch all the commands that the plugin isn't handling). (Aka.. like TWCore does)
Cyan~Fire - Tue Sep 13, 2005 9:21 pm
Post subject:
Command registration is definitely an issue. Ekted's timer feature is also a bonus.

But a lot of the improvements are behind the scenes. Plugin interaction is exactly the same now, but the core code is completely whacked out.

Parital list of changes:
That's all the major ones I can think of right now.
Cyan~Fire - Fri Sep 16, 2005 6:51 pm
Post subject:
Code: Show/Hide
sub   esp, 3064

LOL. Yes, I am definitely going to implement command-registering with handler functions.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group