• Welcome to The Wyrmkeep Entertainment Co. Forum.
 

News:

The forum returns! Still working on tweaks.
Please contact techsupport@wyrmkeep.com to get a forum account.

Main Menu

Game Concept: Technical

Started by Kay, Sep 02, 2004, 07:38 PM

Previous topic - Next topic

Threed

#15
To be more poignent,

    ArrayList squirrel2 = new ArrayList();
          squirrel2.Add(new DlgLine());
          squirrel2.Add(new DlgLine());
          return squirrel2[0].text;

should be,

QuoteArrayList squirrel2 = new Arraylist();
squirrel2.Add(new DlgLine());
squirrel2.Add(new DlgLine());
return (squirrel2[0] as DlgLine).text;

Kay

Thanks! Success so far using List<>s. Will update when I have something worthwhile in C#.

dronon

I may have missed the opening messages in this thread or may be misinterpreting the nature of the discussion, but if you're looking for a PC graphical adventure game engine, there's Adventure Game Studio (http://www.adventuregamestudio.co.uk/).  I'm personally biased towards games having a good story and well-integrated puzzles - not so much 3D or AI elements.  Although the latter are easier to market.  :)

Threed

QuoteI may have missed the opening messages in this thread or may be misinterpreting the nature of the discussion, but if you're looking for a PC graphical adventure game engine, there's Adventure Game Studio (http://www.adventuregamestudio.co.uk/).  I'm personally biased towards games having a good story and well-integrated puzzles - not so much 3D or AI elements.  Although the latter are easier to market.  :)
I can see what you mean. I'm more of an immersion fan myself. I like getting "lost" in the world. ;)

Kay

QuoteI'm personally biased towards games having a good story and well-integrated puzzles - not so much 3D or AI elements.
QuoteI'm more of an immersion fan myself.

Take a look at the messages more than 30 days old to find the origin of the AI talk -- in "What was/is ItE for you?", I think. The reason I brought it up is because I think AI can be part of a new level of immersion in games. In "Ultima VII," shopkeepers held regular hours and went home at night; in "Morrowind," NPCs had access to a wide range of dialogue about their race, job, homeland, etc.. What I expect will happen is that someday there'll be a living world inside the game, and you'll be able to go around chatting with NPCs and making your own plots independent from anything the game designers explicitly put in.

PC: "So, Bob, how are things in town?"
NPC: "Well, we've had a hard winter, so the wolves are coming down from the mountains and eating our livestock."
PC: "I'll take care of it."
NPC: "But the City Council awarded the job to the Mages' Guild since you weren't around, and they'll be ticked if you embarass them..."

The kind of AI that can do that puts game designers in the position of building the world rather than needing to write a story.

By the way, a magazine recently announced details on Bethesda's upcoming sequel to "Morrowind": "Oblivion." In this sequel, NPCs are expected to have goals and be able to execute them in several ways, with the example of a bum who might get food by hunting, by buying, or by robbing the PC depending on which is easiest. That's pretty good. I hope they don't all stand around waiting for you to talk to them, though.

Re: my own tinkering: C# is taking too much time to learn, considering that I'd have to scrap all my existing code to use it and that the main benefit is getting a Windows interface. (The hassle that finally stopped me: evaluating a string containing a variable name to get the variable's value. Threed, you don't need to provide the answer.) For the moment I've gone back to Python and quickly gotten window and button code working. It's still interface work but is closer to letting me work on the actual AI again.

My present goal is to produce a partly graphical online game kind of like "Furcadia," for the sake of having many AIs walking around interacting with humans. The AI is the most important part, so I have to balance my effort between that and making something playable (which means deciphering multi-user network code). Maybe it's vaporware, but it gives me something to shoot for beyond "Do something with AI."

Screenshot (110KB) here: 2K4 Fall Screenshot (Oct 13)

Calbeck

I think that, insofar as ItE combat is concerned, AI should follow a comparitive progression:

1) Self-Preservation.  Anyone who takes 25% damage will have this kick in, forcing them to Retreat In Good Order, meaning they back away from their foe(s) towards a known "safe point" at a speed somewhere between a walk and a jog.  If allowed to get far enough away, they will turn and run for the "safe point" (could be home, could be a nearby guardshack, the main body of the army, etcetera).  50% damage induces Rout, whereby they IMMEDIATELY turn and run away (this opens them up to a back shot which could be lethal, though).

They will do these things UNLESS there is an overriding factor involved.  Overriding factors would include not being ABLE to retreat --- backed into a corner or trapped partly beneath a cart, whenever the pathfinder can't find a safe path to a safe point the AI.  When this is the case, the AI will either fight to the bitter end or (if the Hero's reputation is Good and well-known) surrender outright.  

Overrides also appear on the battlefield, where Officers keep command of the rank and file.  A packed formation has little option but to do as ordered, both as a matter of pride and fear --- pride in terms of what the other men in the company think of you, and fear in terms of what you'll be branded as if you run.  Assuming the Captain's sword doesn't put an end to your cowardice before the enemy does!

This is the kind of "enforced courage" which allowed such things as the Charge of the Light Brigade and Pickett's Charge to occur --- neither had a realistic chance of victory, but the dishonor of not giving your best was considered worse than death.  Conversely, if a unit's Officer fell, it was not considered untoward for that unit to take defensive measures --- such as taking cover, dropping back, or even returning to the baggage trains --- in absence of "trained leadership".

Thus, I suggest that military units have their morale slaved to the Officer in charge --- if HE runs, it must be okay to follow suit, right? -:)

2) Objective.  The thief wants your pocketbook.  The gypsy wants you to toss him some gold.  The Boar Noble wants you to apologize for not groveling properly as you pass him in the street.  The Major wants you to take your company and seize that hill from the unit of enemy pike.

All of these are Objectives.  Any AI will try to achieve its Objective, but not at the cost of Self-Preservation (note Overrides).  The thief will slip back into the crowd and look for another target if you look directly at him and unsheath your sword.  The gypsy relents from his begging when you snarl at him.  The Boar, being a Boar, has to take 50% damage in the ensuing battle before he realizes you just MIGHT WELL KILL HIM.  Run away, run away!  Squuuuueeeeeee! -:D  And the Major?  Well, just come back with your shield or on it, lad...

Thus, no battles should really be "to the death" except in rare dueling or common military circumstances.  

I also suggest that access to weapons be a limited affair --- they are NOT generally tolerated in the hands of common folk!  You only have one since as a courier you are expected to protect your messages and packages, many of which will naturally go to Nobility.  Weapons among the peasantry are essentially whatever they have handy, mostly clubs or sharpened farm implements.  More advanced weapons are the prerogative of official military forces, or might rarely be found amongst brigands.

Therefore, weaponry descriptions should be limited to "this is better than that" --- no need to belabor the fine points --- and should only wind up in the Hero's possession via military issue or taking off the body of a dead criminal.  Note that this means most weapons will only be salable to actual Houses, unless the Hero wants to engage in black marketing.  In which case he's selling either to criminals or rebels and should hope he's not caught doing so!

I think that by keeping it fairly simple, this will prevent the game turning into a tactical simulation and keep the goal of immersion on track.

Kay

What I've got at the moment is a nearly-working text-based game with the potential to send non-text data like images. There's a server program running the world and AIs, and a client program sending/receiving data. I think it would work online.

But that's a far cry from a real game. I'm still at a loss between focusing on the AI and focusing on making something playable. Next programming binge, I expect to firm up the client/server code so you'll be able to connect via client and walk around in a tiny text-based world, basically a crude MUCK. Then I have to decide where to go from there.

Threed

QuoteBut that's a far cry from a real game. I'm still at a loss between focusing on the AI and focusing on making something playable. Next programming binge, I expect to firm up the client/server code so you'll be able to connect via client and walk around in a tiny text-based world, basically a crude MUCK. Then I have to decide where to go from there.
Playable! What good is a technology if nobody uses it?

Threed

Oh, and, uh, google for "Model View Controller pattern" to save yourself a serious headache down the road.

Threed

(Talking to himself, don't mind the crazy)

Why," what's the 'Model View Controller pattern'?" you might ask?

Its a method of abstracting Data (Model) from Rendering (View) and Input (Controller).

In this case its a cheap and easy way of taking care of business with regards to making a game AND an AI: the AI is the Model, the presentation is the View (you can ahve multiple views if you architect it right!), and the Input can be the game logic!

Wow. Amazing. Utterly amazing.


Kay

#25
I've posted the version 4 demo from months ago, here. (It was a version I had lying around as a prepackaged EXE with built-in help screens.)

I plan to make and release a new version Real Soon Now based on the new text-based code. The main problem seems to be that I don't know what I want. The MVC Pattern sounds like good theory compared the mess of code I have. Considering that I don't really want to become a MUCK administrator, maybe I'll reorganize everything so that:
-The server program has a View class.
-A View has a flag indicating Local or Online. Local Views have a graphical window; Online Views have a net connection. (Not sure how to handle the storage of messages to be sent to/from these Views.)
-Program starts with a Local View, not connected to a character... not sure how this should be linked to the Controller, as my code has Windows-like controls that are both input and output.

Will have to look at the article again. The server program still gives you control over a Player character; I guess the main thing is to reorganize that so it uses the new I/O, and change the world-sim a bit, and not mess with the online code.

Another issue is that the AIs are supposed to be in the world-sim, so which one's the Model? As much as possible I'd like to treat them like human players (the Player is really a lobotomized AI instance), using the same kind of code to interact with the world-sim except that they're constantly pinging the sim to sense their surroundings. It'd be cool if a human could possess an NPC for a while and have the NPC still learning from its experiences, so that one day your friend will go offline and you won't notice for a while.

"I see you've switched characters... Mister Anderson."

Quick update Thursday night: Good progress. Implemented a controller/view system that looks sane, but haven't tried hooking an AI up to it. Next: make the world-sim presentable and have a demo of walking around in the world with a brain-dead AI.

(Screenshot from an interface test)

Threed

"The model is the who is the what?!" you say? Well, its O-K-DO-KAY.

Controllers invoke methods in models; thus, you can implement the AI as both a model and a controller of another model (=D).

Don't cut, copy, and paste this: its insane.

//Model of AI logic.
class AI
{
//...AI logic.
public method Think();
public method EatPretzals();

}

//Model... this is one of avatar class.
class Avatar
{

public method DestroyPlanet();

}

//Controller - execution of AI logic.
class Controller
{
private MyAI of type AI;
private MyDataModel of type Avatar;

}

Controller.MyAI.Think(); / AI is done thinking about what it wants to do, so, do that.

Controller.MyDataModel.DestroyPlanet(); //AI was feeling rash.


Soemthing, something, its the medication talking, don't mind me!

Kay

New demo available for download here. Unlike in the old demo, I didn't use the actual AI much, so that they're just sitting there, but you can walk around in a text-based world using nifty model/view/controller architecture and other complicated code that doesn't actually do much. Anyway, it establishes a tolerably-coded "worldsim" and playable interface.

Click for bigger screenshot

By the way, the AI architecture (which is just sitting there uselessly) looks more like this:

def Go():
----RunPhysicalNeeds() # Hunger, thirst, etc. generate goals.
----PickGoal() # Select highest-priority goal
----DoGoal() # Interact with the world
----AICycle() # Form associations between neurons, form episodic memories, etc.

What next? I don't know. Get the AIs moving around again, I guess. It's frustrating that the worldsim's so simple there are lots of things it can't do, but every time I rewrite it, it delays my getting back to the actual AI which was the original point of the thing. Guess I should focus on keeping it playable.

I could use opinions from anyone who's played both demos.

Kay

Now I've got parts of the dialogue system reactivated/rebuilt/refurbished. An AI's default response to dialogue is to try interpreting it by some complicated guesses at the parts of speech; failing that, it uses some Morrowind-style dialogue topics. It's doing something flaky in its responses that I have yet to investigate, and of course it's really dumb, but what I've got now is:

-Graphical interface with scrollable text window; could easily create buttons etc.
-Model/View/Controller architecture
-Ability to log in as any character, even one that's normally an AI (This was a serious pain.); could keep learning functions on even while an AI is "possessed"; minimal distinction between PC and NPCs
-Text-based game world (12 rooms with a few objects)
-AIs that gather sensory input from nearby characters and objects, storing information on new ones
-A few crude dialogue responses using multiple systems for generating a response; AIs don't care whether input is coming from a human -- in fact two AIs in the same room will at this point endlessly talk at each other

I hope to release a new demo soon. Next, I don't know. Going back to graphics? Getting online connections working? Or focusing on making the AIs move again, and making the junky text-based world interactive enough to restore the "X causes Y" learning code? Or continuing to work with the dialogue?

Have you ever been unable to log out? --Tsukasa, ".hack//SIGN"

Threed

Looks like you've been busy these past few weeks.

What kind of AI are you using; state-machine based?