Info

This post was originally intended for a Patreon audience.

Rumor 3.0.0

Rumor 3.0.0 was released at the beginning of October, but I’ve been busy enough lately that I haven’t really had time to write about it. So, I wanted to take some time before the month was over to talk about what changed and the direction I’m thinking about taking the library in.

Before all of this happened, I had drinks at a cafe with a friend who I’ve been wanting to make a game with for a while now (he makes really cool music). We talked about a variety of things like how he thought the new Spider-man game was really great, mental issues like depression, and maintaining relationships. A few ideas for a game were spun up that I got really excited about and I decided to work on a prototype for one of the ideas. So, I went home and started on the first scene for this game and found out that the scripting language wasn’t doing what I was thinking it would.

Basically, the problem was that I had a variable that “determined” what gender the player was. Whenever I would try to do something based on the value of this variable, it would always happen even if it wasn’t supposed to.

That’s strange, I thought, why is it doing that?

As it turns out, whenever the equality of a string to another string was checked, it would always return true!

Oh no! I thought again, That’s terrible! Why didn’t a unit test catch that?

And, as it turned out, I hadn’t written any unit tests for any of the operators in the code to make sure everything worked properly. I remember thinking, once upon a time, that I really ought to write unit tests for all of the operators in the code, but apparently I forgot to do them!

So, I set off to write unit tests for every single permutation of a type, an operator, and another type. This ended up taking basically forever and it added about 3,000 lines of new code.

Along the way, I found a lot of mistakes that I also needed to fix.

Weird issues started to crop up. Like, should the boolean false multiplied by a number be zero? Originally, I decided to make the scripting language be loosely typed, but after writing unit tests this sensibility makes less and less sense. I am considering making a major overhaul to how the types work in Rumor to be more strict.

Additionally, the use of floats and integers as separate types is making less sense as well. Usually, I would think a writer wouldn’t really want to think about the differences between these two types. A number is a number, after all! However, it seems like C# as a language doesn’t have very good fixed point types which I think is the best compromise between floats and integers. Actually having a single number type in rumor might be more difficult to implement.

So, while I did bump the major version of Rumor, I may do so again very soon. If you have any questions about these two proposed changes, I would be glad to hear them out!

Also, as a side note, someone opened a PR to add bugfixes and a few nice things! This is the first time it’s happened and it’s really exciting for me because it feels like someone out there actually wanted to use my library! So exciting!