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
|
|
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
- 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
- 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:
Food items in sector inventory. The general tab also gives you a hint, in case you don't know wether something is food.
After 2 days, this stew has decayed and is not safe to eat any more...
... 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.
Merchants now serve a wide variety of meals and are your primary source of food and water.
Grunty is dehydrating, an his stats suffer greatly for that...
Grunty shot a cow, and spider retrieves its meat. For survival reasons. The cow would have totally done the same, I swear.
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
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
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
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Mercs need food and water to survive[message #307409]
|
Sat, 14 July 2012 18:25
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
Update: Thanks to a discussion, water sources can now be poisonous (think of swamp sectors). You can now specify the type of water sources in a sector via xml.
@Gambi: Sure. But note that if you set your Gun as 'food' via xmls, your mercs will eventually start eating them
@The Bob: New food types can easily be made via xmls.
@Sam: Facility would be possible, yes. Note that there already is s 'kind' of facility: Mercs that are POWs get fed by the army (not much, but enough that they'll live. Otherwise they would starve if the player wouldn't rescue them fast.
@Colibri: If you are going to Chitzena, you can stock up at San Mona (that place has 3 vendors, which makes it the fast food center of Arulco). But yes, it is a problem that there aren't hat many vendors ingame. It'll propably be common to order huge piles of military grade food...
The current food amounts at the vendors are just stock values. Feel free to increase them (and giv note if you think that is necessary).
Also, one can, if there is no other solution possible, lower the digestion rates via the Ini, which gives you more time to find food.
[Updated on: Sat, 14 July 2012 18:30] by Moderator Report message to a moderator
|
|
|
|
|
|
Re: Mercs need food and water to survive[message #307414]
|
Sat, 14 July 2012 19:42
|
|
Soto Banaris |
|
Messages:129
Registered:May 2012 Location: Germany |
|
|
What's missing now are various animals and fruits growing here and there...snakes, crows, rats, rabbits, crocodiles, bats, frogs, spiders, scorpions, crabs, mushrooms and exotic fruits. Could be implemented as creatures that flee very easily or kill once you get too close.
Oh yes... *bows at community for making the pictures* My pleasure...
[Updated on: Sat, 14 July 2012 19:43] by Moderator Report message to a moderator
|
Sergeant
|
|
|
|
|
|
|
|
|
|
Re: Mercs need food and water to survive[message #307479]
|
Sun, 15 July 2012 18:09
|
|
Buns |
|
Messages:655
Registered:September 2010 |
|
|
Absolutly amazing feature. I am looking foreward to have it in game.
I think this will indeed bring logistics to a new level because being required to carry around food and water will seriously reduce your ability to arm each merc with three or so weapons and give him a plenty of ammo and grenades. Food will eat up (hoho) LBE space and weight, forcing you to re-think the standard packages for your team.
It also is an item that is consumed all over the time regardless what your mercs do, so you have to maintain a constant "line of supply" to the nearest source - what also means that your mercs can't be away endlessly.
I also agree that there should be some kind of "in supply" facility which has a merc always in supply when he is in the respective sector. I am thinking of barracks first of all: your mercs can stay at SAM site, for example, without the need to provide for their own food; they would just eat with the other soldiers.
Another idea would be to tie it to town loyatly: A sector that can have militia and that has a certain loyatly, such as 50+%, would feed your mercs for free. This should also apply to mercs set to "Residental Homes" (either rest or patient), as well as patients in hopital.
I would not suggest to make the merc auto-supplied by facilities that are meant to allow for buying food, such as bars.
Farms could be another place for auto-supply because it would be a place for buying food but we can't have unlimted additional vendors. On the other hand, the game doesn't last for years, so farms wouldn't produce additional food during the campaign, what means this might better be places, where we can find lots of food, but once we have plundered the peseants, they don't have any more.
[Updated on: Sun, 15 July 2012 18:10] by Moderator Report message to a moderator
|
First Sergeant
|
|
|
|
|
|
|
|
|
|
|
Re: Mercs need food and water to survive[message #307555]
|
Mon, 16 July 2012 19:50
|
|
Buns |
|
Messages:655
Registered:September 2010 |
|
|
No need for the enemy to use something like that. There are basically two kinds of enemies: those that sit around in a town, SAM or other place where we would consider them "in supply", and those that run around attacking you, and that way usually don't live long enough to become hungry.
[Updated on: Mon, 16 July 2012 19:50] by Moderator Report message to a moderator
|
First Sergeant
|
|
|
Re: Mercs need food and water to survive[message #307557]
|
Mon, 16 July 2012 20:47
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
This feature only applies to your team. The most important reason for that is in the very code of the game. A bit of explanation:
The enemy soldiers do not 'exist' in this game most of the time. They are only created when we fight them in a sector. For example, the soldiers in Meduna only 'exist' once you enter their sector. Before, in the whole game, their is basically a variable somewhere that says 'there are 24 enemies here'. Only once we enter their sector, they get created, with stats, traits, colour, inventory and all that.
So in order to apply the food system to the enemy, we would have to change all that. This would not only be a MASSIVE undertaking, it would also, even if successful, put a HEAVY burden on game resources.
That's the main reason for not applying to enemies.
See it this way: Just assume that the army is either well fed, or requisites food from the poor peasants.
Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Mon Dec 02 09:39:11 GMT+2 2024
Total time taken to generate the page: 0.02774 seconds
|