Buy Official Merchandise!
Forumwarz is the first "Massively Single-Player" online RPG completely built around Internet culture.

You are currently looking at Flamebate, our community forums. Players can discuss the game here, strategize, and role play as their characters.

You need to be logged in to post and to see the uncensored versions of these forums.

Log in or Learn about Forumwarz

Civil Discussion
Switch to Role-Playing Civil Discussion

Viewing a Post

Evil Trout

MODERATOR
Avatar: 35 2023-04-24 23:24:10 +0000

[Crotch Zombie]

Level 21 Hacker

this site is deader than the toddlers in my basement

volatus Posted:

(edit: Expanding on the above inspiration…Log in to see images!

Where “a”, “b”, “c”... represents an 8-bit integer (i.e. 0, 1, 2… 253, 254, 255), let the forum pwnage streak be represented by, for example, afuebwks.

Streak length is determined by the dividing strlen (string length) by 4, since it’s counted in increments of 4. This prevents duplicate awards by only awarding the matching award that will be hit right on the integer when it’s obtained. No need to round or perform calculations. In the above example this will be 2.0, or the second streak increment.

Duplicate detection is determined by searching the streak string for the current forum. So, if I continue the above example, we may have just pwned “e” again. afuebwkse. The search would find that “e” was already pwned, and would chop off from the beginning of the string to, and including, the first (and only at that point) occurrence of “e”, and leave us with bwkse. At this point I don’t know how the administration wishes to handle a decremented pwnage streak – one that was chopped down due to a duplication. If you would like to award the new streak, you could divide strlen by 4 and use the integer result. Or if you prefer not to reward the current streak (unless it matched perfectly with a new increment), you could just break out of the computations and continue.

That should chop the size of your database considerably. Log in to see images!

(edit: This would end up only occupying one table row in the users table for the entire streak calculation algorithm, and would simplify – and error-proof- streak calculation considerably. Log in to see images! )

(edit edit: Also, keep in mind that abcdefg… are just representations of the binary integers that can’t be represented on-screen. This allows for one of up to 255 unique forums to be represented, per byte – now that’s information density at its finest. The information doesn’t need to be presented on screen, so it’s safe to use in a binary table field. Just use string length and string position functions, and call MySQL’s library function mysql_real_escape_string when adding data to the database, to ensure it doesn’t get corrupted.)

I didn’t respond to this because I already addressed how streaks would work on the blog. I went with McBanhammer’s solution.

If you want feedback on your post, I find it a poor solution. Encoding things into strings make it way more complicated for no obvious reason. The disk space savings aren’t worth the difficulty in querying or complicated and error prone nature of the programming.

I just used a streaks table. It’s (forum_id, character_id). If there’s a duplicate constraint the streak is reset. If you die, the next time you enter a forum the streak is reset. It’s working well now!

Internet Delay Chat
Have fun playing!
To chat with other players, you must Join Forumwarz or Log In now!