'Live' asset and script updating discussion.
[08 Jun 05 05:18] Vectrex: I was talking to a guy I know who used to work at EA
[08 Jun 05 05:18] Vectrex: and they had an interesting system
[08 Jun 05 05:19] Vectrex: of 'live' asset updating
[08 Jun 05 05:19] Vectrex: so in the actual game if an asset got updated you could refresh without quiting the game
[08 Jun 05 05:20] psyclonist: that's not so unusal.
[08 Jun 05 05:20] psyclonist: i see no reason why we shouldn't be able to do the same.
[08 Jun 05 05:20] Vectrex: I imagine checking for updated assets wouldn't be that hard
[08 Jun 05 05:21] psyclonist: exactly. then issue 'resource reloads'.
[08 Jun 05 05:21] Vectrex: even checking the folder modified as that gets updated
[08 Jun 05 05:22] Vectrex: but, would that concept be possible with lua scripts? Could you detect a change and recompile?
[08 Jun 05 05:23] psyclonist: the whole entity would have to be restarted. implementing 'edit & continue' isn't much fun. ask MS.
[08 Jun 05 05:24] psyclonist: but other than that, you can sure respawn the entity and certain elements could be saved, e.g. its memory.
[08 Jun 05 05:24] Vectrex: yeah, I wouldn't expect break and continue
[08 Jun 05 05:25] Vectrex: does lua have an interpreted mode?
[08 Jun 05 05:25] Vectrex: interpreted code could be updated without restarting the entity
[08 Jun 05 05:26] psyclonist: way, too much hassle…
[08 Jun 05 05:26] psyclonist: at some point we need serialization, anyway, for save games. something similar could be used here.
[08 Jun 05 05:28] Vectrex: well you wouldn't use interpreted in a released version
[08 Jun 05 05:28] psyclonist: why not? what about modding?
[08 Jun 05 05:28] Vectrex: well.. yeah
[08 Jun 05 05:29] Vectrex: but at worst, automatically killing all changed entities and respawning them at the same spot with copied instance properties (and anything else that makes sense like current state) would be awesome
[08 Jun 05 05:31] psyclonist: load/save is exactly the same. so it's a must :)
[08 Jun 05 05:33] Vectrex: ah yes of course, it would almost be like when the program refreshes, it would do a temp save game and serialize everything, reload the changed assets and scripts and load the game again
[08 Jun 05 05:34] Vectrex: assuming it can handle possible changed structures
[08 Jun 05 05:34] psyclonist: not the whole game but only the things affected by modified resources, of course. sure.
[08 Jun 05 05:34] Vectrex: yeah, but a small version of save game
[08 Jun 05 05:34] psyclonist: kinda like that, yes.
[08 Jun 05 05:37] Vectrex: you could have a seperate thread keeping an eye on asset/script folders
[08 Jun 05 05:37] Vectrex: for updates
[08 Jun 05 05:37] psyclonist: yes. makes sense.
[08 Jun 05 05:38] Vectrex: of course it would be disabled by default for release games
[08 Jun 05 05:38] Vectrex: with maybe a command line option to turn it on for modders