Re: Changed rnums with olc (using room-tables)

From: Sammy (samedi@clark.net)
Date: 04/13/96


On Sat, 13 Apr 1996, Thomas Krautz wrote:

> Just wondering how the OLCs that are currently in existance handle
> creating new rooms. It seems like you'd have to realloc (+1) and
> then renumber the world again (just inc. by one)... THis seems rather
> easy but when you've got a bunch of real_room references that are
> *not* in room,char,mob data-lists (e.g. the start_rooms) what would
> you do there? I mean beside updating them too, is there another 
> possibility for instance not having the need for a subsequent rising
> of the rnums/vnums in the room table?

Obuild actually allocates extra memory for objects, mobs, and rooms 
beyond what's necessary at boot up to save room for new prototypes.  It's 
poor coding but at the time I couldn't handle arrays of struct pointers 
so I took the easy way out.  When I wrote the reset command editor I 
allocated new space when needed and sorted the new zone array.  It's 
still buggy but I'm learning :)

As for problems after resorting the prototype arrays, I can see how rooms 
would cause trouble with all the exits, and of course all objects and 
mobs in the game are pointers to prptotypes, so those would have to be 
updated.  Unless you're using threads, that's likely to cause some 
serious lag any time you create a new prototype.  Hades' solution of 
convetting prototypes into linked lists would probably be a good way to 
solve problems with adding new protos.

Sam



This archive was generated by hypermail 2b30 : 12/18/00 PST