I have a completely modular ship system in the works, but I've hit a small snag. By completely modular, I mean, you buy a Chassis, then you buy/build parts and install them on the Chassis until you have a flyable ship. Anyway.
So I've reached a point in the construction of this system where I need to come up with a way to store a layout for rooms inside the ships. Basically, I would like to be able to have some way to efficiently store data on the rooms in the ship, their layout, and how they connect, without storing any vnum information or the like. I'm also thinking an easy way to plan them out without actually building rooms and then copying them into some kind of layout data structure would be nice, but I'm drawing a blank on how exactly to accomplish any of this.
The whole system is written in C++ and is integrated into a Smaug base, but knowledge of the codebase it's working in makes no difference. Suggestions and/or examples need not be codebase or language independent, I'm just looking for ideas.
You're looking at creating a simple blue-print like data structure. The most efficient approach is to use a shared pointer system where identical ships have an identical blueprint, if a ship is modified you create a copy of the blueprint, modify it, and change the pointer.
An example of this would be a wilderness using tiles.
Could try giving hades kane a nudge. He set up rooms for player boats in End of Time that might be along these lines.
I don't think what we use is what he had in mind.
Basically how we handle player ships is we have a large vnum chunk set aside for this, and the ships are hand built according to the players specifications, and the vnum for the starting location of their ship (the deck) is stored in their pfile, along with the vnum of where they left their ship docked. There's probably much more elegant ways of doing it, but from the player's perspective it works just fine, so…