|
|
Re: "Intel" class becoming obsolete. |
Thu, 30 June 2011 09:24 |
|
Aeglos | | | Messages: 142
Registered: May 2011 Location: Chile | |
|
Originally it contained Tech info (budget, levels, resources) and relations iirc.
It is now being slowly used to describe the concept of "empire" which was not there before, and include all empire specific data. Perhaps renaming it simply to "Empire" instead of EmpireData would make things clearer. I've given thoughts to that.
The EmpireData is supposed to be "The state of the empire" at any given turn.
The server keeps a master copy of all empires so it can know it's clients valid states every turn, and updates their data after turn generation. The intel file it writes contains the respective updated EmpireData that pertains it's owner, and some other collections that are slowly being moved into EmpireData. The Client reads the intel file, extracts it's whole state from there and does no processing at all (Or so is intended).
The ClientState currently consists of one EmpireData object and some collections that are being moved inside there. ClientState does and can contain other things though, like visual preferences, game folders and other non empire specific data.
But the intel file which contained the collections that the clients read and from where it picked what was theirs before is being emptied of them, until it will only contain a single EmpireData serialized. The server might as well serialize those as .intel files intead of proxying it through an intel class.
I might have made a mistake giving so much responsabilities to EmpireData, yet it's still essentially a P.O.D. object and it feels natural for the server to have it, so it can keep a record of the valid state of it's clients each turn independant of the master copy of everything. It also feels natural for the client to just read it's new server generated state and be done with it, no cherry picking, no looking in a dozen collections, no determining anything.
We can still change it of course, dissasemble it into separate collections again, if the consensus is so.
Orders is something else entierly. Right now it sends EmpireData back to the server, but it has to be restructured so it actually sends Orders and not state. That's a bit more complicated and sending state works for now I think.
[Updated on: Thu, 30 June 2011 09:26] Report message to a moderator
|
|
|
|
|
|
|
|