Microsoft has decided to migrate their instant messaging service Windows Live Messenger into the Skype platform. This was something I assumed where going to happen when they bought Skype a few years ago. However, I would thought it would be the other way around. More and more people are also moving from MSN to Skype, and most people ask me "Wtf, are you still using MSN?" as I have contact with many people over MSN. There are also some (really) good reasons why I prefer MSN instead of Skype when it comes to IM.
- Email notifications
I have been using Hotmail ever since I got MSN. I have not seen any good reason to move over to Gmail, as Hotmail has been working in a perfectly good way for me. However, due to the Skype migration, I have been forced to have my email client open all the time in order to receive notifications when I receive an email. On MSN, a small message box would appear saying who you received an email from.
- Better integration with the taskbar
Skype and MSN both behave differently on the taskbar. On MSN, there is one icon indicating whether your status is set to away, busy, or if you are offline. Each you have open is displayed as one individual window, and when someone messages you, the icon starts blinking. On Skype, only a number of messages unread (on this device) appears.
- Far simpler/less bloated UI
The UI on MSN is way simpler and cleaner than on Skype. Contacts uses less space in the contact list, and I really prefer tabbed conversations than how Skype groups your conversations. Even though this has gotten better after the last Skype updates, there is still a long way to go.
- Customization of UI and emoticons
Customization is an important factor. It is a way of expressing themselves either through a different font, emoticon or background image on the conversation window. Even though many people hate custom emoticons, there are people who actually use it. (And there is a way to turn them off) I use internet memes as custom emoticons in conversations, which makes the conversation a bit more personal - to me. Some people also prefer adjusting the text size, mainly because they don't see that well.
- Image sharing
The most annoying thing with Skype is that every single image someone sends me is sent as a file. Sure, it would be nice if I wanted to SAVE the images for later use, but who cares when it is only a screen shot. After a while, my download folder is full of images which I received and I only needed to see one time only. I agree there is room for improvement on the current image sharing on MSN as it is slow and images loses quality, however this is something I would like to see implemented in Skype as well. Even though there are already ways to share screenshots (Gyazo, Imgur, ...), it would have been cool to see if Microsoft could try and implement something new into Skype. On all platforms.
- No syncronization of logs between other devices
When I am taking the bus home, I often talk to people over IM on Skype. The experience is good enough (except that the IM window can start lagging from time to time), but here comes the most annoying feature with Skype. When I get on my laptop again, every single message I have received (and read) on my phone gets sent to my PC. If I was lucky and closed the Skype app on my phone, I wouldn't start receive all the thousands of messages I have sent on my laptop, but on top of all this, all the messages gets marked as unread on the device I have not seen that message before. This is one of the reasons why I do not like Skype as an IM service. The idea of transfering chat history between devices is a good idea, but it doesn't work when all the messages I have read gets marked as unread. Imagine if all the emails you read at work wasn't marked as read when you got back home from work. MSN does not have this annoying feature "which does not properly work".
- Offline messaging
This is where MSN shines. A friend of me uses to get up early in the morning and takes the train to work. As we work together on several programming projects, I often have the need to message him about some changes I made to some code, or something else that he should know. If I use Skype as IM, I would have to let me PC stand on when he gets on early in the morning (when I am asleep). On MSN he would receive the message instantly, regardless if I am offline or not. He would only see that I sent the message to him on 11.20 PM.
- Close Skype actually means CLOSE Skype
When I click "close all windows" on MSN, it logs me out and closes MSN, which is why I clicked the button. When I click close window on Skype, it minimizes it. Why? Because some users got stupid when they clicked the button and they didn't expect it to sign them out.
- Appear offline to one contact or a group of contacts
Sometimes you just want to appear offline to some people. I don't like how MSN removed the "block" feature, but it would be nice if they implemented this feature in Skype as well.
- Youtube integration
Often your friend often sends you a Youtube link and you don't really want to open your browser to view it. It was awesome on MSN unless it was some copyrighted content which could only be viewed in a browser.
Skype and MSN are two completely different products built for two completely different purposes. Skype was made for voice and video, MSN was built for IM. Even though we lose a lot of important features after the Skype migration, I hope many of the points I mentioned gets added. Users have fled from MSN to Skype/Facebook/Steam, mainly because more people use Facebook and Steam is easier accessible during a game, and they are often in a group call while playing League of Xbox. Microsoft is doing a huge mistake by forcing MSN users to start using Skype as each product applies to one certain group of people. Some prefer Skype, and some other prefer MSN. We all have our reasons.
This post will describe how the website I recently built for monitoring the statuses for the SimCity servers. As many already know, the SimCity servers has often been disconnecting and reconnecting during game-play. I have already been working on gameservers where latency can have a critical impact on the end-users experience of the game, as the client relies on updates each 500th millisecond from the server. Having any large latency in a system like this would let the users experience lag (and would get annoyed in most cases, as we all hate lag). The monitoring tool I made there was a windows program which communicated over a special protocol designed just for server monitoring. It provided me with information such as user statistics, database activity and other information that could be of my interest. It was all a simple windows desktop application displaying all the information on a diagram:

This was one of my thoughts on how to monitor the servers, but I would rather provide this information to other users. The entire website is running on Windows Azure and is easily scalable by adding more web-worker-roles to push out information. In general, it consists of three parts: A web-worker role, the database and a background worker.
The worker role
The worker may be the most complicated part of the system, as it is in general the module which does everything, or at least large parts of the job. It has a update cycle of 60 seconds where it downloads a JSON file from EA's web-servers (http://worlds.simcity.com/parallelworlds.json) This file gives us information about which servers are available and their current statuses. Any update to a previous added server would be saved to the database. Each server would then get two HTTP requests. One on the "game" field, and one on the "websocket" field in the JSON file. Each request goes over HTTPS, as it is this protocol which the game is running over. And when the requests are either timed out or answered, the results are stored to the database.
The web-worker role
Having many people accessing the status page or repediatly pressing F5 in order to see if their server has any updates on its ping would be a nightmare for the SQL server. It is reasonable to cache the ping statistics in the background, as well as loading them (loading the servers per user request would cause a long wait for the website to load). Each host and its statistics for the last hour is stored to the web-servers memory and it will not nagg the database for new statistics within the next 60 seconds.
This has been a fun project where I have been able to explore new platforms (Windows Azure and the Azure SQL Servers), however, I would not have been able to end up with this result thanks to my friends helping me out on web-design and designing the cache part on the web-worker role, so big thanks to them!
Today we download applications all the time. On our smart-phone or a game on our computer. Hundreds of thousands of applications are available at our fingertips as we browse through the Google Play store, App Store or the Microsoft Marketplace. Having a platform providing easy access to applications had a huge impact on the software industry creating new markets we did not know of ten years ago. However, the advantage of having a platform over the cloud giving users easy access to hundreds of thousands of applications also has a downside.
When software where going to ship twenty years ago, having one single bug could have a huge impact on how the consumer market handled the product. A game could not possibly have a bug as the console did not have any internet connection for users to download a patch to fix whatever bug there was in the game. That way, the makers of the game had to spend a lot of time and money on testing and debugging the game. This became less and less relevant throughout the years as the Internet Revolution came along. Having a few bugs in a game or a movie editing software got acceptable as users could download a patch or an update from the product company's website. Today, we often see that an update is available on our phones or tablets. Apple first came along with their App Store, then Google (and after a while Microsoft). Their platform let users easily search up applications after need or interest. In the new platform of distributing and providing software, companies and developers could provide updates to their applications easier than ever before. A user would get a notification on the front-page of his device that an update was available, and with two clicks the update would install itself. This is a huge contrast to where users could not even receive a patch on a device not connected to the Internet.
When developing software there is a planning phase, development phase, test phase, then a release phase. The high availability of software had an impact on this model leading to Planning -> Development -> A bit testing -> Release -> Fix bugs reported -> release update and step back until new version with new features is ready. The affect of this is to expose end-users to more bugs having a negative impact on their experience with the final product. The reason of doing so is to get faster a user-share of the market and earn money faster. Having a product released two months before testing properly allows more users to use the product and therefore test it. It is a trend getting more and more popular in the software industry.
It may not be surprising that the last release of SimCity is a big motivation for writing this post. There are many bugs in the game (which is a final product, and not a beta version) which I would say would have been obvious to fix during a proper test phase. Even so, long story short, EA let out the game to hundreds of thousands of users and it was the story of Diablo 3 all over again. Servers could not handle the capacity of all the users wanting to use their newly purchased software. And even when they finally got enough servers up, fixed their server bottlenecks, users where left with a stripped down version of the game which had far beyond an acceptable amount of bugs which a final product should have. On the other hand, Maxis has promised to fix the bugs and they are slowly fixing the bugs. I would say SimCity is one of many products which is a sign of a bad trend in the software industry, and end-users does not like it very well.
Many people which barely slept the night before the launch of the new Sim City game was disappointed when they could not even play the game when it launched. Gamers where raging on EA forums, /r/gaming and social networks and everything from EA to DRM was blamed for the apocalyptic launch of Sim City.
It first started off with downloading the game. For me, this was in fact not a bad experience looking away from the fact my internet connection was not stable at that moment. However, when the game was patched at installed, the fun part had barely started. In order to play the game, a server had to be selected. And if you where lucky to get the list of servers up, you would just be stuck on the next screen displaying "Authenticating with servers". When if the authentication was done, you where able to enter the game. Hooray? No. The first times I was able to enter the game, I was greeted with the message it lost connection to the server. And when it was not, it would barely let you make a region for your cities. Once the servers where able to calm down (around 9PM UTC+1), I could see that each of my attempts on creating a region was successful, but my client turned out to have timed out. However, once I was in-game, the servers where disconnecting now and then, making me frustrated about whether my city was saved or not.
In order to understand what is going on, we would have to understand a part of how Sim City 5 works. First of all, there is no DRM on Sim City, it is a multiplayer game, just like Legaue of Legends, Runescape, World of Warcraft, Habbo, etc. This is to let people work together in their regions which is a large part of what the game is actually meant for. When playing Sim City 5, parts of your city is sent to the "cloud servers" to store your town. If you lose connection to the server, you would risk not letting your city be saved unless your client is able to reconnect. In other words, a larger part of the game is not on the actual users PC, but on the server (City data, multiplayer handling, etc.).
First of all, it strikes me they call it "The cloud". They are not even using the cloud in a correct manner. In fact, a large part of the system is designed wrong to be able to run in the cloud. The way a service (web-site, game server, etc) is supposed to run in the cloud, is that it is able to scale. It does so by automatically increasing the amount of servers which the application is distributed on. By saying so, the application runs over several servers when so is needed. This is one of the core elements of cloud computing. From an end-users perspective point-of-view, when we enter google.com in our browser, we do not select if we want to use Google in USA, Netherland or whatever. Users are way too stupid to make that selection.
The current servers running Sim City holds a given numbers of users until they are claimed full. Then a user has to either wait in a queue of a fixed waiting time for 20 minutes or select another server. The fixed waiting time is just as good as no queue. Imaging having a Justin Bieber concert, and letting in all the thousands of brainwashed teenage girls in at the same time. By doing so, there would be too many people in the gates and they would be congested. Letting each girl wait another 20 minutes before they can enter does nothing to the congestion, it is just as bad. In order to solve this, they need to line up in several lines and they would be let in. This way, the amount of people are load balanced. I know several online games have such systems to prevent congestion on their servers. They retrieve a queue position and an estimating time until let into the game. Legaue of Legends have this system, and I think Sim City should consider implementing it as well.
If the Sim City game was properly designed, users would not have to chose between which server they wanted to play on. Their regions would be stored in between the servers and retrieved when entered the game. That way, each instance could hold a given amount of users or regions and when a max limit is reached, users would be sent to a new instance. Each instance keeps track of all the users and their regions. When a user enters on a different instance, a message saying "Getting your regions" would appear. Instances would automatically be created, and neither users or any working in Maxis would have to care about adding more instances (or servers, in this case). The system would be self-scalebale.
I am missing a great amount of information in the launch tool. When I was downloading patches from the launch tool, there was no information telling me it was doing so. I wanted to see information about download speed, downloaded data, how much was left and an ETA counter. In the server-list, there would be great to see how many users/regions was on each server to determine which one would be best for me to play on. It lets the user get more information about what is actually going on.
The Sim City game went far beyond my expectations after playing the beta. It is a great game which I am sure everyone which loved any previous Sim City game would love. Even though the maps are considered as slow compared with the older games, the interaction between towns is the trade-off. I doubt there will be any singleplayer of the game, as SC5 is a mutiplayer game, not a singleplayer game. Even though the previous games had a singleplayer mode, this is where the world is moving. More and more stuff in the cloud. So right now, there is nothing else we can do than be patient, wait and send good thoughts to the developers of the game which I can assume got some hectic days.
We all remember in the early days of the Internet when we had to use a dial-up modem to connect to the modem. Opening one single web-page could often take several minutes and being able to use the Internet, the modem had to call a specific phone number which created a sound, which is what we associate with this time (http://www.youtube.com/watch?v=AgqEIp2YmtE). It was in the good old days. Most people used Windows 98 with Internet Explorer and using the internet was expensive since we had to pay for how long our connection was open and how much data was transferred.
Today we sit on a far far faster connection and we do not have to pay for how much data we send/receive. Most people are using ADSL or cable modems and some users luckily got a fiber connection to the Internet. All the money is on the speed to the Internet. The most speed you have, the faster you can download data. Schools and companies often have a faster connection since more users are using the net at the same time than private internet users.
Some people often pay a lot of money in order to have the fastest Internet connection available. Sure, a connection around 50Mbit in download rate would fit well if you have 5 kids that download movies and streamed music at the same time. Otherwise, a fast connection is more or less useless.
My ISP called me a few weeks ago and asked if I wanted to upgrade my current fiber connection on 25/25Mbit to a 50/50Mbit since they where having an offer on this plan. Amazingly, I said no. Neither me or my parents need that kind of speed. I sure do download and stream music and videos, but a faster connection is actually useless. In fact, I even rarely use my maximum capacity. Last time when I was downloading content to Halo 4 on my xbox, I had a connection capable of receiving ca. 100Mbit/second (in theory it is 10Gigabit but it is shared among others), and the download speed was around 550KB/s (4.4Mbit/sec). Microsoft's server did not have the capacity to push out data on my super-fast connection. When downloading content from sites such as download.com, the download speed rarely peeks 1MB/s.
A faster Internet connection would of course have an impact on how fast websites loads. The faster your connection is, the faster the site would load. A lot of this is wrong. If we say we have the fastest computer in the world with the fastest browser there is running through a 20Mbit connection, we would not see much difference if we compare it with a normal computer today. A normal web-page is rarely above 1 megabyte, so it should load instantly. In many cases this is wrong. Popular websites such as xbox.com, Paypal.com and Netflix.com can often take up to half a minute regardless of my internet connection speed. Why is it so slow? We have a "fast" connection, our computer is fast, so what is wrong?
There are a lot of factors involved in how fast a webpage loads. DNS resolving, connection handshaking and SSL are all causing overhead and causing the page to load a bit slower. In most cases, these are not to blame when it comes to loading webpages. There are in general two "main causes". The first one is that the web-server is too far away from its visitors. If you test your internet connection to a server in China, you would have a totally different speed if you connect to a server that is close to you on speedtest.net. (Given that you are far away from China) The other one is slow web-servers. This can be the cause of poor dynamic page programming, a slow database-server, or a web-server that is poorly maintained. Many people would blame the platform which the websites dynamic page language is written in, however this is not the case. A slow PHP forum is around as slow as the Xbox homepage written in ASP.NET.
The point of this post is that more and more users are getting faster internet connections than the servers' internet connection around the world. However, it does not only apply to the internet connection, also slow websites are affected. Sure, a 1Gbit connection from Google would be nice, but it is actually useless unless you have some special needs (eg. if you are some institution with hundreds of employees or hosting a website-cluster). Here is how fast some of the websites I often visit loads. Please not I am on a 25/25Mbit connection through wireless connection and a mid-end laptop running SSD with Window 8 and Chrome (Ordered by loading time, fastest first):
|
Website
|
Speed (s)
|
|
Google.com
|
1
|
|
Nrk.no
|
1,40
|
|
Imgur.com
|
1,50
|
|
Aftenposten.no
|
2,50
|
|
Youtube.com
|
2,60
|
|
Twitter.com
|
4
|
|
Reddit.com
|
4,10
|
|
Facebook.com
|
4,30
|
|
News.cnet.com
|
5
|
|
Paypal.com
|
6,70
|
|
Netflix.com
|
7
|
|
Xbox.com
|
12,40
|
The Internet was built for sharing data and communication. In its early days, normal people did not have access to the large knowledge base which this network of computers where holding. However, security was not something it was designed for which later on became a growing issue. However, when people gained access to the internet through their hardcore dial-up connections, a revolution started. This was the revolution of information access. Today we can get the latest and hottest news in a matter of seconds by going to BBC. If you need to know how tall Mount Everest is, Wikipedia will easily provide that information for you, or whoever the president in any country is. The social revolution made us able to share moments of our life, and we are more accessible than ever before. However, because of the easy access to information, file-sharing is becoming a headache for film and record companies. By "paying" governments to add new laws in order to protect and make their own industry more profitable, the internet is under a great threat.
We have heard it before, many many times: "You wouldn't steal a car, you wouldn't steal a handbag, you wouldn't steal a television, you wouldn't steal a movie." before watching a movie. It makes people who download look bad. Ironically enough, it is fun to watch if it is on the beginning of a pirated movie. The movie and music industry has raged as the piracy over the past few years has exploded. They claim to have lost several billions of dollars, if not more, because of piracy. Yes, it might be so if everyone would have to pay for what they saw. However, if they had to purchase the media, they would have never seen or heard what they downloaded. Why does so many download it pirated then, if it is illegal? Isn't it? They do it simply because they can. (Yes we can, Obama) It is so much more simpler to download a movie than having to find it on the right store, or the right streaming provider which has that movie in order to watch it. Many people download episodes of their favorite series hours after the latest episode has aired in the US from Norway. Why? First of all, they have to wait several months, maybe years for it to come on DVD in Norway. It may even take years for it to come on TV in Norway. But why limit it so much when you can watch it whenever you want it - for free?
A large part of youth is downloading movies and music illegally. A large reason of this is because they do not want to spend money on something they can get for free. Kids does not want to spend a lot of money on having to buy a movie they may not even like. They can simply download almost any episode, song or movie they want for free through the Internet. The propaganda movie above says you wouldn't steal a car, and therefore you wouldn't steal a movie, or download it illegally from the net. Put it from another perspective, what if you could download a car? What if you could download the house of your dreams, download the greatest computer, smartphone, your dream vacation and maybe even a few PhDs to your brain. Why not? You can! And it is free!
The Internet is not made for distributing copyrighted material. It was made for sharing information. Large record and movie companies wants to change this by enforcing governments around the world to block and control parts of the net which provides access to copyrighted material. So what? Removing these sites from the net would be good right? The answer is no. And we have already started to see examples of this.
Megaupload was the largest file-sharing websites in the world. It simply removed one problem. When you are sending your 1.3GB large vacation video to a friend, the video file simply will not fit in an email, and you need to upload it somewhere. Megaupload solved this problem by allowing users to upload their files to their sites which could later on be downloaded through a link to your file on Megaupload. There where other providers as well. Mediafire, Skydrive, Google Drive, Dropbox, Rapidshare for just to mention a few served the exact same service. However, pirates also uploaded illegal copies of movies and music to Megaupload. Even so, these files where normally removed because of copyright claims from record companies. Nevertheless, 19th January 2012 it was shut down by the US Government since they claimed it violated copyright laws. This incident caused a lot of attention throughout the Internet, since Megaupload where not doing anything wrong. What they where left with was innocent people put in jail as well as destroying a company making a lot of money through file-sharing. The owner of Megaupload, Kim Dotcom was later let out of jail. However, the servers are still seized as the case is still ongoing and Megaupload remains offline.
The Pirate Bay, which is the most popular Torrent site on the Internet has also been feeling the powers of the record companies. The owner and creators of this site was arrested and put in court in 2009 because of copyright infringement. These people where set responsible for all the action of their users. On The Pirate Bay, you could search for anything you want, then download a torrent link to it which would let you download it from a peer to peer network. In other words, it worked as a search engine, just like Google. Even though, these men where accused for copyright. Why Google is not shut down shows us how much the people who claimed people like Kim Dotcom for copyright infringement really knows about how the systems really works: Nothing.
We live in a world where companies wants to have full control over what we see and listen to. I hope that this will change in a few years. Spotify allowed me to listen to whatever music I wanted to listen to, for around 20$ a month. Even though I'm able to listen to almost every song there is, there are a lot that does not exist on Spotify. Songs are also sometimes removed from there, destroying my playlists. The same thing is with Netflix. It is a wonderful solution for watching whatever content you want, but the content is fairly limited. The cause of why content is limited on services on Spotify and Netflix is because of licenses. It is one of the few horrible things that is stuck from the past when people want to make services like Spotify and Netflix. And because of this, information is easier accessible through less legal ways.
Today, many countries are blocking access to sites such as The Pirate Bay. Why isn't Youtube blocked? Piracy exists on Youtube as well. Norway is considering blocking sites such as The Pirate Bay and other sites which the government claims is violating copyright laws. This is where the fun begins. TPB does not violate any copyright laws, this is because of the magic of peer to peer networks. It is the users themselves who upload illegal content to others. Then why not charge all the people who downloads and uploads the illegal content? That would cause a ridiculous amount of work as almost everyone that uses the net have at some point downloaded something illegally.
Then comes the mayhem around logging IP addresses and charging the owner behind the IP address for copyright violation. By allowing a law like that would show large the lack of knowledge in the government of how the Internet works really is. If such a law is applied, cafees providing free internet could be scared and would remove their open network in fright of being accused for illegally downloading a movie. Hotels might not want to provide open internet for their visitors any more because of the same reason. Companies would suffer, because the government wants to play cat and mouse with pirates.
I would say it is too late for the government to try and gain control over the net. If they start logging IP addresses and block websites, people will simply use VPN connections to download this. The piracy would go down, for a while, but it will later rise up again as people learn about the VPN technology. Later on, the government would start banning these services as well, in addition to other services. And in the end, we would have a Internet where people would decide what you would be allowed to see, and what you are not allowed to see.
Until a few years ago, the clock speed of the CPU was just increasing and increasing. This meant algorithms just using one core would run faster without being modified. In the last years, we have been adding more and more processor cores. This allowed us to do more things at the same time. However, it introduced a problem to the sequential code everyone had been writing the last few years. They did not get any faster with newer processors because they ran on only one thread on one core.
Parallel programming is nothing new in computer programming. Computer scientists have used this technique to distribute workload over processors or computers in super-computers. It has also been available for the regular developer, but in a restricted degree. Many programmers also have bad memories from when they was working with parallel programming where they had a weird bug they could not explain or the program became unresponsive.
The reason why, is because of synchronization. When two threads are trying to do operations with the same piece of memory, it is called a data race. The data race results in an unexpected behavior in the program. In order to avoid this, we lock the data using a mutex. However, locking data can also be bad. It is considered as a bad technique in parallel programming and shall be avoided when necessary. Think of it as this: Two sisters have to share a toy in the kindergarten. Only one can play with it at a time. And it only gets worse as they grow up.
Parallel programming has been more and more discussed the last years. Mainly because we get more computer power because of multiple cores and not through higher clock frequencies on our processors. We don't only have multi-core CPUs in our PCs, we are seeing it in smartphones and gaming consoles as well. Because of the wide area of available multi-core systems, developers wants to make programs such as games, simulation programs and heavy calculation programs take advantage of these systems. However, in order to master the parallel programming technique, a lot of knowledge about how it works is required. When we first learn to program, we learn how to write sequential code. Parallel programming is all about doing more things at the same time. It is the transition between writing sequential and modifying it to be able to do more things at the same time which is difficult for programmers.
First of all, the popular city-simulator Sim City is one of my favorite games. It has been one of the games that had a large impact on my childhood and inspiration for my username I use everywhere as well. I first got into playing Sim City 3000 on an older computer running Windows 98. Those where the times, and I could sit forever until my parents did forbid me to use the computer rest of the day. Years passed on and I saw Sim City 4 was out. However, my computer could not run it because I was stuck on the Windows 98 machine. Many years later I got a new computer which was far far better (Pentium 4, Dell pc). However, I could not seem to find the game in the stores. Therefore, I had no other choice to download the game from the Internet from piracy websites.
In my opinion, Sim City 4 was THE BEST Sim City game I have every played. It was a lot like Sim City 3000, but better graphics and more modern. Even though there was one small detail I did not agree with - the teraforming tool, Sim City 4 was a game I enjoyed, for years.
A few years later, Sim City Societies came out, and I was so lucky to get the game for my birthday. However, when I was playing the game, it did not feel like Sim City, at all. The purpose of the game was to make your sims happy, not control healthcare, traffic system, crime, fire hazard and all the stuff from Sim City 4. The community raged, and Maxis indirectly admitted they don't own Sim City Societies. Even though I called Societies Sim City 5, it was still far from what I would call a good Sim City game.
It was to my big surprise during my summer vacation in Sweden, two years ago, I was able to find Sim City 4 Deluxe Edition. Finally, I had found the game I had been looking basically everywhere for, and I paid gladly the price for it (around 15$). It really felt good I had finally been able to purchase a game I really wanted to buy and I did not have to use those cracks that crashed my game all the time.
Last year, I heard about Sim City 5. Really, Sim City 5? WOAH! The gameplay videos and all the material EA had posted on Youtube was blowing my mind. It looked like Sim City 4 in 3D. When pre-ordering became available, there was also an option to become a beta tester, if selected. And to my surprise, me and some friends got selected a few days ago, and it sure was like the Christmas eve when I saw the email I had been selected as a beta tester of Sim City 5.
It was like magic when I had installed the Sim City 5 and was in-game building my own town. However, during playing, this so-called beta-version had quite a few restrictions. First of all, I was not able to save my town. I had one hour of gameplay available at a time, and there was a lot of features in the game that "was not available in beta". I was here to test out the game and give EA Games feedback on the game. Not get my own opinion on the game and make me want to go buy the game.
I have been testing several beta versions of the Windows operating system. Vista, Windows 7 and Windows 8. Most of those where feature complete when I was testing them and giving feedback to Microsoft. I do not really see why they call the "beta-version" a beta. When I am testing something, I need to use it as close to real-usage as possible in order to give accurate feedback on the product. Imagine how it would be like if Windows shut down each hour, it would just be annoying and I would not even want to test the new operating system.
The release of Diablo 3 caused world-wide attention with its DRM technology. It made people rage quite hard when they had bought the game, and it said "The servers are busy at this time. Please try again later". Sim City 5 will most likely have a technology familiar to this. It is also ironic that Maxis had issues with the launch servers when starting Sim City 5. I do not know what these issues are, if it is some overflow issue or scaling issue, but the fun part is we have technology that can solve this really easily and it is called the cloud.
One shock I got while testing SC5 was all the restrictions. There was restrictions everywhere. While playing Sim City 4, I was used to have a huge map I could form the terrain, place out highways, create complex road systems and then hook them up to my neighbour towns. My feeling in SC5 was like "here is a small part of a region (one region size is almost equal to the size of a large map in SC4), now build the down which is connected to this highway". Sim City is more about building the town. It is about designing efficent road systems to transport your sims, create a beautiful landscape and design a huge metropolis. There was no highways, elevated railways, and I was not able to create new connections to the highway. A lot of my freedom from SC4 was taken away, even though the graphics was awesome and the co-op system looks cool as hell.
It is some years since Sim City 4 was released. We got far better internet connections and hardware is dramatically increased. While I was playing Sim City 3000, I was thinking how amazing it would be if a friend was working on one of my neighbour towns, while I was working with this. It can now be real! However, a lot of the good stuff I recognize with Sim City, is not there any more. Filling the map took only 45 minutes on SC5, and the map is even smaller than the smallest map on Sim City 4. It would not surprise me if there came DLCs available for the game when it gets released. "In order to have this police station with such and such capacity, you need to buy the DLC pack X for Y credits". I just purchased a game, can I please play it, FULLY? I did not buy a game to buy more parts to the game, I bought the game to play the game.
After playing the closed demo beta, I am rather sitting as a frustrated question mark than someone looking forward to a new game that would "change everything". I do not even want to call this a beta, rather a demo for wanting people to go buy the game. Having feedback and such poor bug-report functionality in the game makes me feel that EA does not even care what you think about the game. They just want you to buy it, then give you more money later on through DLCs. But this time, they want to simplify the game so smaller kids can play the game, so they did this by removing functionality that was vital for previous releases. The community is really upset. Out from the forums, another guy wrote a blog entry where he also expressed his frustration about Sim City 5. It is about 5 weeks until the game gets released. I have already pre-ordered the game, I am not going to cancel it, but I do not think there is much hope left for EA Games and large parts of the gaming industry. I know we are consumers. But I do not want to be a consumer slave for EA games. Indie games are good, when they write their games properly so they run on normal hardware, but when it comes to large gaming companies, they don't even care about the game any more, they just want your money.
We are moving towards having more and more managed programming languages. A lot of software companies are praising these types of languages through the roof, while there is a great downside of simplifying computer languages. By simplifying and making programming languages managed, I would say they are moving towards becoming an over-managed computer language.
Computer languages like C and C++ are native or unmanaged programming languages. They gets compiled to native assembly code and you need to take care of the memory handling yourself. However, managed code like Java or C# are languages where you do not need to write any extra code for memory handling. Of course this is great because we do not have to remember calling delete on our objects all the time. However, there is huge downside. If a person decides to learn for example C# by himself, he often does not need to know anything about memory handling in order to write code. However, this could have a dramatic affect on the code written, since the developer has no clue what a garbage collector is or how it allocates memory. Of course this does not mean much if he makes a simple form-application, however, making for example a multiplayer game, this could have a large affect on the scalabillity of the system.
What is making me upset is the amount of effort into making more and more people use the managed languages. Like I said, it is great if you just need a small program for example a form, but in a larger system which may need to be fairly responsive or cant tolerate downtime, it may not be the way to go. I am not saying it is impossible to make a responsive system with no downtime in a managed language, however, it could be easier in unmanaged code. It frightens me when people are starting to drag PHP and JavaScript into this picture. I have seen several people trying to write a game-server in PHP while not really getting anywhere since the language does not yet (as I write this) support threads natively. It might be possible to install through some plugins, however the effort required to make this work is far too much when it should be considered as a part of the standard-package. And last of all, PHP is my eyes simply slow. Even though it contains a huge library for doing a lot of fancy stuff, I do not really care when the PHP process is consuming too much resources to hand out a page to some thousand users. This is since the PHP engine has to compile the website at each load causing a huge overhead related to both disk I/O and compilation time. It is of course possible to configurate caches and stuff like that, however this does not come defaultly. And last of all, PHP is meant for websites. Even Wikipedia says so: "PHP is an open source server-side scripting language designed for Web development to produce dynamic Web pages.". And yet, I do not quite understand why people want to use this language anywhere outside web-servers when PHP sites are out of the box poorly scaleable.
I also do not get why people want to use JavaScript. One good example is the Node.js which there is a lot of discussion about. Yet, the code might look fancy, the performance could perhaps be far better if for example written in C++ specialized for the target platform.
So what does all this mean? In my opinion, it is the main reason where there are so incredibly many shitty programs who are slow or does not work properly. One example is Minecraft, an incredibly popular game written in Java. Yes, Java. The game requires a high-end computer with a dedicated graphics card to get at least 60 fps. In my eyes, this is complete madness when the graphics in the game is pixelated cubes. Yet, there are lot of these cubes in chunks which might be heavy. However, the code is poorly optimized and could have been far better if another framework which perhaps is made for games is used. Java might be good server-side, but client-side games is something game-developers should keep a good distance from.
This does not only apply to Minecraft. Also, a lot of applications. It is often I see a lot of delay that could have easily been avoided, or buggy/sluggish apps. Large parts of the xbox moves away from the fundamentals in asynchronous programming where the UI is suposed to be responsive while an operation is being done, but I have to wait for my friend list to appear in order to close it. Spotify on the Windows Phone platform was one of the main reasons that caused me to switch over to the iOS platform as discussed in a previous post. My point is, we are seeing more and more (unexperienced) developers starting to use managed languages which often causes slow/buggy applications. This is something I think we will see a lot more of in the near future.
Many unexperienced server coders believes the socket decides a large part of the server application performance behavior. On one side they are right, however, it is the overall performance which counts. Yet the socket is a part which many does not get how to use right and then "kills" the performance of the server applications.
Blocking vs. non-blocking
The largest and most critical point when it comes to socket is determined if you chose blocking or non-blocking sockets. (Often referred to as non-async and async) A blocking send function means that the send function will have to wait for the data it sends to be sent before it is done calling the method. When it is a non-blocking, it means the send function is queued to the .NET thread pool, and when the data has been sent, it calls a callback method. A good example is a server application which is designed to hold tens of thousands of connections and respond to requests. If we had to use blocking methods, we would have to create one thread per individual connection which later on would not make the server application really scaleable. On the other hand, if we used non-blocking methods, no extra threads would have to be created since the .NET thread pool takes care of that for us. In addition to this, we would not have to wait for data to be received on each individual thread since callback objects takes care of that.
Exception handling
Exception throwing and catching is expensive. When a connection is closed, it throws an exception if you are using the wrong methods or if you don't check if it is connected. One example on a connection that could throw an exception if it is closed:
private void StartSend(byte[] data, int dataLength)
{
try
{
socket.BeginSend(data, 0, dataLength, 0, sendCallback, null);
}
catch
{
Disconnect();
}
}
There is no check if the connection is connected or if it is unable to send anything. In addition, it would throw an exception if the sending did not succeed. However, it can be avoided by using the following code:
private void StartSend(byte[] data, int dataLength)
{
try
{
if (socket != null && socket.Connected)
{
SocketError error;
socket.BeginSend(data, 0, dataLength, 0, out error, sendCallback, null);
if (error != SocketError.Success && error != SocketError.IOPending)
Disconnect();
}
else
{
Disconnect();
}
}
catch
{
Disconnect();
}
}
This code checks if the connection is open and if the send method managed to send the data. If it failed, it tries to disconnect without throwing any exceptions.
Closing
Closing the connection is very important if we do not want our server to have tons of non-used connections which later on would time out. Closing the socket is fairly simple:
socket.Shutdown(SocketShutdown.Both);
socket.Dispose();
The shutdown method disables any send/receive on the socket. The Dispose is technically the same as Close, since the Close method simply casts the socket to an IDisposable and then call the Dispose method. By calling the Disposed function directly, we do not have to cast the socket in the Close method.
Memory allocation
The buffer created for receiving data can be a headache for those who does not know what happens under the hood in the socket. In fact, when calling BeginSend, there is created objects which allocates far more data than a data buffer with length = 1024. (System.Threading.Overlapped, Socket.OverlappedCache just to mention a few) However, you can avoid the allocation of the buffer by creating buffer-pools for it.
Going further
Out from my own experience with the socket class, I have to make changes to the socket class itself in order to achieve better performance. Moving the code to C++ might be a good idea since I get far more power over the memory used by the server. The overhead caused by P/invoke would not be much higher compared to the current overhead since the current socket already calls native functions by using WinSock methods.