Thursday, July 07, 2005

Rains, Dishes and Dilemmas

Rains have started, water level is going up and so is the number of people falling Ill. I am down with fever and a terrible body ache. I am feeling very restless and i have not felt like this in a long time, I am sure it’s the fever and a very dull weather outside that is contributing a lot to this but I guess there is one more thing which in sub conscious state is adding to the misery.

I am stuck with one of the components of the game. Chef Rastogi

I have completed the Level Editor (more or less), its good enough for me to make levels, save them, load them and re-edit them, so that’s good enough for the time being.

When I started the design work for the Restaurant part of the game, in which the player decides what dish he wants to serve to the AIEaters, I landed in a dilemma. The problem is how can a Chunk of Computer Code figure out whether a Dish it just inputted was tasty enough or not.

A Brief on the Dilemma.

In the game dishes can be made up of a finite number of Ingredients (These are fixed).

Ingredients are divided into the following categories (If required these categories can be changed - but will be fixed for the final game)

  • Non-Veg
  • Vegetables
  • Fruits
  • Spices and Herbs
  • Pulses and Cereals
  • Others (Things like salt, Coffee, Milk, oil etc comes here)
So a dish can be made up of
  • 3 ingredients from Non-Veg category
  • 1 ingredient from vegetable category
  • 0 ingredients from fruit category
  • 4 ingredients from spices and herbs category
  • 1 ingredient from pulses and cereal category
  • 2 ingredients from others category
The name of the dish is a Chicken-Ham-Fish Sizzler with Rice and Potatoes

Sounds yummy

What are the various approaches for a Computer controlled entity - AIEater deciding whether it likes this dish or not?

Theory of Taste: There are in all 5 different kinds of taste buds
  1. Saltiness
  2. Sourness
  3. Sweetness
  4. Bitterness
  5. Umami

My Approach:
Each ingredient has 6 properties
  1. Salt Value [0-1-2-3]
  2. Sour Value [0-1-2-3]
  3. Sweet Value [0-1-2-3]
  4. Bitter Value [0-1-2-3]
  5. SPICE Value [0-1-2-3] (Note the difference here, not take Umami)
  6. Non-Veg or Veg Flag (Boolean)

Each AIEater also has his set of taste values besides his living standards, health, thrill of dinning out etc ,which are not required here)

  1. Salt Value [0-1-2-3]
  2. Sour Value [0-1-2-3]
  3. Sweet Value [0-1-2-3]
  4. Bitter Value [0-1-2-3]
  5. SPICE Value [0-1-2-3] (Note the difference here, not take Umami)
  6. Non-Veg or Veg Flag (Boolean)

Computation of a dish

Ingredient A - 1 2 0 1 3 True
Ingredient B - 1 3 1 1 1 False

if you add the above to make a dish, the dish will have
Dish XYZ - 1 3 1 1 3 True (Higher value is taken; note 1 and 1 does not make the dish (2) twice salty as the proportion of food (Quantity) also increases.

Now AIEater will like this dish if the values match his taste buds (with some variance)

PROBLEM WITH THIS APPROACH:

The taste properties of more than 1 dish can be same, despite of being made up of different ingredients.

Therefore,

Chicken ADD SOYA SAUCE - Taste Good to AI
Chicken ADD ICE-CREAM - ADD Salt - ADD Vinegar - Taste Good to AI

But the later is YUCK!

Phew!

What I am looking for is a more practical and sensible (Making Sense out of a dish) approach for the AIEater to enjoy his food.

PS: AIEater are working on a very simple genetic algorithm (right now)
They are born with a set of taste buds and they evolve their taste buds as the game progress.

Any ideas or random thoughts on this can help me out. Please mail me

No comments: