Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Core/GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ set(GAMEENGINE_SRC
Include/Common/LocalFile.h
Include/Common/LocalFileSystem.h
Include/Common/MapObject.h
# Include/Common/MapReaderWriterInfo.h
Include/Common/MapReaderWriterInfo.h
Include/Common/MessageStream.h
Include/Common/MiniDumper.h
Include/Common/MiniLog.h
Expand Down Expand Up @@ -487,16 +487,16 @@ set(GAMEENGINE_SRC
# Include/GameLogic/ObjectScriptStatusBits.h
# Include/GameLogic/ObjectTypes.h
# Include/GameLogic/PartitionManager.h
# Include/GameLogic/PolygonTrigger.h
Include/GameLogic/PolygonTrigger.h
# Include/GameLogic/Powers.h
Include/GameLogic/RankInfo.h
# Include/GameLogic/ScriptActions.h
# Include/GameLogic/ScriptConditions.h
# Include/GameLogic/ScriptEngine.h
# Include/GameLogic/Scripts.h
# Include/GameLogic/SidesList.h
Include/GameLogic/SidesList.h
# Include/GameLogic/Squad.h
# Include/GameLogic/TerrainLogic.h
Include/GameLogic/TerrainLogic.h
# Include/GameLogic/TurretAI.h
# Include/GameLogic/VictoryConditions.h
# Include/GameLogic/Weapon.h
Expand Down Expand Up @@ -855,9 +855,9 @@ set(GAMEENGINE_SRC
# Source/GameLogic/AI/AITNGuard.cpp
# Source/GameLogic/AI/Squad.cpp
# Source/GameLogic/AI/TurretAI.cpp
# Source/GameLogic/Map/PolygonTrigger.cpp
# Source/GameLogic/Map/SidesList.cpp
# Source/GameLogic/Map/TerrainLogic.cpp
Source/GameLogic/Map/PolygonTrigger.cpp
Source/GameLogic/Map/SidesList.cpp
Source/GameLogic/Map/TerrainLogic.cpp
# Source/GameLogic/Object/Armor.cpp
# Source/GameLogic/Object/Behavior/AutoHealBehavior.cpp
# Source/GameLogic/Object/Behavior/BattleBusSlowDeathBehavior.cpp
Expand Down
6 changes: 6 additions & 0 deletions Core/GameEngine/Include/Common/GameDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#include "WWLib/WWDefines.h"

// Note: Retail compatibility must not be broken before this project officially does.
// Use RETAIL_COMPATIBLE_CRC, RETAIL_COMPATIBLE_DATA and RETAIL_COMPATIBLE_XFER_SAVE to guard breaking changes.
#ifndef PRESERVE_BUILDING_RESUMPTION_DELAY
#define PRESERVE_BUILDING_RESUMPTION_DELAY (0) // The fix for this unfavorable behavior was approved by the Game Design Committee.
#endif
Expand Down Expand Up @@ -103,6 +105,10 @@
#define RETAIL_COMPATIBLE_CRC (1) // Game is expected to be CRC compatible with retail Generals 1.08, Zero Hour 1.04
#endif

#ifndef RETAIL_COMPATIBLE_DATA
#define RETAIL_COMPATIBLE_DATA (1) // Game and tool data files are expected to be compatible with retail Generals 1.08 and Zero Hour 1.04
#endif

#ifndef RETAIL_COMPATIBLE_XFER_SAVE
#define RETAIL_COMPATIBLE_XFER_SAVE (1) // Game is expected to be Xfer Save compatible with retail Generals 1.08, Zero Hour 1.04
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#define K_BLEND_TILE_VERSION_5 5 // Added custom cliff u/v coordinates.
#define K_BLEND_TILE_VERSION_6 6 // Added extra blend layer for 3 textures in cell.
#define K_BLEND_TILE_VERSION_7 7 // Added flag for painting passable/impassable to cells.
#define K_BLEND_TILE_VERSION_8 8 // Added flag for painting passable/impassable to cells.
#define K_BLEND_TILE_VERSION_8 8 // Added flag for painting passable/impassable to cells. Added in Zero Hour.
#define K_OBJECTS_VERSION_1 1 // no dict
#define K_OBJECTS_VERSION_2 2 // includes dict
#define K_OBJECTS_VERSION_3 3 // includes dict
Expand All @@ -49,7 +49,7 @@
#define K_TRIGGERS_VERSION_1 1
#define K_TRIGGERS_VERSION_2 2 // Added m_isWaterArea
#define K_TRIGGERS_VERSION_3 3 // Added m_isRiver & m_riverStart
#define K_TRIGGERS_VERSION_4 4 // Added layer name.
#define K_TRIGGERS_VERSION_4 4 // Added layer name. Added in Zero Hour.
#define K_LIGHTING_VERSION_1 1
#define K_LIGHTING_VERSION_2 2 // Added 2 additional global lights for objects.
#define K_LIGHTING_VERSION_3 3 // Added 2 additional global lights for terrain.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,14 @@ Bool PolygonTrigger::ParsePolygonTriggersDataChunk(DataChunkInput &file, DataChu
loc.z = file.readInt();
pTrig->addPoint(loc);
}
#if !(RTS_GENERALS && RETAIL_COMPATIBLE_CRC)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the Polygon Trigger do anything if it is a single point? How will it change the CRC then?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well for my understanding that a single point trigger cannot contain a point through pointInTrigger(), sript and AI paths such as attack and guard area actions and the supplies within perimeter condition use a trigger’s center and radius.

i suspect that deleting the trigger changes those lookups from a valid trigger to nullptr (Could be wrong, but this is probably the case here) so script or AI behavior can diverge and indirectly change the game CRC.

I think this is why retail Generals keeps its original load behavior here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you verify that CRC mismatches when this is added or removed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will try, and will share the finding here!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you verify that CRC mismatches when this is added or removed?

after some testing, it didnt trigger a CRC mismatches, but im not 100% percent sure of that, i would like to keep it, what do you think?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does look a bit risky, but if this is provably not CRC relevant, then it would be nice to not classify it as such. Maybe someone else has an additional opinion on that.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ask the LLM for an audit whether this can be CRC relevant or not.

if (numPoints<2) {
Comment thread
xezon marked this conversation as resolved.
DEBUG_LOG(("Deleting polygon trigger '%s' with %d points.",
pTrig->getTriggerName().str(), numPoints));
deleteInstance(pTrig);
continue;
}
#endif
if (pPrevTrig) {
pPrevTrig->setNextPoly(pTrig);
} else {
Expand Down Expand Up @@ -239,7 +241,12 @@ Bool PolygonTrigger::ParsePolygonTriggersDataChunk(DataChunkInput &file, DataChu
*/
void PolygonTrigger::WritePolygonTriggersDataChunk(DataChunkOutput &chunkWriter)
{
chunkWriter.openDataChunk("PolygonTriggers", K_TRIGGERS_VERSION_4);
#if RTS_GENERALS && RETAIL_COMPATIBLE_DATA
const DataChunkVersionType version = K_TRIGGERS_VERSION_3;
#else
const DataChunkVersionType version = K_TRIGGERS_VERSION_4;
#endif
chunkWriter.openDataChunk("PolygonTriggers", version);

PolygonTrigger *pTrig;
Int count = 0;
Expand All @@ -249,7 +256,9 @@ void PolygonTrigger::WritePolygonTriggersDataChunk(DataChunkOutput &chunkWriter)
chunkWriter.writeInt(count);
for (pTrig=PolygonTrigger::getFirstPolygonTrigger(); pTrig; pTrig = pTrig->getNext()) {
chunkWriter.writeAsciiString(pTrig->getTriggerName());
chunkWriter.writeAsciiString(pTrig->getLayerName());
if (version >= K_TRIGGERS_VERSION_4) {
chunkWriter.writeAsciiString(pTrig->getLayerName());
}
chunkWriter.writeInt(pTrig->getID());
chunkWriter.writeByte(pTrig->isWaterArea());
chunkWriter.writeByte(pTrig->isRiver());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2828,8 +2828,6 @@ void TerrainLogic::flattenTerrain(Object *obj)

}



// ------------------------------------------------------------------------------------------------
/** Dig a deep circular gorge into the terrain beneath an object. */
// ------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -2879,12 +2877,6 @@ void TerrainLogic::createCraterInTerrain(Object *obj)

}







// ------------------------------------------------------------------------------------------------
/** CRC */
// ------------------------------------------------------------------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions Generals/Code/GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ set(GAMEENGINE_SRC
# Include/Common/LocalFile.h
# Include/Common/LocalFileSystem.h
# Include/Common/MapObject.h
Include/Common/MapReaderWriterInfo.h
# Include/Common/MapReaderWriterInfo.h
# Include/Common/MessageStream.h
# Include/Common/MiniLog.h
# Include/Common/MiscAudio.h
Expand Down Expand Up @@ -437,16 +437,16 @@ set(GAMEENGINE_SRC
Include/GameLogic/ObjectScriptStatusBits.h
Include/GameLogic/ObjectTypes.h
Include/GameLogic/PartitionManager.h
Include/GameLogic/PolygonTrigger.h
# Include/GameLogic/PolygonTrigger.h
Include/GameLogic/Powers.h
# Include/GameLogic/RankInfo.h
Include/GameLogic/ScriptActions.h
Include/GameLogic/ScriptConditions.h
Include/GameLogic/ScriptEngine.h
Include/GameLogic/Scripts.h
Include/GameLogic/SidesList.h
# Include/GameLogic/SidesList.h
Include/GameLogic/Squad.h
Include/GameLogic/TerrainLogic.h
# Include/GameLogic/TerrainLogic.h
Include/GameLogic/TurretAI.h
Include/GameLogic/VictoryConditions.h
Include/GameLogic/Weapon.h
Expand Down Expand Up @@ -787,9 +787,9 @@ set(GAMEENGINE_SRC
Source/GameLogic/AI/AITNGuard.cpp
Source/GameLogic/AI/Squad.cpp
Source/GameLogic/AI/TurretAI.cpp
Source/GameLogic/Map/PolygonTrigger.cpp
Source/GameLogic/Map/SidesList.cpp
Source/GameLogic/Map/TerrainLogic.cpp
# Source/GameLogic/Map/PolygonTrigger.cpp
# Source/GameLogic/Map/SidesList.cpp
# Source/GameLogic/Map/TerrainLogic.cpp
Source/GameLogic/Object/Armor.cpp
Source/GameLogic/Object/Behavior/AutoHealBehavior.cpp
Source/GameLogic/Object/Behavior/BehaviorModule.cpp
Expand Down
124 changes: 0 additions & 124 deletions Generals/Code/GameEngine/Include/Common/MapReaderWriterInfo.h

This file was deleted.

Loading
Loading