tomjn / Shard

A reprogrammable AI framework for the Spring Engine
https://shard.tomjn.com
17 stars 13 forks source link

add direct file i/o and possibly load/save to API #103

Closed eronoobos closed 6 years ago

eronoobos commented 8 years ago

Shard native can already use standard lua io. functions, but Shard Spring Lua can't. There's nothing I really need this for at the moment, but it seems like something the Shard API should have. AKA it's low-priority.

Load/save would take variables or a table and save them as lua code.

It might be a good or a bad idea to build the Shard version into the filenames, so that there aren't issues with old data being loaded. For the same reason, if it's possible to get a checksum of the game configuration, that could be used to avoid the need to delete outdated files.

tomjn commented 6 years ago

This is problematic as it means on the next game, some shards will have differing contents on the filesystem, and behave differently, and since LuaAIs run synced, it'd cause a game desync