Learn to Code via Tutorials on Repl.it!

← Back to all posts
How to make slowprint better (+ranting)
h
SixBeeps (4767)

Slowprint. Rolling text. Hackerman animation. Whatever you want to call it.

It's a popular little detail to add into your game to make it look cooler, and it definitely has done it's job before. In certain contexts, slowprint actually adds a lot in terms of how the game feels and plays. Though, there's a huge issue that seems to have gone unnoticed, that it makes everything slow down.

Now, that might seem obvious at first; after all, it is called slowprint. The problem I'm talking about however is when an implementation of slowprint rolls slower than my reading speed. Then it just feels like a Mario auto-scrolling level that was nerfed way too much.

I understand that some people read at a slower rate than others, and some read quicker. That's fine, but I have yet to see a project with a "scroll speed" setting to account for us who have had 300mg of caffeine listening to speedcore while running a 5k marathon at an average of 251 mph can read at a faster rate. Heck, this is a feature in the original Pokémon games, so it shocks me that nobody else has done this.

At this point, you might be asking: how could I implement a scroll speed option in my game? To answer that, let's take a look at a typical implementation of normal slowprint:

function slowprint(str)
  for every character C in str
    print C
    wait a little bit
  maybe print a new line if wanted

The key part of this block of code is the "little bit" part. How long should we wait in between characters?

If we want to make this a setting, we'd make it a variable, and set the variable according to how slow the user wants the text to roll. This is usually calculated by taking the reciprocal of the reading speed in characters per second. The average fluent English reader can read at 180 wpm = 15 CPS = 66ms in between characters. This conversion is imprecise because it assumes all 5-letter words, but even then, it's really slow. Furthermore, with fluency comes compression, and we can typically make out a word even if a few of its letters are missing:

Ths artcle ws wrttn on Rpl Tlk, whre evrythng is awsom

Because of this compression that we do, we can make our scroll speeds faster. 20-25 CPS is a really common scroll speed, likely because it's around the 0.05 second delay mark. Most games that I consider to have too slow of a scroll speed are usually around this area. Bumping the CPS counter up to 35 significantly improves the reading experience, so I'd say make that an option. Anywhere in between could have their uses as well.

So, why should you care about this? It seems like way too small of a detail to have to even worry about.

I don't blame you for thinking this at all, but to be 100% honest, scroll speed can make or break your game for people like me. More than once have I been disappointed by games that have wonderful gameplay, but feel slowed down by the slowness of the text.

Also, don't you dare think about slowprinting a paragraph of text. I want to see it all at once, so I can take it at my own pace.

Comments
hotnewtop
FlaminHotValdez (355)

"The average English reader reads at 180 WPM" Haha 444 WPM read rate go brrr(I actually read that fast, that's how I finished a 984 page, 272k word book in 2 days.) Also yeah, I REALLY hate games who slowprint gigantic paragraphs and I wait for damn forever to finish reading it. (Oh and by the way, is damn counted a bad word on Repl? If so, sorry.)

Panda1208 (1)

I just made a account today and I don’t have experience so I think this is super cool

xxpertHacker (774)

Kinda late, but I personally like when an application offers to "skip" not the text, but the slow printing. Ex: clicking something to make all of the text appear at once, so I can speedily digest all of it at once, then continuing on with the game/app/whatever.

SixBeeps (4767)

@xxpertHacker oh yeah, that's an even better option.

WILLIAMBAEWER (79)

wait, you guys didnt read the whole harry potter series in a day? (kekW(kappa))

FlaminHotValdez (355)

@WILLIAMBAEWER O.O Assuming you read 12 hours a day, that's 1380 WPM read rate, which is scientifically impossible. Busted

WILLIAMBAEWER (79)

@FlaminHotValdez
who said anything about 12 hour reading times? I read the whole series in 24 hours! gotem

CodeLongAndPros (1579)

Also, don't you dare think about slowprinting a paragraph of text. I want to see it all at once, so I can take it at my own pace.

Only thing you do with this is paginate it.

SixBeeps (4767)

@CodeLongAndPros Depends on the length of the text. If it's long enough, yeah, but you shouldn't need to paginate something that's like 4 sentences long. That's a bit much.

CodeLongAndPros (1579)

@SixBeeps Well yeah, but slowprinting man pages? or info pages?

SixBeeps (4767)

@CodeLongAndPros Well yeah, at that point it's likely reached more than a paragraph.

JBloves27 (1519)

Pretty nice tutorial!

CoolCoderSJ (360)

lol but ive done this with python 2 years ago.....

CoolCoderSJ (360)

In fact i've made my stuff so that a user can enter their own number of seconds instead of choosing

realTronsi (907)

@SixBeeps segmentation fault (core dumped)

python users: foo[-5]

Bookie0 (5657)

lol it is so annoying there's this whole paragraph of slowprint at 0.06 s and no way to skip it. *sigh "Do I really have to read all of this"?

realTronsi (907)

@Bookie0 no one plays the game for the dialogue anyways facts

realTronsi (907)

@Bookie0 makes repl talk bot which uses the edit feature for slow printing comments

realTronsi (907)

@Bookie0 Good 'ole, communism. 🤡