Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
0a59aec
perf(screenshot): Avoid redundant buffers and copies in screenshot up…
tintinhamans Oct 7, 2026
4e21dab
perf(screenshot): Upload probe screenshots one slot at a time at a ca…
tintinhamans Oct 27, 2026
3580bf4
feat(network): Share the game network settings between LAN and online
tintinhamans Oct 22, 2026
11f1f99
feat(network): Measure connection latency, jitter and loss with packe…
tintinhamans Oct 22, 2026
37d3509
feat(online): Rate connections and show the network overlay
tintinhamans Oct 22, 2026
6ecc67e
feat(network): Repair datagram loss with adaptive redundancy
tintinhamans Oct 22, 2026
7110ab3
feat(network): Validate peer identity and authenticate match startup …
tintinhamans Oct 22, 2026
ee259f3
feat(network): Send commands directly across the peer mesh
tintinhamans Oct 22, 2026
fbb383a
fix(network): Synchronize disconnect removal and quit handling
tintinhamans Oct 22, 2026
ecdf4f9
feat(network): Revise runahead from measured latency and frame pacing
tintinhamans Oct 22, 2026
b963419
bugfix(network): Sort fast path in NetCommandList by sort number (#3052)
CryoTheRenegade Aug 15, 2026
3eb6426
feat(network): Control arrival cushion and starting runahead
tintinhamans Oct 22, 2026
cc4d8af
feat(lobby): Add the /net chat command for the relay and connection e…
tintinhamans Oct 12, 2026
350f956
feat(online): Turn on Wi-Fi media streaming mode while a match runs
tintinhamans Oct 16, 2026
8c76a88
feat(ingameui): Implement 1% low FPS display (#2661)
mirelle7 Oct 22, 2026
ad84247
feat(gamelod): Lower effects step by step when this machine cannot ke…
tintinhamans Oct 22, 2026
f189a70
feat(online): Tell players when power saving slows the game down
tintinhamans Oct 22, 2026
5f2863c
feat(online): Show adaptive quality in the network overlay
tintinhamans Oct 24, 2026
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/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ target_include_directories(corei_libraries_source_wwvegas INTERFACE "Libraries/S
target_include_directories(corei_main INTERFACE "Main")

target_sources(corei_libraries_include PRIVATE
Libraries/Include/AdaptiveQualityLevels.h
Libraries/Include/Lib/BaseType.h
Libraries/Include/Lib/BaseTypeCore.h
Libraries/Include/Lib/trig.h
Expand Down
2 changes: 2 additions & 0 deletions Core/GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ set(GAMEENGINE_SRC
# Include/GameLogic/WeaponStatus.h
Include/GameNetwork/Connection.h
Include/GameNetwork/ConnectionManager.h
Include/GameNetwork/ConnectionStats.h
Include/GameNetwork/DisconnectManager.h
Include/GameNetwork/DownloadManager.h
Include/GameNetwork/FileTransfer.h
Expand Down Expand Up @@ -1099,6 +1100,7 @@ set(GAMEENGINE_SRC
Source/GameLogic/System/RankInfo.cpp
Source/GameNetwork/Connection.cpp
Source/GameNetwork/ConnectionManager.cpp
Source/GameNetwork/ConnectionStats.cpp
Source/GameNetwork/DisconnectManager.cpp
Source/GameNetwork/DownloadManager.cpp
Source/GameNetwork/FileTransfer.cpp
Expand Down
1 change: 1 addition & 0 deletions Core/GameEngine/Include/GameClient/Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ class Display : public SubsystemInterface
virtual void setCinematicTextFrames(Int frames) { m_cinematicTextFrames = frames; }

virtual Real getAverageFPS() = 0; ///< returns the average FPS.
virtual Real getLow1PercentFPS() = 0; ///< returns the 1% low FPS.
virtual Real getCurrentFPS() = 0; ///< returns the current FPS.
virtual Int getLastFrameDrawCalls() = 0; ///< returns the number of draw calls issued in the previous frame

Expand Down
44 changes: 35 additions & 9 deletions Core/GameEngine/Include/GameNetwork/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@
#include "GameNetwork/User.h"
#include "GameNetwork/Transport.h"
#include "GameNetwork/NetPacket.h"

#include "GameNetwork/ConnectionStats.h"
#if defined(GENERALS_ONLINE)
#define CONNECTION_LATENCY_HISTORY_LENGTH 10
#else
#define CONNECTION_LATENCY_HISTORY_LENGTH 200
#include "GameNetwork/NetworkSettings.h"
#endif

class Connection : public MemoryPoolObject
Expand All @@ -66,6 +64,13 @@ class Connection : public MemoryPoolObject
void setUser(User *user);
User *getUser();
void setFrameGrouping(time_t frameGrouping);
#if defined(GENERALS_ONLINE)
void setNetworkSettings(const NetworkSettings &settings, Bool unreliableTransport) { m_networkSettings = settings; m_unreliableTransport = unreliableTransport; }
#endif
void setSlot(Int slot) { m_slot = slot; }
void setShortGrouping(Bool shortGrouping); ///< Send at one frame while the run ahead is close to its floor.
Int getRedundancyDepth() const { return m_redundancyDepth; }
time_t getFrameGrouping() const { return m_frameGrouping; } ///< The send interval in use, shorter than the configured one while redundancy is on.

void sendNetCommandMsg(NetCommandMsg *msg, UnsignedByte relay);

Expand All @@ -80,12 +85,27 @@ class Connection : public MemoryPoolObject
void setQuitting();
Bool isQuitting() { return m_isQuitting; }

const ConnectionStats& getStats() const { return m_stats; }

#if defined(RTS_DEBUG)
void debugPrintCommands();
#endif

protected:
void doRetryMetrics();
#if defined(GENERALS_ONLINE)
NetworkSettings m_networkSettings;
Bool m_unreliableTransport;
#endif

void resetRedundancy();
void updateRedundancy(time_t curtime, Bool &active, time_t &window, Int &depth);
Bool hasLossEvidence(); ///< A packet was lost in either direction lately, or nothing says otherwise
Bool getOutgoingLoss(float &lossPercent, Int &longestRun); ///< FALSE when the peer sent no packet feedback
void noteLossEvent(time_t now, Bool burst);
void setRedundancyDepth(Int depth, Int cap, time_t now);
Bool isQueueBuilding(time_t now); ///< Round trip at 2x its low while packets are lost: a full queue
void applyFrameGrouping();
void addRedundantCommands(NetPacket *packet, time_t curtime, time_t window, Int depth);

Bool m_isQuitting;
UnsignedInt m_quitTime;
Expand All @@ -95,11 +115,17 @@ class Connection : public MemoryPoolObject

NetCommandList *m_netCommandList;
time_t m_retryTime; ///< The time between sending retry packets for this connection. Time is in milliseconds.
Real m_averageLatency; ///< The average time between sending a command and receiving an ACK.
Real m_latencies[CONNECTION_LATENCY_HISTORY_LENGTH]; ///< List of the last 100 latencies.
ConnectionStats m_stats; ///< Latency, jitter and loss of this connection.

Int m_redundancyDepth; ///< How many later packets each un-acked command is repeated in, 0 on a clean connection.
Int m_redundancyCap; ///< The deepest depth, from the longest burst to repair and the send interval.
time_t m_lastLossEventTime; ///< What the decay counts from.
time_t m_lastDepthChangeTime; ///< A burst needs a round trip to show whether the new depth helped.
Bool m_queueSuspected; ///< A full queue on the path, redundancy steps down instead of up.
Int m_slot;

Bool m_shortGrouping;
time_t m_configuredFrameGrouping;
time_t m_frameGrouping; ///< The minimum time between packet sends.
time_t m_lastTimeSent; ///< The time of the last packet send.
Int m_numRetries; ///< The number of retries for the last second.
time_t m_retryMetricsTime; ///< The start time of the current retry metrics thing.
};
Loading
Loading