September 26, 2014

Radio Silence is Bad!

It has been a very busy time for me. I am a graduate student so spare time isn't always available. However, I can't really call it a good excuse for not posting on the blog for such a long time.

I've been playing around with Unity 4.6 and have to say Unity is an outstanding engine in terms of ease of development. Especially with the UI framework coming with 4.6. However, on the surface and playing with the tutorials, it really makes me feel like its a tool designed for non-programmers. It does provide you with everything and a high-level abstraction for most concepts but it is really not designed for someone who has worked with low-level frameworks.

LibGDX vs Unity. Naturally, after years of experience with LibGDX using Java, Scala, Groovy, and Xtend I have started to getting tired of having to write the same sort of code over and over to do relatively simple things. Yes, I can reuse most of the code, but after years you have to maintain it and update it to work with newer versions of both languages and libraries. In the end, it is usually best to rewrite it than spend the same amount of time fixing up your already existing code. However, this wastes my time as I spend it working on "engine code" instead of actually making a game. I have a model in the back of my head that every game needs to be written like its a fully networked game (even if it is singleplayer). This is because it forces you to think about your design and really makes it clear what the "game" needs to communicate with the "rendering" and "input" systems.

As a singleplayer game, the "game", "rendering" and "input" systems are all wrapped up into a single unit because it is easy to do it that way. This is why when I see countless games first released as singleplayer I pretty much know they will almost never have high quality multiplayer and won't scale beyond a small group of people. I laugh at all the kickstarters, indiegogo, etc that list multiplayer as a stretch goal, because it tells me that they don't know what they are doing. They don't realize the hole they are digging themselves into and the amount of work it takes to dig yourself out of the pit.

Developers like to do things the easy way, even if it means more work down the road. This isn't specific to games, this is all software, this is being human. This is why governments spend tons of money over the long run on multiple jobs sold to the lowest bidder when they are tendering projects. Everyone sees it as spend 100 and then another 100 later, instead of 150 now and 0 later. Obviously my numbers are made up, but its a very common theme. There is also the fear of spending 150 now is worse than spending 100 now for something nobody is going to use. Decision making is a very hard process, so I don't blame the government for all the poor decisions they make. Just because everyone does this does, it does not mean we have to do it. Just like everyone should be recycling because its a great way to preserve our resources, but it doesn't mean everyone will or even care about it.

Unity so far seems to be a really good basis for the "rendering" and "input" part of the game. However, the whole component and script part is only good for a subset of games in general (obviously you could liberally apply it to every problem and it might do a decent job). Looking at 7 Days to Die, HearthStone, Timber and Stone, Race the Sun, and Kerbal Space Program which are all written in Unity and comparing them with Space Engineers, Prison Architect, Path of Exile, and Xenonauts which are all "in-house" engines sorta, you can really tell a difference in the games in terms of the number of bugs and development time. The Unity based games typically (note: not representative of all games) seem to get unbuggy features completed more quickly at the start of development. I really want to highlight 7 Days to Die against Space Engineers. The games are both approximately the same age and they both have: decent graphics, support multiplayer, voxel-based, and use C# as the main language. Space Engineers updates weekly, and 7 Days to Die is about monthly. I believe Space Engineers has a larger development team at least it sounds that way from what I have seen. 7 Days to Die's multiplayer is significantly more stable, supports 'infinite' generated landscapes, has pseudo-objectives, has a form of AI, is really a survival-based game. Space Engineers has pseudo-survival, it has some interesting automation mechanics, but lacks large world support, no gameplay-based objectives, and no gameplay-based AI. Both games offer a form of modding support and both would be considered sandbox games.

From a software development perspective, I would easily rate 7 Days to Die higher, but both are certainly well made early access games. What has got my attention is how 7 Days to Die is done by a smaller group of people, seems to offer more features, and overall has less bugs (but still has bugs). The only real difference between the two is one is written on an "in-house" engine using SharpDX with Havok and the other is done in Unity. Let us not forget that Unturned (which is a relatively popular game for younger people) was written by a single 16 year old developer using Unity. If I compare Unturned to any of my earlier work, it hands down slaughters it in quality. This is using Java's 2D library, XNA with C#, MonoGame with C#, OpenGL with C++, DirectX with C++, and Android/Desktop games/apps with LibGDX. What is a common theme here? You can probably guess it Unity.

After walking through a bunch of tutorials, I can easily see what is so attractive about Unity. Doing things in it is so mind-numbingly easy that even non-programmers could learn the basics and make a simple game with it. Advanced concepts are available right through the menus, and are typically done well enough they can be used right out of the box in the above games I mentioned. More importantly, the things that don't work out of box can be modified to make them work reasonably well for games. Certainly, good quality code, low-level logic and a whole other set of things seem to be lacking in most Unity games. However, they work, they sell, and more importantly they make money.

One thing I haven't poked around with yet is the quality of networking libraries for Unity/C#. Java has extremely good libraries for this which work automatically across platforms (Win, OSX, Linux, RoboVM, Android) and architectures (ARM, x86) almost seamlessly with the exact same code and binaries (sorta binaries). It does appear on the surface that not using Unity puts small developers, hobbyists, and single developers at a huge disadvantage. There isn't much else on the market which is as mature and able to easily support tons of platforms (read as multi-platform == more money). Yes there are other game engines which can produce much more stunning looking games. However, "stunning looking games" == "has lots of artists" == "Not a small developer" which really means it would be stupid (yes I am going to just outright state it as it is) for a small group or individual to bother trying to make a game using those engines. The biggest hurdle for developing games is finishing the project. The best way to finish a project is to make everything as easy as possible and take as little time as possible. I really believe Unity can help me with that aspect.

So where is this long giant blob of text leading me?

I have a potential game idea I want to explore, it is related to other projects I have worked on (many not ever released to public), and I really think using Unity might actually allow it to come to life much faster than if I was trying to do it in other engines/libraries. Of course, jumping immediately onto this larger project without really getting personal with Unity is a recipe for disaster. Therefore, I will likely be working on a much smaller and simpler game first to make sure I understand the bells and whistles of Unity.

Last but not least, a minor side note: C# > Java. This is coming from someone with 10+ years of Java experience. My reason for not using C# more often, sooner was trying to find a way to easily develop mobile/desktop games without wanting to bash my head in from lack of high-quality tool support and libraries. Fortunately, in the last 4ish years C# has grown massively and it's widely accepted as a good language to use. This means going forward I will likely stick with it for my main development. Of course, Java and Python offer other advantages as well so they will be kept around for their nice features. Now if type annotations make there way into Python 3.5 I will think Python is the best scripting language ever! Okay Perl, Ruby, Javascript, Dart, Lua, and Coffeescript are nice but I still prefer the syntax for Python. Besides, I can mix and match as well. I would also really like D to become more popular because it just makes C++ look silly, but D has pretty much been out of the spotlight for so long I doubt it will gain traction any time soon, at least not like C#.

May 20, 2014

Windows 8.1 Round 2

Many months ago in the summer of 2013 Microsoft released version of Windows 8.1 for people to test out. I blindly went ahead and installed it... which was the biggest waste of 3 days I've done in a long time. Not only did it prove to be insanely unstable, but many applications I needed simply couldn't function on Windows 8.1. It wasn't fully ready for release and was more of a showcase anyways so I basically blew it off as pre-release defects.

I decided after all this time to upgrade to 8.1, in May 2014, over half a year since it has been released. My upgrade process went as follows:
  1. Download upgrade to 8.1 from store I never use
  2. Install upgrade to 8.1 which was fairly quick in terms of OS upgrades
  3. Watch computer reboot and do 'magic'
  4. Watch Windows 8.1 start up
  5. Watch Windows 8.1 give me a blue screen and reboot
  6. Watch Windows 8.1 downgrade itself back to Windows 8 and reboot
  7. Windows 8 loads up and kindly informs me the upgrade failed and I am now running Windows 8
I don't really have an exotic hardware setup, yes I run high-end parts but nothing strange and a modest overclock compared to most. But after this long I would have thought Microsoft would have invested the time to work out the upgrade bugs... Instead I find a nice thread back from October 17, 2013 with 400+ responses talking about how the upgrade fails in an identical manner to me.

Windows 8 keeps looking more and more like a lemon, good thing it boots fast or I would have downgraded (or should I say upgrade) to 7 a long time ago...

Will Windows 9 prove to be awesome? Only time and Microsoft can tell you that... Some days I wish Linux had better game support.

May 9, 2014

Bare-bones Eclipse

I work with many languages, but I like to work with Java. I would prefer to work with C# if the tool/library support was as good as Java, but unfortunately it isn't.

Eclipse and IntelliJ are the 'best' IDEs to use (in 2014) when working with Java. Gradle is the most promising build system for Java. However, Eclipse's default installation you find when searching for it on Google points to a bloated version which has a bunch of unneeded junk. Most of it will simply slow down the IDE. This is why I have been using the Platform Runtime Binary and then adding only the components I need. You can find it from the download site at:

http://download.eclipse.org/eclipse/downloads/index.html

Just follow to the version you want, scroll down until you find the Platform Runtime Binary group and select the version for your OS. When you first launch Eclipse it will load fairly fast, but it will also support absolutely nothing except general projects. I also suggest making a copy of this eclipse installation and using a copy for each language you wish to work with. For example, one version per language or set of languages you are going to use on projects. This keeps Eclipse running extremely fast and means you only ever load the plugins which are absolutely required for your project. There might be a way to disable (without uninstalling) plugins but I have not found the option anywhere. Also some poorly maintained plugins may not cleanly uninstall themselves and cause issues over time which are a nightmare to track down.

May 6, 2014

A "Small" List of Useful Tools and Knowledge

Anyone who has shared files has probably heard of Dropbox. Though it is only one service of many file sharing services. I would never argue it is the best, but it does offer some pretty decent basic services if you want to store a backup copy of files onto the magical thing called "The Cloud". For free, you get limited space (a few GB), window's shell integration, client-side syncing, and ability to create public direct links to your files. I haven't ever had an issue or a complaint about it other than the brutally limited space (if you want to sync all your files you are out of luck or going to pay a fortune with Dropbox).

Google Drive, also provides a limited way of sharing files. It isn't ideal for syncing data and also suffers from limited free space. However, if you use google documents then you technically have unlimited space as they don't count. Not to mention the fact you can work with nearly limitless number of people on the same document together is a great bonus. After using it since... 2009? I have seen it slowly evolve into a great tool for collaboration, and best of all it is free. Need a notepad to share notes with yourself between computers or others, it works like a charm and provides you with a great backup location accessible from anywhere.

BitTorrent Sync, is my absolute favourite tool. It is still in beta (but I've used/built enough software to think everything is always in beta) and works very well between computers. Think of it as a torrent which you can add/update/remove files, encrypt, password protect and runs in the background without a second thought. The idea of using P2P for backing up and sharing data between my devices is absolutely awesome. The best part is that the files are stored locally, so I don't need to spend a fortune for space in "The Cloud". I have 3 computers (server, desktop, laptop) so keeping my data synced between them is required.

7zip, is an absolute must have for compression. Winrar is like the poor sibling in comparison to what 7zip offers. The fact I can choose which compression method, the compression level, encryption, partitioning, etc in a very simple manner means any data I rarely access I can compress down and then put it on my sync folder to provide a compact backup of my data. If it isn't compressible, I can grab the folder with the files and throw it in my sync directories.

Action!, meets the need high-performance and easy to use capturing software. You can separately record multiple channels with Audacity and edit your audio with minimal effort. These two together is enough to record content like professionals and it only costs you $40. Not to mention both are extremely efficient at recording so you don't have to worry about large performance drops while recording. A common issue with FRAPS. The runner up is Dxtory, which provides you with everything you want. I prefer Action! but both are excellent.

CCleaner, is your best friend if you are a Windows user. This little tool is like a weight-loss magic pill for Windows. Keeps the registry clean (a bit aggressively) and removes temp files which really are not worth keeping around. It also allows you to deeply purge files if you want to clear caches, stored passwords, etc. Another important thing is making sure your PATH is good and not full of crap. I suggest Path Editor, but there are many other tools like it. This one just has a bunch of good simple and easy to use features.

Speccy, is great if you don't have the specs of all your computers memorized to extreme detail. It is probably the least important program mentioned here, but when you want to know all the details of your hardware (and some software) it is great for telling you what is inside without opening the box.

Memtest86+, is most likely the best memory testing tool out there. If you want to diagnose a memory issue this is your go to solution. Prime95, is a great CPU/Memory stress tester as it allows you to focus on what parts you are wanting to stress. This is important for finding stable overclocks and just general CPU benchmarking (but mostly just for stable OC, I would never consider a single bench as a good indicator of performance). FurMark, GPU stress/benchmark tool. This tool will let you know if your GPU is being cooled properly as it will stress it to the absolute maximum. This is beyond anything you will ever encounter while gaming or almost any other activity. Great for testing stable GPU OC and system heat management. Finally, Speedtest.net, for checking your network connection quality as slow internet is the greatest source of frustration for anyone.

Operating system is by far the most important software for any computer. The thing is, I have no favourite; however, I do use Windows the most. I use OS X the least, mostly because I don't own a Mac and don't see it providing me with an advantage over anything else. I actually suggest Macs to many people simply because of the "easy to use" part of it, but usually I suggest people simply stick to what they are already used to. I.e. I don't tell a Windows user to use a Mac or a Mac user to use a Windows machine, because most people don't want to spend the time learning all the 'tricks' with a new OS. I have never suggested any Linux distribution to any non-technical users as most of the common software will not be available for them (WINE, cough... yes but is that worth teaching them a whole new environment?). The last thing I want is to teach/explain to them the alternatives and how to use a different OS. If I were to suggest a Linux distribution to a user, it would be either Mint or Ubuntu. Server would be CentOS, but that is mostly because of my familiarity with it. Anyone who games, I would suggest Windows without a second thought. For any developer, I would say you should know all of them, pick your favourite and be using VMs or multi-boot for the others. In this day and age, a developer should know all the popular OSes (Windows, OS X, Linux), including the mobile ones (Android and iOS).

A developer should know most of the popular programming languages and be able to make an application in any of them: C/C++, C#, Java, Python, JS/HTML5 and Php. It wouldn't hurt to also be knowledgeable about Ruby, Lua, Scala, Haskell, D, Obj-C, Shell and Perl. Of course, there are many others to list but really by having the above you would know a majority of different programming paradigms and styles. If you only know 1-3 languages and only use those for everything then there is absolutely no way you can consider yourself a good programmer. Yes, you should have 1-3 languages you are an 'expert' in, but knowing more languages means you better understand how to decompose problems into there obvious solutions. It also means you understand there is no silver bullet language which is the best for everything. A concept most developers seem to naively do without realizing it.

I could easily just keep going with this, maybe I'll do a part 2 in the future and talk about media players, anti-virus, browser, IDEs, text editors, mail clients, etc... I guess I never realized until now just how many applications and tools I use for various tasks. By no means is anything I mention the best, it is just currently the ones I like the most.

February 17, 2014

Libgdx 3D Particles

I recently found out about libgdx getting 3D particle support as well as dropping Android 1.5 support. First of all, Android 1.5 is a very limited version of Android so the idea of removing the dependency and moving to OpenGL ES 2.0 as the minimum should prove to be good for the library. The recent addition of 3D particles is pretty exciting as it will allow me to play around with it and get a feeling for it. However, I've been extremely busy and have no time for hobby related programming because of the demands other parts of my life are making. That just means I have something to look forward to playing with in the future :).

February 4, 2014

Xtend

It has been a while, but it is time for another post.

After my love/hate relationship with Scala went to a sour end I continued to work with Java and for the most part have quiet enjoyed working with tools and libraries which not only work as expected but pretty much always work as intended. Recently, I have been working on a compiler for a subset of Java as part of a project. It has been very interesting to see how its all done and even learning about compiler compilers and how to do the various types of parsing (LL(1), LR(0), SLR(1), LALR(1), etc...). All of a sudden in the middle of all this I had a brilliant idea, why don't I make a simple little compiler that takes some of the simple key features from Scala I like and make a language extension to Java!

No need for the more exotic features of Scala, a brand new exotic runtime library, or byte code generation. I would simply emit Java source files and not have to write as much boilerplate code! Some basic type inference using var/val, make default visibility public (because who really has a real-world use case for package private), I could also create extension methods (because they are totally awesome), add properties to Java or operators/overloading, etc. Like all the features Java *should* have but doesn't. My thinking is along the lines of the fact things like Coffeescript and Typescript exist for Javascript. Java can compile down to Javascript for the most part (GWT). Additionally, if I make it compile down to Java 5/6 it will then work with Android without any compatibility issues.

However, I decided maybe it would be easier if this was done with some light-weight macro system which would run before the Java compiler. I'm not talking about C-style pre-processor here, I'm talking about a type-aware first-class citizen macroing system that we use in the 21st century. I decided it was time to do some quick searching because there is no way I am the first or only person to think about this (how to get rid of all the boilerplate from Java). So after a few searches and a bunch of people on Stackoverflow explaining why macros are bad something popped up called Xtend.

What is Xtend? Well, the name is pretty much what you think it means. It is an extension for Java that is not meant to be a full-blown language replacement but something which compiles down to Java source and is then compiled as Java code. It doesn't try to do any of the other fancy stuff you find in other JVM languages, because the goal is to make it 100% interoperable with Java. It has the exact same type system as Java and provides pretty much every feature I mentioned above, PLUS more. Additionally, it is designed to work well with Java 8's new API meaning I won't have to worry about future compatibility. It also creates Java 5 compatible files which means Android compatible out of box. It does have its own library, but unlike the other JVM languages it is a lightweight wrapper to simply provide syntactic sugar instead of new classes/structures/etc. Why is this good? Well, I get to continue to use everything I know without having to worry about cross-language library annoyances.

The best part so far is the version 2.5.1 has top-notch Eclipse integration, it works as described and no surprises. Mind you they really need to make it easier to create Xtend files by right-clicking on a project (maybe some Xtend perspective?!?!). The lambda structure feels a bit funky as I haven't seen anything like it before. Then again, Clojure also has a slightly odd style but it isn't too strange. Method dispatch and guards are very handy (think Scala's match construct). Everything has a return value, which is very Scala-like. It has value classes, just like Scala's case classes. It removes the default fall through behavior of switch statements (which is honestly the worst and most pointless legacy thing in any modern programming language). I could just list the features it offers but that would continue to make this post more massive. The really nice part is the compiler hooks, and allowing people to easily extend Xtend. I'm almost tempted to say some of the Java 6 concurrency API should be integrated more tightly as a future feature of Xtend, but for the time being I'm glad to have found a wonderful tool which provides the exact solution I've been search for! The other thing I might start looking at is Xtext; however, that appears to fall more into the DSL territory I refuse to dirty my hands in.

Seriously though, why haven't I found this sooner!?