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
Evil Trout A detailed explanation of streaks

BINGEBOT 2015

Avatar: 38 2010-12-05 22:39:25 -0500

Level 12 Troll

I AM A GIANT FART FACE

ET has the Flu, or so he claims. He is not ignoring this thread. Some good points have been mentioned and I will keep my opinion to myself for the time being (until ET has returned).

B2015

markchd

Avatar: 12369 2010-01-24 16:26:11 -0500
18

[Brainfreeze]

Level 69 Camwhore

Craves Power like it's Crystal Pepsi

Poor hungover bastard. Log in to see images!

Seriously, the flu’s a ****. Feel better, ET.

Beavis-Dragon

Avatar: Beavis-Dragon's Avatar
24

Level 56 Emo Kid

Douchebag to the Stars!!!!!!

Hope ET gets to feeling better… then he can explain how the hell some of us have managed to get the 72 streak peen already. I’m hoping my math is just screwed but I’m still lost on how it’s possible someone explain it to me so I don’t kill off my streak on accident

Evil Trout

MODERATOR
Avatar: 35 2013-08-13 11:47:18 -0400

[Crotch Zombie]

Level 21 Hacker

I have ample evidence that ET is a weedy little twerp.

Hey guys!

Okay I think my mistake was trying to use the forum visit history as a way of detecting streaks, when a much simpler approach such as the one McBanhammer suggested would be a lot more effective.

At some point soon I am going to re-code streaking. Unfortunately it’ll involve taking the server down as I’ll be deleting many columns from a huge table and migrating over data to a new table.

markchd

Avatar: 12369 2010-01-24 16:26:11 -0500
18

[Brainfreeze]

Level 69 Camwhore

Craves Power like it's Crystal Pepsi

Evil Trout Posted:

Hey guys!

Okay I think my mistake was trying to use the forum visit history as a way of detecting streaks, when a much simpler approach such as the one McBanhammer suggested would be a lot more effective.

At some point soon I am going to re-code streaking. Unfortunately it’ll involve taking the server down as I’ll be deleting many columns from a huge table and migrating over data to a new table.

Woo! optimizing.

Catt although

MODERATOR
Avatar: 46806 2013-08-07 00:24:18 -0400
100

[Brainfreeze]

Level 69 Troll

Last Catt Standing

okay, let’s look at this

http://i38.tinypic.com/4v319s.jpg (didn’t put the pic here ‘cause it’s large)

I was on a streak at the beginning of this – there was no fisheries or Urbane earlier in the streak.

The FAP should reset everything to zero (or one, if it counts that forum). Clearly it should take at least one more forum to get four in a row, no?

entchen

Avatar: Bug (Microscopic)
3

Level 35 Troll

“Problem Child IV”

MC Banhammer Posted:

This would be my suggested algorithm, which would allow for you to indicate which forums are part of the streak:

Create a new DB table to hold streaks. First column, is the alt’s ID#. Second column is to hold the forum ID# of any forums currently on the streak. One row per forum. The table is keyed on both columns.

Every time you complete a forum successfully, the system tries to insert a row for you and that forum. If it gets a duplicate key restraint, that means you broke your streak. All records for you are deleted from the table, and a new row is written with this most recent forum (the start of a new streak).

Then you do a “SELECT COUNT(*) FROM <table> WHERE user_id = <userid>”, and divide the result by four. If there’s no remainder, award the appropriate peen and scoops for that result number.

If you fail to beat a forum, the system deletes all rows in the table for you.

That’s what I’d do.

Uh, I don’t think that’s actually what you want to do. The idea is we want to break the streak when pwning the a forum that was already in your streak, right? Consider this example:

1. Forum A

2. Forum B

3. Forum C

4. Forum D

5. Forum A

6. Forum E

If you delete all the past history as soon as your find a repeated forum, your algorithm will not necessarily yield the longest streak. In this example, your algorithm calculates the longest streak as ABCD, and the current streak would be AE.

The way I see it, the longest streak here should be BCDAE. So instead of clearing out all the history once you pwn a duplicate forum, you’d just delete the first match and everything earlier than that.

entchen edited this message on 11/17/2008 3:35AM

volatus

Avatar: 80403 Sat Nov 01 01:34:28 -0400 2008
2

Level 25 Hacker

Quit stalking Oda and squawking like a pink monkey bird.

(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.)

volatus edited this message on 11/17/2008 4:32AM

Beavis-Dragon

Avatar: Beavis-Dragon's Avatar
24

Level 56 Emo Kid

Douchebag to the Stars!!!!!!

Someone please explain to me how in the ever loving hell that GS49 got the 76 streak peen, permanoob or not thats just shady

SG94

Avatar: 53266 2011-07-31 00:43:01 -0400
20

[SG Inc]

Level 35 Troll

The most anal, compulsive tattle tale on this site, mess with me and meet the ban axe ****

Beavis-Dragon Posted:

Someone please explain to me how in the ever loving hell that GS49 got the 76 streak peen, permanoob or not thats just shady

http://www.forumwarz.com/discussions/view/18014

M3wThr33

Avatar: M3wThr33's Avatar
16

[WeChall is a ****ty klan]

Level 61 Emo Kid

“Final Cut Pro”

I’m a bit confused. Should this work the same way as it always did? Basically transparent to us? Or is there a way to ‘lose’ the streak but keep it going?

volatus

Avatar: 80403 Sat Nov 01 01:34:28 -0400 2008
2

Level 25 Hacker

Quit stalking Oda and squawking like a pink monkey bird.

BUMP.

ET, did you jump ship or something?

spacekadt

MODERATOR
Avatar: 16186 2011-11-01 00:02:40 -0400
78

[Brainfreeze]

Level 69 Camwhore

meh

volatus Posted:

BUMP.

ET, did you jump ship or something?

streaks were fixed/updated a few days ago…

http://blog.forumwarz.com/2008/11/20/changes-to-streaking-x-forums-in-a-row

volatus

Avatar: 80403 Sat Nov 01 01:34:28 -0400 2008
2

Level 25 Hacker

Quit stalking Oda and squawking like a pink monkey bird.

spacekadt Posted:

streaks were fixed/updated a few days ago…

http://blog.forumwarz.com/2008/11/20/changes-to-streaking-x-forums-in-a-ro

I know… I saw when ET changed it, and I also see the new “streak status” page (although it’d be nice to have it integrated into the forums list somehow). I’ve been waiting to see an update in this topic though, maybe ET can explain what he actually did.

I did put a bit of time and effort into writing that little post up there… I just want to know it was actually read!

Evil Trout

MODERATOR
Avatar: 35 2013-08-13 11:47:18 -0400

[Crotch Zombie]

Level 21 Hacker

I have ample evidence that ET is a weedy little twerp.

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!

volatus

Avatar: 80403 Sat Nov 01 01:34:28 -0400 2008
2

Level 25 Hacker

Quit stalking Oda and squawking like a pink monkey bird.

Evil Trout Posted:

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!

I… really don’t see how it can make things “more complicated”. In fact, it significantly simplifies the implementation! No need to make any queries at all to check for anything… you just run simple string-search and string-chopping functions, which by themselves are even faster than preg_match (perl regular expressions – also not necessary here), and ITSELF is even faster than a single MySQL query! It’s like an all-you-can-eat buffet of optimizations and simplified code, and it really quite boggles my mind as to how you can say it’s “more complicated”...

Perhaps we’re not understanding it the same way?

Evil Trout

MODERATOR
Avatar: 35 2013-08-13 11:47:18 -0400

[Crotch Zombie]

Level 21 Hacker

I have ample evidence that ET is a weedy little twerp.

volatus Posted:

I… really don’t see how it can make things “more complicated”. In fact, it significantly simplifies the implementation! No need to make any queries at all to check for anything… you just run simple string-search and string-chopping functions, which by themselves are even faster than preg_match (perl regular expressions – also not necessary here), and ITSELF is even faster than a single MySQL query! It’s like an all-you-can-eat buffet of optimizations and simplified code, and it really quite boggles my mind as to how you can say it’s “more complicated”...

Perhaps we’re not understanding it the same way?

That string has to be stored in the database right?

So to read it, you need to query. To write it, you need to write a query to do that.

Now, from an efficiency point of view, looking for the occurrence of a letter in a string is slower than querying a database by index. Finding a letter in a string is O(n), finding a row by index in a database is O(n log n)

Not to mention, with the database index you get a guarantee that the same forum can’t be in there twice. With your method there is no guarantee of data integrity.

And many other reasons…

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