June 13, 2017

Resources if you want to learn more about architecture

I've set out to learn more about architecture for a project I'm working on. This will be a collection of the resources I thought were the best. I've learned there is not one "bible" you can read to learn everything about architecture, so you have to use several resources.

The timeless way of building. This book is written by the architect Christopher Alexander, and is the first book in a series of three books that summarizes his ideas on architecture. You might ask yourself why some buildings are "better" than other buildings? Why do you prefer to live in a house but hate to live in another house? Christopher Alexander argues that the reason one building is better than the other is that the building you like was designed by using certain patterns. The main idea is that building a building is an iterative process, and those who will live in the building should be involved in the process. If everyone is aware of this "pattern language" then it will be easier for everyone to participate in the building process, and the result will be a building which feels alive.

Ted talks. Ted is an organization which posts talks, and these talks are supposed to be something extraordinary. It has a search function where you can find several talks on architecture. All of them are not extraordinary, but some are, including one guy who had an idea to stop the spreading of the Sahara desert by using clay buildings.

The Pruitt Igoe Myth. Pruitt Igoe was a housing project in St. Louis. The main idea was to give poor people an opportunity to live in better buildings. But the project failed because the houses were not maintained, so they began to fall apart, which resulted in that the people living in them stopped caring, so they fell apart even more. So the key point from the documentary is that a house on its own is not important, but what's happening with the house when the people have moved in.

June 8, 2017

Youtubers playing Tesla Simulator

So I uploaded my Tesla Simulator to itch.io, and then something strange happened: people began uploading videos to YouTube of themselves playing it. No-one has ever uploaded any videos of themselves playing my games, and it's kinda strange to see someone playing your game online. No big youtubers are playing it, but smaller youtubers are, which is better than if no-one is playing it! Anyway, this is a small collection of them:

People are also wondering if I'm going to update it. And the answer is yes. But I have to figure out with what. Someone suggested you should be able to run over people, but that's not going to happen, and someone else suggested a big city, but that will take a looong time to build, so we will see...

June 5, 2017

The ups and downs of itch

A few weeks ago I found a site called itch.io where you can upload games, books, and assets. You can either give away the content for free or you can sell it. It's also possible to use the combination by asking people to pay what they want for what you've uploaded. I uploaded my (free) Tesla Simulator as an experiment, and this is the result (May 18th - June 4th):
  • 1956 views and 1240 downloads
  • 307 visitors came from my website, while 99 percent of the rest came from itch
  • 839 downloaded the PC version, 335 the Mac version, and 66 the Linux version. This was really interesting to know because I've previously ignored the Mac and Linux users, but they are also interested in your products!
  • A few people have made YouTube videos showing when they play the game. No-one made a YouTube video of the game before I uploaded it to itch
But what if you also want to make money? As usual it depends on the game you have, but someone on Twitter shared their revenue and it looked like this:

Itch is less crowded than the other channels where you can sell your game, but that's also good because it's easier for people to discover your game. It's also easier to upload your game to itch if it's not finished so you can maybe use itch to get feedback while developing the game and then release it on Steam?

Lessons learned from the development of Minecraft

A few days ago I wanted to learn how the team behind Minecraft marketed the game. I made a Google-search and found an article which referenced the blog written by Notch, who came up with the original idea behind the game. I realized it might be interesting to read the entire blog and see if I could learn anything from it. But I wanted to read it from the beginning and Tumblr didn't have that option, so I downloaded the xml file with all blog posts and converted it to pdf with the help of some PHP magic. The result is a 508 pages pdf, which you can find here: The Word of Notch.

It turned out it was really interesting to read the blog from the beginning of the end. Here are some lessons learned:
  • The "blocky" main character was from another game Notch had protoyped, but he thought the blocky design would fit into his new game. That design hasn't changed since much 2009. 
  • The name of the game changed from Minecraft: Order of the Stone. Why Minecraft? Because Notch thought it was a good name.
  • Notch published a lot of blog posts during the development of the game, sometimes two a day or more. Once he published nine smaller posts in one day. Not all post were related to Minecraft - some were movie reviews and other were game reviews. He also posted random ramblings about various topics like the singularity. Sometimes it took 5 days between each post.
  • Notch has always been a fan of the game Team Fortress, so he had a plan to add a similar "Fortress mode" to Minecraft as well as something he called "Zombie Siege." 
  • Notch was programming what he thought was fun to program. Once he had planned to implement multiplayer but got bored and decided to play around with water. This happened more than once. He added blocks like gold and trees instead of any multiplayer code. "I’m getting stressed out over the multiplayer release. It’s not going as well as I’d hope, and as a result, I’ve lost motivation, causing me to work really slow. This is a bit of a vicious circle, and I think I need to relax for a bit."
  • Some posts included stuff like videos and images made by people who were playing the game.
  • He was often struggling with performance problems, that Minecraft wasn't running fast enough. So if you are struggling with that yourself, then don't feel bad!
  • In 2009 Notch explained he had "another job" and didn't have enough time to update Minecraft. He asked for donations: "Also, donate!" 
  • He was asking for feedback. "Please remember to give me some feedback!" And when he got feedback, he showed that he appreciated it. "For those of you who have sent me feedback (ever), thank you very much. You’re the best players a game developer could hope for. You’re honest with your opinions and still understand that I may feel different from you. I listen to all your feedback. Thank you for helping me develop this game."
  • He outsourced the sound and music to a guy called C418.
  • In 2009, he wanted to sell the alpha version of Minecraft for 9.95 Euro, 14.95 for the Beta, and 19.95 for the final version. He also wanted a free demo, which I remember Minecraft had an online version of where you could just place and remove blocks. If you purchased an early version, you would get "to help fund the development of Minecraft," "custom skins," "all future updates". He would later add that those who bought the game got early access to new updates, such as survival mode.  
  • He used a forum while developing the game, and he got comments on the blog. "I think the minecraftforums.net forums are most excellent, and a LOT of good suggestions come out of that place." The forum was run by the community and Notch didn't have anything to do with it. Emails worked fine in the beginning and he replied to all of them. But as the game became more popular he got 50 emails a day and decided to reply to just some of them, but he read all of them.  
  • Most blog posts were short, just a few lines (so much for the SEO talk of long well-written blog posts). Some consisted of just images of someone playing the game or a YouTube video, or a YouTube videos where Notch showed an update to the game.
  • 587 people had purchased the game in June 2009, which is about 2 months since he began blogging, in a later post he said it had sold 990 copies between July 19 and June 13.
  • He was feeling the pressure if being behind schedule (because of an illness, most likely flu) and was "freaking out about making survival mode as fun as I can."
  • He wasn't using a design document, but he had two text files: 
    • bugs.txt - bugs that he couldn't fix immediately but want to fix
    • features.txt - a list of ideas he liked but is afraid to forget if he didn't write them down
  • When coding, his goal was to make what he wanted to make as fast as possible with whatever "ugly" code, and then he improved the code. It "helps motivation to actually see things happening in the game."
  • He spent a lot of the time playing the game. "It's very important to me that the game is actually fun and the only way to make sure they are is to play with it." And if the game is fun, it's also fun to play the game. 
  • When he finished a feature, he tried to release it to the public as soon as possible. Before releasing, he was checking the bugs.txt if there's a bug he should fix. 
  • Version numbering can be tricky to figure out, be he said he would just "bump the version number" when releasing a new version. 
  • He didn't keep a schedule when he wanted to have stuff completed, but "rather keep striving towards my mental image of what I want the game to be like." 
  • If he didn't know what to build next to the game, he played the game as if it was completed, and then "add the first thing that doesn't work yet."
  • "My main method for delivering updates about Minecraft and so will still be this blog" was a quote after he got a twitter account. He was also using irc to chat with people who was playing the game. Irc was one of the software he started at the beginning of the work day and kept it on all day.   
  • "Mostly my free time is fairly normal. I try not to get burned out while doing this." so except for some 12 hour coding marathons, he didn't work himself to death. He was trying not to work on weekends "as much as possible." He also took a three week holiday in Indonesia in the first year of development (no Internet available). While in Indonesia, his service provider almost deleted his database (including information about everyone who bought the game) because his account ran out of money. But he managed to find a wifi on McDonalds and could fix the issue. 
  • When making the game he had a narrow scope, and had plans to add modding support and extra expansions to increase the life span of the game. When the finals version was finished, his plan was to actually make two mobile games (unrelated to Minecraft) and then make another unrelated game, and the continue developing Minecraft, "or whatever else is most requested by the community."
  • At specific points, the game was free. "The reason it's free is to get as much feedback as possible on it, so I can fix bugs and tweak gameplay as good as possible. Once the game is done, it will not be free, except in the form of a limited demo." This upset people who paid for the game, but Notch promised they would get early access to other content (1-3 weeks before other players) and of course the final game. "That's what you've really paid for"
  • A few months into the game development, Notch realized he wanted to hire an artist who could work on the textures and on the models. He also wanted to pay this artist even though he could have found someone who wanted to do it for free. This was the reason: "Some people asked me why I said I wanted to pay, and it’s primarily because I want to make sure it’s a proper business deal so there’s no drama later on. I’ve had that happen before with donated content. But also, I want people to dare charge for their work. I want to be able to do indie games for a living, and I definitely want to help support others to do the same. If someone absolutely don’t want to get paid and make awesome graphics, I can live with getting it for free. ;) And, yes, you will of course get full credits for your art. I’d own it, but I wouldn’t claim to have made it myself." But the first artist he hired would leave after a few months. "However, I went from doing Minecraft on my own to suddenly having to wait for someone else before I could move on. We had repeated problems getting anything animated to load into the game, and eventually I decided to just go ahead on my own."
  • He was experimenting with ads, both on the blog and on the Minecraft homepage but only for those who played the game for free. "In the past, I’ve been dead set on not having any ads at all, but surely there must be a reason everyone else has ads? Thus this experiment." But he realized he would remove the ads because the ads were advertising other game: "But I’m encouraging users to pay for other games, when I would rather have them pay for my game, which is the reason they come there in the first place."
  • He was live-streaming his competition in Ludum Dare live on Twitch. He was scared to develop Minecraft live, because someone could take the source code, but he was doing public play-testing of the game.
  • Minecraft had during the first Christmas a "free copy to a friend deal." During the three weeks this campaign progressed, 1436 copies were given away. Also 361 copies of the game were sold. He also got 2 donations, a total of 67.58 Euro. So it might be a good idea to be transparent with how many copies are sold of the game, because people have this psychological principle saying that they buy what's popular. When Notch married, everyone who bought the game also got a gift code of the game they could give away to someone.
  • He was experimenting with a public TODO list, so people know what's planned and what's going to happen. If he wasn't sure what to do next, he asked the community by using polls. "I put up a poll on what to do next, and posted it on irc and on twitter. Farming got 39% of the votes, so that’s what I’m doing now!" He was also asking how long the day/night cycle should be by using a poll. He was using polldaddy.com. He began using scrum when he hired more people. 
  • People could register for free and registered user #100000 got a free copy of the game and a personal email. Notice that some of those #100000 users were computer bots who registered accounts and thus not real humans. Maybe it helped to sell the game because everyone didn't know that even though he wrote about it in the blog?
  • "I like it when several small but relatively simple individual components [like fire and water] kinda gang up on you and make the game a really complex environment. There’s no need in making each component super complex."
  • It took about a year before Notch realized that Minecraft should have an endless map.
  • He was playing other computer games while developing the game. 
  • He started to sell the game a month after the first engine test.
  • He had server issues and at one point he had to give away the game for free because the server died.
  • "Basically, any developer working on the game [Minecraft] (two people at the moment) can just come up with something they’d want to add on a daytoday basis, as long as the rest of the team thinks it’s a decent idea. If it ends up being fun, it gets added."
  • January 12, 2011: one million sales. April 25, 2011: two million sales.
  • "We stepped on the plane to New York, and the Minecraft server died. While flying from New York to San Francisco, Tobias managed to get the servers back online via the amazing wonder of inflight WIFI."
  • "One reason why Minecraft has managed to get as much personality as it does it that it’s only been a couple of fairly nerdy game developers working on it."
  • They didn't analyze how players played the game: "Right now, the only way we can figure out roughly what people are doing with the game is to track logins. Once you’re logged in, we have no idea what happens."

April 28, 2017

Short April Updates - from forest fires to foam skirts


Forest Fire

Many years ago I took a class in Differential Equations. One of the assignments was to simulate the evolution of a forest fire and the result was displayed on a graph. The problem was that you only got the end result and couldn't see how the fire evolved to get to the final result. A few years later I learned Unity, and decided to see if I could simulate a forest fire while at the same time see how it evolved. And it turned out I could.
The forest fire worked, but the visuals didn't. The first problem I had was smoke. A forest fire is large and you need a lot of smoke to cover the entire area - and that is not good from a performance perspective, and the resulting simulation was running in like 3 fps (30 fps is the goal). Luckily, both Unity and I have improved our skills.
The first thing I improved was to replace the fire particles with a glowing-ground-shader. Most of the time, you can't see the fire because of all the smoke, so by having just flat fire instead of fire particles makes no difference. I also decided to use animated smoke particles from Unity's free library of particles: Free VFX Image Sequences & Flipbooks. By using animated particles, the smoke will look more thick and you can use less particles to achieve the same result.
The second problem I had when I created the original forest fire was similar to the smoke problem: a lot of trees will decrease the performance of the simulation. To solve that problem when I created the original version was to combine all trees into a single mesh. This is also a complicated solution because it will make it much more difficult to remove the trees as they burn down. Luckily I could now replace all that code with a single shader called GPU instancing, which is something Unity recently added. If you add one of those materials to objects with the same mesh, Unity will automatically combine them, and the performance will improve. Anyway, this was the result:


As said in the forest fire update I added an animated glow shader to simulate the fire. The reason was that I've also improved my shader skills. The first shader skill I learned was Interior Mapping, which is a technique used to simulate floors in buildings. The second technique was Parallax Mapping, which is a technique not that different from interior mapping, but you can simulate more "organic" deformations, such as this:

Tesla Simulator

I few years ago I made a Tesla Simulator to market a book I wrote about a guy called Elon Musk. It was available to the public through Unity's webplayer, which you could run directly in a browser like Chrome or Firefox. The problem now is that most browsers have stopped supporting the webplayer, so I had to make an offline version. At the same time I've cleaned up a lot of silly coding mistakes I made, because the Tesla Simulator was the first project I made in Unity - and I've apparently learned a lot since then.

"Make a boat" tutorial

One of my most popular Unity tutorial I've made is Make a realistic boat in Unity. What the tutorial didn't have was how to add foam to the boat, and I've thought a lot about what the best way is to add foam to a boat. Then I found this tweet:

...which was a cool idea on how to add foam, so I decided to implement it: Add foam. To make that work, I had to learn a technique called Convex Hull, which I wrote a separate tutorial on how to implement: Find the convex hull of random points.