[crossfire] Items that evolve all the time

tchize at myrealbox.com tchize at myrealbox.com
Tue Apr 26 05:21:31 CDT 2005


Was awaiting a growing world for long :)

I already thought about it and i concluded making items grows at map opening 
was the lowest cpu consuming process.
Perhaps we could add a tag to object like isAlwaysActive.
Then at map loading time, all object (not only growing ones) with 
isAlwaysActive at 1 will get their pending moves counts (there is already 
such a thing and it's at the core of the object activity code) increased by 
the nubmer of turn they would have accumulted if the server did lag for the 
whole time the map was swapped out. 

The advantage of such a process is that you only have to implement classical 
'move' of your growing object, the disavatage is that if a map was swapped ou 
for a very long time, player could see a seed suddently become a dead tree. 
But this should not be a problem as, in my mind, the fastest growing objects 
(honey making thingie) should get more than one play turn per 5 minutes and 
so, to get a really strange result of a growing object, this would mean 
having a map swapped out for about 20 to 30 turns, which represent 100 to 150 
minutes swap out. Most of map get reset before this happen.

On the other hand , sever could give map object the time to do their 'pending 
turn' just before inserting the player, and so player won't see anything 
special (and since map was loaded from swap, there is nobody else in there)

So to conclude:
- no need for an extra storing tag for the last time it got a turn. There is 
already logic for that (the tag is named lastxxx don't have code here)
- giving isAlwaysActive objects the opportunity to do their accumulated turns 
since last map swap out (can be done in loading code using timestamp in the 
map struct). This could apply to things other than growables
- handle the growing process in the object move code
- no need for such things as an overlay map

Now concercing weather interaction. This is abvious values like humidity and 
temperature, when available, should influence the growing process :)
And the type of ground too!

Le Mardi 26 Avril 2005 11:37, Nicolas Weeger a écrit :
>
     
      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)
     
     >
     
     
     >
     
     
     >
     
     
     >
     
     
     >
     
      _______________________________________________
     
     >
     
      crossfire mailing list
     
     >
     
     
      crossfire at metalforge.org
      
      
     >
     
     
      http://mailman.metalforge.org/mailman/listinfo/crossfire
      
      
     
-- 
David Delbecq
Royal Meteorological Institute of Belgium

    
    


More information about the crossfire mailing list