• Register

Born some months before the 80´s started, back in those days where C64 and Amiga ruled the world. After first gaming experiences with Atari, Gameboy and the almighty x286 i quickly began to learn programming. First in Basic, Turbo Pascal and a little C++, later i learned the fun and creative experience that GameEngines offered like the AdventureGameStudio or UDK. After some years of modding for several games like Neverwinter Nights, Mount and Blade i felt in love with Unity3D. Between all those i made a living as juggler and physical artist aswell as some short (but intense) career as musician in a experimental mediaval/folk band.

RSS My Blogs

The incredible power of procedural content generation

abhuva Blog

Its quite a while since my last post, and lots of stuff happened inbetween. We finally got accepted by a real publisher with our first game and now my team-mates take over with marketing etc.

While the first game was more a proof to ourselves that we are able to do a complete development cycle, beginning from scratch up to finalizing and publishing it - the second one is now getting into more interesting realms.
I was always quite fascinated from procedural content generation (PCG) in general, and some of the fruits of my early experiments are shown in some older posts at my wordpress blog.

The new project is making heavy use of some PCG techniques. Namely map generation and word/sentence generators. While both are often used and well known, i wanted to go a bit further and test out some ideas.
The main issue during out last game was that our Designer created game-content like texts and stats/balance - i had to hardcode them into the scripts. This was a bad aproach cause it basicly doubled the time needed for it.
Now i tried to develop some tools to outsource this data from the game. This not only allows for a quicked development but also makes the game moddable. I choosed XML for this, cause its rather easy to use complex data-structures with it, without the need to re-invent the wheel with developing our own data-formats (and scripting exporter/importer algorithms).

Now, you may wonder what this have to do with PCG.
Well, lets take as example the word/sentence Generator:

Word / Sentence Generator

Generators like that work quite simple. Lets say we want to come up with a bunch of names that all sound nordish. An easy way to do this is to analyze nordish names and get a list of syllables that make up those names.
A simple formula would be: Beginning syllable + middle syllable + ending syllable = name

Depending on the data for those syllables you can produce a large amount of names that all sound quite believable.

Alffdanr Jakobhjalsen, Aris Rasberg, Fenrir Sorenhauser, Svadildorr Leonbak, Gudnarr Leonhaugen, Sleipbrandr Herhjallum, Fentoppr Hagerickbak, Hallki Skjeggeardgen

A more complex example would be descriptions for items, or book-descriptions. Basicly you try to make up rules that tell how the sentence is made up of different pieces. In general its the same concept like with the names, just more complex.
After developing the base concepts of this generator i tested it with setting up a simple sentence for a book-review. The output is something like the following:

This roll published by Alfris Hauthonvik is muddled mostly due to uninspiring features.
This writing is totally senseless mostly due to the totally lack of content.
This writing from the known writer Eijotr Lundgen is very easy to understand despite the really great crafted content.
This atlas is reasonable clear thanks to the very great done organization.
This book is totally senseless.
This work written by the well known writer Hallfrodr Harbak is interesting.
This text from the writer Ganfari Sorenrickvik is hard to understand thanks to the totally uninspiring diagrams.
This book published by the unknown writer Favnir Anter is quite clear.

The quality of the sentences differs, sometimes its coming up with strange or amuzing curiositys, but in most cases it already giving pretty good results.

Now the great part about this is that both examples are done with the same generator. To be able to allow this i came up with a simply ruleset wich you describe in XMLs.

An example XML dataset looks like this:
(for some reasons, i cant post XML code blocks here, in case you want to see the full XML code you can read the original blogpost here: Abhuva.wordpress.com )

#DWARVNAME#
A,Ba,Bi,Bo,Bom,Da,Do,Du,Dwa,Fa,Fi,Fre,Fun,Ki,Lo,Na,O,Tel,Tho,Thra,:100 za,:10
bur,char,fur,ghal,in,li,lin,mil,ni,ri,rin,un,vi,:100

This ruleset have an ID wich is used to reference this specific rule (#DWARVNAME#), and it have a list of rules wich are basicly strings that hold a number of elements, each seperated by a commata.
Those strings get parsed by the engine to "deconstruct" the rules and get the seperated elements. I mainly did this to avoid unneccesary complex XML structures. The number at the end of each rule is describing the chance that this rule gets applied at all.
This simple trick already allows for quite some variations.

Instead of all the time having 3 syllables added together, its easy to describe a ruleset here wich often only uses 2 syllables, but sometimes uses 3.
The above ruleset could output names like:

Bomli, Thrazamil, Aghal etc...

Another quite important thing is the option to reference other rules in those elements. To seperate normal content and rule-references correctly i suspect that each rule-ID is beginning with a # sign.
The process of generating the final words/sentences is recursiv. It would be of course quite easy now to "script\" infinite loops". To avoid this i count the number of recursion steps the algorithm takes, and just break out if i get over a hardcoded limit.

The last thing i implemented for now is the option to save the output of a generator in a variable and be able to use that variable in the rules.

With this simple setup we are already able to make up quite some complex generators for different use. Some example:
(Again, this isnt the correct code as this sites dont let me post it, you can see the correct XML code on my blog if you are interested: Abhuva.wordpress.com )

#TEST1#

#DWARVNAME_FULL#,:100
!1,:100
#DWARVNAME_FULL#,:100
!2,:100
A ,:100 <!-- here we begin actually building the text -->
small ,ugly ,tiny ,crude ,greedy ,funny ,:50
dwarf ,guy ,person ,:100
called ,named ,known as ,with the name ,:100
?1,:100
met a , was a friend of , travelled together with ,:100
a person , someone ,a guy ,:100
called ,named ,known as ,with the name ,:100
?2,:100
. ,:100;

The special new functionality here is the command !1 and ?1, wich basicly saves and loads into the variable slot 1. Currently i am providing 20 slots wich should be more than enough for quite some complex setups. They can be also used to pass things from within the game, so it would be quite easy to construct sentences that mention the name of the player for example.
The above example isnt the complete ruleset, i am calling the ruleset #DWARVNAME_FULL#, saving the output in slot1, calling it again (and getting another result), saving that in slot2, after this basic setup i begin to construct the simple sentence. This is just an example i wrote for our game-designer to show off how all elements are working together - its not used in the actual game.
With this simple tool, the players could mod their own name-variants, item-descriptions and so on. At the moment its more a proof of concept and still in early experimentation phase, so we havent decided how its actually linked to the game and how much freedom we give to players in respect to modding.

Well, enough text for today, stay tuned for more insights into our use of PCG techniques for our new game.
Feel free to visit our company´s site for news : www.zatobo.com
or check out our first game : Indiedb.com

Infinite Terrain - a first prototype

abhuva Blog

I just started to research and experiment for our next project.
Our game-designer insisted that all the action shall take place in an infinite and seamless 3D world - well, thats something that can bring nightmares to poor programmers like me when you hear it.

After some tests with a more traditional tile-based system (pre-constructed 3D meshes) i came up with the following idea:

Lets imagine a 4x4 grid of terrain pieces. Each terrain will be defined by a heightmap, a splatmap and some detail maps wich describe where foliage is placed. Nothing new so far, just a simple terrain system.
The heightmap will be calculated from a rather simple Perlin Noise script and textured based on height and slope of the resulting terrain.

Now we are developing in Unity3D and also with the free Indie-version - this means not really much graphical highlights out of the box, and to be honest - the terrain system itself is a bit outdated too. Tough the community is constantly trying to push those boundaries, and cause of this (and countless hours of research) i found some nice improvements like for example some shader replacements wich enabled the use of normal maps on the terrain.

I took some screenshots from the first tests:
Nearly everything in there is procedurally computed at runtime.
The heightmap and texture distribution on the terrain aswell as the skybox ( with animated clouds ).
Just cause it adds to the beauty i also used a water-shader i already improved during the development of our first game and some lens-flares (i know, totally unrealistic and over-used, but it just looks pretty =P )

First Procedural Terrain Tests

First Procedural Terrain Tests

I am quite proud how it turned out... Keep in mind this is just a couple of days work (and most of the time research on different terrain generation techniques and failed experiments).

You can already walk endless in any direction ( currently some lag occurs while calculating the new terrains but i am quite sure that this can be solved, i am quite new to the concept of co-routines but so far the lag is already acceptable).

The game itself isnt even announced yet in any form, so i cant talk about what the player will do in there. But the framework i am building right now will enable player-generated worlds ( you set the world on a macro scale, micro scale will get generated automatically).

Well, hope you enjoyed the pics as much as i do rigth now...

Open Source Installer and Patch Solutions

abhuva Blog

Development on Vinland: Arctic Assault reached a stage where i actually had to think about stuff like Installers and Patching Solutions.
After researching i realized that there is a great piece of Open Source Software that fulfills all those roles called NSIS (Nullsoft scriptable install system).
I had used this a while ago for my mod project, but never dived deeper into its scripting system.

So what does this offer now?
Well NSIS itself lets you script an installer system that looks and performs like the usual windows installer routines you are used to. Its very flexible in the way it handle things.
But the true power comes with plugins.

One of those plugins is called VPATCH -> this basicly checks for the difference between 2 files and outputs a patch file wich only contains those difference and is therefor much smaller in size.
This plugin gets expanded by a software called nsispatchgen wich uses this plugin to recursively go through a directory (including subdirectorys) and compares with another set. It puts out a complete structure of files and directorys that you can use to patch as well as a basic script wich you can use to build your Patching Installer in NSIS.

It wasnt easy to get it running first, while there is quite some documentation available it defintly lacks the easy-to-use way of paid-solutions.
But after having it set-up it works like a charm.

Installer VAAInstaller VAA

The installer itself is creating Startup menu entries, building an Uninstaller.exe and including the installed software into the registry aswell as connecting it with windows install/uninstall functionality.
The patches only contains a small fraction of the data now, so the players dont need to download the whole game data anymore, so its way faster and cheaper on bandwith.
All this gets presented with a nice and clean looking GUI - what much can an indie-developer ask for.

In case you are now interested and didnt heard about this before, check those software out :
Nsis.sourceforge.net
Nsis.sourceforge.net
Sourceforge.net

First Steps

abhuva Blog

While my original blog at www.abhuva.wordpress.com turned into some kind of Portfolio over the last months - and cause i see myself now nearly daily visiting this site, i thought - well, i could just get my stuff together and move over to here to just randomly blog around...

The last month got me some steps closer to a goal i was hoping (and working) for over the last years -> getting a foot into game development.
While my first steps was rather unsuccessfull, my first selfmade game "Marble Runner" got me like 30 cent overall during the last 7 months, i didnt gave up and concentrated on some mods for the game "Mount & Blade" ...
The work i did there (the mod "Scaedumar" was rather sucessfull, got nice feedback and i even got asked to publish it on Desura) lead to the invite to a really great modding team working on one of the biggest mods for Mount&Blade called "Prophesy of Pendor".

During the half year i worked like crazy for them (developing some rather unique features scripting wise, as well as building some of the best scenes i ever made for this game) i also found that the Lead-Designer of that mod and I had very similar concepts, ideas and could work more than well together.

During December last year he talked to me about a serious project he wanted to start - an independent gaming company.
Now this was what i was hoping for the last years - to get enough reputation from my work to meet some people who would share the same dream and take the risk and just grab for the stars...

Seems the first steps are made now, a company got founded wich holds now 3 members (our Game Designer and writing genius, a business guy who is mainly responsible to take care that all financial stuff and paperwork dont hinder our way to victory, and me - being currently a jack of all trades regarding programming, modelling, texturing - well mostly everything to get the games running)

This is also a lesson i learned from my first tries with commercial games - the urgent need for people that can do marketing, community talking and overall business - cause honestly i suck at all of them...

Its a first step into a hopefully brighter future =)