Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411525 Posts in 69377 Topics- by 58431 Members - Latest Member: Bohdan_Zoshchenko

April 28, 2024, 06:23:39 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperDesignMemory/History in games.
Pages: [1]
Print
Author Topic: Memory/History in games.  (Read 3873 times)
increpare
Guest
« on: May 03, 2008, 01:23:13 PM »

I don't know if this is more suited to being here, or on the more technical programming thread, but I thought I'd ask about games where people have memories, or where there's some real sense of the past still being around in them.  Basically, I started playing Dwarfortress a couple of weekends ago, and it struck me that I hadn't seen seen any games where characters had something like real memories before.  And I recall reading in an interview with that guy that even in one of his first, text-based, games, the bad-guys would taunt the player with the namas of previously-killed foes.

I'm guessing that he's not the only guy out there with a penchant for such things, so I figured it might not be too bad a thing to toss it out here.
Logged
mewse
Level 6
*



View Profile WWW
« Reply #1 on: May 03, 2008, 02:11:04 PM »

Many years ago, I worked on a (never released) commercial game, where I was responsible for writing the enemy AI.  It was a vehicle-based arcade combat game, vaguely similar to the Twisted Metal series.

Anyhow, I was bored one day, and so built a backpropagation feedback loop into the AI structure so that enemies would learn from their experiences.  The backpropagation worked, but there was actually very little time for enemies to learn, as most would be killed within just a few seconds of engaging the player.  So I decided that I'd assume that all the AI enemies were in radio contact with each other, and so everyone in the level could learn from the experiences of those who were actually fighting the player now.

That worked a lot better.  By about a quarter of the way through a level, the enemy had learned enough to stop their more foolhardy moves (such as charging directly into me from the front), and were actually starting to use more effective tactics against me.  But by about halfway through the level the enemies gradually began to become much sparser;  some enemies which had been placed in the level simply weren't there.  Some gun turrets wouldn't attack me.  And then, not much more than midway through the level, the enemies were simply gone.

I was a bit puzzled about what had happened.  I dropped into the debugger and yes, the missing enemies were all still alive and in the game.  I paused the game and took control of the camera to fly around the level, and eventually located them;  All the remaining enemies in the game (the ones I hadn't encountered yet) were crowded together into the far corner of the map.  I'd apparently defeated enough of their number that they'd finally realised that attacking me just wasn't ever going to work, and so their new best strategy was to find out where I was, run away, and then hope that I didn't find them.

I was very proud of them.  But for the sake of gameplay, I had to remove their learning brains.   Cry

The experience kind of soured a lot of combat games for me.  By the time I'm midway through playing a shooter, I'm usually getting a little nostalgic for my AIs who were smart enough to realise that they didn't have a chance, and would actually desert their posts to run and hide from me.
Logged
Inane
TIGSource Editor
Level 10
******


Arsenic for the Art Forum


View Profile WWW
« Reply #2 on: May 03, 2008, 02:38:43 PM »

so their new best strategy was to find out where I was, run away, and then hope that I didn't find them.
That is SO awesome, Mewse :D.
Logged

real art looks like the mona lisa or a halo poster and is about being old or having your wife die and sometimes the level goes in reverse
increpare
Guest
« Reply #3 on: May 03, 2008, 02:41:23 PM »

I was very proud of them.  But for the sake of gameplay, I had to remove their learning brains.   Cry
Sad Sad Sad Sad



Logged
handCraftedRadio
The Ultimate Samurai
Level 10
*



View Profile WWW
« Reply #4 on: May 03, 2008, 02:41:42 PM »

I was bored one day, and so built a backpropagation feedback loop into the AI structure so that enemies would learn from their experiences.

You make it sound so easy...
Logged

Melly
Level 10
*****


This is how being from "da hood" is like, right?


View Profile
« Reply #5 on: May 03, 2008, 05:19:00 PM »

Maybe you should just have made sure that some actions were mandatory, like actually engaging the player or holding their position.

What you say you did in a boring day seems awfully advanced, though. Are you SURE you didn't spend a week at least on it? Tongue
Logged

Feel free to disregard the above.
Games: Minus / Action Escape Kitty
Zaphos
Guest
« Reply #6 on: May 03, 2008, 06:20:54 PM »

Couldn't you make it so 'running away' was not an option they could learn, without removing their brains entirely?

(Also, that's really cool mewse!  Though Melly, I don't think a feedback loop sounds *that* advanced?)
« Last Edit: May 03, 2008, 06:24:53 PM by Zaphos » Logged
mewse
Level 6
*



View Profile WWW
« Reply #7 on: May 03, 2008, 07:52:45 PM »

What you say you did in a boring day seems awfully advanced, though. Are you SURE you didn't spend a week at least on it? Tongue

My memory is that it was just one day, but do recall that there were a lot of boring days in that period and management was mostly leaving me to my own devices.  And it was an awfully long time ago.  So yes, it's very possible that a week's boredom has all blurred together into a single day in my head.

But Zaphos had it right;  the change really was only adding a feedback loop which adjusted the state and sub-state weighting values which my AI code was already using.  The feedback loop worked based upon changes-over-time to the outputs of heuristics which the AI code was also already using.  I had written all the really difficult AI code long before this point.  Smiley

Couldn't you make it so 'running away' was not an option they could learn, without removing their brains entirely?

The problem wasn't that they had learned that running away was good;  it's that they had learned that attacking the player was bad.  All their various attack options had been penalised to the point that their adjusted "how much do I want to do this" values were near zero.  In comparison to that, they felt that retreating from the player (or failing that, any of their other high-level goals) were much better alternatives. 

So even if I'd entirely removed their ability to run away, they probably still would have chosen to attack someone else (members of another faction, unaligned NPCs, etc), or repair another vehicle or follow a patrol route or engage in other non-direct-combat activities.

I didn't really remove their brains entirely, but I did turn off the "everyone learns from everyone else" logic, and made each enemy's goal penalties decay over a minute or so.  In effect, I'd taken away everything but their short-term memory.  Which from my point of view, does kind of count as removing their brains.  Sad
Logged
Zaphos
Guest
« Reply #8 on: May 03, 2008, 09:48:44 PM »

The problem wasn't that they had learned that running away was good;  it's that they had learned that attacking the player was bad.  All their various attack options had been penalised to the point that their adjusted "how much do I want to do this" values were near zero.  In comparison to that, they felt that retreating from the player (or failing that, any of their other high-level goals) were much better alternatives. 

So even if I'd entirely removed their ability to run away, they probably still would have chosen to attack someone else (members of another faction, unaligned NPCs, etc), or repair another vehicle or follow a patrol route or engage in other non-direct-combat activities.

I didn't really remove their brains entirely, but I did turn off the "everyone learns from everyone else" logic, and made each enemy's goal penalties decay over a minute or so.  In effect, I'd taken away everything but their short-term memory.  Which from my point of view, does kind of count as removing their brains.  Sad
Oh, I see.  Still, I'd think you could hack around it a bit by saying, the feedback loop can't deviate more than this far from the initial priorities, or, the feedback loop has to re-normalize things so that an enemy has at least probability p of picking one of the 'attack the player' options.

I like the idea a lot -- it does seem like a simple feedback loop could give a good sense like, "as soon as the player starts to figure out how to deal with one AI strategy, the AI switches it up."  So if it could be made to work, that'd be pretty sweet Smiley
« Last Edit: May 03, 2008, 09:50:24 PM by Zaphos » Logged
William Broom
Level 10
*****


formerly chutup


View Profile
« Reply #9 on: May 03, 2008, 10:07:31 PM »

LOVE seems like it will do this pretty well. I don't need to tell anybody what LOVE is, now, do I?
Logged

Melly
Level 10
*****


This is how being from "da hood" is like, right?


View Profile
« Reply #10 on: May 03, 2008, 10:14:48 PM »

It's in our hearts.
Logged

Feel free to disregard the above.
Games: Minus / Action Escape Kitty
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic