ID:154402
 
Can you do this? Like for eaxmple a hunger proc if I want the character to get hungry and if the player doesnt feed the character he dies. Can I make the character get hungry when the player is off line? Oh ya this will be on a permanate server.
Sure, just leave the mob there if they log off. Note though : This would NOT be wanted behavior, if someone takes a vacation IRL they die, if they dont have enough time to get on they die, etc. I atleast dont like it

Alathon
In response to Alathon
Well, it would match the "virtual pet" model... and besides, what if the game has inns? You go to an inn and rent a room, instead of getting hungry, it just deducts room and board from your coinpurse.

Another way to do this is to note the game time that a player logs out... when he or she logs back in, apply an appropriate number of modifications to the "hunger" variable, the bank account, whatever.
In response to LexyBitch
LexyBitch wrote:
Well, it would match the "virtual pet" model... and besides, what if the game has inns? You go to an inn and rent a room, instead of getting hungry, it just deducts room and board from your coinpurse.
Yes this will be an option. And if I leave the player in the word would it lag?
In response to BurningIce
BurningIce wrote:
LexyBitch wrote:
Well, it would match the "virtual pet" model... and besides, what if the game has inns? You go to an inn and rent a room, instead of getting hungry, it just deducts room and board from your coinpurse.
Yes this will be an option. And if I leave the player in the word would it lag?

Depends on how much you're looping. If players got hungrier once every 20 real-world minutes, for example, you'd only see a tiny jump in CPU. The real problem is keeping track of all players all the time, even when you're booting fresh and they haven't logged in yet--you'd basically have to load everybody into the game from the savefile, every time you loaded the game, regardless of who was currently playing. It'd be better to go with Lexy's suggestion and just calculate how much hungrier they should be based on the time they spent offline.