Skip to content
Merged
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
1 change: 1 addition & 0 deletions Core/GameEngine/Include/GameNetwork/NetworkInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class NetworkInterface : public SubsystemInterface
virtual void parseUserList( const GameInfo *game ) = 0; ///< Parse a userlist, creating connections
virtual void startGame() = 0; ///< Sets the network game frame counter to -1
virtual UnsignedInt getRunAhead() = 0; ///< Get the current RunAhead value
virtual UnsignedInt getBufferedFramesAvailable() = 0;
virtual UnsignedInt getFrameRate() = 0; ///< Get the current allowed frame rate.
virtual UnsignedInt getPacketArrivalCushion() = 0; ///< Get the smallest packet arrival cushion since this was last called.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ void GameSpyStagingRoom::launchGame()
GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_NEW_GAME );
msg->appendIntegerArgument(GAME_INTERNET);

TheWritableGlobalData->m_useFpsLimit = false;
// TheWritableGlobalData->m_useFpsLimit = false; // GeneralsX @bugfix fbraz3 21/07/2026 Keep FPS limiter active in multiplayer to avoid rendering at uncapped 500+ FPS

// Set the seeds
InitRandom( getSeed() );
Expand Down
2 changes: 1 addition & 1 deletion Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void LANAPI::OnGameStart()
GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_NEW_GAME );
msg->appendIntegerArgument(GAME_LAN);

TheWritableGlobalData->m_useFpsLimit = false;
// TheWritableGlobalData->m_useFpsLimit = false; // GeneralsX @bugfix fbraz3 21/07/2026 Keep FPS limiter active in multiplayer to avoid rendering at uncapped 500+ FPS

// Set the seeds
InitRandom( m_currentGame->getSeed() );
Expand Down
11 changes: 11 additions & 0 deletions Core/GameEngine/Source/GameNetwork/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class Network : public NetworkInterface

virtual void setLocalAddress(UnsignedInt ip, UnsignedInt port) override;
virtual UnsignedInt getRunAhead() override { return m_runAhead; }
virtual UnsignedInt getBufferedFramesAvailable() override;
virtual UnsignedInt getFrameRate() override { return m_frameRate; }
virtual UnsignedInt getPacketArrivalCushion() override; ///< Returns the smallest packet arrival cushion since this was last called.
virtual Bool isFrameDataReady() override;
Expand Down Expand Up @@ -589,6 +590,16 @@ Bool Network::AllCommandsReady(UnsignedInt frame) {
return m_conMgr->allCommandsReady(frame);// && m_conMgr->allCRCsReady(frame);
}

UnsignedInt Network::getBufferedFramesAvailable() {
UnsignedInt currentFrame = TheGameLogic->getFrame();
UnsignedInt readyCount = 0;
// Limit the search so we don't loop forever if network is somehow way ahead
while(AllCommandsReady(currentFrame + readyCount) && readyCount < 100) {
readyCount++;
}
return readyCount;
}

/**
* Take commands from the connection manager and put them on TheCommandList.
* The commands need to be put on in the same order across all clients.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ void GameSpyLaunchGame()
GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_NEW_GAME );
msg->appendIntegerArgument(GAME_INTERNET);

TheGlobalData->m_useFpsLimit = false;
// TheGlobalData->m_useFpsLimit = false; // GeneralsX @bugfix fbraz3 21/07/2026 Keep FPS limiter active in multiplayer to avoid rendering at uncapped 500+ FPS

// Set the random seed
InitGameLogicRandom( TheGameSpyGame->getSeed() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,11 @@ void W3DDisplay::gatherDebugStats()
}
#endif

fpsString.format( L"FPS: %.2f", fps);
if (TheNetwork != nullptr) {
fpsString.format( L"FPS: %.2f (Buf: %d)", fps, TheNetwork->getBufferedFramesAvailable() );
} else {
fpsString.format( L"FPS: %.2f", fps);
}
m_benchmarkDisplayString->setText( fpsString );

Int polyPerFrame = Debug_Statistics::Get_DX8_Polygons();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ void GameSpyLaunchGame()
GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_NEW_GAME );
msg->appendIntegerArgument(GAME_INTERNET);

TheGlobalData->m_useFpsLimit = false;
// TheGlobalData->m_useFpsLimit = false; // GeneralsX @bugfix fbraz3 21/07/2026 Keep FPS limiter active in multiplayer to avoid rendering at uncapped 500+ FPS

// Set the random seed
InitGameLogicRandom( TheGameSpyGame->getSeed() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,11 @@ void W3DDisplay::gatherDebugStats()
}
#endif

fpsString.format( L"FPS: %.2f", fps);
if (TheNetwork != nullptr) {
fpsString.format( L"FPS: %.2f (Buf: %d)", fps, TheNetwork->getBufferedFramesAvailable() );
} else {
fpsString.format( L"FPS: %.2f", fps);
}
m_benchmarkDisplayString->setText( fpsString );

Int polyPerFrame = Debug_Statistics::Get_DX8_Polygons();
Expand Down
Loading