Main Categories: | Landscape | Fenceposts | Wildlife | Trees | Mushrooms | Art | Games || All Posts ||
for daily images, visit my ||Tumblr||
Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Friday, 29 August 2014

Caravan Defender

It's been a long time since my last successful game jam - that was the dotBrighton Game Jam in september 2012.

In the meantime I have tried to do Ludum Dare a few times, working at home, on my own, but I never get close to a finished product in the time allowed.

So it was great to sign up for Kiwijam 2014 - they set up a maker space in Auckland University and did a great job of organising stray individuals like me into teams ready to attempt the impossible - make a game in 48 hours!

Kiwijam maker space - humming with energy on Sunday afternoon, as the clock ticks down - will we get our games done?

My team decided to use Unity3d - such a good tool for rapid prototyping - and eventually we went with the idea of doing an RTS game about creating and defending caravan trade routes, and although we didn't have time for graphical niceties, or game structure, we did get the game engine functional within the time limit.

Screenshot from the version of Caravan Defenders presented at the end of Kiwijam.
I've published the game on itch.io for anyone who would like to mess around with the system. There is no way to win, unfortunately.

Click here to play!
 Enjoy!






Markov Text Generator

I wrote this simple Markov text generator last week - mostly as an exercise in getting to know the Dart programming language and tools.

The generator works by being presented with a body of text, and it goes through the text, recording statistically what letters tend to follow on from the various sequences of letters. Then it uses this data to generate more text using the same statistical probabilities for each letter sequence. See this wikipedia link for more details.

For such an inanely simple algorithm, it is capable of coming up with beguilingly complex results:

Seeded with a 234k chunk of The Lord of the Rings.

I'm scheming on how I might use it in computer games... NPC background chatter might be one use, or libraries full of books - you could insert useful text on a particular page, and have the players get a clue about what to look up in the book to get useful results, rather than just inane babble!

But text is only a sideline - Markov Chains might also be useful in ai routines, random level generators - anywhere where you want to approximate a complex system without modelling all the underlying processes.

Tuesday, 4 March 2014

Spirals

I wrote a while back about how elegant spirals can be in computer games - in particular, they are useful if you want to iteratively cover a space with evenly distributed points, with the range expanding out from a single starting location and with one growing tip - I have used them in the past for searching for a suitable placement point in a landscape for a game object, but I'm sure there are many other applications.


Anyway, I didn't include any code in that post, so here below is a Spiral function that is ready to use. This is written in C# for Unity, but should be easy enough to convert to whatever you happen to be using.

Vector3 Spiral( float dist, float spacing ) {
float rad = Mathf.Sqrt(  dist / (Mathf.PI*spacing ));
float angle = Mathf.PI * 2.0f * rad;
 
Vector3 retVal = Vector3.zero;
retVal.x = spacing * rad * Mathf.Sin( angle );
retVal.z = spacing * rad * Mathf.Cos( angle );
return retVal;
}



'dist' is the distance along the line of the spiral from the origin, and 'spacing' is how far apart you want the coils of the spiral to be from each other (this spiral has the handy attribute of maintaining a constant radial distance between each concentric coil.)

To achieve an even distribution of points, increment the distance param by the value of spacing - that way points will be equally distant form their neighbours on the line as they are from the neighbouring coils.

Here is a screen shot of the points generated by calling Spiral( dist, 1.0f ) with dist = [0,1,2,3...] As you can see, the unit spheres are packed pretty close to 1 unit apart:



Changing the spacing to 2.0f and iterating Spiral( dist, 2.0f) with  dist = [0,2,4,6,8...] will lead to each of the unit spheres having 1 unit's space between them:



...Spirals!



Wednesday, 21 December 2011

SantaTrackerHD

Just a quick plug for Santa Tracker HD one of Onteca's flagship Apps. For this year's version I was asked to do a flashy 3d globe which Santa zips around at several million miles an hour delivering presents.

The app also has sightings, and advent calendar, an entertaining blog written by Santa himself, and lots more. You can get it for iPhone/iPad from the App Store. Search for Onteca + Santa and you should find it no problem.

Tuesday, 8 February 2011

Chainsaw

I have written a small chainsaw simulation toy for iPhone and iPad!



It's available for free with adverts and 4 textures to cut up, or for 59p with no adverts and a broader selection of materials.

http://itunes.apple.com/app/a-chainsaw-lite/id414880605


A more generic power tools simulator is in the works.

Friday, 20 August 2010

Monsteca Corral

The Game Gods blog posts were all a by-product of an extended - and particularly fruitful - game development crunch period I went through last year.

The main product of all that crunching was, in fact, not a blog, but a Wiiware game - Monsteca Corral. After all the crunching, the game is now complete and ready to be unleashed upon the world!




If you are a Wii owning, Wii Shop Channel browsing kind of a gamer, you should definitely boot up your Wii and buy it right now!

One thing that you can't appreciate from the Youtube video, and I haven't yet seen mentioned in any of the reviews, is the fact that this game runs at a smooth 60fps. This does make a big difference to the play experience, but also to the level of detail we could put into the graphics, which are pretty plain compared to most modern Wii games.

I think it was the right choice for this game. With contemporary dev tools, and large development teams, it is VERY difficult to write a game that runs at full frame rate on a console. You are constantly having to cut back on visual flourishes, and withstand comparisons with other games that are using two or three times as much processing power per frame as your game can.

So, please enjoy the smoothness! and roll on Monsteca II ^_^

Friday, 28 August 2009

Spirals



It is amazing how little use is made of spirals in computer games, they are really useful shapes - they can iteratively cover a 2d surface from a starting point in all directions quite evenly while still only having one growing tip, and they have an intrinsic beauty that is all their own.

Friday, 26 June 2009

Argh! Trigonometry, Alison & Accident Book

Whenever you find yourself doing anything involved with trigonometry during the development of a 3d game, a little alarm bell should sound at the back of your mind - could you accomplish your aims more elegantly and efficiently by the application of a few vector cross and dot products? usually the answer is yes, and you should dump all those mouldy old atan2()s like a hot air balloon dropping sand bags.


Make sure your inappropriate over-reliance on trigonometry is properly recorded in the office accident book, and then move on. Don't look back - a nasty little trig fairy is lurking back there, just waiting for an opportunity to trepan your canoodle with a rusty old funnel-cap.