Author Topic: Ideas for AI partners  (Read 30721 times)

Vanguard

  • Rogueliker
  • ***
  • Posts: 1112
  • Karma: +0/-0
    • View Profile
Ideas for AI partners
« on: October 01, 2009, 05:40:48 AM »
I'm considering making an AI companion a somewhat major part of my game, and I'd like to hear people's thoughts on various ideas.

I'm planning on having them be mostly identical to the player - they both share experience and level ups, and can use the full range of equipment.

Firstly, what if I made it so your partner couldn't permanently die, but instead after running out of health, they were unavailable until you exited and re-entered the dungeon (which would regenerate all of the enemies inside)?

I'm trying to think of ways to minimize the frustration, and permanently losing half of your fighting force due to an AI mistake would be just that.  On the other hand though, it might be exploitable if the player enters a dangerous area and has their partner fight enemies, while they wait on the stairs with no real risk.

I don't want the player to not get experience for the AI's kills, because that would add to the frustration I'm trying to avoid.  Does anyone see a good way around this problem though?

Another thing I'm considering is adding a friendly fire toggle.  I know that it's the tradition in roguelikes for everything in a ball spell to take damage, be it an enemy, a teammate, or you yourself, but poor positioning on the AI's part could make things a lot less fun when they're a serious part of the game.  Do you think it would be a good idea to make it so the player can "turn off" their ability to harm friendly npcs at will?

Thirdly, I'm sure some people would prefer not to have to deal with an AI's issues, or maybe they just like the style of "going it alone" better.  What would be a good way of compensating these players for their lack of a party member?  Would giving them slightly more attribute and skill points upon levelling up be good?  What if I awarded slightly more experience per kill to players who fight without a teammate?  The biggest problem I see there is that once they've reached the maximum level, the player with an AI teammate is objectively superior to the one without.

A few alternate ideas I'm considering are letting AI teammates die permanently, but having a limited supply of them back at the main town (say, 10), so while the AI may mess up here or there, the player shouldn't run out unless they themselves get careless.  They'd always match your experience level, so there wouldn't be any bothering about getting the new guy up to par.  Similarly, I could have only one companion, but they'd get a few "extra lives," so to speak, giving a similar result.  What if they survived any hit that reduced them below 0 hp, so long as it didn't take them below -10?  What if they left their unconscious body as an item that had to be carried to the exit to save them (as the game Guild does, if anyone has tried that)?

So what do you all think?  Is it worth the trouble, or should I not bother and go the traditional route instead?

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Ideas for AI partners
« Reply #1 on: October 01, 2009, 06:33:07 AM »
I think all your ideas suck quite bad. Forcing to work with stupid AI characters has ruined many potentially good games. I say make everything optional: you can have companions if you want to and you can kill them/they can be killed. The game is not over when someone of them dies.

Vanguard

  • Rogueliker
  • ***
  • Posts: 1112
  • Karma: +0/-0
    • View Profile
Re: Ideas for AI partners
« Reply #2 on: October 01, 2009, 06:53:25 AM »
Your opinion is noted, but you could do with some more tact.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Ideas for AI partners
« Reply #3 on: October 01, 2009, 08:55:54 AM »
Your opinion is noted, but you could do with some more tact.

What is "tact"?

Etinarg

  • Rogueliker
  • ***
  • Posts: 424
  • Karma: +1/-1
  • Idea archivist and game tinkerer.
    • View Profile
    • Gedankenweber Blog (German)
Re: Ideas for AI partners
« Reply #4 on: October 01, 2009, 09:04:51 AM »
I'd assume a meaning along the lines of diplomacy and tactfulness.

Fenrir

  • Rogueliker
  • ***
  • Posts: 473
  • Karma: +1/-2
  • The Monstrous Wolf
    • View Profile
Re: Ideas for AI partners
« Reply #5 on: October 01, 2009, 01:34:25 PM »
Could you somehow make the game about keeping stupid allies alive? You could make it so there's always more allies on the surface, but getting them experience takes time.

Stopped Auto-explore: Greater Demon
You begin sneaking.
Blain begins sneaking.
Thog begins sneaking.

Thog shouts, "Hey, I found a nickle!"
The greater demon notices Thog!
Player: "Bloody stupid... NO! Don't run this way!"
Thog bumps into you.
The greater demon notices you!
Player: "OH SHI-"
Blain snickers.

This sounds like it could be annoying. Just a thought.
« Last Edit: October 01, 2009, 01:36:09 PM by Fenrir »

Etinarg

  • Rogueliker
  • ***
  • Posts: 424
  • Karma: +1/-1
  • Idea archivist and game tinkerer.
    • View Profile
    • Gedankenweber Blog (German)
Re: Ideas for AI partners
« Reply #6 on: October 01, 2009, 01:57:14 PM »
Do you think it would be a good idea to make it so the player can "turn off" their ability to harm friendly npcs at will?

In a team based game, with AI controlled members, I think allies should not be hurt by area attacks. It would make the game just too difficult and contradict the importance of working together with your AI controlled companion.

I see two routes. The traditional "one character and their pet", or the warlord/summoner approach "one character and his army".

In the latter case it's easier to play with a fairly stupid AI, since the size of the army will make up for the mistakes of single members. If it's only one pet, I think the player will need quite some control over the AI.

Vanguard

  • Rogueliker
  • ***
  • Posts: 1112
  • Karma: +0/-0
    • View Profile
Re: Ideas for AI partners
« Reply #7 on: October 01, 2009, 10:16:51 PM »
Could you somehow make the game about keeping stupid allies alive? You could make it so there's always more allies on the surface, but getting them experience takes time.

Stopped Auto-explore: Greater Demon
You begin sneaking.
Blain begins sneaking.
Thog begins sneaking.

Thog shouts, "Hey, I found a nickle!"
The greater demon notices Thog!
Player: "Bloody stupid... NO! Don't run this way!"
Thog bumps into you.
The greater demon notices you!
Player: "OH SHI-"
Blain snickers.

This sounds like it could be annoying. Just a thought.

Dungeon Minder already has the working-with-an-intentionally-incompetent-AI niche down.

Hi

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 154
  • Karma: +0/-0
    • View Profile
    • Email
Re: Ideas for AI partners
« Reply #8 on: October 02, 2009, 01:10:27 AM »
you could make it so that you two share experience earned but when the AI dies the experience that they have given from that level vanishes. Maybe make it so that experience isn't applied until you go down a level from where it was earned.

purestrain

  • Rogueliker
  • ***
  • Posts: 172
  • Karma: +0/-0
    • View Profile
Re: Ideas for AI partners
« Reply #9 on: October 02, 2009, 06:53:07 AM »
You just need a way to communicate with the AI. Just simple things
- Fall back
- Attack left crowd
- Stay here
- Be stealthy...
- Don't fight until required
- Engage in combat
- I want't to do a ranged attack <here> so stay out

You can't blame the AI if the AI doesn't know what your plans are.

Antsan

  • Rogueliker
  • ***
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: Ideas for AI partners
« Reply #10 on: October 11, 2009, 04:20:55 PM »
You could make the AI very customizable through a strategy interface. The game wouldn't be so much about hack and slay anymore, it would be a little bit closer to all those bot-programming games, just a little bit less complicated. Writing scripts of how to behave combined with keyboard makros (first hit a special key to mark the next one as command to your ally) to switch between different script (some could be provided from the very beginning) could make the game accessible to more players and the system more flexible.
"Seems Plan A doesn't work right, switch to Plan B!"

Friendly fire should at all means be included, I think. There is so much space for additional gameplay. Why cut out the challenge? With the system as described above this would be even more crucial: You wouldn't have to take care that you don't hurt your ally, you would have to take care that he won't blast you into pieces accidentally.

Of course this wouldn't be really newbie-friendly.

Slash

  • Creator of Roguetemple
  • Administrator
  • Rogueliker
  • *****
  • Posts: 1203
  • Karma: +4/-1
    • View Profile
    • Slashie.net
    • Email
Re: Ideas for AI partners
« Reply #11 on: October 11, 2009, 04:39:56 PM »
I think all your ideas suck quite bad. Forcing to work with stupid AI characters has ruined many potentially good games. I say make everything optional: you can have companions if you want to and you can kill them/they can be killed. The game is not over when someone of them dies.
Your post goes against Rule 1.2 of the Codex of the Temple, please read it again and have it in mind while posting

Ex

  • IRC Communications Delegate
  • Rogueliker
  • ***
  • Posts: 313
  • Karma: +0/-0
    • View Profile
Re: Ideas for AI partners
« Reply #12 on: October 11, 2009, 08:34:04 PM »
I like pet AI characters in video games. MMOs use them quite a bit, rather successfully I might add. In terms of the actual AI, it shouldn't be too difficult to rig something. In most MMOs, the player receives experience for the pet's kill, but not as much as the player would have if he had killed it himself. Some offer equally for pets, but this makes pets incredibly powerful. But that seems to be the intent here, so the player could simply receive all the experience for the pet's kill, and the pet could receive it, too.

In terms of ally intelligence, just allow the player to command the pet. The pet should automatically start doing common sense things, like attacking a monsters which is attacking the player or itself. But the player needs to be able to directly control the monster with basic commands. Stuff like attack, defend, run, heal, etc. All these commands should take targets, such that you can command your pet to attack a specific character. Of course, the pets should occasionally ignore your commands, but not too often. Probably, they would be more likely to disobey if their health is low.

Making the pet follow the player should be fairly easy. If the pet gets stuck over a distance of some amount from the player for over a certain amount of time, the pet can be moved to the player. To do so, scan the area around the player in a certain radius for any open squares. For each open square, find out it's distance from the monster's old location. Use the open location close to the player that is also closest to the monster's old location as the monster's new location. Pretty simple.

Pets with ranged weapons or area of effect attacks would be pretty cool... Great idea! Good work!

Vanguard

  • Rogueliker
  • ***
  • Posts: 1112
  • Karma: +0/-0
    • View Profile
Re: Ideas for AI partners
« Reply #13 on: October 12, 2009, 02:12:00 AM »
I appreciate all the suggestions, but please bear in mind that this is my first time writing a "real" AI, so it's probably not going to be terribly advanced.  The biggest thing I'm going to work on is never having them be a burden on the player, or at least, as little as possible.  That means that they don't pick up items without permission, they shouldn't pick fights the player clearly doesn't want to get involved in, they'll never attack a friendly character until the player has attacked them first, and so forth.

I'm curious which of these two options is more popular:

The first option is having it so at character creation, you make both your own character and your sidekick.  You have full control over what attributes and skills your sidekick acquires as you progress.

The second option is having an adventurer's guild of sorts, with a set of static AI sidekicks you can choose from.  They will always scale up to your experience level, and you can freely switch between them at the guild.  If one dies, they're gone forever, but you can hire another to replace them, and will only be left companionless if you manage to get the entire guild killed off.

For the first option, there are a lot of possibilities for how I could handle their death or defeat, and I've already explored them in the first post.

Etinarg

  • Rogueliker
  • ***
  • Posts: 424
  • Karma: +1/-1
  • Idea archivist and game tinkerer.
    • View Profile
    • Gedankenweber Blog (German)
Re: Ideas for AI partners
« Reply #14 on: October 12, 2009, 07:51:06 AM »
I appreciate all the suggestions, but please bear in mind that this is my first time writing a "real" AI, so it's probably not going to be terribly advanced. 

Keep it simple. A very basic behavioral model will already be good enough for most RPGs. The more simple it is, the less likely you are to make mistakes in implementing it.

A suggestion:

Try to make framework. This will have basic function like "find path to/move to", "attack target" or "cast a spell". Then make decision plugins, which will evaluate the importance of actions. Let the framework call all decision plugins (how important is it to move now? How important is it to attack? ...) and then call the basic function based on the plugins evaluation of the situation. This way you can expand the framework easily later, and most of the brainwork will be in the plugins, and not intermixed with the basic framework code - so the plugins are easier to understand and easier to bugfix.