djcev.com

//

Memory / Work / QuakeOneDogMode

Created , last updated . Source file.
Tags: , , .

This page is for taking notes for and tracking my work on a Quake mod. You can find the mod itself (such as it is) in this software repo. The mod in its current state is almost entirely the work of other people; you can find a credits list in the README.

Table Of Contents

TODO list

Current significant bugs:

  • camera / cutscene system needs to be refactored
  • spawn_tfog & spawn_tdeath need to be reworked

In the codebase:

  • CSQC improvements (fixed tempentities [lightning], etc.)
  • Implement camera bobbing & rolling (for feature parity with Q1)
    • Improve player movement feedback in general
    • Done in CSQC; See Nuclide base/src/client/camera.qc
  • Improve (or implement a new) player unstick function
  • Item system rework
    • All items respawn according to DM spawntimes
    • Reduce max ammo count
  • Monster code rewrite
    • Monsters understand & can pick up items on the map
      • different monsters pick up and use different weapons
      • monsters time items?
    • New movement system for monsters (waypoints?)
      • Implement movetogoal & walkmove in Quake C
      • Study bot code: frikbot, frogbot, nexuiz, nuclide bots
  • Sounds
    • New (varied) sounds for jumping

Outside - articles, video, etc.:

  • Record a video demonstration of the new movement behavior
    • demo of SlideMove & StepSlideMove
    • demo of Quake 3 style strafejumping
    • demo of QC implementation of stepjumping / pseudo-airstepping
    • demo & explanation of doublejump and telejump
  • Write and publish an article going over the above code & changes

Naming Conventions & Style

Break lines that don't fit within 80 columns. Braces ("{}") get their own line. Always use braces for switch/case blocks, and for every member of an if / else if / else block if any member of that block has more than one line.

Use lowercase_with_underscores names for functions within the class/object hierarchy. Use upper camel case names for functions outside that structure and for functions called by the engine.

Use lowercase_with_underscores names for entity fields and local variables. Use upper camel case names for globals.

Stats and Skills

Reserve one float field for stats: self.stats (name?). Each stat is represented by three bits allowing for seven possible values for each stat (0-5 with one reserved?). A float can contain 23 possible bits; this gives us enough space for 7 (7x3=21) individual stats.

Strength, Intelligence, Endurance, Agility, Luck

The fallout S.P.E.C.I.A.L. system has seven stats. Strength, Perception, Endurance, Charisma, Intelligence, Agility, Luck. Each stat has a range of 1-10 (IIRC).

VtM: Bloodlines has nine stats (Attributes): Strength, Dexterity, Stamina, Charisma, Manipulation, Appearance, Perception, Intelligence, Wits. Three physical, three social, three mental. Each stat has a range of 0-5.

Cyberpunk 2.0.2.0. has nine stats: Intelligence, Reflexes, Cool, Tech, Luck, Attractiveness, Movement Allowance, Empathy, Body.

Doom RPG has eight stats: Strength, Defense, Vitality, Energy, Regeneration, Agility, Capacity, Luck

Arcana has four: Strength, Endurance, Intelligence, Alertness

Morrowind has eight: Strength, Intelligence, Willpower, Agility, Speed, Endurance, Personality, Luck

Divinity Original Sin has six: Strength, Dexterity, Intelligence, Constitution, Speed, and Perception

Hexen II has six: Intelligence, Wisdom, Dexterity, Strength, HP, Mana Level

Movement

Currently implemented:

  • Quake 1-style air control (PM_AirAccelerate)
    • Active only when holding +left or +right
  • CPM/Painkiller-style +movement direction air control
    • Active only when holding +fwd or +back
  • Quake 3 strafejumping
    • Active when requesting diagonal movement while in the air, i.e. holding either forward or back and also one of the sidestep left or right keys.
  • Quake 3 wall clipping / skimming
    • 250ms window checked against the doublejump timer.
  • New slidemove based on Q1, Q3, and Nuclide.
    • Implements airsteps and Q3-like 'sticky' steps
  • Crouching (based on Quake 3, Nexuiz, and Nuclide code)
  • Crouchsliding (based on Rapha's demonstration in his QC movement tutorial)
  • Doublejumps & Stairjumps (two jumps within 400ms)
    • Now with correct ground accel behavior (done by raising wishspeed limit)
  • Teleporter jumps (doublejump through a teleporter)
  • Walljumping (based on Warsow, Xonotic, and Quake Champions Classic code)
  • Targeted trigger_push entities (Quake 3 jumppads)

Need the following sounds:

  • water footsteps
  • short jump
  • normal jump (HUH!)
  • doublejump
  • walljump

Items & Weapons

Possible new armor system: a more 'metroidvania' style setup where armor upgrades set A. the maximum armor you can have and B. the absorption tier. Armor shards would then refill up to the max value set by armor upgrade. Upgrades would be: base (max 50, 1/3 absorb), Green (max 100, 1/3 absorb), Yellow (max 150, 3/5 absorb), and Red (max 200, 4/5 asborb).

Weapons. Each have their own ammo type & pool.

  1. Axe (id1 standard)
  2. Shotgun (id1 standard, modified damage & spread)
  3. Lasergun (same as the enforcer's gun)
  4. Nailgun (nails have knockback for climbing purposes)
  5. Stakegun (Painkiller; Q2 Railgun replacement)
  6. Tribolt (Quake Champions)
  7. Rocket Launcher (id1 standard)
  8. Lightning Gun (id1 standard)
  9. No weapon selected (shove / pick up an object?)

Ideas for additional items:

  • Rations (food? function as a health item?)

New item selection / use system:

8 item slots (numbers 1-8 on the keyboard / impulse 1-8). Slots can be selected at-will even if empty. If an empty slot is selected then item 0 (the player's hands) will be shown. Touching an object with an empty slot selected will pick up that object and map it to that slot. A new impulse (10? 13?) will throw an item away from the player, removing that item from the selected slot, freeing that slot for further use.

This allows for picking up and carrying things like ammo boxes and health packs. With an ammo box selected "using" it (+attack) will add that ammo to the player's appropriate ammo_whatever field. A health box would heal the player on +attack, and so on. A thrown item will do a negligible amount of damage if it hits an enemy (5? 10? dmg).

player_fire_hands (?), player_impulse_throw_item (?)

Monsters

New monsters: bats, rats, spiders, etc. Maybe I can learn how to model for Quake? I dunno. That seems unrealistic.

Mapping

TODO table of biomes, associated maps, progression

Code Style

Indent with tabs. Curly brackets on their own line. Constants are CAPS_WITH_UNDERSCORES, functions are lowercase_with_underscores, variables are lowercase_with_underscores.

Object / Class structure

Function checklist for every object:

  • optional: void() objname_blocked
  • optional: void(entity attacker, float damage) objname_damage
    • was: th_pain
  • optional: void() objname_destroy
    • was: th_die
  • optional: void() objname_think
  • optional: void() objname_touch
  • optional: void() objname_use
  • void() objname_respawn
    • respawn chosen entity
  • entity(...) spawn_objname
    • accept a limited number of arguments, spawn objname entity, and return it
  • void() spawnfunc_objname (or just void() objname)
    • traditional spawn function

Brief list:

  • base_entity [think, touch, use]
    • base_mapentity [+ destroy]
      • base_func [+ blocked]
        • see files in qc/func
      • base_item - item pickups [damage, destroy, think, touch, use]
        • base_item_ammo
        • base_item_armor
        • base_item_health
        • base_item_key
        • base_item_powerup
        • base_item_rune
        • base_item_weapon
        • item_backpack
      • base_monster [stand, walk, run, missile, melee, pain, turret]
        • player
        • base_bossmonster
          • boss (chthon)
          • boss2 (PD chthon)
          • oldone (shub)
          • oldone2 (PD shub)
        • base_flymonster
          • wizard (scrag)
        • base_swimmonster
          • fish
        • base_walkmonster
          • enforcer
          • hknight (death knight)
          • knight
          • ogre
          • soldier (grunt)
          • demon (fiend)
          • dog
          • shalrath (vore)
          • shambler
          • zombie
      • base_trigger (is_waiting)
    • base_tempentity
      • base_projectile [think, touch]
        • bullet
        • death knight missiles
      • fireball
        • flak
        • grenade
        • laser
        • lavaball (Chthon, Oldone2, Ogre, Shambler)
        • minigrenade / multigrenade
        • rocket
        • spike (nail)
        • voreball
        • wizard spell (Scrag/Wizard attack)
        • zombiechunk

Client Prediction Notes

FTE has some kind of anti-cheat that sometimes loses packets when doing QC player movement physics, see https://github.com/fte-team/fteqw/issues/208. "cl_maxfps_slop 0" might improve the situation. See also "cl_threadedphysics" (conflicts with CSQC_Input_Frame according to Spike).

spawnfunc for _misc_model

List of entities that need to be networked:

  • cshift (SVC_CGAMEPACKET) DONE
  • func_door DONE
  • func_movewall (func/rotate.qc) DONE
  • func_new_plat DONE
  • func_plat DONE
  • func_togglewall DONE
  • func_train DONE
  • misc_explobox DONE
  • misc_model DONE
  • misc_modeltrain
  • playerclient DONE
  • trigger_fog (SVC_CGAMEPACKET)
  • trigger_ladder DONE
  • trigger_push DONE
  • trigger_setgravity DONE
  • trigger_teleport (probably doesn't need to be networked)

in CSQCTest:

  • CSQC_Ent_Update -> ParsePlayer -> RefreshPlayer -> Pred_PlayerUpdated
  • deltalisten -> RefreshPlayer -> Pred_PlayerUpdated
  • self.predraw -> Player_Interpolate -> Pred_UpdateLocalMovement

Pred_PlayerUpdated is called when CSQC_Ent_Update reads player entity data
Pred_UpdateLocalMovement is called from the player's predraw function

in Dogmode:

  • PlayerPreDraw incorporates Pred_UpdateLocalMovement
  • PlayerUpdate calls PlayerUpdatePrediction (which replaces Pred_PlayerUpdated)

Sound Editing, Re-Mixing, Sourcing

Goal format is 16bit 22050hz mono. Encode to ogg to reduce size?

Already have:

Looking for:

  • items/ammo_pickup.ogg (Quake Champions Doom Edition)
  • items/armor1.wav
  • items/backpack_pickup.wav
  • items/respawn.ogg (Quake 3)
  • items/shard_pickup.ogg (Quake Champions Doom Edition)
  • items/weapon_pickup.ogg (Quake Champions Doom Edition)

footsteps: dirt/grass, metal, stone, wood, water, water wading

  • player/slide.ogg (Enemy Territory: Quake Wars)
  • player/stepwade?.ogg (Quake 4)
  • player/stepwater?.ogg (Quake 4)

Bookmarks, Reference Links

Mapping

Mods

Movement References

Quake C

Vector Math

Sounds