Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creature mood system #11

Closed
Bertram25 opened this issue Jul 29, 2014 · 25 comments · Fixed by #454
Closed

Creature mood system #11

Bertram25 opened this issue Jul 29, 2014 · 25 comments · Fixed by #454
Assignees
Milestone

Comments

@Bertram25
Copy link
Contributor

See also: http://forum.freegamedev.net/viewtopic.php?p=56960#p56960

A new config file defining the mood will be introduced. It will define mood modifiers (each having a unique name).

  • Each creature starts with a default mood of 1000 (configurable)
  • Mood modifiers are computed during the creature upkeep. But not each turn, it will be randomly computed to avoid computing it too often (with a random period between 0 and 5 turns)
  • Modifiers can be > 0 (will make creature happy) or < 0 (will make creature angry)
  • There are several levels of hapiness: (happy, neutral, upset, angry, furious). They depend on base mood + mood modifiers. When < 0, the creature will be unhappy (angriness level configurable).
  • When the creature is happy/neutral, it behaves normally
  • Upset creatures have up to 20% chances of stopping to work when working. They engage allied creatures with mood modifier < 0 in sight (if no ennemy in sight)
  • angry creatures: same as upset + they might flee (20%) if an enemy is nearby + they don't work at all
  • furious creatures: same as angry + They try to go to the portal and leave the dungeon if they reach it. An angry creature for more than 2 minutes will become rogue (cannot be picked up and attacks any player).
@hwoarangmy
Copy link
Contributor

BTW, shall we had natural ennemy creature so that your own creatures fight each other like in DK ?
That was fun :)

@Bertram25
Copy link
Contributor Author

BTW, shall we had natural ennemy creature so that your own creatures fight each other like in DK ? That was fun :)

Yeah, that's quite the consequence I sincerely think we had in mind when a creature is in bad mood.
IMHO, though, the other creatures shouldn't touch the creature mood since it's making things harder to maintain, but making natural enemies fight when their mood is low instead sounds cool to me. :)
What do you think everyone?

@hwoarangmy
Copy link
Contributor

Yes, if in bad mood, if a creature with negative modifier is found, it should be attacked.

BTW, I think we should define in CreatureMood a modifier per creature so that if there is 1 dwarf, it is not the same as full of dwarfs :)

@akien-mga
Copy link
Member

That sounds great :-)
To which extent should "natural enemies engage in fight" be understood though? Will they fight until one of them dies, or would they deal a few non-lethal blows?

@hwoarangmy
Copy link
Contributor

Will they fight until one of them dies, or would they deal a few non-lethal blows?

If I remember well, in DK, they would fight to death (like spider and fly)

@Bertram25
Copy link
Contributor Author

Yep, fight to death.

@Bertram25
Copy link
Contributor Author

Yes, if in bad mood, if a creature with negative modifier is found, it should be attacked.
BTW, I think we should define in CreatureMood a modifier per creature so that if there is 1 dwarf, it is not the same as full of dwarfs :)

Last thing I wonder is whether we should apply such a modifier right away at spawn time, or whether we should apply it when two creatures "meet each other". The latter would permit us to separate such creatures, but also make it more natural... What do you think?

@hwoarangmy
Copy link
Contributor

Last thing I wonder is whether we should apply such a modifier right away at spawn time, or whether we should apply it when two creatures "meet each other".

Applying only when they meet, will be a little bit more complicated. If we do so, we should have huge modifiers that apply only when creatures can see each other. This way, if a spider is surrounded by flies, it will attack one easily. And if you manage to get flies away, it won't affect spiders :)

Even if we do that this way, we can keep the creature condition spawning even if they never meet

That sounds good to me :)

@Bertram25
Copy link
Contributor Author

That sounds good to me :)

Sorry, which one of the solutions?

@hwoarangmy
Copy link
Contributor

Sorry, which one of the solutions?

Applying when they meet :)

@Bertram25
Copy link
Contributor Author

K, fine to me. :)

@hwoarangmy
Copy link
Contributor

Actually, to me, we should use a huge modifier that applies per natural ennemy/friend in range sight.

@Bertram25
Copy link
Contributor Author

Looks fine. We'll fine tune values anyway after the thing is implemented.

@Danimal696
Copy link
Contributor

Fight to the death when a creature meets another one it doesnt like and its on a bad mood (probably from seeing that one creature) im with Hwoarangmy in this.

@Bertram25
Copy link
Contributor Author

Set milestone 0.4.9 for the spawn conditions part. It'll move back to later once this part is done. :)

@hwoarangmy
Copy link
Contributor

Why don't you rename this one to mood system and open another one with spawn conditions ?

@Bertram25
Copy link
Contributor Author

Why don't you rename this one to mood system and open another one with spawn conditions ?

Official reason: Because at the time the issue was created, we needed to have a whole view of the future format and I didn't get around reviewing this so far.

Non-official reason: Because I'm such a lazy one sometimes. ;)

Ok, let's split the issue, especially now much of the new format is more or less functional.

@Bertram25 Bertram25 changed the title Creature advanced spawn conditions & mood system Creature mood system Oct 22, 2014
@Bertram25 Bertram25 modified the milestones: Later, 0.4.9 Oct 22, 2014
@hwoarangmy hwoarangmy self-assigned this Jan 23, 2015
@hwoarangmy
Copy link
Contributor

I will have a look at the mood system. My proposition is (as always, I will update the issue description when we agree):

  • Each creature starts with a default mood of 1000
  • Mood modifiers are computed during the creature upkeep. But not each turn, it will be randomly computed to avoid computing it too often (with a random period between 0 and 5 turns)
  • Modifiers can be > 0 (will make creature happy) or < 0 (will make creature angry)
  • After being computed, if the mood is < 0, the creature will engage allied creatures with mood modifier < 0 in sight (if no ennemy in sight) and might flee if it an enemy is nearby.
  • No mood modifier should be hardcoded (including awakness or hunger)

Questions:

  • Do we want several angry levels (example: if mood between 0 and -100, they attack natural enemies, if between -100 and -200 and 10% chances of fleeing when there is an enemy, they attack any nearby allied creature and 25% chances of fleeing when there is an enemy, if between -200 and -300, they attack rooms/traps, if < -300, they leave the dungeon).
  • Do we want creatures to leave the dungeon if angry ?

@Bertram25
Copy link
Contributor Author

Do we want creatures to leave the dungeon if angry ?

I think yes, but only at extreme low mood and for some time. Remember we have now have to pay them (ah, I do think the payday fees should be lowered a bit, but WDYT?) and it means that the mood will end being bad somehow, I guess, even (mostly?) at the beginning of the game where you don't have much money and a lot of needs.

Do we want several angry levels

I think yes, too. Do we prevent them from working also at some point?
But I do think the creatures should only attack other creatures they hate, and not destroy your rooms/traps as it is hard enough to build it all up with an enemy on the other side of your walls.

I guess the casino (that is increasing mood), and support to force a creature to leave will also be needed next to this feature. ;)

Just my two cents.

@Danimal696
Copy link
Contributor

But I do think the creatures should only attack other creatures they hate, and not destroy your rooms/traps as it is hard enough to build it all up with an enemy on the other side of your walls.

Yes, please, no room destroying; but i would change
-200/-300 They try lo leave your dungeon
<-300 They become feral/rogue (change to teamless- attack anything) so you no longer have power over then (as opposed to being able to jail a creature that is trying to left your dungeon)

Mood in creature config, so some of them have shorter fuses than others (demons) or massively longer (skeletons). I also think we need to lower the creature run away chance in normal combat to something like 10% HP left, rigth now all creatures run away in any figth and i feel we need more battles to the death, so maybe a chance to not to run away?

@hwoarangmy
Copy link
Contributor

What I've said when indicating the different angry levels were just examples, no worries ^^

ah, I do think the payday fees should be lowered a bit, but WDYT?

Well, payday is IMHO the key to drive average game length. If it is expensive, aggressive players will have an advantage. If it is not, it will encourage to turtle. We should play carefully with that. Now that it is said, I've never played a real game since pay day so I don't really know if it is too expensive. If you feel it is, you can change it as you will. Remember that you can change the fees or the time between 2 pay days.
Note that this time should not be too quick as creatures will become angry with gold after 2 pay days if they are not paid.

Do we prevent them from working also at some point?

I think yes.

-200/-300 They try lo leave your dungeon
<-300 They become feral/rogue (change to teamless- attack anything) so you no longer have power over then (as opposed to being able to jail a creature that is trying to left your dungeon)

Ok, I will have a look. But IMHO, we should first decide how they behave when angry. So, here is what I think (mood values will be configurable):

  • -0/-200: they have up to 25% chances of stopping to work when working. They engage allied creatures with mood modifier < 0 in sight (if no ennemy in sight) and might flee (20%) if an enemy is nearby
  • -200/-400: same + they don't work at all
  • < -400: same + They try to leave dungeon
  • < -600 (for 2 minutes): They become rogue

Mood in creature config, so some of them have shorter fuses than others (demons) or massively longer (skeletons)

Of course ;-)

I also think we need to lower the creature run away chance in normal combat to something like 10% HP left

I will open another issue for that

Do we agree ?

@Bertram25
Copy link
Contributor Author

Note that this time should not be too quick as creatures will become angry with gold after 2 pay days if they are not paid.

You're right. Let's have a few games before tweaking stuff. Well, you know, when you play the Keeper, you get angry and cruel fast (against your own creatures and the enemy ones) ;)

I will open another issue for that

Yep, I agree as for me. This is not linked to mood directly so I guess we can do it now.
Again, once the overall mood stuff is done, a few games should show what's too high or too low.
Nice work toward clear specs. :)

@hwoarangmy
Copy link
Contributor

BTW, I was wondering if it could be a good idea to create a special file for mood (instead of creatures.cfg) because:

  • creatures.cfg is already pretty big
  • I don't think we should allow to override mood modifiers in levels
  • Because mood will be affected by other creatures, we need to have loaded every classes before being able to check for the mood modifier about creatures. I know we can do that even if we let it in creatures.cfg but I think it is not straight forward.

WDYT ?

@Bertram25
Copy link
Contributor Author

Ok for me. It doesn't change anything and if it can make things simpler for you, there is no way we should bother for that.

@hwoarangmy
Copy link
Contributor

ok. I will do that then.

@Bertram25 Bertram25 modified the milestones: 0.5.0, Later Jan 28, 2015
@Bertram25 Bertram25 mentioned this issue Jan 28, 2015
73 tasks
akien-mga pushed a commit to akien-mga/OpenDungeons that referenced this issue Feb 2, 2015
part of OpenDungeons#11

Creatures becoming rogues are missing. This because we have to decide how to make them become rogue
hwoarangmy referenced this issue in hwoarangmy/OpenDungeons Aug 3, 2015
… were removed

+ dehardcoded the dirt tile used as a workaround for lightning issues

fixes OpenDungeons#700
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants