Skip to content

Jules qc optimizations - #2

Draft
TDA317 wants to merge 2 commits into
Jason2Brownlee:mainfrom
TDA317:jules-qc-optimizations
Draft

Jules qc optimizations#2
TDA317 wants to merge 2 commits into
Jason2Brownlee:mainfrom
TDA317:jules-qc-optimizations

Conversation

@TDA317

@TDA317 TDA317 commented May 24, 2025

Copy link
Copy Markdown

No description provided.

TDA317 and others added 2 commits May 24, 2025 09:23
Just the basic changes explaining what it is I am doing here...
This commit introduces several small optimizations and clarifications
to the QuakeC game logic:

1.  Redundant `makevectors` calls:
    Removed several redundant calls to `makevectors(self.v_angle)`
    within weapon firing functions (`W_FireAxe`, `FireBullets`,
    `W_FireRocket`, `W_FireGrenade`, `W_FireSpikes` in `weapons.qc`).
    These functions now rely on the `makevectors` call made at the
    beginning of `W_Attack()` to set your view vectors
    (v_forward, v_right, v_up). This avoids unnecessary recalculations
    of these vectors when firing weapons.

2.  Code Clarifications (Comments only):
    *   Added a comment in `qc/player.qc` to `player_run` clarifying the
        existing animation frame update mechanism.
    *   Added a detailed comment in `qc/weapons.qc` to `LightningDamage`
        explaining the specific (and somewhat quirky) vector math used
        to determine the spread of the lightning beams.

    These changes are not expected to alter gameplay behavior but aim
    to improve code efficiency slightly and enhance maintainability
    through better comments on complex or non-obvious code sections.
    All modifications include "TDA-Jules" in comments for tracking.

    Files affected:
    - qc/player.qc (comment added)
    - qc/weapons.qc (code changes and comments added)
@TDA317

TDA317 commented May 24, 2025

Copy link
Copy Markdown
Author

Ignore this... I'm learning github. Sorry

Original prompt:
This is the QuakeC game code from the game Quake. It is not the original vanilla code. It has already been modified to remove compiler editors and had a few minor optimizations and modifications performed.

I would like you to look over this code for any possibility of optimization. Then make those optimizations. I understand that this is reasonably clean code and optimizations may not have much real world change.

At this time, please try not to affect gameplay with these changes other than possible speed and stability improvements.

Any/all modifications must be heavily commented. Please include TDA-Jules in those comments so future humans can easily find those edits.

Result: changes to just two files. player.qc and weapons.qc

@TDA317
TDA317 marked this pull request as draft May 24, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant