 |
|  |
 |
|
Gary Thomas
|
 |
New Zealand
Mar 2001 time: 17:33
|
|
I can't find any earlier references to this, though I remember a considerable discussion.
Having offered to code this, I propose to implement a system I have had in mind for some time, using the well known principle of coder's privilege.
The System:
1. Saving is automatic at the end of every turn.
2. A game may be saved part way through the current turn only - at the end of the turn the part way save is removed.
3. The data is saved in an incremental fashion, with a complete copy every so often (the interval to be derived by experiment), though truly unchanging details will be saved once only.
4. Each model will have its own save class, separate from other models.
5. The save file will be zipped.
6. If an earlier game (other than the last move or the current move) is reloaded, any subsequrent saves are lost. However, the player will be given an option to branch the saved game, thus producing another, and distinct, save file.
The advantages:
1. There is no silly micromanagement of save files as happens in Civ.
2. A complete playback of the game is possible.
3. Waste of space by duplicating static data, move after move, is much reduced. In particular, the basic map is saved once only.
4. It exploits the particular assets of Java.
5. I expect to code it so that loading a game is essentially instantaneous. I say this with some confidence, after recoding a program that manipulated an 8Mb Access database into Java. It turned out that the entire information in the database can be stored (zipped) in about 500K, and can be read in in about 1.5 seconds.
Cheers
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:33
|
|
quote: 5. I expect to code it so that loading a game is essentially instantaneous. I say this with some confidence, after recoding a program that manipulated an 8Mb Access database into Java. It turned out that the entire information in the database can be stored (zipped) in about 500K, and can be read in in about 1.5 seconds. |
I know the stuff. I prototyped things last year where I could gain a factor of 100 in file size because of far too many information duplications in the file format.
I agree with Gary's approach. It should be tried. If size is an issue, we will see when this happens, and it should be relatively easy to lose the previous turns if that's what you want. Keep in mind that just zipping the file often gives very good results.
|
|
|  |
 |
|
Mark_Everson
|
 |
Canton, MI
Jan 1970 time: 00:33
|
|
quote: Originally posted by Gary Thomas
As well, since my next project is a scenario editor, I can use the save game code there as save scenario code.
The consequence of all this is that, at least as a first cut, the save/restore system will essentially be a save/restore scenario system.
Once that is working I will write the scenario editor. |
Sounds Outstanding!
quote: And once that is working I will work on the incremental save option, since, by that time, I expect that even Mark will realize that the files are getting large. |
Personally, I think it'll take Mark longer than that to come around, but you may be right. . .
|
|
|  |
 |
|
Gary Thomas
|
 |
New Zealand
Mar 2001 time: 17:33
|
|
I have encountered a roadblock in my save/restore coding.
There is a structural problem which I have discussed previously (about two years ago).
The basic game was designed to read in a whole lot of files - civilizations, military, social, economic, religion, and so forth, overlaid by specific scenarios.
Frankly this is a big unmanageable mess, and clashes horribly with the save/restore mechanism.
It is also something that I have been against from the beginning.
My conception and preference is that each scenario definition file should be completely self-contained, so only a single file is read in for each play of the game.
The objection to this was that it meant that scenario designers would have to repeat large amounts of data, from one scenario to another. This applies particularly to the military data.
Having given the matter considerable thought recently, I realized that we have been on a slightly wrong track.
Yes, there should be comprehensive files on the topics I listed at the start of this post. On the other hand, a scenario should be a single file and the program should not need to read in a large number of files containing irrelevant data.
The solution, now that I have been studying the data saving system in some detail, is a properly designed scenario editor which will take the necessary parts of the standard reference files and produce a single scenario file.
As well as being tidier than the present system, it will add one very large benefit. It will mean that the global data will be included in the scenario file. So, in order to test the effect of these global parameters one will be able to produce a test scenario in which only a global parameter is changed. This could them be downloaded and tested by people other than the coders.
The effect of this is that I am more or less forced to exchange my top priorities and work on the scenario editor now.
This in turn means that it will not be done this week, as I had hoped.
Cheers
|
|
|  |
 |
|
Gary Thomas
|
 |
New Zealand
Mar 2001 time: 17:33
|
|
I put this in a separate post to avoid diluting the impact of the previous post. This relates to names of things in general (though not to language, Jack).
One of the problems we have had in scenario design is that the same civilization has different incarnations in different scenarios. For example, the Roman civilization of Delenda is quite different, and many centuries removed, from the Roman civilization in Attila. There is no provision in the data file system to differentiate these, apart from giving them different names.
My proposal, to get around this difficulty, is to introduce a two-level naming system (like the genus - species system of Linnaeus). Within a game references would be to Rome. However, between scenarios we would have Rome - Early Republic, Rome - Marian, Rome - Late Republic, Rome - Caesar and so forth. The scenario editor would then allow the scenario designer to select the appropriate one.
Another simple refinement for the scenario editor, will be to specify an era, and restrict all options to that era. This is easy to do, provided each of the XML objects allow the specification of one or more eras.
Cheers
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:33
|
|
I don't really understand why several files is a bad thing. Given the current code, where each file is read in a separate thread, I understand it can cause problems, but it's just an ordering problem. I'd much rather have a #include-like directive than have a single file, because I like to edit things by hand. Now having bigger files won't prevent me from doing this, and I can always start with the scenario editor if needs be. I also don't get why having several files from the start hurts. You can always merge them together into a single 'scenario' file? But hey, now that I've ranted a bit, I must confess that Gary has the very bad habit of being right when it comes to coding, so I think that's probably the thing to do.
Now the next question is: Do we wait for this to be completed to get a demo 8 out or not?
|
|
|  |
 |
|
Gary Thomas
|
 |
New Zealand
Mar 2001 time: 17:33
|
|
The problem is that we are making the game play the part of a scenario editor. The present program reads in a great deal of scattered information and discards most of it. Under that system, when I write the save file it will be quite different from the scenario file. If someone starts a game and immediately saves it, for a great many reasons, mostly concerned with debugging and code safety, I would like the saved file to be, as nearly as possible, exactly like the scenario file.
What I am really aiming for is a system that is simple.
The argument that the game should be structured to make it easy to hand edit scenario files is not a good one. You are, I think, viewing scenario files as a kind of programming code. For the real purposes of a scenario file, an include statement is very wrong, and leads, inevitably, to dependencies. I believe that I have expressed my opinion of the deeply evil nature of dependencies in the past, though, it seems, not sufficiently eloquently.
I am not interested in making it easier for people who want to hand edit things, at a cost of making it more difficult for the people who play the game.
When I devise a brilliant new scenario, I want to be able to send someone a scenario file and have it run, without having to also send a military file, a social file, a religion file, a technology file, a riots file, a weather file, and whatever else. Once the scenario is set, it does not need any of these things. They should be incorporated when the scenario itself is built. For practical reasons, and only in the short run, I will accept a separate map file. However, because the map file and the scenario file are indissolubly connected, I would prefer that they be incorporated in a single file.
The fact that I went a lot of trouble to make the data files human readable and modifiable, in the form of XML files, should not be considered as meaning that that is the way scenarios should be designed and built. It is, essentially, a debugging tool only.
Because, in recent years, a scenario editor, in most strategy games, has become almost as important as the game itself, I think that such an editor should be provided (and I have started doing it). And it should be to the same standard as the game itself. People who want to hand edit the result can, of course do so, but using cut and paste. It has fewer dependencies.
And I think, with some regret, that the next version should be issued without waiting for the save/restore.
Cheers
Last edited by Gary Thomas on 16-04-2004 at 00:00
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:33
|
|
Don't worry, Gary, I know the evil of dependencies. But I also know the evil of copy paste (when you change a bit of code and find that is has been copied in ten files by different people who could have reused your service...).
How will you go for the scenario editor? How will you say when you create a new scenario that you reuse the tech tree, etc.? Will you keep resource files to build the scenario file from? I mean resource files are just used to speed up the scneario editor to lead to a single scenario file, but never used by the game itself.
|
|
|  |
 |
|
Gary Thomas
|
 |
New Zealand
Mar 2001 time: 17:33
|
|
In one sense the scenario editor will do what the game itself does. The fileinput class reads a considerable number of files and, essentially, combines them into one file. What I propose to do (amongst other things!) is to move that functionality to the scenario editor.
I would hope that it will be easier to make minor changes in the scenario editor, rather than by cutting and pasting.
As to general functionality, the scenario editor will work on two levels. It will enable editing of the standard data - changing global values, or editing what I call the reference files, that is, the files which contain lists of unit archetypes, civilizations and so forth.
Those reference files will be read in every time the scenario editor is run.
The person using the editor will have the option when designing a scenario of selecting any of these components from menus, and modifiying them if desired, or of creating new objects specific to that scenario.
Because the save/restore and scenario editor will be closely related, it will also be possible to edit a saved game, as though it were a scenario. This adds the feature that I have always wanted, of changing the player civilization during the game.
Cheers
Last edited by Gary Thomas on 16-04-2004 at 13:22
|
|
|  |
All times are GMT. The time now is 05:33. Apolyton Time is 00:33. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|