Re: Roomless world
My approach is even simpler. Creatures, Objects, Dungeons, Portals, etc, are all types of Thing. Each Thing can contain other Things, and each Thing also stores its own X/Y position (which is a relative position). The original design included the use of abstract containers for grouping Things together based on proximity, but I never bothered implementing it - I tend to avoid premature optimisation, and while searching the entire container isn't exactly efficient, it's still an insignificant fraction of the processing effort.
One other difference is that your Things are rectangles, while mine are circles - you store two points, while I store one point and a radius. I do use rectangles for areas though (e.g., the "black forest" might be defined as all forest terrain between 50/50 and 500/500).
|