entomb / dragonchan

A prototype script to transform any /b/ thread into a dragon slaying match.
24 stars 17 forks source link

Requests - Top Deceased, Enter Health, Top "Buff" #3

Closed RobertsOma closed 11 years ago

RobertsOma commented 11 years ago

First of all, I really enjoy playing your game and love your application for it (hostet some games myself)

But though it seems as if there could be some improvements.

Regards,

RobertsOma

entomb commented 11 years ago

Hello @RobertsOma ,

I think your requests are awesome ideas, I will squeeze them into a release soon!

for the HP, it could be set by the OP's email or subject, what do you think? 50k is a huge dragon, I dont think we will be able to kill one that big before the thread reaches post limit. this also brings opportunity to people trolling with large/small dragons if we don't put a min/max value on it

I can also simply boost the HP ratio to max 30k-35k instead of the current ~27k

what would you preffer?

entomb commented 11 years ago

This has been done. I'll think about a better solution for the custom HP setting latter.

sysr-q commented 11 years ago

You could allow the OP to give a little push to the cap via email field, you know, setting it to +100 through +5k or something.

RobertsOma commented 11 years ago

Well glad you could settle this that quick and let me be some part of it, thanks! I think maxing the cap to like 37k is a good idea, last time we beat a 25k way too fast!!!

Also you should row the Top Bard list beneath the other Top Lists, not beneath Most Deaths. Would make more sense. Adding to my requests:

Adding to the max. Health:

I also think the latest hit feature is somewhat unnecessary.

entomb commented 11 years ago

Hello @RobertsOma ,

All those features are good improvements and I have thought of some of them before. I'll work some in as soon as some other core issues get solved/implemented. Right now I'm worried about the API cache because I don't want the game to get banned by 4chan mods for making too many requests, i found a solution i just need to write it in code.

as for the autoupdate, you can use the bookmarklet, for now it doesn't work on HTTPS but you can give it a try in HTTP, if you never used a bookmarklet before it's realy simple: 1) drag the link to your bookmark bar 2) navigate to any /b/ thread 3) click that link 4) an auto-updating window will pop at the top with the current HP and status 5) ???? 6) SLAY DRAGONS!

Ill keep this issue open for future tips you might have!

entomb commented 11 years ago

hi there @plausibility,

Theres alwready some implementation of this in the works, using the email field to customize the dificulty. But it seems useless to release this before there's a complete tutorial page so OP's know what they are doing.

sysr-q commented 11 years ago

There isn't much you can do to cache the API, since you do need to crawl it for updates periodically. But as it's recommended to only hit it every 10 seconds, if you split the load up, as long as you've not got more than one or two games running simultaneously (do you limit how many threads there can be running?) it shouldn't be an issue. What I mean by this is: don't scrape the API every time someone requests the page, automatically do it every ten or so seconds.

entomb commented 11 years ago

Therere can be more then one thread, i've seen it before, but what happens is that one of them will not have enought people and will eventualy 404.

The issue is that i'm making 1 request per thread per person per refresh and i should do 1 per thread per second.

This was just a prototype and i didn't bother adding an async thread fetcher, so each refresh is a call to 4chan api.

sysr-q commented 11 years ago

You should add some sort of hard cap, since /b/ is only 15 (?) pages or so, IIRC. That'd mean you can balance out the API calls by spreading them out over a few seconds each, with some variable delay based on thread activity or some such. Don't do one per second, you should do a request between 3 and 10 seconds per thread I think, again, depending on thread activity. That'd mean if the thread is quiet you're not going to be hitting the API up every second doing nothing.

Also, make sure you use the If-Modified-Since: X headers, just so you're not running over data which hasn't changed.

That should make it much easier and cleaner for you to handle refreshing and stuff.

entomb commented 11 years ago

thanks @plausibility, the cache is working right now on a 3 second expire.

I have no intention of using If-Modified-Since because i need the whole thread on all request.as for your other suggestions, they make a whole lot of sence, but this is just a script to track posts on /b/ and kill dragons. I wouldn't put much work into elegant architectures for now, but feel free to pull request ;)

@RobertsOma 4chan limits /b/ removing the email field from the posts. nothing I can do for now to customize the dificulty.

sysr-q commented 11 years ago

If-Modified-Since could clean up the script because you can throw that up there, see if it returns whatever the HTTP header for not modified is (300 or something), then you can just wait for the next loop; no point wasting cycles if you're not doing anything, right?

RobertsOma commented 11 years ago

@entomb, thanks for the great support, I'm not on GitHub that much, so I didn't look it up, sorry. And wow, thanks for adding my name to the site!! Going with the Bookmark then.

Looking forward to many great games and even more improvements in the future!!