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.
Post a Comment