Sunday, 31 March 2013

Unity - Conway's Game of Life

Hey everyone. So instead of working on my coursework, I decided instead to recreate Conway's Game of Life. Now I know I could have used DirectX or some other render framework to create this, but instead I was working in Unity at the time so I chose to use that. If you'd like to play the game go ahead, read on for some more information about the project.

For those who don't know, Conway's Game of Life is a so called 'Zero-player game' the purpose of which is for the user to devise a starting state and watch it grow. To allow this to happen there are a few rules that are specified to allow the system to progress. Firstly there are two states which each cell has, namely Dead or Alive. Each cell has 8 neighbouring cells and after each time step or generation the following rules are applied:


  1. Any live cell with fewer than two live neighbours dies, as if caused by under-population.
  2. Any live cell with two or three live neighbours lives on to the next generation.
  3. Any live cell with more than three live neighbours dies, as if by overcrowding.
  4. Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
Although basic, these rules lead to some very interesting patterns. For example, one of my favourites, the 'beehive'.
The Beehive
Classed as a still life and one of the more common of the randomly occurring patterns. Although if you add a life to one of the corners it will result in four more beehives.

An interesting pattern
Now if you do the same for each of these four, like this: 



 This results in a really cool explosion type system that last for quite a few generations. A so called "Methuselah".
Wacky patterns!
After a few hundred generations, this system eventually results in 8 gliders and stabalises.

System begins stablising, note the 8 gliders.

There are an infinite variation of patterns, new and interesting ones are discovered all the time. The system has got to the stage where automated processes are used to try to discover new patterns.

If you'd like to give it a shot, play the version I made here on my blog. It's still a bit buggy and requires some new features which I will get around to implementing when I have a chance but it has the full functionality of the game. 

Anyways, enjoy and please tell me what you think! Until next time.


Email : markmmiller@hotmail.co.uk
Xbox Live : Dr Death MK 2
Steam : 7thsanctum

Saturday, 30 March 2013

DirectX - Particle System

Made some changes and upgraded my particle system. Finally set it up so it works on the geometry shader which has improved performance by quite a lot. I get around 680 fps with around 80,000 particles.

Looks almost like snow!

The main problem I'm having currently is separating the emission rate from the frame rate, just now every frame it emits a new particle so it does this as fast as it can. This means that when the frame rate drops the number of particles emitted per second will be less.

Spiral particles

Currently my goal is to fix this, I've already got it generating 10 times as many points but there are some problems with actually getting them all to render in the same pass. Other than that, hopefully I will get finished up this week then can do some data analysis next week, comparing this system against the older CPU based one.

Still gets 680 fps with most of them visible


Email : markmmiller@hotmail.co.uk
Xbox Live : Dr Death MK 2
Steam : 7thsanctum

Saturday, 23 March 2013

Gaming Discussion - The Free-To-Play Model

Free-to-play mobile games are pretty rubbish. Here is why.

Recently, even more so than in the past. The free-to-play model for video games has become an increasingly popular method of marketing your game. In today's economic climate, why would you drop £40 on a so called 'AAA' title when it is just a rehash of previous game ideas or another sequel in a never ending saga.

You can have any character you want as long as he's brown haired and in his thirties

Originally the popularity of the free-to-play was due to several Massively Multiplayer Online Roleplaying Games (MMORPG), such as Neopets and Maplestory as well as their ease of access. Practically anyone with a computer could play. Things got even better for free-to-play with the creation of Runescape by Jagex, a web based RPG with great graphics and sound gameplay. These games are still amongst the most widely played of the free-to-play games out there, and what they lack in sheer graphical fidelity and immersion that mainstream 'AAA' titles might have they make up for it in being wide reaching, affordable and not requiring advanced technology to run them.

It was no surprise then that the mobile gaming platforms of iOS and Android lapped up this model and soon a whole host of developers churned out so called "free-to-play" games like there was no tomorrow. This has led to a mass of games which are all identical in but name and graphical style. How naive was I to think that Jurassic Park Builder, The Simpsons : Tapped Out and Tiny Tower would have anything but identical gameplay. (I would mention many others as well but sadly I have no space here to list them all) They all follow the same format of building things, early on they emphasise the fact everything you do takes time (real time) and that you can speed things up with the use of money (real money). This inherently has nothing wrong with it, if your user is impatient why not give them the option to speed things up a little bit? That itself is fine, but when it gets to the point that a game is pretty much unplayable because you are sitting and waiting for the game to let you play then I think it is unreasonable. I got to a stage where the time it took to build a new floor was something along the lines of two real life days (48 hours), there is nothing else to do in that game other than collect rent and change the uniforms of your staff. There are no tactics, no thought. Nothing that can go wrong other than your lack of efficiency. It's matter of order building, collect money and then wait. Rinse, cycle and repeat. This can be said for every single of those games in those formats and is what I call preventative gameplay. Where a game actively tries to stop you from playing.

Another notable example is CSR Racing, a game in which you participate in drag races against other AI controlled cars. Each race requires a certain amount of fuel and you start off with around 10 units of fuel. Each race results in credits which you can then spend upgrading and buying new cars so that you can win bigger and better races, thus rewarding you with more credits. The main gripe I have with this game is the 10 units of fuel limit and the inability to just play races for the fun of it. If I use up all my fuel I have to pay real money to restock or wait through the timer. It's not like I can even play skirmish races that don't result in extra money but allow me to hone my skills. Of course, developers have to recoup their costs somewhere but I don't think it's fair for a game to advertise itself as free-to-play when in reality it's free-to-play (for a bit). It's not impossible to take this model and make it work.

Look at all those races I can't play 
Take for example World Of Tanks, a free-to-play tanks battling game much in the same way as CSR Racing has cars in it's garage you are instead filling up your garage with tanks. The main notable difference I find with World Of Tanks is that it does not restrict you from playing the game. At no point does it actively stop you from playing and ask you for money. Each tank battle nets you credits and before you head out into the next battle you need to repair and rearm your tank with credits. The amount you earn from a battle, even if you lost is usually more than enough to recoup the costs. I'm pretty rubbish and my tank finances are still in the black. Now is this model so hard to do? One of the incentives that the wargaming.net team always said was paying allows you to progress faster through the game. Double XP/Credits plus rarer tanks (which don't necessarily mean superior). Even other mobile games like Zombie Gunship don't stop you from playing just to ask for money. 

Not a single fuel indicator in site

There are many notable games out there that follow this free-to-play model that I would be more than willing to invest money into and have already done so in the past. Games such as Hawken, Age of Empires Online, Planetside 2, World of Tanks and Firefall stand at the forefront of my mind. Even notable games such as APB and Star Wars : The Old Republic switched from being subscription based to the free-to-play model and have been just as successful if not more so than in the past.

I think showing the player what they could get for subscribing but not forcing them too is always good.

The thing to note is all these games I have mentioned are PC games. Even Runescape and MapleStory are PC based games. Where are all the mobile games? Who knows my friend. Currently on my mobile device I have these free-to-play games; Zombie Gunship, Curiosity, Jurassic Park Builder, Showdown, Checkers and Wordament. Of all the games in this lot the only one I would put money towards are Checkers and Wordament and for those two I can't even work out how.

Do I think free-to-play is bad? Of course not, just certain ways companies and marketers push it out there harm it's effectiveness, sometimes even to the detriment of the game itself. This is what I think needs to change in free-to-play mobile games.




Email : markmmiller@hotmail.co.uk
Xbox Live : Dr Death MK 2
Steam : 7thsanctum

Thursday, 14 March 2013

Unity - Trail Renderer (with colliders)

Hey guys, just a quick post to show what I'm working on just now. I really ought to be doing some coursework but that's just no fun sometimes. 

So I was poking about in Unity and noticed that they have something called the Trail Renderer which acts like a particle effect that is produced as an object moves and leaves behind a trail. Simple stuff eh?

More info can be found in the Unity Documentation.

So after reading about this and trying it out with just basic colours my first thought was Tron! This inspired me to try and recreate the famous light bike scene from both the original and the recent sequel. Sadly though the light trails have no native colliders which made things a tiny bit more difficult. Instead of just leaving it at that I started adding in box colliders so that collisions with the light trail can be made easier.

Figure 1. Light Trail with Colliders
 As you can see, I'm currently finding it difficult to match up the length of the trail to the length of the trail of box colliders! Currently I have a few ideas how to match it up which I have yet to implement but another easier solution would be to just get rid of the light trail entirely and replace the code I have with textured boxes. I've yet to decide which technique will be better for this.

Figure2 . Close up of the trails Colliders still need resizing.
Anyways it's still a work in progress so I'll post updates when I can. You can find the latest version of this prototype on my Unity blog.

Also check out the following video which inspired me to make this :




Email : markmmiller@hotmail.co.uk
Xbox Live : Dr Death MK 2
Steam : 7thsanctum

Sunday, 10 March 2013

DirectX - Particle System

Currently working on particle systems and creating fire with smoke effects in DirectX 11. Things are coming along slowly but looking good so far.


I still need to implement fire as well as porting this to the geometry shader.

Check out this video for it in action.


Make sure to check out my OpenGL coursework from last year and stay tuned for more unity updates. I've also uploaded a new idea I'm working on in Unity to the Unity dev blog so check that out too!



Email : markmmiller@hotmail.co.uk
Xbox Live : Dr Death MK 2
Steam : 7thsanctum

Friday, 1 March 2013

SIE App Jam Day - Super Trolley 2

On the 27th of February I participated in the very first App Jam hosted by the Scottish Institute for Enterprise at Napier Univeristy. The task was to make an application for mobile devices in less than 9 hours.

I decided to make a game in which you had to run around a supermarket and try to cram as much stuff into your trolley as you could within a certain time frame. (If you've ever seen Supermarket Sweep you will understand where the inspiration comes from)

I developed the game in Unity3D with the aim to get the core gameplay elements in and then port to Android. Since I didn't have much time I avoided spending too much time in sourcing or creating assets, instead finding the main items free online. I figured getting the game playing well was most important.

Figure 1. The Player's Character.
After setting up the scene and setting up a system for spawning different items along the shelves I had to create the player. My original plan was to have the player attached to the trolley via their hands, left clicking with the mouse would lift up the left arm and right clicking the right arm. This would mean that the player had to maintain control over the trolley whilst trying to swipe as much stuff off of the shelves as possible. Sadly though I couldn't get the arms acting the way I wanted in the time I had so I instead opted to attach the player to the trolley through the use of a spring and have the arms fixed in place, extended.

Figure 2. The player after collecting lots of items
After trying to get the arms working which was my main goal, I realised I'd spent too long on this part which meant other parts of the project suffered. I finally added in a method of counting up the players score and measuring time. The game so far includes 2 items but adding more won't be too difficult.

I have many places I wish to improve this game, people at the Jam seemed to enjoy the parts they played despite numerous glitches so I will work on this some more when I get a chance to. Hopefully with more time I will be able to get the arms working!

Anyways that's enough from me, I haven't slept enough over the past few days so I better catch up this weekend. See you guys next time. 

Oh and here is a quick gameplay video where you can see how it works as well as numerous problems, I will upload a version for webplayer soon when I get some of the problems fixed.


Also thank you to Darren Whigham for organising this event check out his twitter here for some cool game development stuff. Thank you also to SIE as well as Informatics Ventures and Codeplay for attending.