Code Monkey home page Code Monkey logo

gamygdala's Introduction

gamygdala

An emotion engine for games based on the Gamygdala approach (with an eyewink to game and amygdala).

This is the main repository for the Gamygdala emotion engine. It is used for emotion simulation in NPCs or player controlled characters in games. For now we have published the javascript version of the system. A c# version and Java version are in development.

For more info visit the website (http://www.joostbroekens.com/gamygdala). You can read more there, and run the example code. The example code is based on the game engine Phaser from photonstorm (http://www.photonstorm.com/). Gamygdala itself is not dependent on Phaser, but we have created two Plugin classes so that easy integration is possible with the Phaser Plugin system.

To see the running example that explains Gamygdala usage, or to play the two (simple!) example games, visit http://www.joostbroekens.com/gamygdala. To get a complete local copy that runs, download the master branch, and unzip. Run mongoose-free-5.3.5.exe which creates a simple web server with root dir the local dir where gamygdala is in. Then visit: http://localhost:8080 and click on the link to see the example.

To play around and learn how to use gamygdala edit gamygdala_demo.html Hint: use Notepad++ to edit.

Have fun!

Joost Broekens TU Delft

gamygdala's People

Contributors

broekens avatar svenvanhal avatar

Stargazers

 avatar  avatar Ship of Genius avatar  avatar Yiran Zhang avatar 缘炒 avatar Brendan Fallon avatar Gilzamir Gomes avatar  avatar Josh Grebler avatar Dmitriy Chernukho avatar Saimon avatar Fahd Alhazmi avatar Marcus L Endicott avatar KobraKid avatar Haley avatar  avatar Daniel Gilbert avatar Fausto Vanin avatar  avatar Sean Thompson avatar Sergey Tolmachev avatar Andrew Prentice avatar Drew Prentice avatar Maira B. Carvalho avatar Dietrich Ayala avatar Michael Anthony avatar Chris Dolphin avatar  avatar Blaine Motsinger avatar Magnús Snorri Bjarnason avatar  avatar

Watchers

Michael Anthony avatar Alex Popescu avatar Sergey Zhulin avatar  avatar Maira B. Carvalho avatar

gamygdala's Issues

There is an error on update goal likelihood?

In incremental updates of the goal likelihood (line 351 to line 353 in file Gamydala.js), likelihood is calculated as:

	newLikelihood = oldLikelihood + likelihood*congruence; //line 352
	newLikelihood=Math.max(Math.min(newLikelihood,1), -1); //line 353

Like me a miss calculation of the goal likelihood in a range out of [0, 1] (line 353). A fix for this issue can be:
newLikelihood=Math.max(Math.min(newLikelihood,1), 0); //line 353

Right?

Thanks

Incongruous emotional states?

Consider the following code:

let emotionEngine = new TUDelft.Gamygdala();
let emotionAgent = emotionEngine.createAgent('player');
emotionEngine.createGoalForAgent('player', 'win', 1.0);

emotionEngine.appraiseBelief(0.5, null, ['win'], [1]);
emotionEngine.printAllEmotions();

emotionEngine.appraiseBelief(1, null, ['win'], [-1]);
emotionEngine.printAllEmotions();

Output:

player feels hope:0.25, 
player feels hope:0.25, distress:0.75,

We would expect an agent to feel hope after the first appraisal, as they do here, but not after the second appraisal once we've shattered their dream of winning. However, the "hope" emotion is still hanging out in the agent's array of emotions.

I'm not sure if this is a bug, a limitation of the system, or intended behavior. It doesn't seem to make much intuitive sense to me, but I admit I might be missing something. Is the current emotional state supposed to be generated anew for each appraisal? Or, are the old emotions supposed to hang around, as happens now, even when they seem incongruous?

I believe the agent should also be feeling disappointment: 0.75 after the second appraisal, but that issue is mentioned here: #9

Shared goals but only one evaluation and non-reachable "disappointed" state

Thanks for a great example of Gamygdala implementation.

Trying this out in a translated version for SWIFT to run on Mac (done myself based on your JS code) I have a few questions

  1. It seems the model can have the same goal associated with different NPCs (share goal) - however, is it correct that utility cannot vary in the implementation ? Let’s say two NPCs has the same goal but that one has disutility (negative utility) from achieving the goal - and the other has utility from achieving the goal. It seems that both NPCs would refer to goal identified by goal-name uniquely.

  2. My other question is about calculating internalEmotionalState where the condition to become "disappointed” is Likelihood of achieving goal equals zero and secondly that the change in delta likelihood is strictly above 0.5. This implies that LH must have been negative before the belief-update - but that does not seem to be possible since the normal update rule for new Likelihood = (Congruence x Likelihood + 1) / 2 - thus a number between zero or 1. Thus, it seems that “disappointed” emotion can never be reached? Am I missing something here? Should deltaLikelihood be evaluated as below -0.5 - or maybe just as absolute (so only extreme values) ?

I fully appreciate that this is an older project so I don’t expect an answer.

Thanks for a inspirational article and very thorough implementation,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.