mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Minor tweaks/fixes
This commit is contained in:
parent
f906d98fe5
commit
393b25eb7f
@ -295,9 +295,9 @@ float FuzzyHelper::getWanderTargetObjectValue(const CGHeroInstance & h, const Ob
|
||||
boost::optional<int> objValueKnownByAI = MapObjectsEvaluator::getInstance().getObjectValue(obj->ID, obj->subID);
|
||||
int objValue = 0;
|
||||
|
||||
if(objValueKnownByAI.is_initialized())
|
||||
if(objValueKnownByAI.is_initialized()) //consider adding value manipulation based on object instances on map
|
||||
{
|
||||
objValue = objValueKnownByAI.value();
|
||||
objValue = std::min(std::max(objValueKnownByAI.value(), 0), 20000);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1540,12 +1540,12 @@ void VCAI::wander(HeroPtr h)
|
||||
|
||||
if(dests.size()) //performance improvement
|
||||
{
|
||||
auto fuzzyLogicSorter = [h](const ObjectIdRef & l, const ObjectIdRef & r) -> bool
|
||||
auto fuzzyLogicSorter = [h](const ObjectIdRef & l, const ObjectIdRef & r) -> bool //TODO: create elementar GetObj goal usable for goal decomposition and Wander based on VisitTile logic and object value on top of it
|
||||
{
|
||||
return fh->getWanderTargetObjectValue( *h.get(), l) < fh->getWanderTargetObjectValue(*h.get(), r);
|
||||
};
|
||||
|
||||
const ObjectIdRef & dest = *boost::max_element(dests, fuzzyLogicSorter); //find best object to visit based on fuzzy logic evaluation
|
||||
const ObjectIdRef & dest = *boost::max_element(dests, fuzzyLogicSorter); //find best object to visit based on fuzzy logic evaluation, TODO: use elementar version of GetObj here in future
|
||||
|
||||
//wander should not cause heroes to be reserved - they are always considered free
|
||||
logAi->debug("Of all %d destinations, object oid=%d seems nice", dests.size(), dest.id.getNum());
|
||||
|
@ -219,7 +219,7 @@ public:
|
||||
{
|
||||
h & sounds;
|
||||
}
|
||||
if(version >= 788)
|
||||
if(version >= 789)
|
||||
{
|
||||
h & aiValue;
|
||||
}
|
||||
@ -262,7 +262,7 @@ class DLL_LINKAGE CObjectClassesHandler : public IHandlerBase
|
||||
{
|
||||
h & sounds;
|
||||
}
|
||||
if(version >= 788)
|
||||
if(version >= 789)
|
||||
{
|
||||
h & groupDefaultAiValue;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "../ConstTransitivePtr.h"
|
||||
#include "../GameConstants.h"
|
||||
|
||||
const ui32 SERIALIZATION_VERSION = 788;
|
||||
const ui32 SERIALIZATION_VERSION = 789;
|
||||
const ui32 MINIMAL_SERIALIZATION_VERSION = 753;
|
||||
const std::string SAVEGAME_MAGIC = "VCMISVG";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user