That’s weird - some of these symbols are actually present in .cpp’s so they should not trigger this while some are not defined at all like EventCondition destructor so they should be generated by compiler. And all of them are marked as DLL_LINKAGE.
I found two structures not marked as such (will commit) but they are not mentioned in this log at all.
Figured this out.
When class is marked with DLL_LINKAGE, Visual attempts to instantiade its copy ctor and copy assignment operator. Because CFilesystemList contains a non-copyable field (vector of unique ptr), the default copy-ctor and assignment cause compile error.
The fix is to provide dummy methods like:
CFilesystemList(CFilesystemList &)
{
assert(0); //class is not copyable
}
CFilesystemList &operator=(CFilesystemList &)
{
assert(0); //class is not copyable
return *this;
}
Ugly.
Or, if we were to target Visual 2013, we could simply =delete them.
Yes, such dummy methods preferably should be private.
Still, it’s good to keep the assert even in private method, since the class might attempt to copy itself (eg. in one of its methods). Private hides it only from the outside.
I have the problem that I need to deep copy an instance of CGHeroInstance. Campaign data with progress is kept in the client and won’t be deleted after playing a scenario. In the campaign data for every completed scenario a list of hero instances/crossover heroes will be stored. When crossover heroes travel to the next scenario they should be deep-copied to not modify original crossover heroes. Otherwise it would be possible to restart the scenario with the heroes state of the current map.
There are 3 possible solutions:
a) manually write a copy c-tor (error-prone, laborious, code duplication with serialization code)
b) remove d-tor in CGObjectInstance and all subclasses to autom. generate copy-ctor by compiler -> not possible due to objects holding strong ownership of other objects, you can’t copy unique_ptr
c) use serialization code to copy objects: e.g. Util::copyObject(whatever) returns copied instance of whatever -> use loader and saver functionality and cache data in memory (buffer) -> should be simple, stable, no code duplication, not as fast as direct copy but code is in general more important than performance
Just want to let you know, that I added knowledge and spell power into hero strength calculation. (checked with OH3 and hero placeholder handling) I hope that it won’t cause any problems.
It is very difficult to ever evaluate usefulness of spells by AI and ESPECIALLY the usefulness of knowledge. I’m pretty sure it will result in high AI suicide rate, better roll it back.
Not to mention hero strength is used also by core game mechanics, like diplomacy.
And well… I believe right now saving a CGHeroInstance* to a file and subsequently loading it produces a deep copy.
File IO is a bit too much wasteful for my taste, but if a special serializer is provided that stores an object to an memory buffer (even a crude vector should suffice) then it should be enough.
Implementing new serialzier should be strightforward. Inherit CIser and COser and “override” write/read functions.
Set special features flags in a constructor if needed. (AFAIR defaults should suffice)
Then, something like this should clone hero (or object of virtually any serializable type)
*this << hero
CGHeroInstance *copy;
*this >> copy
Mind that deep copy will also store parts of game rules objects (VLC (like CHero).
Just provide a flag parameter for deciding whether include spell power/knowledge in calculation or not. Or split to it to 3 methods: fightingStrength, magicStrength, totalStrength or sth like this.
Apparently both variants of strength calcualtion are needed in engine.
I don’t know where to write this, but I think it should be OK here. We have a lot of assigned mantis points. Problem is that you really don’t know if someone is currently working on a specific mantis point. I would like to suggest to use assigned to only if it’s in progress by someone.
I have de-assigned a few mantis points, currently I’m working on #1597 and #1643 only. Warmonger, could you disable default assignments? I look into mantis frequently and use filters to find mantis points.
What about priorizing mantis points? I think it would be great if 1 or 2 developers priorize from time to time up to 10 mantis points. Highly priorized mantis points with severity crash/block should be done first, less priorized mantis points with severity minor later for example.
Currently the issue is that no one is doing anything, as it’s end of semester for most of us. Not to mention Ivan who must be really busy with revolution now.
By the way, maybe use AI to evaluate adventure map monsters strength (AI value, fight value)?
Nobody seems to set meaningful values for creatures. And if AI will be clever, let it alone decide what strength creatures before him have.
As for creatures placement on map for guarding purposes (when preparing map), it can be done alone with their level value and/or summary hitpoints.