Thursday, 13 January 2022

Worldbuilding – how much of it do you need, and when?

 I've talked about worldbuilding here before, but one thing we should discuss before any of that is the amount of worldbuilding needed for your story.

A disclaimer before we get started: This article is based on my experience writing a fantasy series, and what I've discussed here won't necessarily apply to every writer or every story. 

This article was inspired by this image which was shared in several writing communities:

Image containing text, posted by dontbotherwiththisblogthanks: I am sick and tired of fantasy worldbuilding tips making writing inaccessible your story is valid if you don't know about the classic literature of eastern city folk. Your story is valid despite you not knowing how the garbage disposal of medieval cities work. Stop. Telling. Writers. They can't/shouldn't write until they have everything figured out. Figuring out the world, and knowing what you need, partially comes from writing the story. Not everyone is Tolkien. Not everyone can or NEEDS to know every single detail about the world. JUST WRITE YOU WORLD.

And I basically agree with what this says. 

The problem

In my opinion, the issue mainly comes with many those who give writing advise putting the cart before the horse. Sometimes, they're just telling you how to do the worldbuilding, expecting you to figure out the context and apply it appropriately, which can come off as putting too much pressure on writers. Sometimes, it's just worldbuilding tips being shared, or ideas, which can also intimidate someone considering getting into worldbuilding for the first time.

The thing is, worldbuilding simply can't happen in a vacuum. At least, I know I can't do it. It simply becomes super tedious extremely fast if I have nothing to anchor me to in the world I'm writing about.

For example, say you decide you need a language (one of my favourite aspects to tackle, you may have noticed already). 

How do you create it? You could go ahead and create a language in a vacuum, but the thing is, you will inevitably end up with a language that has a certain character in terms of sound. Then you have to think of the kind of thing these people talk about. You could go with basic phrases that you assume everyone will need to use, but if you have no context to ground you, you'll start floundering fairly quickly, because you simply don't know which words you need to create.

If you succeed and create a workable conlang, good for you, but you've already added a constraint to your story before you've written any of it. You've already decided a lot about how these people view the world, and now, your story will have to adhere to it.

Especially if you've decided to finish your worldbuilding before you start.

This applies to any aspect of a world that you decide to build. For example:

  • Their economy tells you a lot about other aspects of their culture as well, such as relations with neighbouring countries, diets, the level of atmospheric pollution, etc. 
  • Their religion tells you a lot about how they view morality. 
  • How their sewage system works tells you their general attitudes to cleanliness. 
  • Their ancient literature tells you the type of story telling they enjoy. 

You can try this yourself with any other aspect of worldbuilding. Go ahead and try it, it's a fun exercise. Everything – and by that I mean everything you create, every detail you specify, adds another constraint to the story that you want to tell.

It may reach a point where trying to fit a story into this world just becomes impossible.

I'm not saying this isn't possible. It's definitely possible to start writing with some worldbuilding to create an interesting setting. Some genres practically demand early worldbuilding. What I'm advising against is doing too much worldbuilding, or forcing yourself to do too much worldbuilding at the start. 

The possible solution?

My recommended solution: don't try to do it all at once, and you don't need to figure out everything.

Once you start writing, you can do a lot of worldbuilding on the fly. You don't have to know everything about the world you're writing about, because 

  1. Some of it doesn't affect the story in any way, 
  2. Your POV character knows only so much about the world they inhabit
  3. They will only ever know so much about it,
  4. Only so much of it will every affect the story in any way, even if you're using an omniscient POV,
    and most importantly,
  5. You're definitely going to have to edit that first draft.

For example, when I started writing my fantasy series, I knew I'd be using a conlang, I knew I wanted it set in a fantasy setting, and I had a basic idea of the general story themes and the sort of magic system I needed. Everything else  the cultures, the maps, all the calculations about the planet's orbit, the languages  all of that came  afterwards. 

I mean, if I had tried to do it all at once, I would have been bored and abandoned it halfway.

The best part is that the first book is basically finished, but I'm still worldbuilding. I'm adding more details on their religion, specifics of their diet, etc. I'm still expanding vocabulary in my conlang, stuff I didn't need to know the words for in the first book. Neither of these played an important role in the first book, so despite all the extra worldbuilding I've done between books 1 and 2, I haven't had to edit a thing related to worldbuilding.

You see, the biggest advantage in fantasy as a genre is just how much of the world is under your control, at least in my opinion. You control how strong the gravity is. You control the animals that exist in your universe. Perhaps more relevant to storytelling, you control social norms. You design the systems that your MC may have to fight. If you do your worldbuilding as you go, you can adjust your world to suit the story you want to tell. It's also possible to tweak both the story and the world until you end up with a story that you like. 

This process can also be iterative. It certainly was for me. I went three to four rewrites with placeholder names for my characters. While I don't recommend you doing the same (it was probably a stupid idea and I probably need to learn how to plan), iterative worldbuilding gives you the chance to figure out how the elements work together and work on the elements that you really need for your story.

Another advantage to this approach is you don't force yourself to do more worldbuilding than necessary, so you can save some time and effort that way. Or you can do the extra worldbuilding because you enjoy it. At least, the choice is yours.

Also, worldbuilding is a really good cure for writer's block for me. Might not work for everyone. Please follow your muse's advice.

In short, it all boils down to:

  • Start writing your story first. 
  • Start with a few elements of worldbuilding that you need, flesh out the rest between writing
  • Don't make it a chore. Worldbuilding is supposed to be fun.

Please let me know what you think in the comments. I would love to discuss this topic further.

You can also follow me on Facebook here.

Happy Writing, and see you next time!

Wednesday, 10 March 2021

The Playfair cipher

Ciphers are an indispensable tool for mystery, detective, and crime writers.

Most of the ciphers we've talked about here are monoalphabetic ciphers, ciphers where one letter maps to exactly one other letter (The one exception being the Vigenere cipher).

A major problem with monoalphabetic ciphers is that they are very easy to break, especially if you have a lot of text to work with. So, if you have a few short sentences (like in the adventure of the dancing men), it can be quite challenging to the detective, but if the message is a few paragraphs, your detective can probably break it in their sleep.

 With polyalphabetic ciphers, one letter maps to more than one other letter. What this does is it hides the distribution of letters in the text, making statistical analysis difficult (not impossible) and it hides common, short words that give the cipher away, such as ‘the’, ‘a’, ‘on’ ‘in’, ‘is’ and so on. This makes the cipher significantly harder to crack. Of course, a lot of these can be broken by a computer bruteforcing it given enough time, but again, a lot of people aren’t very clear on how to get a computer to bruteforce something.

The Playfair cipher

This is a cipher that has been used for military applications for real in world war 1 and world war II. Of course, with modern computers breaking it in a fraction of a second, it is no longer secure enough for that purpose.

What's interesting about this cipher is that it encrypts pairs of letters, or bigrams rather than single letters. This means, instead of trying to find statistical data for the usual 26 letters, you’d be looking for statistical data for 600 combinations of letters. This makes it impossible to break without a considerable amount of text to start with.

At the heart of the Playfair cipher is a five by five square grid. You’re going to need a key for this cipher to work, so let’s go with cipher because why not? The first thing to do is to fill the grid with the cipher. If there are any repeated letters in your keyword or phrase, skip them the second or third time they appear.

Once that is done, fill the table with the rest of the letters of the alphabet. There are only 25 places in the grid, so you can write only 25 letters. Some people drop Q, or some such uncommon letter, and let the person who deciphers the cipher figure out that the letter is missing (or you can communicate that to them which is probably the better option). I prefer to combine I and J, because that’s what was done with the Latin alphabet in the early days. 

Incidentally, that is why you have 600 pairs – the combinations possible are non-repeated letter pairs as you will see, so you will have 25 choices in your first choice and 24 the second time. This gives 25x24 combinations.


To see how the cipher works, let’s take the following phrase: hello world.

The first thing to do would be to break it into pairs of letters, and separate any double letters. You can use X for the purpose. You can also use it to form a bigram for any letters that are left over like D in this case. You can also use any letter that isn’t common in repeated pairs, like Q, instead of X.


Now, we cipher it bigram by bigram. The first bigram is HE. Both are on the first row. When we’re dealing with a single row, we replace each letter with the one to the right, wrapping left. That gives EC.

The next pair, LX, is on the same column. This is similar to the last one, as in, we replace each letter with the one below it, again, wrapping up if we have to. Here, that gives us SP.

The next pair is LO. Here, the two are one different rows and columns. In that case, we form a rectangle with the two letters, and each letter is replaced by the letter in the same row as it and in the same column as the other in the pair. This gives GS.

WO is another rectangle, so we follow the same procedure as the previous one: same row, opposite column. That gives VQ (try is out yourself, or look at the video to see how it's done).

RL is another rectangle, using the same process, we get BG.

DX is another rectangle, and again we using the same process to get BY.

So our ciphered message is EC SP GS VQ BG BY.


Once you've ciphered the message, someone has to decipher it in order to read it. To decipher it, we do the same in reverse.

Our first pair is EC.  They’re on the same row, so we replace each letter by the one to left, wrapping to the right if necessary. That gives HE.

The second pair, SP is on the same column, so replace each letter by the one above it, wrapping down if necessary. That gives LX.

The third, GS, is a rectangle, so it’s same column opposite row again. That gives LO.

The fourth, VQ is another rectangle, and with the same process, we get WO.

BG is another rectangle, and again we get RL.

BY is another rectangle, and deciphering gives DX.

The deciphered message is 'HE LX LO WO RL DX'. You can get rid of the X's, and rearrange the spacing, in order to get our original message, ‘HELLO WORLD’.

That is the basics of how the Playfair cipher works. Have fun with it (Maybe try different keys, longer keyphrases, and try enciphering paragraphs for practice). 

That’s it on the playfair cipher for now. If you have any questions of comments, well, mention it in the comments below.

You can follow me on Facebook here or on YouTube here.

See you next time!

Monday, 1 March 2021

Colombo needs more trees

I had to visit the Colombo city area some time back. That involved a bit of walking, and parking the car in some rather, well, sunny places. I think I should mention the car had a bit of an AC issue. By some miracle, I actually got home without too much of a heat headache, but it got me thinking.

Colombo seriously needs more trees. Or solar panels. Or more trees.

Please hear me out.

Colombo is situated in the wet zone. Its average annual rainfall is 2348 mm according to a quick google search. The daytime temperature seems to hover at 30-32 Celsius. It receives a ton of sunlight. That is basically plant heaven.

There are a few streets with a full canopy overhead, and in those places, well, it's actually quite pleasant. However, when you look at most of the streets, there is no significant tree cover. 

I mean, I can see people have tried and there are juvenile trees in places - I understand they take years to grow. Sure, it'll take time for those trees to provide any meaningful level of shade, but when they do, it'll be so worth it. 

But, in some places, you don't see that, either. There's the street and there are buildings, and the sun just grills the road surface which then blinds everyone around, roasts the pedestrians, and barbeques the vehicles from below.

My suggestion is, if it's possible to grow trees, do grow them. They look lovely and help cool the streets. I recognize the problems with this though - not every street has enough space between the tarmac and the buildings for a large tree. There is electrical wiring and they could get in the way of trees in some places. 

I'm not saying they have grown trees in every possible location - they haven't. 

Well, a possible solution is a canopy of vines. There are some vines you could use as a sort of shade tree that uses a bit less land area for roots and stuff. A bit of a problem with this is that it'll make a road a veritable tunnel. It would be better than a true tunnel of course - mottled sunlight would come in like with a tree cover - but some people may find it a bit claustrophobic. Another thing is maintenance - it could become more difficult than trimming off a few branches, and if the netting overhead is too dense, the dead plant matter (leaves and such) could pile up on top of the net, making it a true tunnel, and a stinky one at that. 

Still, I think this is a viable solution for some places.

If you think it will be a problem for streetlights, well, you could use those poles as part of the structure and put the vine canopy over them.

But I recognize that some people might not like this approach, but well, there is another solution. Solar panels.

Sure, they wouldn't be quite as shading, but there is a lot of solar energy falling on Sri Lanka in general that is underutilized. Sure, it's not available when it's dark, but we're in the tropics and pretty close to the equator at that, which means the length of the day doesn't vary by much. It's not like you have to account for twenty hours of darkness on some days. 

According to linked source, Colombo receives somewhere between 2.5 - 4.0 kWh/m^2 of solar energy per day depending on the season. When travelling in Colombo, it feels like a lot of that is used to heat the tar and mess up with car AC systems for some reason. It's a lot of energy. Solar panels over some areas of road can be used to capture some of that.

This is especially true for highways, especially in areas where the view isn't too great. There is a maximum possible height on highways anyway due to all the roads going over them, so installing solar panels over at least some sections can help. It won't be a tunnel if you install it in short sections about the width of a road crossing overhead. That'll be a lot of electricity we can use, and people won't be frying in their cars.

This is just my opinion on what I think should be done, as someone who is decidedly not good at dealing with sunlight or heat in large doses. In addition to reducing the severity those problems, you get electricity and/or a pleasant atmosphere as a bonus.

Do you agree with me, or do you see any issues with this approach? I'd love to have a discussion on this topic, so please comment below.

You can follow me on Facebook here or on YouTube here.

See you next time!

Wednesday, 17 February 2021

Simple substitution cipher - ciphering using a predefined key

 This one is different from the previous code I posted because here, as it uses a key file as the key instead of a hard-coded one.

The code:

#include <cstdlib>

#include <iostream>

#include <fstream>

#include <cstring>

using namespace std;

char line[250]={'\0'};                  //For input data

char line_c[250]={'\0'};                //For coded/decoded data

char line_key[250] = {};                //Key

//array storing the alphabet

char code[68]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',




 * Ciphers a character.


char get_ciphered(char character){

    char ch = '\0';

    for (int i=0; i<68;i++){

        if ((character==code[i])){

            ch = line_key[i];




    return ch;



 * Deciphers a character


char get_deciphered(char character){

    char ch = '\0';

    for (int i=0; i<68;i++){

        if ((character==line_key[i])){

            ch = code[i];




    return ch;



 * Ciphers a line of input


void encode_simple(){

    int temp=0;

    char temp_1 = '\0';

    for (int i = 0; i<250; i++){

        if (line[i]=='\0') break;


        if (temp!='\0'){









 * Deciphers a line of input


void decode_simple(){

    int temp=0;

    char temp_1 = '\0';

    for (int i = 0; i<250; i++){

        if (line[i]=='\0') break;


        if (temp!='\0'){











int main(int argc, char** argv) {

    //for input and output files

    ifstream input1;

    fstream output1;

    ofstream output2;


    //for key

    ifstream key;



    //set key array from file"key.txt",ios::in);


    for (int i = 0;i<68; i++){

        if (line_key[i]==0){

            cout<<"null character";

            line_key[i] = '+';




    //cipher input1 and put to output 1












    //decipher output1 and put to output 2











    return 0;


This code needs for files:
input1: your input plaintext
output1: your ciphered text
output2: the deciphered text from output1
key: a text file containing a single line. For example, for the test run, I used
Basically, the first character here will map to the first character on your code array, and so on.

Speaking of that, the array code[68] contains your alphabet. Here, I've used alphanumeric character plus a few symbols. You can change it as you like.
Try to match the length of the file 'key' to the size of your alphabet. If key_line is not filled completely, the program will warn you, but it will run anyway. All the missing characters will be replaced with '+' in the key. Deciphering will be chaos (say, the key ends at Z. Then everything after Z will be ciphered to +, and deciphered to Z).

The ciphering and deciphering parts of the program are separate, so you can change the program so that it uses one or the other.

For ciphering only, you can comment out everything from '' to 'output2.close' (the latter part of the main function).

For deciphering only, you can comment out the two lines at '', and then comment out everything from 'while(!input1.eof...' to 'output1.close'.
Make sure you put your ciphered text in output1.txt.

I am fully aware this is not the best code for the purpose out there, mostly because I whipped it up in ten minutes using bits and pieces from previous stuff I've done. (Don't tell me you don't do that, I know for a fact that you do).

I'd love to have your feedback on this. Also, if you have any questions, please ask in the comments below.

You can follow me on Facebook here or on YouTube here.

See you next time!

Wednesday, 3 February 2021

When should you kill a character?

I've already done a blog post on how not to kill a character. That was focused on one character death I wrote in particular. This one, however, is a more general guideline on when to and when not to send your characters to their grisly ends.

My preferred genres are mystery/thriller and fantasy, both genres that involve a lot of death. In both genres, the writer can remove any character at any time – or at least, find an excuse to do so. So, when should you go ahead with it?

The good reasons

These are the good reasons to write a character death, but that doesn't mean that the character death you write will actually be good. It just means that they are probably necessary to the story.

Reason 1: It is the logical end of that character’s arc. If your character has served his purpose, you can get rid of them. Related to that,

Reason 2: Leaving the character in the story longer would make things too easy for the rest of the cast. Of course you could deactivate a character in other ways (leaving the country, going into a coma, suddenly deciding to be a hermit, going to prison, the possibilities are endless), but death has a finality to it that very few other alternatives have.

Reason 3: To motivate other characters. This is a bit of a cliché at this point, but a character death can motivate others to act. It could be grief, it could be a need for revenge, and it could simply be the loss of attachment. Either way, it can be a great source of motives for other characters.

Reason 4: to further the plot. All you mystery writers know exactly what I’m talking about.

The bad reasons

This is the kind of thing that happens when you take your real world frustrations out on your characters. These are the character deaths that are not necessary to the plot. 

I'm not saying you can't make one of these good. It all depends on execution.

Reason 1: Just for shock value. 

Look, I’ve done this. I’m not saying I’m innocent, I’m saying I’ll not do it again and you shouldn’t either. Besides, if you need to kill a character to generate emotion, your story may be running on fumes in terms of character motivations. Also, if you keep doing this, your readers will grow numb and any serious character deaths that need to land won’t land with them.

Another possible problem with this is, characters have functions. If you get rid of one randomly, other characters will have to cover for them or you’ll have to introduce new characters. That means building their image in the reader's mind, which means more effort and a longer story.

Reason 2: Because you have too many characters and need to reduce the size of your cast herd. Again, I’ve done this as well. First of all, if your character doesn’t need to be there, you shouldn’t have put them in the story in the first place.

You can fix this in a few ways. One is to give your character some function before killing them off, but that, too, has become a bit of a cliché. The second is to economize the number of characters you have, so that none of them are extraneous.

A rule of thumb I like to use is, if you can’t remember the name of the character if you tried, you won’t mind their death at all.

In conclusion,

Think about it before you decide you're done with that character. It's better than rewriting half a book because you realized you're out of characters (I have done that).

Those are my thoughts on the topic, but do tell me what you think in the comments.

You can follow me on Facebook here or on YouTube here.

See you next time!

Tuesday, 26 January 2021

How to make breaking a simple substitution cipher harder


As you may be aware, simple substitution ciphers can be cracked quite easily, especially if your text is long. Still, there are ways to make things a little difficult for any potential code breakers trying to crack it.

Strategy one: Hide the spaces

Letter lengths can clue someone in on standalone letters like ‘a’ and ‘I’, or common doubles and triples such as ‘so’, ‘to’, ‘on’, ‘the’, etc. One way to obscure these is to hide your spaces. One option is to remove them completely, but it can lead to ambiguity, as you don't know where one word ends and the other begins. This is especially true with complicated words and place names.

You can also hide them in the ciphertext by replacing spaces with an uncommon letter, say, z in plaintext, likezthis.zIfzyouzarezwritingzinzEngllish,zthezletterszZzandzQzarezsuitablezforzthis.

Once you cipher it, you'll get a solid block of text. This will make short words less obvious visually. However, it can be cracked, because when you do the frequency count, guess what will be the most numerous? The character you replaced space with. For example, this paragraph has fifty eight spaces and thirty five examples of the character E.

In addition to that, when it comes to doubles and triplets, there is statistical data available on the most common pairs and triples in the English language. This data can also be used to break the cipher, again, provided your ciphertext is long enough.

Strategy two: Change your alphabet

What we’ve done so far uses just the 26 letters of the English alphabet. You can mix it up by separating upper and lowercase letters like so:

You can make it even more complicated with numbers and punctuation, or even the space character. Or you could include symbols and Greek letters. I won't judge you.

There are two reasons this approach works. One, the alphabet is larger, which means that the probability distribution has to be calculated over a larger number of characters. Often, these frequency tables are harder to obtain if not impossible. If you throw a few numbers and punctuation into the mix, it’s all but impossible.

The second is, a larger number of possible characters also means you need more text for the typical distribution of letters to show up.

At the end of the day, though, you’re still working with a simple substitution cipher. The most numerous character will be space, followed by lowercase e. Based on that, you can crack the rest. That's a weakness of simple substitution ciphers in general. You could complicate things by replacing characters, but there is a limit to what they can do to secure your cipher.

If you have any other strategies to make breaking the cipher harder, please tell me more in the comments. 

You can follow me on Facebook here or on YouTube here.

See you next time!

Wednesday, 20 January 2021

Is 'said' a good dialogue tag?


To make my stance on the issue clear – I prefer a mixture of no dialogue tags and ‘said’. I know not everyone agrees with me, and in fact, I know most of my English teachers do not agree with me, but hear me out.

I’ll start with an example. 

Example 1: Anything but said

It’s the same dialogue, written in four different ways. The first: Here, dialogue tags are used every time, but if ‘said’ can be avoided, it is avoided.

This may not be the best representation of that kind of writing, but that’s mostly because I actively dislike this type of writing. My problem with it is that it leaves nothing to the reader’s imagination. It treats the reader like an idiot. On top of that, it adds emphasis everywhere, dulling the effect for when you really need to hammer the point home.

Example 2: Always said

Here, too, the speaker is indicated every time, and ‘said’ is used except when it’s necessary to use a different dialogue tag.

As far as I am concerned, this is actually better than the previous one. True, it doesn’t demonstrate your superior vocabulary, but the dialogue tag is mostly invisible here. More importantly, the reader can fill in some of the nuance themselves and the text isn't screaming at them all the time.

There is still not perfect, or as perfect as a writing style can be. It’s necessary to indicate the speaker every time. Besides, even an invisible word can start to stand out if it’s overused.

Example 3: Said + no dialogue tags

The third: this avoids dialogue tags when possible, but uses said when you need a dialogue tag to indicate the speaker.

Full disclosure, this is my preferred method. The reader has quite a lot they can fill in, but the gaps in information aren’t so large that they can’t be bridged. I, for one, like to assume that my readers are paying some attention and are intelligent. 

When you need a dialogue tag, you can use something fairly innocuous, like said. When there’s a back and forth between two people and it’s clear that it is the case, you can avoid dialogue tags for, say, a few lines.

But please, for the sake of whatever you believe in, do not have a back and forth conversation of three pages with no reminder of who’s saying what.

About that,

Example 4: There are no dialogue tags

This avoids dialogue tags altogether, instead using action and the rhythm of the conversation to indicate who’s speaking.

This one works too, but it requires quite a bit of work on the reader’s part in order to make sense of what is going on. The reader needs to be paying attention all the time - face it, no writer is that good at pacing. Besides, it’s fine for a ~100 word conversation, but with longer texts, it's easy to lose track of who's saying what. That ambiguity can change the interpretation of a scene completely.

That was my two cents on the topic. Do let me know what you think of it in the comments. 

You can follow me on Facebook here or on YouTube here.

See you next time!

Worldbuilding – how much of it do you need, and when?

 I've talked about worldbuilding here before, but one thing we should discuss before any of that is the amount of worldbuilding needed f...