[crossfire] Items that evolve all the time

Nicolas Weeger nicolas.weeger at laposte.net
Tue Apr 26 04:37:11 CDT 2005


Hello.

I'd feel like implementing growing stuff, ie for instance plant an apple tree seed and it becomes a nice apple tree, then yields apples. Or a beehive which generates honey at a certain rythm. No planting for now (but that may come!), but still i'd like to have items generated from time to time. Note that I probably won't use a creator, as I don't want items inserted into the map, but items stored into the "growing item" that you could collect with special tools.

The trouble I'm being confronted to is that I need to have those items "move"/grow even when their map is not loaded, so that everything grows correctly - this makes the game more interesting imo. The other option of course is for players to wait for map reset, but somehow I think it's less interesting - or put a short reset time for that kind of maps, but still you could loot much stuff each time.

So I'm wondering how to achieve that. I see 2 options:
* do something like the weather code. Store "growing" items somewhere, parse that regularly, update maps accordingly. Drawback: you can potentially have many different maps containing growing items, not only the outside world. Thus beware the number of maps that need to be taken into account.
* store items like an overlay / unique tile, with tickcount. Then when loading make them run for elapsed period since being saved. Drawback is that it may take some time at map loading - though I don't expect the growing behaviour that hard, more like 'for each tick add some random food amount, when it reaches some value there is a new item to collect'.

The 2nd approach feels the best, but then I need to store tick count somehow.
Note that potentially items could change based on whether they have collectable items or not (ie tree with apple(s), bare tree), so there'll be some tweaking too.

Ryo

Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34€/mn) ; tél : 08 92 68 13 50 (0,34€/mn)




    
    


More information about the crossfire mailing list