Monday, 30 April 2012

Group VS Induhviduals

It's been slow progress on the simulation game as I've been busy releasing a free game for Android called Gravity Pong which you should all go download now, as this makes me happy (Currently at 6 downloads and $0.05 income from AdMob).

I've also been putting some time into my next mobile game, which will be a snowboarding game built on the Box2D framework (which I'm accessing through the useful Libgdx framework).


It's very much in the beginning phase but I've been enjoying working on the pixel art.

As I've been away from my computer I've been forced to think about programming, as opposed to just blindly forging ahead. This has lead me towards some changes in my approach.

Groups Versus Individuals

Currently in my simulation game every entity is treated individually. It searches the area around itself and makes decisions based on what's there (not through a very complicated decision making process though!) A wolf may have a pack which it is connected with, but it's main goals are always what it comes up with.

I was thinking this way because I want my game to have that individual feel to it, where characters pick their next move based on how they feel, rather than just being a small part of a larger machine.

However this leads to very inefficient programming as each entity covers the same ground with its searches.

Take for example the concept of a herd of deer grazing in a clearing when a wolf approaches.

Relatively simple in concept but harder in process.

If I treat every deer seperately I have to check each of them to see if they notice the wolf, or if they're too busy eating, then check to see if they notice other deer running away etc. As each deer checks these facts they cover a lot of the same area and repeat a lot of the same checks.

What I am considering changing it to is to have groups, and I update a group which then updates it's members making it simpler to share information.

I can then check for a predator overall, then figure out who notices using only one instance of all the data.

If ideally implemented the behaviour shouldn't differ from when they are behaving entirely autonomously but will be a lot faster and simpler to implement. It also lends itself quite easily to having a leader in charge, whether an alpha male or a human with leadership skills which is something I'm looking forward to implementing.

It also makes more sense having a pack know it's den rather than having each wolf have a link to the den etc
It keeps things more compartmental, and more easily changed later.

Obviously this is a somewhat forced instance but it helps explain how I'm feeling currently about implementing this.

Thursday, 19 April 2012

Gravity Bounce

My new game for Android, free to play!

Gravity Bounce!


 It's not the most complicated game currently (duh! It's 'a simple game where you hit a ball back and forth').

I am looking forward to improving it with feedback though, so please do post and give your thoughts and complaints.

Friday, 6 April 2012

World Generation

I got bored with working in a big square so I've now added fairly basic world generation.

I've done this using Perlin noise, which I've implemented using a mix of code from several locations but mainly:
http://www.koders.com/java/fid4C0DF87533C6764D9A354792A97F7C75A11BE8CD.aspx?s=Fog

and the Simplex Noise paper by Stefan Gustavson.

I got the links from Stack Overflow where I've also posted my first question and got the scholar and student badges :P

So I could view the world gen I added a map view, where each tile is represented by one pixel of that colour.



It's not the most efficient but it works well enough.

The downside of having the map drawn is I'm not having to deal with updating the whole thing at once which is leading my down the optimisation route. I find that reasonably fun though.

I have added a rudimentary human, but he doesn't do much, I need to start working on user stories (something I've always disdained in the past) but they seem like a good idea for this sort of thing, because the scope is so large.

Here's a screen with creatures enabled: All the white spots are Deer, red are dead Deer...


Apparently I need to tweak their breeding now they have room and a tendency to spread!

How do you think gameplay should go?

Currently I'm planning on controlling being somewhere between Age of Empires, Dwarf Fortress and Sims. Where you say something needs to be done, but you don't give particular commands to particular units. We'll see!

Hopefully I'll get some form of interaction going soon, then I can post a version on my website for people to try and give feedback.