Far Cry 1 Source Code

repository·main·Indexed 21 days ago

https://github.com/strongpc123/far-cry-1-source-full

Source code for Far Cry 1, including core engine components such as CryGame.dll (game logic and CXGame loop), CryAISystem and CryInput DLLs, and the CryNetwork module featuring the CClient class for network connection management and IClientSink for event handling. Also contains CryFont documentation regarding FreeType BDF and PCF font driver implementations.

Tokens
28.7K
Snippets
67
Records
154
Agent score
76%

What's inside far-cry-1-source-full

  1. Overview of CryAISystem project files

    main

    The CryAISystem application is structured as a Dynamic Link Library (DLL) with the following key components:

    • CryAISystem.dsp: The project file containing project-level information used for building. Note that while .dsp files can be shared, users should export makefiles locally.
    • CryAISystem.cpp: The primary source file for the DLL.
    • StdAfx.h / StdAfx.cpp: Files used to generate the precompiled header (CryAISystem.pch) and the precompiled types file (StdAfx.obj) to accelerate build times.
  2. Overview of CryGame.dll components

    main

    The CryGame.dll module contains the core game logic and engine interfaces. The primary implementation of the game logic is found in CXGame, which implements the IGame interface.

    Key functional areas include:

    • Main Loop & Updates: Managed via CXGame::Run() (the main loop) and CXGame::Update() (per-frame updates).
    • Scripting Interface: A large collection of ScriptObject* classes (e.g., ScriptObjectEntity, ScriptObjectWeapon, ScriptObjectPlayer) that bridge engine functionality to the scripting system.
    • Systems: Core systems such as PlayerSystem, MenuSystem, AIHandler, and XNetwork handle specific engine responsibilities.
    • UI/HUD: Managed through UI, XHud, and UIHud components.
  3. Overview of the ResourceCompilerPC DLL

    main

    The ResourceCompilerPC is a Dynamic Link Library (DLL) designed to act as a resource compiler specifically for the PC platform. It contains the platform-specific converters required for resource processing.

    Key Architectural Rule:

    • Platform-Specific Code: Must reside within this DLL (ResourceCompilerPC.cpp).
    • Shared Code: Any code that is common across all platforms (such as CGF loading or processing logic) must reside in the main resource compiler executable (.exe), not in this DLL.
  4. Establish TCP connections through Firewalls

    main

    Establishing TCP connections through firewalls is more restrictive than UDP. Firewalls generally do not allow unsolicited incoming TCP connections.

    To establish a connection:

    1. Single Firewall: The side behind the firewall must initiate the connection to the side without the firewall. For example, if only the client has a firewall, the client must open the connection to the Server's TCP port.
    2. Dual Firewalls: If both the client and the server are behind firewalls, a TCP connection cannot be established without manual configuration (e.g., port forwarding or changing firewall rules) on at least one side.
  5. Understand the CryEngine 1.33 Gold Edition SDK License

    main

    The SDK is provided under a specific contract with CryTek. By downloading or using the SDK, you accept these terms:

    • Usage: You may download and use the SDK free of charge to develop a modified CryTek game (published by Ubisoft) running on CryEngine 1.
    • Distribution of Games: You may distribute your modified CryTek game in CryEngine and object code form, but only for free.
    • Distribution of SDK: You may copy, modify, and distribute the SDK and your modifications in CryEngine and object code form, but only for free.
    • Requirements: Any distribution of the SDK must include this LICENSE file and the original copyright notice.
    • Commercial Use: If you wish to use the SDK for commercial purposes, you must contact CryTek directly at https://www.crytek.com/contact.

    Disclaimer: The SDK is provided "AS IS" without warranties of any kind. CryTek is not liable for any damages arising from the use or inability to use the engine or SDK.

  6. Project Structure and File Roles in ResourceCompilerPC

    main

    The ResourceCompilerPC project consists of the following key files:

    • ResourceCompilerPC.vcproj: The main Visual C++ project file containing configuration, platform, and version information.
    • ResourceCompilerPC.cpp: The primary source file for the DLL implementation.
    • StdAfx.h & StdAfx.cpp: Precompiled header (PCH) files used to accelerate the build process, generating ResourceCompilerPC.pch and StdAfx.obj.

    Developers looking to customize the logic should look for TODO: comments within the source code, which indicate areas intended for extension or customization.

  7. Build the CryScriptSystem DLL

    main

    The CryScriptSystem project is a Dynamic Link Library (DLL) managed via a .dsp project file. To build the project, use the CryScriptSystem.dsp file. Note that users sharing the project should export their makefiles locally rather than sharing the .dsp file itself.

    Exporting Symbols and Generating a .lib File

    By default, this DLL does not export any symbols. Because of this, the build process will not produce a .lib file. If you intend to use CryScriptSystem as a dependency for another project, you must perform one of the following:

    1. Export symbols: Add code to the source to explicitly export symbols from the DLL.
    2. Linker Settings: In the project's Linker settings page, check the "doesn't produce lib" checkbox if you do not require an import library.
    CryScriptSystem.dsp    # Project file used to build the DLL
    CryScriptSystem.cpp     # Main DLL source file
  8. Build the CryInput DLL

    main

    The CryInput project is structured as a Dynamic Link Library (DLL). To build the project, use the CryInput.dsp project file. Note that the project uses StdAfx.h and StdAfx.cpp as precompiled headers (PCH) to speed up compilation, which generates CryInput.pch and StdAfx.obj.

    Use CryInput.dsp to build the project.
  9. Configure CryAISystem DLL for project dependency

    main

    By default, the CryAISystem DLL does not export any symbols, which means it will not produce a .lib file upon building. If you intend to use CryAISystem as a project dependency for another application, you must perform one of the following actions:

    1. Export Symbols: Add code to the source to explicitly export symbols from the DLL.
    2. Linker Settings: In the project's Linker settings page, check the "doesn't produce lib" checkbox to allow linking without an export library.
  10. Configure CryInput as a project dependency

    main

    By default, the CryInput DLL does not export any symbols, which means it will not produce a .lib file during the build process. If you intend to use CryInput as a dependency for another project, you must perform one of the following actions:

    1. Export symbols: Add code to CryInput.cpp to export specific symbols from the DLL. This will cause the compiler to generate an export library (.lib).
    2. Disable lib production: In your linker settings, check the "doesn't produce lib" checkbox to allow the project to build without a corresponding .lib file.