Friday, September 30, 2005

The Code Empire

I've been programming some Empire code for my game but it's very skeletal. I've also rejigged some of the IO so the diretories have sensible names. This weekend I'm going to have my "world select" code finished.

Nothing too excited - if I keep up the pace I'll be stage three of my program plan by next weekend. That will be nice :D

Wednesday, September 28, 2005

Making the computer sing!

Creating a grammar to produce a random song is hard. I'm guessing AI research PhD hard. But I just want extremely simple ditties to liven up my game. And if I can make insulting ditties about the player - all the better!

A grammar can only produce extremely simple songs - as it's very hard to keep the song about the same thing. You might have a production.


[songs_about] -> love | angels | sausages | wilderbeast


Looks pretty promising right? - WRONG!

The song will change half way through - at one point the singers talking about love then sausages - entertaining - yes but not widely applicable.

Therefore the grammar output needs to have some post processing / don't use a grammar at all - or use a Context Sensitive Grammar (harder to right, not as fast) instead of a Context Free Grammar.

For now I'm going the post-process route. Anyway with these grammars bards could make up songs on the spot - enough songs to draw from and it might even sound okay. The bard could also draw from things he can see - which could be interesting.

I'm very interested in making songs about the players deeds if they're cool enough but the current way I'm making songs won't cut it. Anyway let's see a pre-post-processed song grammar output.

Oh I knew a man and he loved a [lovedthing],
Finer than the big wide sky thought he, it to be,
[lovedthing] oh [lovedthing] was all his eye did see,

[lovedthing] oh [lovedthing] was all his eye did see,
hey hey oh heyyyy,
[lovedthing] oh [lovedthing] was all his eye did see,

Oh I knew a man and he loved a [lovedthing],
Finer than life itself thought he, it to be,
[lovedthing] oh [lovedthing] was all his eye did see


Surely heartfelt and the new global number one. Let's assume I've written some post process code (which I haven't) and let's say it makes the following song:

Oh I knew a man and he loved a cat,
Finer than the big wide sky thought he, it to be,
cat oh cat was all his eye did see,

cat oh cat was all his eye did see,
hey hey oh heyyyy,
cat oh cat was all his eye did see,

Oh I knew a man and he loved a cat,
Finer than life itself thought he, it to be,
cat oh cat was all his eye did see


Currently I have a conversation mark-up code thing - I may produce that rather than plain text. That may make things a little more interesting - it can handle producing stuff like a woman, anorange.

Here's the pretty crude grammar. I actually wrote three of four song grammars but this was the first:


[start] -> [songs]

[more] -> "life itself" | "the big wide sky" | "the deep blue sea" | "gold and silver" |
"his sweet family"

[songs] -> [song1]

[song1] -> [stanza1] "\r\n" [chorus1] "\r\n" [stanza1] |
[stanza2] "\r\n" [chorus1] "\r\n" [stanza2]

[stanza1] -> [line1][line2][line3]
[stanza2] -> [line1][a1line2][line3]

[line1] -> "Oh I knew a man and he loved a [lovedthing],\r\n"
[line2] -> "He loved it more than " [more] ",\r\n"
[a1line2] -> "Finer than " [more] " thought he, it to be,\r\n"
[line3] -> "[lovedthing] oh [lovedthing] was all his eye did see,\r\n"

[chorus1] -> [line3] "hey hey oh heyyyy,\r\n" [line3]


Here I could also have [emotion] -> hate | love ... which would give the song more scope for being random. These are all post process procedures - which I haven't touched. I'd like them to be quite modular.

Of course I also want books, item description, personal histories ... etc

... maybe I should be looking in more fractal stuff. (the linguistics stuff in this article is dodgey in my opinion. You and I understand the sentenced - Bryan bryan-ed his was down to the shops. We can make up words and be very creative in sentences - it's not a strict grammar - have these people ever heard anyone speak?)

Also this link about games for education caught my attention. One of the things in the back of my head is a FF / DQ rpg to teach English. A little like Slime Forest (which is for learning Japanese) but with more puzzles.

Tuesday, September 27, 2005

Jeeves and Wooster, policemen like foxes enjoy being hunted.

Currently I'm doing boring IO stuff. Also the people at my job actually seem to want me to do some work this week so I have less time to tinker. I downloaded the latest version of the Snippet Compiler (the beta one).

Last night, by the magical wonders of the internet, I was watching some Jeeves and Wooster (featuring Hugh Laurie and Stephen Fry). I always thought the books played with words quite well and the series, though rather old now, is excellent.

The names where also good too, as recent posts have shown I'm a bit fixated with names at the moment. The names bandied about in this program - along with the language is obviously upper class. These names belong to certain strata of society. I wondered if I could get a grammar going ... :D I only watched one episode but I managed to note down a few of the names that came up mainly last names. Today at school I came up with the following rough grammar:


[start] -> [S1][mid][e2] | [S1][V][e1] | [S2][V][e1]


[S1] -> "gl" | "br" | "f"
[S2] -> "wo"
[V] -> "a" | "e" | "i" | "o" | "u"
[mid] -> "ith" | "ains" | "ipps" | "iggs"
[e1] -> "ssup" | "ster" | "gget" | "n" | [e2]
[e2] -> "ley" | "wauld" | "worth" | "wick" | "bottom"


Which gave some reasonably good outputs even though it's obviously rather limited at the moment.


Fithley
Woan
Glogget
Woester
Woen
Briggsley
Brester
Glithbottom
Woussup
Woin
Bregget
Figgswauld
...


These are pretty good names but I'd like a little more variety. I'm thinking of creating possibly fifty or so grammars like the above for upper and lower classes. On top of that I may add a random grammar generator that will probably create truely unusual but not impossible name-sets.

Of course at this point you may be thinking Why why why all these names? Well I find it entertaining and interesting. Also the scope of my game is rather large and name thirsty. I'm not the only one[2, 3] of course people writing MMORPG will want name generators perhaps as leveled as mine (or even more complicated)

Nothing else interesting to report at the moment though.

Sunday, September 25, 2005

A Grammar Bender

I'm on a bit of a grammar bender [2, 3] at the moment.

Today I converted my old pirate crew and captain generator, written in C# to two nice grammars.


Cut throat Robinson
Cutlass Thirsty Thomas
Yellow Joyce
Sea Cow Rapin' Bill
Whore Bitin' Bob
Fingean the criminal
Muttering Todd
Silver Swimming Henry
Nail Carryin' Guybrush


I'm tempted to post the grammars here but they're pretty lengthy so I'm going to skip it!

Here's some random french too! (see the grammar at the bottom of this post)


Entretarfitie ciep nunson sousolec
Chanic quuntou entrejimspemee gaumir
Ranceau conessom maliman rancam
Senoir quoeunir chontent sileur
Conamep blonpie fentegne goitain
Sousassugne vanseau voic ranpec
Stance entredagnejonou ninsusse domeur


Words seem a bit long but still pretty cool.

I've added a help commmand to my console - so I don't forget the commands I add!

Also this is an excellent article on promoting your game!

Saturday, September 24, 2005

Grammary Front End Goodnes'

I have a very nice C# form front end to my grammar parser, builder, excuter-majig.
(probably about 15 minutes work - C# is a wonder! Once again I'd love to show pictures - I'm holding out that one day bloggers picture option will work for me, too)


[start] -> [C][V][C][End]
[C] -> "b" | "c" | "d" | "f" | "g" | "h" | "j" | "k" | "l" |
"m" | "n" | "p" | "q" |"r" | "s" | "t" | "w" | "x" | "y" | "z"
[V] -> "a" | "e" | "i" | "o" | "u"
[End] -> "dur" | "mir"


Grammars such as the above go in one box - names come out the other! Splendid.

Minor problem is that, for different grammars, I never reset the parse tree so the grammar just grows and grows. The end functions probably aren't too clean in lua either. (as in tricky to remove memory-wise)

Here's some example output:


Bifmir
Mesdur
Lizdur
Giymir
Rojdur
Jirdur
Foldur


Not bad names - ends could do with a little variety though.

This and my world generation algorithm in my main code has made today quite successful!

I've registered a source forge account and might upload this project once I've polished it. Probably under the MIT license or some quite unrestrictive license.

The High Seas

My world generation is working. I can now walk my character around the world through (overly vast) oceans and come across land! It's pretty cool. Just like a mighty pirate.

I'd put up a screen shot but the image tool for blogger does not work me :(

I'll now remove the world generation code from the user selection screen (I hacked it into test.) Then I'll work on whatever next on my todo list. Or I might add a front end to my grammar thing - then I can convert some complicated C# code and Lua code into clean simple grammars.

I'm approaching the fun coding again! yay!


Still the world selection screen will probably hurt me :D

Friday, September 23, 2005

The F in Friday is for Freedom

Today it's a bank holiday in Japan. I don't care why - I'm just happy it's here.

This morning I spent ages rewriting the last post - so it was far clearer. At the end I added more examples. There where useful links all over the place. But posting to blogger failed! And going back revealled the original post. I wanted to cry. I'm sure there's some plugin for firefox that might save me future horrors like this ... I'll look for it later.

This morning I've fixed up my code. The globes genarator seems to be working reasonably nicely. It's writing files out. Soon I'll push it into my main code base shortly. Hopefully painless.

Thursday, September 22, 2005

Grammars

I had a couple of goes at creating a grammar programming language before. I posted some my results in this venture here and here. I never finished my implementation because I ran up against something tricky problems and got bored. Well, recently I started playing with this again but this time I finished!

If you're not familiar with grammars (I talked about using them for generating random names) they are collections of rules. As an example, let's make one production rule for all the vowels. We'll call the rule V.


[V] -> a | i | e | u | o


Pretty simple. Any [V], a non-terminal, can be reduced to anyone one of the vowels, a terminal. Now imagine we had the constants, too and something called "ends".


[C] -> b | c | d | ... | z //assume I've written them all out here
[ends] -> dar | ug | hir


We can line up these non-terminals ([C][V][ends]) to create names.


[name] -> [C][V][C][ends]


Then if we reduce [name] by randomly picking elements we'll be given a variety of randomly generated names. Of the form a constant, a vowel, a constant.


pick1: Nogdar
pick2: Hilug
pick3: Yahdar
etc


Pretty cool! Not just for names either - we can build random descriptions. Also grammars don't have to be reduced to strings they could be reduced to a list of functions or instructions.

At first I tried to create a nice parser written entirely in Lua. My last attempt had also been in Lua ... and it's painfully obvious it's just not the right language, for me, to do this stuff. So I did it in C#, the traditional way -- I parsed it and built a symbol tree.

There a lot of things that can be done witha symbol tree - it can be used to generate a C# data structure, that can the make use of the grammar. This would probably be the expected thing to do. If you want to go the program language route then you might change the tree to an ASM program or program for virtual machine (like the one .net uses). I didn't do either.

The program outputs the tree as a Lua program. (Previously I'd had written a Lua program that would write a lua program according to a grammar, that worked but had a restrictive syntax). Then the program generated works just like the grammar and can be run in Lua. The reductions are randomly picked (there's no options for probabilities like from the vowels be more likely to select 'e'. This is something that can be added later) Grammars can also be written that call Lua functions too! So that's quite a lot of power right there!

I had intended this program for world generation but currently I'll be using it for names and title generation. I may add a few extra steps like randomly generating the grammar itself (possibly with a grammar :D).


[metaEnds] -> "ends ->[" [C] [V] [C] "]"


If I polish it I may upload it as a sourceforge project as its potentially quite useful to others as well.

That's it! Following are grammar examples!

(These are taken (an converted) from http://www.ruf.rice.edu/~pound/ but it seems to be dead at the momement. The names are left undescriptive)

Psuedo French



Why did I choose this one it's massive! Oh well. Imagine in your game you could, on the fly create random foreign books - or have people randomly speak (say before you've learnt the language).


[words] -> [C][D][F] | [C][V]"n"[A][X] | [C][V]"n"[A][U] |
[C][V]"n"[A][T] | [C][V][M][T] | [C][D][M][U] |
[C][V][M][U] | [I][V][M][T] | [E][C][T] [C][V][Z][X]

[I] -> "in" | "ad" | "con" | "des" | "mal" | "pour" | "sous"

[E] -> "entre" | "re"

[T] -> [V][F]

[M] -> "l" | "ll" | "t" | "ss" | "n" | "m"

[U] -> "eur" | "ien" | "ant" | "esse" | "ent" | "able" | "oir" |
"eau" | "aire" | "erie" | "e" | "er" | "ir" | "ain" | "age" |
"ule" | "on" | "ade"

[C] -> "b" | "c" | "ch" | "d" | "f" | "g" | "j" | "l" | "m" | "n" |
"p" | "qu" | "r" | "s" | "t" | "v" | "s"[P] | [R]"r" | [L]"l"

[F] -> "c" | "f" | "gne" | "m" | "n" | "nt" | "p" | "r" | "sse" |
"t" | "s" | "l"

[Z] -> "c" | "f" | "gn" | "m" | "n" | "nt" | "p" | "r" | "t" | "s" | "l"

[A] -> "c" | "p" | "s" | "t"

[P] -> "p" | "t"

[Q] -> "b" | "d" | "g"

[L] -> "b" | "f" | "p" | "c"

[R] -> [P] | [Q] | "f"

[V] -> "a" | "e" | "i" | "o" | "u"

[D] -> "au" | "ai" | "oi" | "ou" | "ie" | "eau" | "oeu"

[X] -> "ee" | "e" | "ou" | "ie" | "eau" | "oi"

Thursday, September 15, 2005

Name Generators for NPCs to populate your RPG (or any other game)

This post will go over some name generation algorithms. As humans beings we can easily make up names - watch:

Bob, Orthur, Sonstig, Rachon

How can we make the computer do something similar?

1. A Really Big List


Open notepad, start typing names. At the very least we'll want two lists one for female names and one for male. (You may also be able to grab lists off the web. Baby naming sites seem to be abundant and full of oddness that would go well in most games York Hawkright)

When you create a NPC you check gender, choose the correct list then randomly choose an entry.

Advantages


  • Names will always be sensible (no "wwprojh" or offensive words)

  • No CPU cycles are spent on generation algorithms.


Disadvantages


  • Takes a lot of time and effort.
    • The more stratification* you want the more effort is required

  • The list is finite - as some point there will be repitition

  • Altering name distribution is tricky. (some names are slightly more common in region X for instance)



*stratification: Perhaps you'd like names associated by birth place. Indian people tend to have different names than Chinese people. You might also want to swap names by social standing, beggars have different names than lords. Occupational names may also want to seperated -pirates and ninjas. Knights and monks. Bad guys and good guys. Demons and Angels.

The big list approach has enough drawbacks for us to want something better. Not to say big list is redundant. It made be used with any other name generation technique.

2. Markov Chains


By using a markov chaining algorithm we recieve a data structure that can produce many different names. A markov chain is a record of patterns in a sequence of information. Here our sequence of information will be letters but it could be any sequence - dungeon tiles, musical notes etc.

A markov algorithm has two important parameters, the first is the data sequence. The second is it's "pattern memory" or "step size". This is best explained with an example.

Example 1. Stepsize = 1


The data sequence will be the following three words.

bag
bat
ate

Each word we'll feed into the algorithm ... and this is what will happen:

First Rule: b -> a b|ag

Letter b's can be followed by letter a's. Is what this says. This rule is recorded.

Second Rule: a -> g ba|g

Letter a's can be followed by letter g's. The final rule that doesn't need recording is letter g's are followed by nothing. This is default behaviour for all letters without rules. That leaves us with two production rules.

b -> a
a -> g

From these rules we can make new words. This is done by randomly choosing a starting rule. For instance we might choose rule two. We put down "a".

a

According to the production rule we know after a we can put a "g". This is our only choice so we put down g.

ag

G has no production rule so we should stop. This leaves us with the rather unsatisfactory word "ag".

What to do when we've finished but the words to short? Well we can pick another rule at random - the warning here is this greatly increases your chances or getting some rubbish words. So we have ag, let's say we but down "a" or "b" then follow the production rule. We might get

agag or agbag

So even at this early stage we have things that look like words!

Now to feed in the last two words. This leaves us with the following rules.

b -> a
b -> a
a -> g
a-> t
a -> t
t -> e

So some of the rules are duplicate, that means their more likely to get picked. (Programming this you'd probably give each rule a pick count rather than have multiple duplicate rules in your array. This also allows you to toggle whether or not you want probablities to effect picking.)

Using these rules we can produce things like: batag, bate, bagbat ...

Example 3. Stepsize = 2


So what's step size 2? Well the production rules produced will now look like the following:

ba -> g_
ba -> t_
at -> e_.

As you can see setsize two really suits words greater than three letters. How about "rope", "road" and "peon". The following rules would be produced.

ro -> ad
ro -> pe
pe -> on

From this we can get: ropeon. The more words fed in the greater the possible outputs. Let's add "adventure".

ro -> ad
ro -> pe
pe -> on
ad -> ve
ve -> tu
tu -> re

In this fasion a large database of rules can be built. You are best feeding in name-words rather than gardening terms, for instance.

Advantages


  • Easy to churn out new words from a name list.

  • The intensive phase of building the data structure is done once and need only be done once.


Disadvantages


  • It will tend to produce some obviously non-name words
    • Especially if it's comes to a end (g-> nothing) and then you force it to pick a random production and carry on.

  • It has to carefully set up by feeding in a "good" data set.

  • It's not easy to demand words of a certain size



Markov chains are a step in the right direction. Names will often be good enough. But can we do better?

Extension to the Markov Chain Algorithm


We force words to meet certain moulds. This ensures we always have words of a set size and logical composition. Each word we enter into the database we save the order of it's constant vowels. e.g.


nathiel -> CVCCVVC
derkor -> CVCCVC


Then we lock all generated names into the above patterns. This reduces the amount of non-name words.

3. Handbuilt Grammars


A grammar is a lot like a collection of the production rules we generated above but this time we type them out by hand! Seems a bit like a step-backwards but we'll get much higher quality names this way. First here's the bat, bag, ate grammar version of a the markov chain.


[a] -> a[t] | a[g]
[b] -> b[a]
[g] -> g
[t] -> t


The square brackets mean that this an element that needs to be reduced. The | (pipe) means "or". Seems to be pretty similar but we no longer have the probabilty stuff (this of course can be programmed in). Well hand writing the grammar give us a much finer degree of control. Let's imagine a grammar for last names.

[name] -> [C][V][C][ending]
[C] -> b | c | d | f | ... // A selection of the constants
[V] -> a | e | i | o | u
[ending] -> ith | on | ton | field | man

So we reduce [name] and from this are given some more symbols to reduce. Once we reduce everything we're left with a name. If we're given two or more "or" options in a production we pick one a random. This name genator will produce names such as:


Darman, Homon, Turith ...


These aren't bad names! So we'd probably want to create at the least a male and female grammar. We'd get a standard somewhat related set of names.

The fun doesn't stop with names for players of course - we can name stars, swords, monsters, cities, boats, ports, districts, houses, steeds, gods ...

If we write a grammar interpretter that will take in any type of grammar - then we can generate the actually grammar content randomly! :o

Advantages


  • Great degree of control and random generation combined

  • Names sounds natural and relatedness between names can be encouraged


Disadvantages


  • Handbuilt grammars are ... Yes! Created by hand. Therefore there's sometime investment

  • You may end building quite a few if you want names for different places, and monsters names... blah blah blah


And here is some extremely cheap lua code


--[[
Cheap Grammar
A attempt to make a grammar with out the hard parsing programming.
--]]
require("lualib.txt");
math.randomseed(os.time());

function C()
return Pick({"b","c","d","f","g","h","j","k","l","m","n","p","r","s","t","v","w","x","y","z"})
end

function V()
return Pick({"a","i","e","o","u"});
end

function Ending()
return Pick({"ith", "ton", "on", "field", "man"})
end

math.randomseed(os.time());
print(C() .. V() .. C() .. Ending());


Rogfield, Ravon ... Geton, Xanith, Kolman.

(Why does my random pick function alway pick R first? Something to look into)
lualib.txt is my library of useful lua functions. One of these functions is Pick. I'm considering writing something on this library but for now Pick is left as an excerise for the reader.


4. The End


There are three ways to add a variety of names to your game. You can chose to use one or use them all in concert. Have fun.

Some resources


I seem to have removed a load of my links - I'll come back to this and try and fill it up with a few useful bits

Wednesday, September 14, 2005

Busy

Tonight eikaiwa, tommorrow japanese lesson, friday enkai, saturday morning osaka, monday morning return.

It's going to be a while before I'm going to be able to work on EINFALL. I have handwritten some stuff on name generation. So I might get time to type that up thursday and post it. It's a general overview rather than code but still worth checking out I think. Useful for RPG games with randomly generated content or procedural content.

Tuesday, September 13, 2005

On going ...

This weekend I sat down and got quite a bit done. I didn't finish though - there's still a few bits and pieces that needed tidying up. My world generation stuff seems to work well and there's a little bit of threading in there two.

All thats left to do is write the generated maps to disk (this is dropping in a function call). That's it for this stage. It will need to be expanded on later - I'll want to give the worlds I create a name and cities, empires, caves, dungeons that kind of thing.


Also there's a really really cool image manipulation reseach site here. The techniques they show have loads of applications for game developments. I also wonder in the algorimth could be easily extend to 3D dimensions. Definitely check out the video it's excellent.

I could imagine using this to pick things up in old style ultima style 2D game. It would make the objects act more naturally and be pretty surreal.

Sunday, September 11, 2005

Generating Maps for AdventureRole Playing Game Fun

Today I want to finish patching my world generation code into my main "trunk" of my RPG's code. The word trunk is in quotes, as the only source management I use is copying and pasting.

This post (on the RPG Rogue-like development group)for interactions between game world objects - like opening doors, attacking characters and all that - seems to be an excellent idea.

Instead of having


NPC1.Attack(Monster2)


Which means that at some level NPC code must know about Monster code and this leads to a lack of clean seperation. Well instead you do the following:


Rules.Attack(NPC, Monster2)


This way only rules need know about all the game objects and the game objects themselves can be written in an extremely clear manner. It would probably mean that the objects would have to be a little more public as rules will need to request quite a bit of information.

(I always kinda of wish that you could have an oop language where privacy could be altered for each class like public{class1, ..., class n}: for instance.
C++ kind of has a crude version of this with the friend keyword. There's probably some reason it's not been done - maybe it's gets you into coding trouble ... still I'd like to play with it.)

I also now found myself wondering about generating the Rules internal code randomly using a preset-rule bag and lots of Lua :D but I think my RPG is quite ambitious enough.

The thread this post was plucked from is here but I didn't find the rest of it all the useful.

Another thread that caught eye was a list of special attacks for monsters. Though I think this type of thing could be better compiled from walkthroughs taken from places like gamefaqs.

Wednesday, September 07, 2005

The loveliness of houses.

Today has been a pretty bad development wise and in most other respects but hey it's finally coming to close. I made some very small nudges towards pushing my world generator in my main code. I'm at the bit where data files are being created and they need to be put in certain directories - which may need to be made - and what do we do if there's that looks like we have to overwrite
and ...
and ...
and ...

so it needs a lot of testing and stuff. It has lots potential breaking areas grahh. Aim is to have it all done by end of the weekend. This could be hard as I'm working Saturday.

Also I'm trying to decide what to do next year 2006 around July. If you're a very nice Game company and want me to work for you - please let me know :D I'm also looking at maybe taking a year in Bangalore on a tourist visa and working on my game. Even though I doubt it would ever generate a years worth of cash it's something that's important to me and something I want to make.

Tuesday, September 06, 2005

Today's RPG update: I'll beat you with my shoe.

What got accomplished today? Well I was polished off my Culture class - that's right a class for culture you ingrate.

There's also a class called theIdeasOfMan. I'm quite sure the contents of such classes are mysterious and that's the way it should be. OOP 101: Objects should be like a black box, black and mysterious - you want to open it but it's locked with a mysterious key in a mysterious hole.

The main things these interesting classes do - is ... allow the NPCs to be much more inventive with their insults to the characters. And that's all any one wants from a game. Currently it's a bit of nightmare but there's a definite plan to tie it down.

There's lots of Lua and lua code generated on the fly. It's all quite exciting but I'm not going to go into any detail until there's something to show. i.e. a screen of a man or woman, I'm nor sexist this 2005, insulting another character.

Onwards and upwards.

Monday, September 05, 2005

About a third

Of the world generator's in place. It's pretty much identically to an earlier prototype but the values that are plugged in are generated by the computer rather than me.

I've put in some class stubs so I can begin the rest of the development. These are a set of classes that are going to expand so I've taken care to design them quite cleanly.

I should be able to finish it by this weekend and have working in the main project. Which means a lot of functionality that was scatted randomly all over the code can be culled. The map class is an impressive mess and is pretty large to boot - I need to trim that down and some point.

Once that's in though - that's the first of my three steps to completing stage III. I 'd really like to flesh out the console a bit more so I'll be doing that after stage III's complete.

Sunday, September 04, 2005

GUI Fixedish (woo I've made up my mind, I'm gonna keep baby badada da da da daa)

Gui wasn't showing up because of alpha testing being set by the tile rendering stuff and not reset.

Works okay now.

The overlapping bug is annoying I don't know where it's coming from. It even happens when the tiles aren't touching and only when they're in certain positions. I'm not actually sure what comes next now. I need to work up a road map again.

*Later*

The main problem at the moment is I'm not sure what I should be doing. So I've created my 3 point plan of how to polish off stage III. I'm not too far away - it's just all the programming is boring stuff I tend to avoid. Lots of IO and checking directories exist - gah.

Currently I'm squishing together my world generation code and my main game. After than I have more menus to attend to. Then something a little more interesting - adding some architecture to my game to support some metamap stuff. Then I have to fix things and finish all those bits of code that seem to be at a loose end waiting for other bits of code to be finished.

I've standardize my comments as well while I go - mainly so they're easier to grasp at a glance. I've adopting the same system I use for Lua which is based heavily on Natural Docs which of course has been in my bookmarks for a while..

Goal to do by next weekend: Global Generator encorpated and working.

*Later still*

Generator seems to be working. Dragging it across wasn't too much of a hassle. There where a few magic numbers that had been arrived at by trial and error for a 100x100 map. These have been turned into rough heuristics for all maps - I'm not sure how it will work on a range of sizes yet.

It was suprisingly easy to get back into coding for my main project. Actually I started another project in the same solution so there was less clutter to work around - but i can still pull in any objects I wanted and stub them if I wanted.

Currently I have a nice console output showing that the basics are working fine. I need to do some fine tuning and I also need to work on the second half - it's nice to have the feeling I'm getting stuff done again on the project though.

Among other things stage four will actually have enemies and :o combat!! That's when things start getting exciting I guess. I've had a few goes a prototyping the combat engine in Python but nothing's really felt right yet.

I'm still following the Linear Algebra course. It's explained very well - easy to follow. I'm suprised and happy their are free lecture movies on the net for this sort of thing. I wish there where similar ones for actual graphics programming too! I'm thinking I'll try and do 2 or 3 a week. To get it to stick I'll do the excerises too. Should give a much better maths grounding. I found a linear algebra text book for free as PDF! on the web!

Fun fun.

I was also looking at P# (Prolog for .net! yay!) and wondering how hard it would be to fix this into my code. I couldn't find license though :(

Friday, September 02, 2005

Goals

All on Sunday!

-Get the GUI working during the game
-Try and kill off the overlapping tile bug
-Reproduce crash
-Fix up commenting
-Consider refactoring map code