[DGD] Dealing with huge objects

Petter Nyström jimorie at gmail.com
Sun Jul 15 18:00:14 CEST 2007


Hello list, I have a task I wondered if anyone could give advice on
how to best accomplish with DGD.

I need to store a very large grid of integer values to represent a map
of my world. The world can be considered a traditional room based
system with one room for each coordinate in this grid - but I am not
planning on loading actual room objects until someone really wants to
go there. But I do believe I need to have the integer grid loaded in
more or less its entirety at all time. This is because the grid is
used not only to load appropriate rooms, but also to draw ascii maps
of the world and I anticipate most of the grid's data to be accessed
fairly frequently.

My first attempt at this has simply been to allocate the grid as a
two-dimensional integer array in a daemon type object. The problem is
that this grid needs to be rather huge to accommodate for the world I
want to build. My test case is using a 1000 x 1000 grid - 1 million 32
bit integer values. When DGD tries to swap out the object holding this
data, it crashes as it runs out of sectors. I assume this can easily
be solved by increasing the number of sectors given to DGD at startup.
But it got me thinking that my approach probably isn't so good to
start with.

What I would like to hear is advice on how to best implement stuff
like this with DGD and also how I best configure DGD for dealing with
it. I am thinking the best would be if I could just assign DGD with
plenty of real memory and have it *never* swap some choice very large
objects. But, I don't know. Advice?

Regards,

Jimorie



More information about the DGD mailing list