DLL development discussions

so even without coffee i managed to nail my conclusion :) i hope we could one day fix that Prehistoric method and make those 200 archers just one data package probably that would enhance things significantly probably

We don't have access to that code - its all inside the main game engine, which we have no source for.
 
@Koshling, at CvTaggedSaveFormatWrapper::Read(const char* name, int& idHint, int& idSeq, int count, bool values[], bool bAllowTruncation) there is no checking, does the read array is smaller, then required. Shall I add it?
 
@Koshling i said some day who knows what miracle might happen ;)

@N47 and that is probably a lot of work if i am not mistaken ;)
 
@Koshling, at CvTaggedSaveFormatWrapper::Read(const char* name, int& idHint, int& idSeq, int count, bool values[], bool bAllowTruncation) there is no checking, does the read array is smaller, then required. Shall I add it?

It's deliberate - see the comment:
Code:
//	Allow reading LESS than the desired number.  This allows for things like new player options
The result is the end of the array is left as it was (which should have been default-initialized by the constructor or reset() method of whatever class owns it. As the comment alludes to, the canonical example is game options (older saves may have less game options, though always a leading subset)
 
Oops, I've read it as MORE. :p Btw, what is the class enum and why in ReadClassEnum you pass the values of it though getNewClassEnumValue, but in ReadClassArray you don't?

edit
And one more -- if a save is corrupted, like there is a wrong number of landmarks, do we still do our best to read it? If so, how to give player at least some message, that there was something wrong?
 
Oops, I've read it as MORE. :p Btw, what is the class enum and why in ReadClassEnum you pass the values of it though getNewClassEnumValue, but in ReadClassArray you don't?

edit
And one more -- if a save is corrupted, like there is a wrong number of landmarks, do we still do our best to read it? If so, how to give player at least some message, that there was something wrong?

Both getNewClassEnumValue() and ReadClassArray() use m_enumMaps, which is the underlying mapping dictionary for class enums. ReadClassArray() uses it directly rather than through an encapsulating method is all, but they are both doing the analogous mapping. Could probably be better encapsulated.

CvTaggedSaveFormatWrapper::HandleRecoverableIncompatibleSave() pushes a message onto a list of warnings that are displayed of the user after a load - this is how minor incompatibilities that do not make the save unusable are handled, and notified to the user.
 
Unfortunately, the landmark creation as it is now do not feat storing landmarks in an array. It first create excess of landmarks and then remove them. Storing them in an array would need id mapping on removal, if we do not want the array look like a cheese -- id to a landmark is an index in the array. Is it a good idea to change the algorithm to something, which do not need of removing? It would also save as few rounds over whole map at the landmark creation and a byte in CvPlot - my personal favorite. :)

Btw, who did the landmarks?
 
id to a landmark is an index in the array. Is it a good idea to change the algorithm to something, which do not need of removing? It would also save as few rounds over whole map at the landmark creation and a byte in CvPlot - my personal favorite. :)

Is this why when i put landmarks on a Pre-Made map they NEVER show up??:( They use to ALooooong time ago.
 
No it is not. But I can check why. But I am not aware, how landmarks are added manually. Is it during a game-play or in the world builder? And is it possible to remove them manually?
 
No it is not. But I can check why. But I am not aware, how landmarks are added manually. Is it during a game-play or in the world builder? And is it possible to remove them manually?

These are "signs" that are added manually on a PRE-made map.
 
From what I see, player defined signs are different then landmarks. The landmarks create their own signs, but a player can't touch landmarks directly. They can probably only override their signs, but the landmarks stays untouched.

Signs don't seam to be stored in the game, so that is probably why they disappear. I can change the mechanism, such each user's sign would be a landmark. Then they would not disappear. But not quite sure, aren't signs defined with CvPlot::addSign not used for something else. In that case, some signs which shouldn't be permanent, would appear each time the game is loaded from a save.

(Headacheing ;_; Am not sure, does what I write match the reality. ouch ouch ouch :()
 
From what I see, player defined signs are different then landmarks. The landmarks create their own signs, but a player can't touch landmarks directly. They can probably only override their signs, but the landmarks stays untouched.

Signs don't seam to be stored in the game, so that is probably why they disappear. I can change the mechanism, such each user's sign would be a landmark. Then they would not disappear. But not quite sure, aren't signs defined with CvPlot::addSign not used for something else. In that case, some signs which shouldn't be permanent, would appear each time the game is loaded from a save.

(Headacheing ;_; Am not sure, does what I write match the reality. ouch ouch ouch :()

They are stored by the Python I believe, encoded in the CvPlot scriptData, which is opaque to the DLL, but persisted on behalf of the Python (BUG uses a tagged format of some sort to encode info into script strings on various objects). However, it's not something I'm very certain about - try PMing AIAndy - he may know. Consequently I **think** the DLL code only has to worry about maintaining the landmark data it is given in that session (but as I say it's not an area I am very certain about)
 

You know as much about it as I do quite honestly (probably more now you've looked into it a bit). What you say makes sense, and a more efficient internal representation seems like a good idea. Provided that the APIs are maintained, then changing the storage structure should be fine - go for it I'd say.

The other question is what to do for test cases to check it all works once changed? I'm not sure how to get maps generated with landmarks on them. If you play with the game option 'personalized maps' then the maps have lots of what APPEAR to be landmark names on them, but I'm not sure if these are ACTUALLY landmarks, or just signs - that would be my first suggestion as a starting point though...
 
They are signs generated for landmarks. Quite interesting. It indeed look like landmarks after creation would add signs for them and only those are shown, and the landmarks by them selves are quite unused. (But still I have a headache.)
 
@Koshling, I'm wondering about naming conventions. What do you think "trash" and "F" mean in FFreeListTrashArray? (Going to add my own size balancing array class and am wondering how to name it. :hmm:)
 
@Koshling, I'm wondering about naming conventions. What do you think "trash" and "F" mean in FFreeListTrashArray? (Going to add my own size balancing array class and am wondering how to name it. :hmm:)

Not a clue. The 'F' might even be something as prosaic as 'Firaxis'
 
@Koshling, I'm wondering about naming conventions. What do you think "trash" and "F" mean in FFreeListTrashArray? (Going to add my own size balancing array class and am wondering how to name it. :hmm:)

F meant/means Firaxis or Fireworks game engine (that would be for civ 5 though, which has similar naming conventions).

Otherwise, for naming conventions almost all classes are called CvSomething (Cv short for Civ), and variables use Hungarian naming (int iInteger, bool bBoolean, CvSomething::m_iInteger).
 
Top Bottom