Re: [DM-dev] Hierarchical/Flat model
Brought to you by:
acdalton,
henningsen
From: Stephan B. <ste...@ei...> - 2001-08-22 14:12:07
|
On Wednesday 22 August 2001 03:05, you wrote: > >I spent last night re-vamping the file output code. The DungeonElements > >support a full hierarchical approach, but I've made a subclass, DMDungeon, > >which enforces a flat approach, while hiding the data hierarchically. > > This looks to me like you have code that is a hybrid of two distinct > approaches that cannot really coexist peacefully. As far as I'm concerned, > I have no use for the hierarchical part, and would therefore prefer a pure > flat approach for simplicity reasons. I knew you'd say that! ;) Yes, it's absolutely true, but I'm trying to make an approach which means I don't have to implement yet another layer in QUB, which would use a hierarchical model. For example, when a user is drawing a dungeon, they shouldn't be restricted to one flat surface and a number of primitive objects. I want them to be able to place a wall inside a room in such a way that if they move the room,the wall goes with it. That's way too much work with a flat model, and the programmer would have to make assumptions about what's on the flat board (for example, there's no longer a room, there's just a series of marks which represent walls). In the hierarchical model it's as simple as room->move(....). > An advantage for the hierarchical model that I can see is in interactive > design, where you could easier move around a complicated nested structure > consisting of e.g. a room with several attached walls and Crawlers. But if > you can move flat structures around, moving things around in several steps > (once for the room, for each wall, etc) wouldn't be that much of a burden, > really. Not worth the complication in the code, anyway, IMO. Yup (if I had read that before I wrote the above paragraph I would have seen that you're already on the same wavelength ;) To me it seems more work to move the flat-structured data around. I agree completely that the flat and H models aren't mixing well. I really think I will nuke the H structure and go with something very, very flat. I won't kill me, it'll just wound my sense of architecture ;). Nothing fatal, certainly. ;) > So have I missed something? What is the use of the hierarchical model for > you? Just for interactive design, mainly, and because QUB already has the code (XML stuff) for serializing and loading hierarchies of data, so I could store dungeons in XML format extremely easily this way. If I do a flat model I've got to use an intermediary format and encode/decode it along the way. No biggie, though. I'm determined to get the file i/o finished and out of the way as soon as possible, so I'm shooting for this weekend. If that means I have to nuke the hierarchy, then that's what I'll do, I guess. I can always rewrite later with no harm done. See ya! ----- stephan Generic Universal Computer Guy st...@ei... - http://www.einsurance.de Office: +49 (89) 552 92 862 Handy: +49 (179) 211 97 67 "People say it is hard to switch from Windows to UNIX; sure: but it is impossible to switch from UNIX to Windows!" |