Memory / Work / QuakeOneDogMode
Created ,
last updated .
Tags:
quake 1,
software,
video games.
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
- Naming Conventions & Style
- Stats & Skills
- Movement
- Items & Weapons
- Monsters
- Mapping
- Code Style
- Object & Class Structure
- Client Prediction
- Sound
- Bookmarks
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
- Monsters understand & can pick up items on the map
- 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, Endurance, Intelligence, 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
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)
- Copied from Nexuiz; see their t_jumppads.qc
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.
- Axe (id1 standard)
- Shotgun (id1 standard, modified damage & spread)
- Lasergun (same as the enforcer's gun)
- Nailgun (nails have knockback for climbing purposes)
- Stakegun (Painkiller; Q2 Railgun replacement)
- Tribolt (Quake Champions)
- Rocket Launcher (id1 standard)
- Lightning Gun (id1 standard)
- No weapon selected (shove / pick up an object?)
Ideas for additional items:
- Rations (food? function as a health 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_func [+ blocked]
- 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
- base_projectile [think, touch]
- base_mapentity [+ destroy]
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
- Map-Center Prefabs https://github.com/Map-Center/prefabs
- Q1 Metrics https://book.leveldesignbook.com/process/blockout/metrics/quake
- https://tomeofpreach.wordpress.com/quoth/tutorial/rotation-overview/
Mods
- Footsteps Pack https://www.quakewiki.net/quake-1/mods/footsteps-pack/
- Keep Uber Mod https://github.com/JosiahJack/Keep
- Looking Smart ITS https://www.moddb.com/mods/its/features/looking-smart
- Tome Of Keep Mod https://josiahjack.github.io/KeepModReadme/
Movement References
- About Stairs https://www.esreality.com/post/1701577/about-stairs/
- Bunnyhopping Prog.'s Perspective https://adrianb.io/2015/02/14/bunnyhop.html
- Corner Clipping https://www.esreality.com/index.php?a=post&id=1554131
- Doom 3 Player Physics
- RTCW SlideMove
- Warfork PMOVE
- Xonotic Walljump
Quake C
- Adv. CSQC Prediction https://icculus.org/~marco/quakec/csqc/prediction.html
- Converting entities to CSQC https://forums.insideqc.com/viewtopic.php?t=5483
- Customphysics in CSQC https://forums.insideqc.com/viewtopic.php?t=5830
- Diff. Movement configs https://celephais.net/board/view_thread.php?id=61533
- gBase CSQC code https://github.com/gnounc/gBase/tree/main/id1/client
- Guide to CSQC hats https://forums.insideqc.com/viewtopic.php?t=5662
- How To Use blank in CSQC https://forums.insideqc.com/viewtopic.php?t=5619
- Idiots guide to CSQC https://www.attackersgored.com/?p=2107
- Super Nailgun QC Tutorials https://nullpointpaladin.wordpress.com/page/2/
- Synchronising QC anims https://forums.insideqc.com/viewtopic.php?t=5832
- QuakeC Builtin Functions https://quakewiki.org/wiki/List_of_builtin_functions
- QuakeWiki Tutorials https://quakewiki.org/wiki/QuakeC_tutorials
Vector Math
- Reflecting A Vector https://3dkingdoms.com/weekly/weekly.php?a=2
Sounds