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.

2 comments:

Anonymous said...

That sounds bloody cool :)

What are your plans with the engine though, once it's finished - will you be making a game, or is it just a programming project?

BTW, I see that you've linked to Alter Ego in your links page. I wholeheartedly approve, that game is fantastic - something everyone should play! The C64 version is definitly best if you can get a hold of it somewhere.

balaam said...

There's no real engine :D
The engine and the game seem to be one big mess of libraries. Though some of the lower level libraries are cleanly seperated.

But yes I'm making a game, very slowly. I've been hanging around the walk-around demo for a very long time now :D As soon as my first hamlet is complete I'll post some screen shots.