[DM-dev] EnhancedDungeon class
Brought to you by:
acdalton,
henningsen
From: Henningsen <al...@gl...> - 2001-07-07 14:38:42
|
I've been thinking that I'd like to get some practise with STL stuff, and what better than to write my next contribution to the DungeonMaker. I'll write a whole separate new class with a constructor EnhancedDungeon(pDungeonMaker) that calls pDungeonMaker->GetMap( , ) for initialization. Everything else is independent from the old code. Stephan, as long as you don't change the values/meanings of the numbers returned by GetMap, everything will mesh nicely. I'll work from my latest code, and we can later merge. The EnhancedDungeon will have data members called "focal points", and will store the shortest path to all focal points right in the map, for use in AI routines. Typical focal points will be the exit, and chokepoints like the centers of rooms the player has to pass through, or the locations of NPC's, what-have-you... Based on conditions (like "player close to focal point 1") the AI can then switch the path-targets of monsters around, making them appear smart. This is something I will need in the demo game I intend to write, in order to orchestrate the behavior of large numbers of Pacman-like mini-monsters. I think it will be useful in other circumstances also. The code that finds the closest path from every point to the exit will also identify enclosed spaces, and it is then very easy to break them open or put a door in to make a room. So that is the second bit of functionality EnhancedDungeon will add. This will allow the use of many "openAtStart"-Crawlers, which have a chance of enclosing spaces, and will even allow the introduction of "closed"-Crawlers, that are closed at the start of their run, and leave no opening at the end of their run, guaranteeing to create enclosed spaces and therefore rooms. One suggestion for Stephan: In order to get lots of rooms, we need the option to have "closed"-Crawlers. For that to function, we'd need a new parameter in the stats (for every generation different), "closedProb", which would be most similar to openAtStartProb and should be next to that. You could test your flexible file handling stuff by introducing that, and I could then implement its functionality in the core dungeon construction code after I got my new class going. (Without the class, this will of course totally wreck the dungeons.) You'd have to change the definition of the stats-struct too... What do you think? Anybody else has a thought about how to improve EnhancedDungeon? Speak up while there's no code yet;-) Peter |