4 ms·
I had an idea to do something similar to this but with a story, where a random text character would be garbled (or maybe deleted) with every visit. I wasn't su
by cableshaft 4y ago
I had an idea to do something similar to this but with a story, where a random text character would be garbled (or maybe deleted) with every visit.
I wasn't sure how best to handle that on the backend side, not really something I've ever had to do before. Especially dealing with (possibly) full text fields and a bunch of people hitting up the website in a short period of time, possibly thousands at a time.
I could have just recorded visit counts, and have it randomly generate on the client side based on the visit count, but I wanted to keep it persistent for all viewers.
- bo0tzz 4y agoHave you tried just doing it the naive way? Databases are damned fast, and actually hitting pageview counts of "thousands at a time" is pretty unlikely (it seems like being on the HN front page gets you about 10 hits per second at peak).
- enneff 4y agoModern computers can easily mutate text thousands of times a second. Think about what a browser does instantly when you load a page. Also what would you need a database for? Why not write to a text file?
- bigDinosaur 4y agoDB for most easily handling concurrency I would assume. Not that it would actually matter how you implemented it in this scenario.
- taftster 4y agoOr maybe the opposite, where the story unscrambles with each visit. Either direction could be kind of interesting. Like imagine a murder-mystery game, of sorts. The story gives more clues as each guess to solve the murder goes unanswered. Or a choose your own adventure type scenario, where the directions are "chosen" by some visit. Interactive story telling on the massively-multiplayer scale could be really interesting.
- cableshaft 4y agoYeah I like that also. Kind of matches another idea I had, but never got around to making, where it was kind of a mystery novel, but it was written in segments, and each purchased PDF would create a random assortment of like 30% of those segments, with some enforcement of sequencing or acts to keep them somewhat coherent, and in some of those segments would be some pretty crazy relevations, and then there's a shared community book available to anyone who's purchased a copy of the individualized book, that auto-includes any passages that people choose to share from their copies (or I could just let people do it themselves, add it to a wiki or whatever). But they could also choose to keep it private if they wanted, and the website would let everyone know how many times each passage has been generated (but not shared). I even considered making the tech in a way that if successful I could open it up to others to make and sell their own stories like that, like a dedicated website. Problem is, you need to write a story that works with that format, and that's difficult. I started a bit of work on it, and then got distracted by other projects. It's kind of like those old sticker books back in the day, where you buy packs of stickers and put them in numbered spots in the book and it slowly reveals the whole picture. Loved getting those back when I was a kid. Also getting the random generation right so it doesn't like give everything away after just 10 books sold. Still like the idea though. Maybe someday I'll get back around to it.
- dgoldstein0 4y agoWhy does it need to be random? Pseudo random with a fixed seed would give you random looking deterministic numbers
- cableshaft 4y agoYeah I hadn't considered that and I should have, that's a good point. Should have brought been using my gamedev brain more. Probably because I was coming up with various ideas of making it more gamified, where visitors could help keep the page from falling into entropy by spotting errors and fixing them (like it'd only work if they changed it back to the correct word or whatever). But yeah, pseudorandom might be the way to do this on a basic level. Good idea.
- progman32 4y agoHow about it deletes a random word and replaces it with an AI-chosen word.