LPCGame icon indicating copy to clipboard operation
LPCGame copied to clipboard

Loading/Saving Data and Prefabs

Open Twinklebear opened this issue 12 years ago • 2 comments

Images/Animations should be described through their own json file that would be loaded as needed, instead of directly in the state's json file

Loading/Saving changes system

  • Clean up old loading system
  • Put in place system for saving entities/images/etc. to json files via Blah::Save(file)

Need to be able to save/modify the image data files in the editor

Entities should be in their own json files and loaded through file links in the state's json file

  • Entity json files
  • Idea for state specific entity data: It could be overriden by specifying the state specific data in the state file, this data will then be used to override the entity data
  • With all these extra file readings I think the need arises for a generic file reader/writer to write and read JSON from desired files, eliminating the need for Image, AnimatedImage and Entity to each have their own JSON file opening function

Maps should be described in their own json file

  • Load maps from their own json file
  • Editor must request filename to save as when saving a map of tiles. A scene is not a map, a scene has a map, entites and other junk
    • Map overrides??

Tilesets should have an associated json file describing additional tile properties, which image to use and which tile goes with which clip

I think the various entity/map/etc. json files should be built into a single state file when exporting a build though, to reduce the amount of I/O operations needed to load a map.

Twinklebear avatar Oct 13 '12 06:10 Twinklebear

Done so far:

  • Image and AnimatedImage json files
  • Entity json files
  • Map json files
  • Tileset json files (once btstevens pull request is merged)

There is also the JsonHandler class available for usage for simplifying interactions with json files.

Twinklebear avatar Oct 13 '12 07:10 Twinklebear

Working on cleaning up loading, Image, AnimatedImge and LuaScript now just load from filenames and can be saved as filenames. Save() still exists but will be migrated to being used for saving entities to seperate JSON files from the editor so DO NOT USE IT for Image/AnimatedImage. Unless you're adding in saving editor created data, but that's a ways off.

Twinklebear avatar Oct 13 '12 07:10 Twinklebear