Changes between Initial Version and Version 1 of Ticket #1089, comment 11


Ignore:
Timestamp:
Aug 27, 2013, 6:11:39 AM (6 years ago)
Author:
historic_bruno
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1089, comment 11

    initial v1  
    1313> About your last point, still: I think I see what you mean. Basically using "for" on an AI object, we get the templates? This is unavoidable if we want the AI to access entity/template data without using global objects or passing the shared script fully (indeed the gamestate holds references to them). I think we could either change this, or change their properties so that they can't be reached in a for loop (I'm fairly sure this is doable). Afaik, we are already "factoring out the raw template and entity data into something only accessed via functions (still stored in JS) and easily repopulated during deserialization" mostly (there's a few parts where this data is accessed directly for lazyness).
    1414
    15 We can define properties so they're not enumerable, this is already done with some properties in BaseAI, but I changed that to test the full serialization approach (no properties skipped, so it should work perfectly). Basically, even if the serializer skips some properties, they will have to be restored exactly as before on deserialization, which means adding special handling for them. I would rather that special handling be part of the API, rather than each AI separately as it is now (AIs have serialize and deserialize functions that pass "opted-in" data back and forth, called by CmpAIManager)
     15We can define properties so they're not enumerable, this is already done with some properties in BaseAI, but I changed that to test the full serialization approach (no properties skipped, so it should work perfectly). Basically, even if the serializer skips some properties, they will have to be restored exactly as before on deserialization, which means adding special handling for them. I would rather that special handling be part of the API, rather than hiding some data and leaving each AI to handle it separately, as it is now (AIs have serialize and deserialize functions that pass "opted-in" data back and forth, called by CmpAIManager)