Does this sound like an appropriate approach or has anyone any other ideas?
My current project is a caveman simulator. Sort of a cross between the people simulation in The SIMs, role-playing like Oblivion, and realistic simulation like a flight simulator.
fatigue goes down at a rate of 1.05% per second
water goes down 1% every 10 minutes
food goes down 1% every 15 minutes. + 1% per hour in cold weather (increased calories required to maintain body temp).
sleep goes down 1% every 10 minutes
mood is affected every 15 minutes by food, hygiene, water, encumbrance, disease, social, rain, heat, and cold.
hygiene is reduce by 1% every 7 minutes if active, by 2% if running, and by 1% every hour if active.
NPCs heal at a rate of 1:5000 chance per minute to heal 1 point of damage. An average NPC has about 12 hit points.
NPC and God relations move towards zero at 1% per day.
sleep recharges at 1% every 2.77777 minutes. this is affected by quality of bedding, and weather (if sleeping outdoors).
it takes 9 seconds to eat one unit of a given type of food. the amount of food boost you get depends on the food eaten. from a low of 1 for fruit juice, to a high of 15 for meat and veggie stew.
drinking one unit of fluid requires 2.66666 seconds. the chance to get a water boost of 1% is a function of the quality of the water (100% quality = 100% chance). you also get a food boost from drinking things like fruit juice.
I don't try to sync the player to the game clock. just like real life, if you don't go to bed and get up at regular hours, you'll find yourself living on the timezone of someplace you're not.
mostly, i make it so they go down at a correct rate for death. IE water goes down at a rate which makes them die of dehydration in the same amount of time as they would in real life (about 3 days). and it takes about 3 weeks to starve, etc.
in the end, all you can do is make a first best guesstimate of what the rates should be, then test and tweak til things seem ok.
as for "freewill" AI to undertake actions based on these:
In the previous version of the game, I used an expert system that would go down a checklist of prioritized needs. water first, cause that's the fastest way to die, then food, etc. I got it all the way up to where they would explore the world, find resources, gather resources, and use the resources to manufacture weapons and equipment. at that point i decided that "free will" was programming the computer to play the game for you, and decided not to implement it at all. Instead, the checklist was used as the basis for the interactive tutorial, advising the player as to what they ought to do next, based on the current state of the world simulation. it would guide you from a new character with nothing to the point where you had food, water, shelter, resources, had made a weapon, and had all the skills to do these things.
Every simulated minute results in the variables changing based on the current action.
timewise, i model things in periods of 66 milliseconds, not one minute. for my game engine, this is analogous to using a frame as the unit of time in a shooter title running at 30 fps.
My fear is that it will all come a bit contrived when I add other variables, motivations and actions and I will have to tweak the existing ones to make them reflect "normality"
if you're shooting for realism in your simulation, there will be no substitute for testing and tweaking. try to come up with a good model or formula or set of rules based on reality first. then put in your best estimate of what the rates of increase and decrease should be. and then you have to dial it in, to balance it.
it can be done. i have 6 core stats, 14 variable stats, over 200 objects, 10 types of environments, 50 skills, 75 types of animals, and over 1000 actions implemented by 100 separate action handlers. and everything affects everything. 13 months into the project, and i still tweak stuff. with each tweak, it becomes more realistic. come up with a good model, put in realistic numbers, test and tweak.