basic virtual world question

Hello,

Just posting to ask your thoughts on how you would implement the following (what sort of infrastructure would you create?):

I'm trying to create some 'living' objects that can perform various actions, like move, fight, eat, rest etc. Lets say the area in which that can move within was a simply array (100 x 100, no gui required, could be simply characters on a screen, ala nethack/moria)

Now here's the thing, I want to let these things go on their own for a long while (lets say overnight) and I would like to observe the results later...

I also want the ability to add and remove new objects at any stage, and I would like it if certain conditions were met that objects themselves can create new objects or destroy existing objects as well.

I dont need realtime so speed of processing isnt an issue, a turn-based system would be fine (which could tie back to a heartbeat of sorts, maybe with a minute intervals)

Also, I'm thinking of some sort of interface so that If I were to enter this world as an object I would have exactly the the same actions available to me as the all the other CPU objects, and vice versa..

If I add some new action for me then they too can utilise it if their 'character' requires it..

I know this is going to be quite a complex little side-project for me, but I'm curious on your thoughts. I know how to do bits-n-pieces and am i little unsure as to how one dynamically manage objects if their capabilities/actions could change in the future...

any/all thoughts/comments are appreciated.

Thankyou for your time.

[1625 byte] By [hwystara] at [2007-10-2 5:18:08]
# 1

Hi,

Maybe just use polymorphism and make all game objects extend a GameObject class that declares the method doSomething(), and all creatures and whatever define it in their own particular class. The game world would just iterate through all GameObjects and call that method.

Or you can use Reflection if you want to randomly call methods that you don't know exist on objects that you haven't defined yet. Use Class.getMethods() and then Method.invoke(). There wouldn't be much AI if you just randomly did stuff like that though.

CommanderKeitha at 2007-7-16 1:20:22 > top of Java-index,Other Topics,Java Game Development...
# 2
Hi,I am working over simmilar tool. I need sth to run, develop and evolve autonomic agents (MSc diplom work ;). Maybe we could work toogether, for a while at last. If U R interested in some contact, pls hit me at piotr(dot)kobik_at_gmail(dot)com.Kind regardsPiotr
PiotrKobika at 2007-7-16 1:20:22 > top of Java-index,Other Topics,Java Game Development...