Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/binaries/data/mods/public/simulation/data/pathfinder.xml
r9665 r9666 1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Pathfinder> 3 4 <!-- 5 Previously all move commands during a turn were 6 queued up and processed asynchronously at the start 7 of the next turn. Now we are processing queued up 8 events several times duing the turn. This improves 9 responsiveness and units move more smoothly especially. 10 when in formation. There is still a call at the 11 beginning of a turn to process all outstanding moves - 12 this will handle any moves above the MaxSameTurnMoves 13 threshold. 14 15 TODO - The moves processed at the beginning of the 16 turn do not count against the maximum moves per turn 17 currently. The thinking is that this will eventually 18 happen in another thread. Either way this probably 19 will require some adjustment and rethinking. 20 --> 3 <!-- Sets limit on the number of same turns moves we will process --> 4 <!-- Setting the value to 0 disable this functionality --> 21 5 <MaxSameTurnMoves>64</MaxSameTurnMoves> 22 6 -
ps/trunk/source/simulation2/components/CCmpPathfinder.cpp
r9665 r9666 53 53 m_DebugPath = NULL; 54 54 55 m_SameTurnMovesCount = 0; 56 55 57 // Since this is used as a system component (not loaded from an entity template), 56 58 // we can't use the real paramNode (it won't get handled properly when deserializing), … … 59 61 CParamNode::LoadXML(externalParamNode, L"simulation/data/pathfinder.xml"); 60 62 63 // Previously all move commands during a turn were 64 // queued up and processed asynchronously at the start 65 // of the next turn. Now we are processing queued up 66 // events several times duing the turn. This improves 67 // responsiveness and units move more smoothly especially. 68 // when in formation. There is still a call at the 69 // beginning of a turn to process all outstanding moves - 70 // this will handle any moves above the MaxSameTurnMoves 71 // threshold. 72 // 73 // TODO - The moves processed at the beginning of the 74 // turn do not count against the maximum moves per turn 75 // currently. The thinking is that this will eventually 76 // happen in another thread. Either way this probably 77 // will require some adjustment and rethinking. 61 78 const CParamNode pathingSettings = externalParamNode.GetChild("Pathfinder"); 62 79 m_MaxSameTurnMoves = pathingSettings.GetChild("MaxSameTurnMoves").ToInt(); … … 176 193 SerializeVector<SerializeShortRequest>()(serialize, "short requests", m_AsyncShortPathRequests); 177 194 serialize.NumberU32_Unbounded("next ticket", m_NextAsyncTicket); 195 serialize.NumberU16_Unbounded("same turn moves count", m_SameTurnMovesCount); 178 196 } 179 197 … … 185 203 SerializeVector<SerializeShortRequest>()(deserialize, "short requests", m_AsyncShortPathRequests); 186 204 deserialize.NumberU32_Unbounded("next ticket", m_NextAsyncTicket); 205 deserialize.NumberU16_Unbounded("same turn moves count", m_SameTurnMovesCount); 187 206 } 188 207 … … 477 496 u32 moveCount; 478 497 479 if ( m_AsyncLongPathRequests.size() > 0)498 if (!m_AsyncLongPathRequests.empty()) 480 499 { 481 500 // Figure out how many moves we can do this time … … 504 523 } 505 524 506 if ( m_AsyncShortPathRequests.size() > 0)525 if (!m_AsyncShortPathRequests.empty()) 507 526 { 508 527 // Figure out how many moves we can do now -
ps/trunk/source/simulation2/components/CCmpPathfinder_Common.h
r9665 r9666 182 182 std::vector<AsyncShortPathRequest> m_AsyncShortPathRequests; 183 183 u32 m_NextAsyncTicket; // unique IDs for asynchronous path requests 184 u16 m_SameTurnMovesCount; // current number of same turn moves we have processed this turn 184 185 185 186 // Lazily-constructed dynamic state (not serialized): … … 190 191 bool m_TerrainDirty; // indicates if m_Grid has been updated since terrain changed 191 192 192 // For responsiveness we will proce es some moves in the same turn they were generated in193 // For responsiveness we will process some moves in the same turn they were generated in 193 194 194 195 u16 m_MaxSameTurnMoves; // max number of moves that can be created and processed in the same turn 195 u16 m_SameTurnMovesCount; // current number of same turn moves we have processed this turn196 196 197 197 // Debugging - output from last pathfind operation: … … 250 250 virtual void FinishAsyncRequests(); 251 251 252 v irtual void ProcessLongRequests(const std::vector<AsyncLongPathRequest>& longRequests);252 void ProcessLongRequests(const std::vector<AsyncLongPathRequest>& longRequests); 253 253 254 v irtual void ProcessShortRequests(const std::vector<AsyncShortPathRequest>& shortRequests);254 void ProcessShortRequests(const std::vector<AsyncShortPathRequest>& shortRequests); 255 255 256 256 virtual void ProcessSameTurnMoves();
Note:
See TracChangeset
for help on using the changeset viewer.
