January 1, 2021

Books I read in 2020

Each year I write a list of books I read during the year. This is the 2020 list:
  1. Historical Study: German Tank Maintenance in World War II. Available for free!
  2. Physically Based Shader Development for Unity 2017: Develop Custom Lighting Systems
  3. Omaha beachhead. Omaha beach was one of the beaches where allied forces landed during D-day. It turns out much more happened than what was seen in the movies. Available for free! 
  4. U.S. Army Engineers, 1965-1970. Available for free!
  5. The Volunteer: The True Story of the Resistance Hero who Infiltrated Auschwitz
  6. Predator: The Secret Origins of the Drone Revolution
  7. The Art of Fluid Animation. Written by a guy who developed a real-time implementation of the Navier-Stokes equations called Stable Fluids, which is actually a simplified version of the Navier-Stokes but in the end he compares the results with real flow and they are similar.
  8. Disney's Land: Walt Disney and the Invention of the Amusement Park That Changed the World. Tells the story of how Disneyland was built in less than one year.
  9. Stuka Pilot. Written by a pilot who flew a Ju 87 "Stuka" dive bomber during World War 2.
  10. The Devil in the White City: Murder, Magic, and Madness at the Fair That Changed America. Tells the story of the 1893 Chicago World's Fair: how it was designed, built, and operated. It also tells the story of a mass murderer who killed visitors to the fair.
  11. The Ghost Map: The Story of London's Most Terrifying Epidemic - and How It Changed Science, Cities, and the Modern World. Tells the story of a cholera outbreak in 1850s London - you can find some parallels to the corona outbreak.
  12. Architects of Intelligence: The Truth About AI from the People Building It. Is a collection of interviews with people who are involved with the latest Artificial Intelligence algorithms, including Deep Learning.   
  13. Other Minds: The Octopus, the Sea, and the Deep Origins of Consciousness. Is a book about the octopus. 
  14. Outnumbered: From Facebook and Google to Fake News and Filter-bubbles – The Algorithms That Control Our Lives. This is not a math book - it's a book everyone can read who's interested in the algorithms used by Facebook, Google, Amazon, etc. 
  15. The Elephant Whisperer: My Life with the Herd in the African Wild. The author, Lawrence Anthony, adopts a herd of elephants to his so-called game reserve, which is a large area of land where wild animals live safely and tourists can come and watch them. The book is not just about the elephants, but also about the general life in a game reserve.
  16. Thunderstruck. Tells the history of both the wireless telegraph and a murder that took place in London. Is written by the same guy who wrote "The Devil in the White City" which was also about a technical achievement and a murderer.  
  17. Erebus: The Story of a Ship. Written by a member of Monty Python, this book tells the story of the ship Erebus which explored the south- and north pole during the 19th century. If you ever saw the television series The Terror (season 1), you have already seen the ship Erebus and her sister ship Terror.
  18. Vengeance: The True Story of an Israeli Counter-Terrorist Team. Tells the story of what the Israelis were up to after the Munich terrorist attack. If you saw the movie Munich by Steven Spielberg, it's based on this book.     
  19. Game Programming Patterns. Is a free book with common design patterns used in games. These are really useful as your game project grows. It was the second time I read this book and I still learned a lot so it's really useful. 
  20. Level Design In Pursuit of Better Levels. Available for free!
  21. Six Days of War: June 1967 and the Making of the Modern Middle East. Tells the story of a six days long war between Israel and its neighbors. Half of the book is about the history of the region before the war. 
  22. Calculus Made Easy. Gives you a brief repetition of calculus which may be useful if you forgotten one or two things since you where in school. Is available for free!
  23. Wizard: The Life and Times of Nikola Tesla: Biography of a Genius. A biography on Nikola Tesla. 
  24. Sid Meier's Memoir!: A Life in Computer Games. Is written by the creator of the famous Civilization computer game series. 
  25. Sapiens: A Brief History of Humankind. Tells the history of where humans came from. It also includes discussions on religion, technology, and the meaning of life. 
  26. Homo Deus: A Brief History of Tomorrow. Is the follow-up book to "Sapiens." The author argues that we have solved humanity's major problems, such as hunger, war, and medicine. In the future humans will instead create technologies so we can live longer, be more happier, and have more power. But if that happens will we still be members of Homo Sapiens, or will we be categorized as a new species: Homo Deus? 
  27. Red Phoenix. Tells the story of a fictitious war between North- and South Korea. 
  28. Brief Answers to the Big Questions. Stephen Hawking is trying to answer questions like: "Is there a God?," "Is there other intelligent life in the universe?," "Will artificial intelligence outsmart us?"  
  29. Hue 1968: A Turning Point of the American War in Vietnam. The battle of the city Hue can be seen as Vietnam's Stalingrad. Is written by the guy who wrote Black Hawk Down.   

In Swedish:
  1. Berg-och-dalbanan: jakten på den heliga G-kraften. A book about roller coasters from a Swedish perspective.   

April 22, 2020

Why you should use GitHub

GitHub is one of many services where you can upload your code for version control. The basic idea behind version control is that code projects tend to become big and messy and version control makes the project less messy - especially if many people are working with the same project.
I think it was last year I really started to use GitHub for my code projects. I had several years earlier tried to start using GitHub but I stopped because I think I felt GitHub was confusing to use and I didn't really need it. But last year I found Sourcetree which is making GitHub less confusing to use (you don't have to memorize git commands). I also learned that GitHub has started to allow free private repositories - when I first started using GitHub all code had to be available free to everyone which is obviously not good if you are working on secret projects. So now I've put almost all my code on GitHub.

If you are working with a team then you almost always need to use GitHub or some similar service. But why should you, as an individual user, use GitHub?
  1. Backup. It's never fun when your computer crashes and your projects disappear into the darkness. To backup your projects you can copy-and-paste them into some backup software like Google Drive och Dropbox. This is working fine but can be a little annoying if you make many updates. With GitHub you can backup your projects with just a few clicks. You should still use another backup method because you can't trust GitHub - there's always a small probability that they will mess up and your code is gone forever, so it's always better to be safe than sorry. 
  2. Easier to experiment. Let's say you want to experiment with an idea you have and this idea involves deleting some code. Now deleting code for experimental purposes is never good because the experiment might fail and then you have to recreate the deleted code. With GitHub you can start different branches, which will split your code into branches and you can easily change between each branch to compare the experiment with the original code. If you are not happy with the experiment, just delete the branch.    
  3. You don't need to be tech support. What I've done lately is to publish some of my Unity tutorials on GitHub. I earlier had this pedagogical idea that people will learn more if they read the tutorial instead of copy-and-pasting from GitHub. But people will sometimes fail, so they will e-mail you and you have to spend time trying to solve their problems. It's also much easier to update code through GitHub than to update the code you earlier copy-and-pasted into html. So publishing your tutorial code on GitHub will save you time and energy.
  4. Free marketing. Something I realized after putting my code on GitHub is that people also found my code through GitHub's search function - they didn't come just from the original site. GitHub has a small, but still adequate, analytics page where you see from where people found your code. So if you want people to find you code you should put it on GitHub because it might be difficult to make people find your code by just making your original site rank higher in the search engines. And if you link your Twitter account from GitHub you will also get a few extra Twitter followers! 
  5. People will test the code for you. GitHub has this function where people can easily report issues with your code, which is really good because it might be difficult to test the code on your own.  

So how can you start learning GitHub with Unity if you have no idea where to begin? I think this tutorial is a good start: Using Git with Unity Tutorial [2019]. It will teach you how to use GitHub with Sourcetree. Atlassian, the creators of Sourcetree, has also created this online course: Version Control with Git, which you can go through in a few hours and it will teach you a little more than just the basics.

If you are interested in visiting my GitHub account you can find it here: github.com/Habrador

January 1, 2020

Books I read in 2019

Each year I write a list of books I read during the year. This is the 2019 list:
  1. Predator: The Secret Origins of the Drone Revolution. Tells the history of the most famous military drone: The Predator.
  2. Fighter Wing: A Guided Tour of an Air Force Combat Wing. A combat wing is a collection of different military aircraft organized to complete a specific mission. This book tells you about the different aircraft, the weapons, and the organization.
  3. Bomb Hunters: Life and Death Stories with Britain's Elite Bomb Disposal Unit in Afghanistan.  
  4. A Dawn Like Thunder: The True Story of Torpedo Squadron Eight. Tells the story of a carrier based squadron of torpedo bombers during the battle of Midway and Guadalcanal. 
  5. Designing Games: A Guide to Engineering Experiences. There are many books on how to make games, but this book is written by the game developer who made RimWorld. That game sold more than one million copies, so you better study the book. He wrote it before he made RimWorld. 
  6. Dust Off - Army Aeromedical Evacuation in Vietnam. Tells the story of medical helicopters in the Vietnam War. Is available for free!
  7. The Grid: Electrical Infrastructure for a New Era. One often forgotten achievement of humanity is that we have electricity in our homes. But this system is crumbling because the system is old and will also change to be more environmentally friendly, so if you want to learn about the feature of how to deliver electricity, you should read this book. 
  8. Logistic Support. Much has been said about the battles of the Vietnam War - but not what happened behind the scenes. To fight a battle you need ammunition, food, etc. How can you transport it from US to Vietnam in the best way? This book will give you an overview of the logistics behind the Vietnam War. Is available for free!
  9. Wind, Sand and Stars. Is a memoir written by a french pilot who in the 1930s was flying mail across the french empire. 
  10. Topgun: An American Story. Is written by one of the founders of Topgun (and yes it is "Topgun" and not "Top gun" as in the movie). Despite the name, the book is not only about Topgun - it's a biography of the authors career in the US Navy.  It starts with the Vietnam war, some Topgun in the middle, and ends when he commands an aircraft carrier. His basic idea is that the pilot is more important than the aircraft, so it includes some criticism of the latest aircraft in the US Navy: the F-35, arguing that a cheaper aircraft with a more skilled pilot would have been a better solution.
  11. Why Did the Chicken Cross the World? Tells the history of the chicken. 
  12. Last Stand at Khe Sanh: The U.S. Marines' Finest Hour in Vietnam. Khe Sanh was a military airfield in Vietnam and this book tells the story of when it was under siege for more than two months.  
  13. The Colosseum. Tells the history of the famous Roman amphitheater. The most interesting part is how little we know of what actually happened in the Colosseum. Not many sources exists, so movies have taken a lot of creative freedom. 
  14. Babylon's Ark: The Incredible Wartime Rescue of the Baghdad Zoo. Tells the story of what happened to the Zoo in central Baghdad after the 2003 Iraq war. 
  15. When Thunder Rolled: An F-105 Pilot over North Vietnam
  16. Worm: The First Digital World War. Tells the story of the Conficker computer worm which was a virus people thought would cause the end of Internet.
  17. We Bought a Zoo: The Amazing True Story of a Young Family, a Broken Down Zoo, and the 200 Wild Animals That Change Their Lives Forever. With the longest sub-title ever there's no need for further descriptions.
  18. Circle the wagons - The history of US Army convoy security. Is available for free. 
  19. Nine Lives: My time as the MI6's top spy inside al-Qaeda
  20. Humble Pi: A Comedy of Maths Errors. Consists of several examples of where minor mathematical errors have resulted in big consequences. For example, ground crew confused the units of measurement when they put fuel in an aircraft, so the aircraft ran out of fuel and almost crashed (the fuel gauges were also broken). 
  21. Surely You're Joking, Mr. Feynman!: Adventures of a Curious Character. A book about the Nobel Prize winner Richard Feynman (spoiler: he didn't want the prize). 
  22. Permanent Record. Biography on Edward Snowden.
  23. Unity 2017 Game Optimization - Second Edition: Optimize all aspects of Unity performance

Books in Swedish
  1. Det bevingade verket. Tells the history of the Swedish Air Force. 
  2. Med invasionen i sikte. Tells the history of the Swedish Air Force 1958-1966, and how a war with the Soviet Union would have happened. 
  3. ÖB:s klubba - Flygvapnets attackeskader under kalla kriget. Tells the story of the ground attack part of the Swedish Air Force during the Cold War. 
  4. System 37 Viggen. Consists of shorter stories written by people who were involved with the Viggen project, which was a Swedish military aircraft. 
  5. Svenska hackare. Gives you an overview of who has been hacking what with a focus on Sweden.
  6. Poltava. Tells the story of a famous battle between Sweden and Russia in the 18th century. 
  7. På spaning efter det okända - Bilder från kalla krigets ubåtsjakt. Each chapter is written by someone who was involved in the 80's anti-submarine hunts in Sweden. 
  8. Ubåtsfrågan 1981-1994. The Swedish government set up a total of three groups with the task of analyzing the assumed underwater violations of Swedish waters that have been going on mainly in the 80's. This is the second group's report. 

October 21, 2019

Adventures making stylized vehicles

After making three stylized characters in Blender I needed to do something else. So why not learn hard-surface modelling and texture painting while making some stylized vehicles? The first vehicle is a US coast guard helicopter model MH-60:

The reason I decided to make this exact helicopter was that I had an old non-stylized model of it collecting dust in a folder, so I might as well use it and improve it. What I also wanted to learn was to add decals to a model. Decals are those logotypes and text and there are several ways to add them. When making games I think the best way is to paint them on top of the base texture by using Blender's stencil function. What you do is you have the texture with a transparent background and then you just paint it where it should be and Blender is figuring out how to add it on top of the base texture. The problem I discovered is that the texture resolution has to be high or the logo and text will become pixelated meaning that you can see the pixels and can't read the text. The helicopter's texture is 2048x2048, but because I realized this was a problem after painting the base texture, and I didn't want to redo it all, I had to cheat by using a 4096x4096 texture on top of the base texture or the logotypes would be visible. This is something I wanted to improve when making the next model.

I also decided to experiment with low-polygon characters with lower polygons than I had previously used. The stylized characters I experimented with before are still low-polygon but they take several days to make because you have to make a high-polygon version and then a low-polygon version, which is a process I talked about in a previous article: How to make a stylized game character in Blender. A single of these lower-low-polygon characters takes less than a day and I think the result is still good if you are not looking at them very close:

Next vehicle I made was a Visby corvette belonging to the Swedish navy:

As said before I wanted to fit everything into a 2048x2048 texture and the easiest way to do that is to have as few UV islands as possible. This is the texture and you can see I managed to paint the logotypes and text on top of the base colors. The result is still kinda pixelated if you look really close, so I might have to experiment more to get a better result:

I wanted to put the Visby corvette in a scene, so I also made the underwater robot rov called "Double Eagle." It belongs to the Visby corvette and they lift it out with a crane to look for underwater objects such as mines:

The final scene is a half below water and half above water. To make the light shining through the water volume I had to experiment with volumetrics, which is really slow to experiment with. The reason is that volumetrics is really slow to render so if you make a small change you have to wait really long before you can see the result of that change. But after a few hours I think the result is good:

If you want to see more images, I've uploaded them to my Artstation account:

September 3, 2019

Book review: Babylon's Ark

I clearly remember the 2003 Iraq War. The reason is that I did my military service at the same time as when US invaded Iraq and there was chatter that the Swedish army would extend the length of our military service because of a higher security risk. Now Sweden is far away from Iraq, so perhaps someone thought that Russia would use the opportunity when many US forces were in Iraq to cause trouble in Europe. Luckily, that didn't happen and the invasion of Iraq ended after a few weeks. But people would for many years still be dying in Iraq because not everyone thought the war had ended.

Fast forward a few years to when I was listening to a radio show where Malik Bendjelloul, a Swedish documentary maker, talked about his life. You can read a translation of it in English here. In it, he talked about how he wanted to make a documentary about Lawrence Anthony, a South African who was working with elephants.
"Lawrence had for the past few years tried to help a group of ferocious elephants, elephants that had destroyed surrounding villages and would now be put to death if no one embraced them. So for the past few years, he had for months hanged out with these elephants. And it led to that his entire way of looking at life on our planet had changed. The more time he spent with the elephants, the more he experienced his own inferiority. The human brain may be developed, but all of our other senses are embarrassingly undeveloped: our hearing, our sight, our touch. Researchers have still not understood how, but everything indicates that elephant senses function in a way that sounds like science fiction. For example, one has begun to understand that elephants can communicate with each other over incomprehensible large distances. Maybe over entire continents. Lawrence argued that he occasionally felt this communication. It had felt like the elephants had tried to communicate with him. He didn't want to talk much about it - in part because it was difficult to put it into words, in part because he understood it sounded a bit too much new age fuzzy. I returned to Sweden and thought it existed material for a good story."
But Malik Bendjelloul was also talking about one of Lawrence Anthony's other adventure: when he, just a few days after the 2003 invasion of Iraq had ended, traveled to the capital of Iraq, Baghdad, to help the animals at the zoo. I was really happy when I realized that he had written a book about it before he passed away in 2012. It's called Babylon's Ark: The Incredible Wartime Rescue of the Baghdad Zoo, and it's the best book I've read so far this year. There are some clips available on YouTube, but you should also read the book.

Not only did he rescue many of the animals at the Baghdad Zoo, but also other animals across Baghdad. Lawrence Anthony realized that another zoo existed in Baghdad, and it was called Luna Park. It was in terrible shape, so he decided to move the animals to the main Baghdad Zoo:

Saddam Hussein, the former leader of Iraq, collected horses, and they also needed to be rescued. During the war, the horses disappeared because they were very valuable, but Lawrence Anthony and his team managed to find them and bring some of them to the zoo:

So if you want to read a feel-good book that I rated 5/5 stars on Goodreads you should read Babylon's Ark.