Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CS2 support tracker #132

Open
42 of 75 tasks
GAMMACASE opened this issue Sep 27, 2023 · 2 comments
Open
42 of 75 tasks

CS2 support tracker #132

GAMMACASE opened this issue Sep 27, 2023 · 2 comments

Comments

@GAMMACASE
Copy link
Member

GAMMACASE commented Sep 27, 2023

This issue is a progress/issue tracker for the ongoing development of cs2 hl2sdk branch done by the community and am members.

Completion status:

  • ConVar and ConCommand related stuff:
    • ICvar interface;
    • ConVar lifecycle (Creation/Operation/Deletion) (Currently requires API only work);
    • ConCommand lifecycle (Creation/Operation/Deletion);
  • Utility classes:
    • Obsoletion of tier1.lib and transition to tier0 structure:
      • commandbuffer.cpp moved to tier0;
      • memstack.cpp moved to tier0;
      • netadr.cpp moved to tier0;
      • stringpool.cpp moved to tier0;
      • strtools.cpp moved to tier0;
      • uniqueid.cpp moved to tier0;
      • checksum_* moved to tier0;
      • diff.cpp moved to tier0;
      • cbyteswap.cpp moved to tier0;
    • VProf related classes (mostly moved to tier0):
      • CVProfNode;
      • CVProfile;
      • VProfScopeHelper;
    • KeyValues;
    • KeyValues3;
    • CBufferString;
    • CUtlString;
    • CUtlLeanVector;
    • CUtlVectorBase;
    • CUtlOrderedMap;
    • Vec3D;
    • CUtlTSHash;
    • CUtlMemoryPoolBase (?);
    • CUtlMemoryFixedGrowable_Base (?);
    • CCircularBuffer/CFixedSizeCircularBuffer;
    • CUtlScratchMemoryPool/CUtlScratchMemoryPoolFixedGrowable;
    • bf_read/bf_write seems to have additional properties, might need a revisit;
  • Game interfaces that require attention/reversal:
    • INetworkGameServer;
    • INetChannel;
    • ISource2Server;
    • ISource2GameEntities;
    • ISource2ServerConfig;
    • CSchemaSystemTypeScope (Now using CUtlOrderedMap for CSchemaPtrMap);
  • Schema/Datamap access:
    • CEntityClass;
    • Datamap;
    • CSchemaClassInfo;
  • Game Events:
    • IGameEvent;
    • IGameEventSystem;
    • IGameEventManager2;
  • Entity access:
    • Client userid/pawn/controller/ehandle conversation;
    • Entity lifecycle API (Generally these could be replaced by calling game functions instead, so these mostly optional if there's a way to do it without using the game code):
      • Creating an entity (by classname, other means?);
      • Dispatching spawn and its keyvalues;
      • Killing/Freeing an entity;
    • UTIL_* functions to provide conversation from (?):
      • CEntityIndex -> CBaseEntity;
      • CPlayerSlot -> CBaseEntity;
    • CGameEntitySystem;
    • CConcreteEntityList;
    • CEntityIdentity;
    • CEntityHandle;
    • CEntityKeyValues;
    • EntityInstanceByClassIter_t;
  • Resource/Manifest management:
    • Basic resource precaching workflow;
    • CEntityPrecacheContext (Needs to be moved to a separate location);
    • IEntityPrecacheConfiguration;
    • IEntityResourceManifest;
  • Ray Tracing mechanisms (Generally its already doable with what we have):
    • CGamePhysicsQueryInterface;
    • IVPhysics2World;
    • CGameTrace;
    • CTraceFilter;
    • Ray_t;
    • Update MASK/CONTENTS flags;

If you want to contribute to the project, please make sure to pr the changes to cs2 branch as well as discuss them beforehand in the AlliedModders discord in appropriate channels.

This is a collaborative work and a lot of the research and development was done by: vanz, Wend4r, slidybat, poggu_, psychonic9, zer0.k, mooshua, boeing666, komashchenko, 0xe58, number201724 and others from the AM Discord. So huge thanks to them!

@dvander
Copy link
Member

dvander commented Sep 27, 2023

This is awesome, and incredible to see so much already figured out! Thank you for writing this up, and thanks to everyone who has already dove in and expanded community knowledge of the engine.

@dtugend
Copy link

dtugend commented Oct 4, 2023

Hi, thanks for your efforts.

I am currently still trying to figure the KeyValues system (seems like it's different in ways I didn't manage to figure yet), but I can say for sure, that IKeyValuesSystem has a destructor as first class member (it's exposed in tier0.dll):

class IKeyValuesSystem
{
public:
	virtual ~IKeyValuesSystem() = 0;
//...
};

(Currently it's in the SDK without.)

Edit:
Apparently the problem is that there's two different KeyValues systems: KeyValues and KeyValues3.
For example IGameEvent::GetDataKeys (which the offset is shifted wrongly a bit, so is for HasKey) uses KeyValues3, not KeyValues.
It should be possible to reverse engineer KeyValues 3 from tier0.dll's ?DebugPrintKV3@@YAXPEBVKeyValues3@@@Z (void __fastcall DebugPrintKV3(const struct KeyValues3 *)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants