rigertd / LegacyMUD

A multi-user dungeon engine developed in C++.
Other
0 stars 0 forks source link

Default items added to starting area on deserialization #1

Closed rigertd closed 7 years ago

rigertd commented 7 years ago

The GameLogic::startGame function creates a bunch of default items and containers, assigns them to the starting area, but does not actually add them to the area. If you save the game and then load it from the file, these items appear in the starting area. Are these default items intended to be in the final product? If so, is there any way to create them without assigning them to an area?

keithadkins commented 7 years ago

Good catch. This should be assigned to Rachel. We should not be hard coding in game default objects. Here's the solution: create a "base" game data file that includes only a starting area. When the game is started, this will provide a room for a player to start in. A world builder can then expand on the world from here.

rigertd commented 7 years ago

Assigning to Rachel (only close issues when they are resolved; otherwise just change the assignee)

weissmar commented 7 years ago

I responded to Keith on Canvas, reposting:

Hi Keith,

Is there documentation on how to put together the data file for this purpose?

The game has to start with at least one Area and one PlayerClass (which in turn needs a SpecialSkill) so the world builder can log into the game. The remainder of the default objects won't be needed, except for testing purposes.

When the game is loaded, the startArea member of GameLogic will need to be initialized with a pointer to an Area. This is the area where new players are initially loaded into the game and cannot be nullptr. I'm sorry I didn't mention this before - I didn't even think of the fact that the data component would need to do this since it can't be hard-coded.

Thanks!

rigertd commented 7 years ago

I requested a feature enhancement to DataManager for the starting area in #6. This particular issue has been fixed (namely, the hard-coded items were removed).