Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: Mercs need food and water to survive
New feature: Mercs need food and water to survive[message #307392] Sat, 14 July 2012 15:25 Go to previous message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Mercs can now eat and digest food

I've implemented a food system. Basically, this (fully optional) feature works like this:

  • Every merc now has 2 new values, 'food' and 'water'. Every hour, these values are lowered (we 'digest' food and water). The amount digested depends on a base value, the kind of activity we perform, and (for water) on the temperature of the current sector.
  • If food or water levels are too low, we suffer from it. There are the following penalties:

    • Maximum possible morale is capped. Mercs aren't exactly happy if they starve.
    • Energy regeneration by sleep is lowered.
    • Our breath regenerates slower.
    • Our performance on assignments (repairing, training, etc...) is worse.
    • There is a chance that our health and strength stats will be lowered.
  • The more hungry and thirsty we are, the more severe these penalties will be. Until we die. Yes, you can and will die from not having food and water long enough. A some point you lose several health stat points every hour, condemning your merc to a slow and agonising death.
  • Stats lost by lack of food and water can be regained by doctoring. However, they can only be healed if the patient is well-fed again.
  • With stock values, you can survive about 3-4 days without water, and about three weeks without food. This is the time until you die, you will suffer much, much earlier Smile
  • Eating food works just like using a canteen: drop the food on the body in your inventory. Food can restore food and/or water points.
  • Some kinds of food can decay over time. A coloured bar indicates the status of the food (green -> good, brown -> bad), the item description gives a hint as well.
  • Decayed food gives less food and water points. It can also poison you.
  • Food can alter morale. Drinking a fine wine can improve morale, while eating the rotting carcass of a cow might lower it.
  • If your merc is low on food, indicators on his portrait will show you that. You can also see the exact food values if you hover of the life points bar.
  • Of course your mercs wont silently die if you don't pet them. once they get hungry, they will auto-feed: They will search their inventories for food and eat if necessary. That way, you can just place some food in their inventory and let them deal with it.
  • Your mercs will refuse to eat any more food if you try to fill them up. The aren't bears you know, they don't eat tons before going into winter-sleep.
  • Canteens are now truly refillable (just like the description always said). You can fill canteens by pressing 'Ctrl' + '.'. The following will happen:
  • Canteens now don't disappear if you drink from them. They will stay at 1%, this simulates them being 'empty.'

    • If there is any water tile in this sector, all canteens in the sector and in your team's inventories will get refilled.
    • Note that water in a sector can be poisonous (like in swamp sectors). Your canteens will be filled, but the resulting watermix will be unhealthy. You can get poisoned by drinking poisonous water!
    • Otherwise, the game checks if there are any water drums in this sector. Canteens will be refilled from that as long a it has any water in it.
    • A water drum is a very huge barrel of water that exists solely for this purpose: Fill a drum with water and store it in your HQ to replenish your squads water supply.
    • Only food that has any drink points can get refilled.
    • This only works if there are no enemies in the sector.
  • You can buy food at merchants all over Arulco. Best sources are the Santos brothers. Some types of food are also available at BRs (military rations and conserves).
  • Some food can drop as random loot from enemies.
  • You can now gut dead cows and bloodcats to get their flesh. It is nutritious, but your mercs will not be happy about eating raw meat...
  • Food also works in conjunction with drugs. You can set up an item to be both drug and food, both will work. For example, energy drinks work both as an adrenaline drug and lower your thirst. Note that this way, you can also allow a drug syringe to be used multiple times Smile
  • This feature only works for the mercs of your team. It doesn't affect anybody else.
  • As Alma currently has no mechants that could sell food, your mercs can now eat in th Alma Barracks cantina, it's a new kind of facility.

Some demonstration pics:

http://i50.tinypic.com/2r62t5g.jpg
Food items in sector inventory. The general tab also gives you a hint, in case you don't know wether something is food.

http://i46.tinypic.com/23rq1rb.jpg
After 2 days, this stew has decayed and is not safe to eat any more...

http://i46.tinypic.com/70xu02.jpg
... Spider ate it anyway. As it was rotting, she received 1 point of poison for this. The empty glass on her portrait signifies that she is thirsty. If she has any water in her inventory, she will consume it automatically at the next full hour.

http://i49.tinypic.com/2mfkv42.jpg
Merchants now serve a wide variety of meals and are your primary source of food and water.

http://i49.tinypic.com/2eo9ls1.jpg
Grunty is dehydrating, an his stats suffer greatly for that...

http://i47.tinypic.com/345juab.jpg
Grunty shot a cow, and spider retrieves its meat. For survival reasons. The cow would have totally done the same, I swear.

http://i50.tinypic.com/2w3ajvs.jpg
Grunty took water from a swamp in his canteen. It was unhealthy, and now he is poisoned.

There are ini settings for this in the Ja2Options.ini under 'Tactical Food Settings'. A detailed explanation is given there.

There are new xml values in Items.xml:
  • takes an UINT32. This determines the specific kind of food this item is
  • New -tag flags:
    #define WATER_DRUM	0x00000010	//16		// water drums allow to refill canteens in the sector they are in
    #define MEAT_BLOODCAT	0x00000020	//32		// retrieve this by gutting a bloodcat
    #define COW_MEAT   	0x00000040	//64		// retrieve this by gutting a cow
    

    If you want an item to be a water drum, do not only set its ItemFlag to 16, but also set to 1.

And there is a new xml file, Food.xml (JMich-specific data follows):


	7                -> the food type (set this in Items.xml) (UINT16)
        EPA                -> description (not game relevant, purely for orientation in this file) (CHAR16, length 80)
	450      -> eating the whole food gives 450 food points (INT32)
	0      -> drink or 'water' points are here (INT32)
	50   -> one eating action will use up 50% of this items status. So we can take 2 bites off of this item here (UINT16)
	1          -> morale modifier if we eat this (food decay can lower this, even negate it) (INT8)
	0        -> the rate at which the item decays (FLOAT)



Maps/SectorNames.xml now has the new entry 2 (UINT8). This determines the water quality:
  • 0 - no water here at all
  • 1 - drinkable water (rivers, water supply from houses)
  • 2 - salt water, can't drink that (until something gets implemented...)
  • 3 - there is water here, but it is poisoned (swamps and polluted sectors)

It is assumed that sectors underground have no water source at all.

For now, there can be a maximum of 128 food items. That should be enough for now Smile

If nobody can come up with good reasons why this should be excluded, I am inclined to bring this into the trunk. However, I would first like to get some feedback/critique/improving suggestions on this.

Important: Many, many thanks to Soto for this. He provided the most awesome pics for it, it would have gone mad if he hadn't done that (the pics, not the going-mad stuff).

Edit: Thanks to an idea that came up on IRC, you can now poison your water if you take it from unhealthy sources.

Edit 2: The needed trunk version is r5413, the needed GameDir version is r1472.

Edit 3: As of r6024, food intake is now non-linear. The amount of food points is reduced the more saturated you are. It is thus reasonable to eat when you are hungry - don't be a bear preparing for hibernation Smile

Also, due to very popular demand, food percentage now goes from 0% (starving, not having eaten in 3 weeks) over 100% (optimal value) to 200% (just ate a whale).

[Updated on: Fri, 26 April 2013 02:51] by Moderator

Report message to a moderator

Captain

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New feature: strategic militia command
Next Topic: New Feature: ballistic shields
Goto Forum:
  


Current Time: Sat Nov 30 23:28:21 GMT+2 2024

Total time taken to generate the page: 0.07235 seconds