
Originally Posted by
C453
This started as a joke after playing DayZ, but I decided to finish it.
no screenshots as of now.
Anyways, what this does is implements a hunger/food system much like the ones in survival games like DayZ.
Every once in a while, your hunger state changes.
If you overeat, you die.
If you starve, you die.
If you are starving, your speed, def and attack go down dramatically.
This encourages players on the private server to actually go in the realm and "hunt" for food.
Hunger level will be stored via database per character.
Also I'm pretty lazy to add my own items that I might just use @ZBORNOX 's food pack for food.
Any Ideas?
Not played DayZ before
I would like to know how the hunger system will be implemented?
The flash client could be modified to add a new stat called hunger, depends on the method you are using to notify the user of the hunger level, maybe a simple text packet containing the message “food level at 100 percent” sent every minute to each player.
I’ll assume the food items will be consumable, therefore the client will send a UseItem packet
Containing the food item id, this is where the food level can be increased by a set amount dependent on the type of food item consumed.
the server needs to decrees the food level, a simple way to do this would be to have a 1 minute timer, decreasing each players food level by 1, and maybe decrees the food level by how many tiles the player as seen since the last update, tiles seen is divide by some fixed constant like 1000, so every 1000 tiles seen decreases the food level by 1, then checking the food level to determine what stats are effected like the speed, attack, def stats, updating these stats is defined by the current food level.
You just need to add a extra integer called “food level” or “hunger level” to the mysql database
Also storing the changes to the stats like speed in the mysql database would corrupt the original stat values but depends on your implementation, you can just change the player stats in load char functionality, by using the current food level.