Thursday, April 27, 2006

Adventure Game Design Patterns


What we call chaos is just patterns we haven't recognized. What we call random is just patterns we can't decipher.
- C.Palahniuk


How about an abstract approach to adventure game design? Or at least an abstract approach to creating puzzles in adventure games - that could be useful!

The General Pattern That Adventure Games Take

Here is the general format adventure usually present:

An objective is given or hinted at.
become a ninja, save the world, rescue a girl, save a kingdom, get that guys hat ...

The objective not immediately obtainable.

Attempting to achieve objective will explain why it's currently not achievable.
the ninja master lives in Japan and you live in Australia, you don't know who bought the nuclear weapons, there's a big forest infront of the tower where the girls imprisoned, the guy with the hat has a big dog ...


The objective then splits into sub-objectives, each of those may split into sub-objectives and at the finest granularity are the puzzles. The puzzles are interesting because they're more broadly applicable to gaming as a whole.

Puzzles



Let's break down adventure game puzzle into pieces and then we can catergorise these pieces and use them as building blocks for new puzzles. Most of my examples will be culled from Monkey Island One. If you've not played it, then beware of spoilers.

We can describe puzzles using the notation below:

PROBLEM → SOLUTION.


Here's our first example puzzle to break down, it's one of the puzzles from Monkey Island 1.


One of the early puzzles from Monkey Island 1

Problem: You can't get into the kitchen because the cook always stops you.
Solution: Wait until the cook is serving the pirates food, then go to the kitchen.

We only want a rough mechanically idea of what's going on so we might formalize this as

Problem: Guardian 
Solution: Temporal

The problem is described as Guardian, to mean some entity prevent you from taking a certain action.
The solution Temporal means you must do some action at a given time - maybe at night, or on tuesday or when someone is distracted.


You can probably think of several puzzles that could fit into the above slots, and that's why I think looking at these puzzles is a good idea. We could expand the above formalization to dictate what's being guarded:

Problem: Guardian(location) 
Solution: Temporal

Let's move on to a list problem types and solution types that I've identifed. Then we can go through some examples of how to use them.

Problems



Problems can be a little fuzzy in their boundaries.

Guardian
There is a FOO stopping you from doing something, it may block a location, it may be guarding an item, or an NPC.

Typical Example: The bridge troll guarding a bridge.
Non-Typical Expample: Bad breath guarding an NPC - you won't talk to him with bad breathe.

Want FOO
Your character wants or needs something but cannot directly get it. This maybe knowledge, money, training, ...

Typical Example: The sword costs 300 gold.

Key Request
To proceed the character must have a certain item. The character might need a password, to be part of certain group, to have certain clothes, ...

Typical Example: A locked door that requires a key.

Temporal Item
An item that you need to use keeps dissapearing before you can use it. Maybe you need a gold key to open a door in the thieves market - but it's always stolen when you get to the door, or you need to transport acid but it dissolves the container.

Typical Example: ?

Hidden FOO
This is a problem the player might be unaware of and it's potentially a very hard problem. There's an item, destination or NPC that the player needs but it's somehow hidden. A file in a cake, tree house city up a tree trunk, secret passage, long lost master trainer... you might need a microscope, telescope or something that allows you to see the hidden thing, or you might need to pick up or move a concealing object.

Typical Example: File in a cake.

FOO out of reach
You can see, smell, hear, see evidence or have been told of FOO but you can't physically get it. This is closely related to want FOO. Maybe it's too high up, or maybe you can't catch it. Think a mouse, or a parachute in a tree, or a treasure chest deep under water, a monkey with a gold ring, a lost city, an island, the moon.

Typical Example: A box on a top shelf that you can't reach. The fabled city of gold.

Trapped
You character is in someway trapped and needs to escape, perhaps locked in a room, a cement block on their feet and sinking underwater, tied up and all the variations on the theme.

Typical Example: Thrown into prison.

Approaching Danger

If you stay where you are and do nothing you will die (or similar). Think of an oncoming flood, you're underwater and going to drown, there's a biker gang approaching, the police are coming for you, there's an evil alien after you, the ground is crumbling, the bombs going to go off, angry bears, BEES! (Can sometimes be similar to trapped.)

Solutions



A problem may have more that one solution or a combination of solution pieces.

New Item Perception
An item must be seen in a new light, that pot could be helmet, the bat could be boomerang, this is something the user has to understand in their head, or it be required that the character formally understands this knowledge. For instance you may need to look at the bat, then the character might say "Hey looks a bit like a boomerang" then the game will promptly rename it baaterang and you will now be able to use it as different item.

Typical Example: Water as a mirror, Paper clip as lock pick.

Combine Items
You need to combine, two, usually inventory, items to produce a more useful item. Poison and meat creates drugged meat, cat hair and glue creates fake side burns, gold foil and a toy badge creates a police badge ...

Typical Example: Poison and meat to create drugged meat.

Trial and Error
Generally something to be avoided but can be an amusing distraction. What's the correct offering to hillside tribe, how should a certain machine be adjusted or put together, what order should three levers be pressed in, how should a conversation tree be navigated.

Typical Example: Pull three levers in the correct order to open the door.

Obvious Item Use
Using an item straight forwardly on something other object, or performing a straight forward action to an object. A key on a door, the fish with the troll that wants fish, the money with the shopkeeper.

Typical Example: Give money to the shopkeeper.

Change Item State
Very closely related to obvious item use but specifically items that will change the current item - eating a cake, smashing a glass, burning wood to get charcoal, cooking raw meat, opening the box...

Typical Example: Eating a cake to get a file. Opening a container

Temporal
Warning this can be a very difficult solution, you must do a certain action at a certain time - enter the kitchen when the chef isn't looking, scarifice the virgin when there's full moon, spit when the winds blowing with you, throw the bomb when the gas fire goes out ... at all other times the action will fail.

Typical Example: Enter a room when the room owners isn't there or is distracted.

Monkey See Monkey Do
This is quite a general meaning - you might see a NPC give a password, well then you follow his lead and say the same word, or you might see him do a combination, or you might physically follow him down the streets to see where he goes.

Typical Example: Follow the NPC to his secret place / treasure.

Repitition
Do the same action more than once, it won't succeed on the first action but will succeed on a subsequent repition. For example a wooden door kicking it once may do nothing, the second time you kick it it might break, you might have to ask an NPC about something twice to show that you're really interested. These solutions can also be quite difficult.

Typical Example: Breaking something, smashing a bar window with a hammer for instance, chopping down a tree with a saw.

Spatial
Can be even more difficult than temporal. An action will only succeed if the character is in a certain place, avoid the patrol by standing in the shadows, shoot the apple by standing on the hillock, be behind the man when you hit him with the bat ...

Typical Example: Hiding in the shadows so you can't be seen.

Bait Item Use

Different than obvious item use. With obvious item use we give the fish-wanting-troll the fish. With bait item use we throw the fish in the river and the troll jumps in after it. We "bait" the river. Bait Item Use, indirectly solves the problem - something nearby is interacted with in the hopes it will distract or remove the problem. Throwing a rabid chipmunk into a chefs kitchen so you can steal his wash cloth, putting cheese in a mouse trap, putting an attractive women across the road to make a bouncer move away from a door.

Typical Example: Cheese in a mouse trap to catch a mouse you cannot directly catch.

Real World Knowledge

The puzzle requires some aspect of real world knowledge. This includes nearly every puzzle but this pattern highlights a puzzle where it's especially true. Formulating a chemical compound, using magnets to move metal objects, knowing the to syphon petrol you usually start by sucking the pipe with your mouth, that a strong magnet will wipe a video cassette, that salt wards off evil ...

If the knowledge required is too obscure it may make the game very hard.

Typical Example: Balloons are often filled with helium, helium is lighter than air, helium can change your voice.

Sabotage (high level)

Stop something working, prevent something from happening, if you want to get a better job in a company you might sabotage the competition using laxatives in there drink, talking to them, distracting them with a light, you could remove a cars spark plugs, put a penny on train tracks ...

Typical Example: A spanner between two cogs.

Common Puzzles



The Trade



Trade is a resticted version of:

Want Foo -> Simple Item Use

It's only where to get something you must give something first, so it's more commonly.

Want Foo -> Simple Item Use (give)

You want the magic axe but the warrior wants a replacement weapon before he'll hand it over. This is the nornal trade puzzle. It's not really a trade puzzle if you can hit him on the head with a spade and then take the axe which is what the unrestricted Want Foo -> Simple Item Use would allow. Unless you say you were trading a blow on the head with a shovel for an axe ... but I think the warrior may want to dispute that.

Need To Travel

A special case of FOO out of reach, where FOO is a location. Think Monkey Island in the secret of Monkey Island. Or the secret herb patch in a forest.

FOO out of reach(location)

The solution maybe be a long series of puzzles.

Some notes about the above catergories



All catergories are human invention and exist only in our heads. Few catergory systems are perfect. Some puzzles are better and more satisfying than others. The main problem with this is that it does not differenciate between good puzzles and lack luster ones. So with that said there are a few I'd like to focus on here:

I think in Monkey Island 2 you had to close an open door to find something on the back of it. At the time an extremely tricky puzzle because it's an easily overlooked thing.

The same kind of thing with picking up an item that you would imagine to be unpickupable such as a poster on a board of other posters. The poster might be useful in itself or reveal a hole or a different poster.

It's worth noting this list doesn't say much about fashioning a good game either. For instance in monkey island one there's some great foreshadowing where you get money from the circus for being fired out of a canon with a pot on your head, then later you fire yourself out of a canon with a pot on your head to get to Monkey Island.

Big Example List



These examples are culled from Monkey Island 1, if you haven't played the game yet I advise you miss this section out.

Release the prisoner - Monkey Island 1

The prisoner is stuck in his cell. Grog will dissolve the bars lock, unfortunately it also dissolves the cup. To solve this problem you must keep transfering the grog from cup to cup.
Problem: Temporal Object 
Solution: Repetition, Combine Items

You must repeatedly transfer the grog from cup to cup.

Canon Job - Monkey Island 1

You wish to get fired from a canon for money but your potential employers are unwilling to fire you without a helmet. You give them them a cooking pot and they agree to fire you.

Problem: Key Request
Solution: New Item Perception, Obvious Item Use


Guardian Dogs - Monkey Island 1

There are dangerous dogs blocking your path.

You must realize a petal causes sleep, then you must combine the petal with meat then you must give the drugged meat to the dogs.

Problem: Guardian
Solution: New Item Perception, Combine Items, Obvious Item Use


Getting a birds fish - Monkey Island 1

A bird is eating a fish on the dock. You want the fish but everytime you approach it flies away with the fish. If you stand in a certain place, a board rises and hits the bird knocking it away - leaving the fish for you.

Problem: Guardian
Solution: Spatial Location


Swordsman Training - Monkey Island 1

You want the swordsman to train you but he won't do it unless you have a sword and give him money. Once you have the sword you must show him and once you have the gold you must give it him.

Problem: Want FOO
Solution: Obvious Item Use (gold), Obvious Item Use (sword)


Trapped - Full Throttle

At the start of the game you're trapped in a dumpster.

Problem: Trapped

If you punch the hatch it will open, freeing you.

Solution: Obvious Interaction.

Want To Enter A Trailer - Full Throttle

You want to enter a trailer, there's a door and a man stopping you, he won't let you in.

Problem: Guardian

If you kick the door when he's talking you'll kick the door down and flatten the guy in the trailer.

Solution: Temporal + Obvious Item Interaction

Dog Guarding the Junk Yard - Full Throttle

Everytime you go to pick up something the dog stops you.

Problem: Guardian

To get rid of the dog you have to remove by throwing meat in a car, the lifting the car with a magnetic crane.

Solution: Bait Item Use, Real World Knowledge(magnetic cranes are for moving cars) + Obivious Item Use(crane)

You can't get into a Locked Room - Full Throttle

You cannot seem to get into a locked room. You may not know, though you may guess, that this is because an item is hidden from you.

Problem: Hidden FOO

The solution is to move a pillow and find a crowbar, for now I'm putting this as obvious item use though I might change it.

Solution: Real World Knowledge(people put things under their pillows), Obvious Item Use(move, pillow)

Final Thoughts



Spatial, Temporal and World Knowledge are best used as modifiers on the other solutions.

I think the list is quite interesting and if you think you've can regcognize anything similar I'd be interested to here. I intend to go through a few adventure games and see what I can find.

*I changed simple item interaction to obvious item interaction to reduce the scope. Some of the examples now read a bit weird.

Notable abscences are timed problems also I found it hard to categorize the sword fighting and insult collecting with pirates and then later using those collected insults in a new situation with the swordmaster.

PuzzleFamiliar



Here's a program that will create puzzles patterns for you to fill out. All the patterns are documented there too.

PuzzleFamiliar.zip

You'll need the .net runtime. Though it's quite likely you already have it.

Next stop is LUNCHVILLE because all this stealin' made me hungry!

Today I did something fairly interesting that I've been meaning to for a while.

What are puzzles? Can they be defined and are they made of rules underneath that we can reuse?

Big questions, a little too big to work on at school, when I'm being busy drinking coffee. Anyway I always thought it would be interesting to take an adventure game and see if it's puzzles could be broken down and classified. So I did it with Monkey Island 1. See the next post, I don't want to dirty my classification with normal day to day ranting.

EINFALL going slowly - there may be screens shots this weekend. Tentative. I'm busy friday night, all day saturday and saturday night probably busy sunday morning. But hey after that well I might get some work done. I also entered a dig dug competition which hasn't got further than blitting a bitmap to the screen.

I think I made an interesting post over here.
Also I've been reading up on some game design patterns (see my bookmarks) and I think I have a few interesting things to say but not quite yet. Next up Adventure Game Patterns.

Saturday, April 22, 2006

We can own movies on tape, here we are in the 90s.

Recently I've been fiddling with wordpress on my local machine and I've finally managed to approach exactly what I want, so I'm quite happy about that. If only blogger was as configurable - I wish they had code tags for formatting code ...

Also I finally got emacs working with ruby - it seems I'm stupid and downloaded a old version. I've also got predictive text working now too, well buffer searching predictive text anyway. So I've downloaded Ruby SDL but I haven't touched it yet.

Anyway how about EINFALL. Well cities require at least two texture sets - the city textures and the underlying plains, mountains whatever land texture set. I've always known this but when I was designing the map - getting it to work was foremost on my mind. So I only have one slot for a texture set and a helpful note saying this should be an array or similar.

Fine so that needs some modification. Also my skills have improved or my programming humbleness has increased. I can see the tile class kind of sucks and there's too much crap it in. So I want to make a much lighter one, that has the added benefit of allowing me to optimize rendering even more if I so wish (ordering tiles in texture sets and pipeline voodoo that I'm not really familiar with).

My map class it's the worse class I've got, apart from maybe the stupid singleton engine class I made. It's a messy class and it's hard to change because it has a messy interface.

Why does it have a messy interface? Well my game stream maps from the harddisk and while the maps being streamed - there needs to be a placeholder. So the placeholder and the actual tile map inherit for a stupidly complicated interface. I intended to refactor this by have the placeholder inherit from the real tile map and then overwrite any critical methods.

On the tilemap also had a poorly thought our basemap parent. I've refactored those to into each other as tilemap was the only thing that used the basemap and I have since written a well thought out generic map class. So I'm spending some time cleaning up these old classes and then I'm going to add more than one texture set per map. Finally for my last magic trick - I'll change it so that the map is serialized rather than use my current crazy system which I wrote to avoid threading. But it's far too hard to maintain. The threading will be extremely simple and isolated so I won't ever get race conditions or two threads trying to save or load from the same file.

Anyway that's what I'm currently up to.

Also I wrote out the knowledge chain in a generic way - that I mentioned in my last post. I'd throw down the source code here but my CopyAsHtml visual studio plugin has stopped working and refuses to start again. It's quite simple anyway it just an extension to C#'s generic dictionary class.

EDIT:

Excellent I've managed to kill off the horrid ILocalMap interface. Thankyou virtual and override.

Tuesday, April 18, 2006

I found myself longing for my own crime-sniffing cat.

One day, in the event, of finally recieving a first adsense payment - I intend to buy some hosting. I don't really want to pay for it myself. I've already got the domain name, and already I wish I'd chosen something else ... still :D.

...anyway back to the point, on this fateful day I'll probably go with Wordpress. And I'll be able to make pages that list only my articles and from that day forth my pointless blog posts, like the one you're reading, and my posts of substance, shall be forever split and happiness will be had by all. The currently cool and groovy thing about wordpress is the Widget. It's like a drag and drop webpage editor. Webpages and their associated technology have run away from me. I could handle simple html pages and I dabbled with perl, php, sql but now it's all AJAX web 2.0, css and all that stuff - luckily all I've ever aspired to - is exactly what wordpress offers and it's free to boot. I've currently got a test page on my local webserver where I tweak my layout until I'm ready to unleash its wonderousness upon the world.

Lately I've been on a bit of Scheme with Emacs kick. Emacs actually seems quite nice, it highlights and formats my scheme code. I can write my own macros. I would like refactoring code and autocompletion. I'm pretty sure I can get autocomplete - but I haven't looked into yet. Refactoring for me includes being able to rename functions - and the function is renamed everywhere, selecting code and then extracting it as a method or function. Also I'd like to get to know ruby better but I don't really want to start without indentation! I'm still suffering from electric-ruby trouble and my newbie-ness at emacs leaves me at a loss as to how to correct my problem.

There's a wonderfully odd ruby tutorial from Why called Why’s (Poignant) Guide to Ruby and it seems I may well be the last person on the internet to discover it as del.icio.us shows 3798 other people linking to it. I do seem to remember, a long time ago, a short article about ruby with cartoon foxes - maybe that's where this books grown from. Anyway it's very entertaining - I suggest you check it out even if this is your first time on the internet and you find computers quite scary in general.

Today



A day off, a day for more university applications and a little bit of game programming.

My tearing problem remains in windowed mode - I think the code needs profiling.

Today I'm working more on the game side of the code base - at least I'm getting there anyway.



As I work on this project there's a certain structure that keeps coming up - I'm going to call a knowledge chain. So far I've ignored it or implemented half assed versions.

First let me give an example of it's use:

Let's say we have world, and in this world there are two cultures: forest dwellers and city people. Okay got it? Now on screen is an NPC, your run of the mill, scenery NPC, the kind we all hate in real computer games. We want to know his name.

So we ask "What's your name?"

Now because he's a boring scenery NPC he doesn't have any name data, in fact his knowledge base is empty. So he asks his "brain", "Brain, what is my name?" and his brain looks at the local database and see's no entry for name. So the brain asks the culture - "Culture, what's a a good value for name?" and culture will look up name and it has some default value there like "a peasant". So then our scenery NPC might say "I'm a peasant".

In other cases the NPCs local knowledge would override the global knowledge.


That's not the only example but hopefully it gets across the kind of problem I'm looking to resolve. Local knowledge being able to override less local knowledge in a big knowledge chain.

In the above example we might have had.


Culture
|
The Dark Brotherhood
|
NPC


Then maybe The Dark Brotherhood would have a default value for name, like "I'm a member of the dark brotherhood". Quite nifty right? I haven't actually programmed any of this but it does seem like a jolly good idea.

The problem that this currently seems to fit is to do with textures. I want a city of culture B to use B's textures to create the city. But I don't want all the cities to be the same, so I might specialize some of the cities textures as local knowledge - red doors are suddenly quite popular or something - a little thing that makes the city more unique.

When we're dealing with knowledge that NPCs might have, then it seems things might be trickier and access to knowledge would probably benefit from being restricted.


Hero>"Hello peasant where's the Hidden Diamond of ultimate power?"
Peasent> Brain?
Brain doesn't know - asks culture
Culture ah-ha I have an entry here - it's in the majors bedroom.
Brain, cool!
"It's in the majors bedroom."
Hero> Thanks.


We could resolve this with a "knowledge level" (0,1,2...) or knowledge class (lower class, middle class, upper class). Peasants may not know the following ..., Nobles can't the know the following...

... Actually may be careful constructed knowledge chains would get rid of this problem?


Culture Culture
| |
Peasant Group Noble Group
| |
NPC NPC



Let's say on the Noble group has an entry for the location of the ultimate gem of power. Now it's nicely restricted to a certain subset of NPCs.

If you did this though it means - the very top knowledge base wouldn't know everything. So you have to deal with DONTKNOW returns which could make programming a little more tricky.

Sunday, April 16, 2006

Arggggh

So it turns out yesterday was a work day. That one took me by suprise.

That's not what I'm arghhing about though.

I seem to have developed tearing when I move my character up or down the diagonal lines flicker across the screen. Moving the character left or right doesn't have this effect.

So I hummed and harr for a bit, before bolt-of-lightening I'll simple revert using revision control - see if the problem goes away and wee! Done.

Before a second thought could occur I was already doing it. Of course everything was broken because I have no knowledge of large project organization. EINFALL is like a knotted ball of wires. It's made up of several dll files that have their source code in other directories - these dlls should be quite modular. But that doesn't mean that I don't change them, I change them all the time. But I only version control my main project - oh poo. So that turned into a big mess and it looked like I'd killed all my new code.

I managed to relink everything now and get back to the problem at hand.

The tearing dissapears in fullscreen mode. Where has it come from? I'm sure I haven't editing any rendering file ... why only on the vertical movement line? I don't even know how to start with this - so for now I think I'll be leaving it.

If it hadn't appeared in fullscreen mode, well then I could put it down to something I've accidently broken but - no! (;_;)

EDIT:

Maybe the first step is a FPS counter?
... the thing is I've not been adding anything to that area of code. Brah, let's see what's happening.

EDIT:

FPS is a little low but pretty constant - no big change when "tearing" occurs.
Hmmmm. I seem to remember reorganizing some code that might have effected it - check that next.

EDIT:

The map buffering code seems to be messed up ... it's also messed up in the earliest revision of my code gah. Once stage three gets locked up - I'm going to have a good hard think about how I can bring all the code together yet keep it seperate :D

EDIT:

Ah I think the tearing and buffering and related symptoms of a overly fat main loop. The bufferings working it's just slow. It you keep walking and don't stop you'll find the end of the map before the rest of the map is loaded. But if you take a few rests, it'll have buffered by the time you get there. This didn't use to be a problem - so I've probably done something stupid. I'll have to take a look a profiling tools.

Currently I'm adding a few events and doing more code reformatting.

EDIT:

This is the chaps blog who wrote ruby-electric, I hope he'll be able to give me a hand.
http://deezsombor.blogspot.com/2006/04/what-do-you-mean-by-emacs-not-being.html

Friday, April 14, 2006

I'm making a mockery of your Friday.

Friday starts with an F.

So today was another one of my very long, very empty days at school where I spent lots of time sitting in the staff room. I decided to be a bit bolder today and did some tile work. That's right tiles, buildings need tiles. (Apart from all the time I spent being frustrated at emacs, oh here's a question for those in the know - if my emacs files has only the following in it:

(require 'ruby-electric)

why does if fail it says define-minor-mode is a void symbol, or something similar. Why why why why why? Grah. I cannot find any help on the internet. Perhaps when I have free time and an internet connection I'll find a chat room and pressure some bearded guru into teaching me.))


I have to say I've amazed myself - to me eye these tiles are superb, triple A for the 90s. My corner tile doesn't quite work but who cares I don't think you can really tell. The tiles are just standard walls tiles and something that might be used as a path.
Anyway look forward to them appearing in a screen shot soon.

I'm not posting these tiles here as I don't want them used by miscrents.

Thursday, April 13, 2006

Still town generation.

Actually for the moment I'm pretty much satisfied with the town generation and am stalled at making some basic art. Today I've been repeatedly frustrated by emacs and getting ruby to work nicely within it on my windows portable. I like programs to be somewhat discoverable - no one likes to read the manual, that's not the fun way to learn. Emacs is not a "discoverable" program.

Here's my current todo list, marked up in whatever GTDWiki uses for it's markup - some html shorthand.


!Doing

*Link city placement code, with city generation code.
**Start by browsing world smith and see when the calls need to be hooked up.


* Create an IVoice interface
** Possibly a set colour and say function
** Exist in NPCs and have a say wrapper
** Use from console for player.


!Done

*Done by splitting locktypes: allowing structure soil to be killed off by already placed Locks.
** To do this the Lock permission needs breaking in two. We'd have a L and a B for built. Soil from structures would be allowed to place over built but would not actually be placed. This should help to prevent the slight city stifling we have now.
**Logic for the above is implemented. But there's needs to be a decision about when to turn a tile to built? Right away?
(Right away atm)


*It seems the placers failing sometimes when there seem to be spots for buildings available. -> Turns out hamlets are often quite small.
*Isolate and extract those classes and add them to the EINFALL main build.
*Add the other classes as a resource / dll.
* Find source of and remove [[building wobblyness]] in placement.
** I believe this is solved but I'm not sure. I added the rule so that unless that map connector is overriden then the structure cannot be placed. This is so that more appropiate rotations would have a chance to be placed.
*Add structure rotation matching.
*Have connectors chosen at random.
*Have structure to load chosen at random. (already done).
*Make a list of classes that will need access to the tile map / shell map.
*[[Make More Irregular Buildings]]
*Make a more detailed town.
**What's the execution path where the second building is failed
to be added? It should suceed because there are two sides to everyroad.
**Fix it.

*Make warlords house smaller.
*Print out a character map, representing a created town.
*Got expanding rectangle working.


Here's the console mode output for a generated city called Kehenda ... actually it's a hamlet.


Generating a culture without a World Culture to modify
The culture of horiyubu is born!
Now introducing horiyubus captial city
Adding a layout to the city: True
Supplied Building Permission
Creating 4 buildings.
Supplied Building Permission
Supplied Building Permission
Supplied Building Permission

[The City of kehenda]
:Permission data:
[Current constructiong Nothing
Planner details:Layout city planner works using a permission grid

















BBBBBBBBB
BBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBB
LLLLLLLLLLLLLLL
cLLLLLLLLLLLLLLLc
LLLLLLLLLLLLLLL
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBB











]
:City Data:
[
















#########
############ #
# ## #
# ## #
# ## #
# ## #
####################



################################
# ## #
# ## #
# ## #
# ## #
# ## #
# ## #
# ##########
# #
# #
# #
#######################











]

Saturday, April 08, 2006

Your very own Sky Net

I was poking around the game programming wiki and saw that an article on Rule Based AI was wanted. So I wrote a very basic one with a description. I intend to write something similar for my game at some point, so this is a small prototype.

There's an interesting postmortem on Stardock's Galactic Civilizations II: Dread Lords over on Gamasutra, registration required.

As for me I have simple ascii village generation working now, which is nice. My next todo is sorting the namespaces out correctly. I've been playing around with the Scheme programming language too - a dialect of Lisp. I haven't got too far yet but it's something I've been meaning to do for a while.

I've stopped using a .txt Todo list and I've started using a one-page-wiki called GTDTagglyWiki. I store it locally and have it as a bookmark when firefox opens. For some reason it comes with crappy and really slow animations - there can be turned off in options and after that it's quite useful.

Monday, April 03, 2006

Articles

Very interesting looking links up here.

Highlights:

Postmortem: Blizzard Entertainment's Diablo II

Baldur's Gate II: The Anatomy of a Sequel

http://www.gamearchitect.net/ Musings of Game Engine Structure and Design



I've been getting up a hour earlier to program in the morning. Unfortunately it turns into "internet time" :D. Still some morning unit tests have been written.

Now back to programming.

Sunday, April 02, 2006

Plotting Headaches

Lets say I have a grid G.
The grids cells are composed of one of two types - free or occupied.

Now given a point in the grid P, what's the biggest rectangle we can make that includes P?

That's the algorithm I'm currently writing. I wrote some on Friday, I think, but it was godawful and very complicated. The one I'm writing now is much cleaner and should work nicely.