Compare commits

...

269 Commits

Author SHA1 Message Date
Marco Cawthorne 822a7221b2
WIP pmove, AI, etc. changes 2024-04-22 15:11:12 -07:00
Marco Cawthorne d5053299dc
func_rot_button: Fix spawnflag 32. Mistakenly thought to be 'toggle'. 2024-03-26 16:14:07 -07:00
Marco Cawthorne 53bab46f7d
func_button: if "lip" isn't set, set it to be 4. 2024-03-26 12:45:38 -07:00
Marco Cawthorne ff649187ee
env_sprite: Update QUAKED comment to mention 'material' key. 2024-03-24 20:12:10 -07:00
Marco Cawthorne a9ededfd1a
Menu-FN: when 'rate' is ridiculously low, set it to the engine default (30000) 2024-03-23 13:40:17 -07:00
Marco Cawthorne 4b35d47522
Menu-FN: Only run the drawfill() command when the engine requests an opaque loading screen. 2024-03-22 15:39:05 -07:00
Marco Cawthorne 33d7c3cc50
NSMonster: change error() to NSError() to aid debugging. 2024-03-21 18:57:31 -07:00
Marco Cawthorne 95b7c87ea3
Menu-FN: Init strings after game library init. 2024-03-20 12:33:26 -07:00
Marco Cawthorne 1514c977e9
NSNavAI: set _m_flRouteGiveUp to something valid, and change our pathskip tracebox to work like the nodegraph one. 2024-03-18 23:50:14 -07:00
Marco Cawthorne c1eb4bcb99
func_tracktrain: if no globalname is defined, and/or relation target is unset, don't attempt to reposition 2024-03-17 22:56:36 -07:00
Marco Cawthorne 9b9988232f
VGUI3DView: only setproperty VF_DRAWWORLD when MENU is not defined. 2024-03-11 20:59:06 -07:00
Marco Cawthorne 2a6571e33b
make_radiantshader.sh: mkdir if scripts doesn't exist 2024-03-10 16:47:19 -07:00
Marco Cawthorne b99ec4b39b
make_radiantshader.sh: strip non program portion of a .mat if available 2024-03-10 16:32:40 -07:00
Marco Cawthorne 8533f6d228
add make_radiantshader.sh 2024-03-10 16:18:03 -07:00
Marco Cawthorne 48b76b8786
Bot_ExistsInServer: ddecolorize names before comparing. 2024-03-09 19:22:26 -08:00
Marco Cawthorne ffa3645395
Menu-FN: Call `cfg_save` at certain points in case cfg_auto_save isn't on. 2024-03-08 09:27:57 -08:00
Marco Cawthorne 396910e587
env_muzzleflash: set it as MASK_GLOWS instead of MASK_ENGINE to ensure we attach
after the viewmodel position has updated.
2024-03-07 19:38:46 -08:00
Marco Cawthorne ee60a09eed
infodecal: fix client-side ones always rendering.
Add some more icons for various NSPointTrigger entities.
2024-03-06 20:27:54 -08:00
Marco Cawthorne d31a3b65fd
NSView: fix some warnings. 2024-03-06 19:38:39 -08:00
Marco Cawthorne d697f53ca5
NSView: when we switch between dead/alive state, reset damage display/shake variables. 2024-03-06 19:31:26 -08:00
Marco Cawthorne e9f9ae5829
NSMonster: add support for `sequence` key, used by some sitting NPCs. 2024-03-06 19:30:38 -08:00
Marco Cawthorne bd74c588da
worldspawn: Set HDR values regardless of enabled state, in case the user wants to enable it. 2024-03-06 19:14:18 -08:00
Marco Cawthorne dcb87039b1
NSPointTrigger: Save/Restore for the debug texture. 2024-03-06 19:13:48 -08:00
Marco Cawthorne 3d32e75e88
NSClientSpectator: add new method SpectatorDeathcam() 2024-03-06 19:13:11 -08:00
Marco Cawthorne bd2705eed6
NSTalkMonster: m_flFollowSpeedChanged should be 1.0 instead of 5.0 (as comment suggests) 2024-03-06 19:12:05 -08:00
Marco Cawthorne 0bb88774a2
Add new class: NSSpawnPoint. 2024-03-06 19:11:37 -08:00
Marco Cawthorne 2838900a82
scripted_sentence: set m_iValue before UseTargets. Document '`duration` key. 2024-03-06 10:17:10 -08:00
Marco Cawthorne d9d579478a
monstermaker: Prevent monster DropToFloor().
NSMoverEntity: Remove eager MoveToPosition check that broke func_button's NOMOVE variants.
2024-03-05 23:27:26 -08:00
Marco Cawthorne 3a1a5d66f5
scripted_sentence: add support for `refire` key.
Add some more icons. Also NSPointTriggers should be SOLID_NOT now as to not
travel across levels.
2024-03-05 22:48:00 -08:00
Marco Cawthorne 09839aa198
multi_manager: Minor clean up. 2024-03-05 08:21:26 -08:00
Marco Cawthorne efe079bdf7
Updates: Strip version number from preview img url. 2024-03-05 08:20:50 -08:00
Marco Cawthorne f11a10d343
func_tracktrain: Save/Restore more fields, keep track of when to play the movement sounds. 2024-03-05 08:19:56 -08:00
Marco Cawthorne a3268ef65b
env_shake: active global shake entities can be stopped by removing them from the game now. 2024-03-05 00:33:37 -08:00
Marco Cawthorne a9b6f9a428
trigger_transition: filter out "players" in all transitioning modes. 2024-03-04 20:13:53 -08:00
Marco Cawthorne 0c2db7a23a
SV_PerformLoad: Saner check for if we can call Destroy()... 2024-03-04 19:55:30 -08:00
Marco Cawthorne 32a36d8017
Server: show 'entered game' message once and only in MP. 2024-03-04 19:48:37 -08:00
Marco Cawthorne f0034cb03a
SEND/READENTITY_ANGLE: use WriteAngle()/readangle() 2024-03-04 19:37:51 -08:00
Marco Cawthorne 9c66c2c5f9
func_door: Fix `targetClose` not getting triggered right when START_OPEN spawnflag is set 2024-03-04 19:34:13 -08:00
Marco Cawthorne c0b031ed9f
Nodes: Make the way nodes are generated a bit better. 2024-03-04 18:52:21 -08:00
Marco Cawthorne e2239a236f
Minor cleanups to some point entities and replace various usage of whichpack(). 2024-03-04 18:51:07 -08:00
Marco Cawthorne 50cc1b6198
phys_rope: Remove newline from print. 2024-03-04 18:49:22 -08:00
Marco Cawthorne 6c8b56c39f
env_explosion: Don't trigger when disabled (duh) 2024-03-04 18:48:54 -08:00
Marco Cawthorne 57b19425c1
NSIO: Give it an empty ParentUpdate() to work around StartFrame() calling a null function on them. 2024-03-04 18:45:06 -08:00
Marco Cawthorne 37ab385bcf
NSEntity: add empty DebugDraw method for listen servers. 2024-03-04 18:44:10 -08:00
Marco Cawthorne 0f96e635b0
NSTalkMonster: add anim event 1009. 2024-03-04 18:43:17 -08:00
Marco Cawthorne 86cfec6e6d
NSTrigger: ensure killtarget is transferred on delayed triggers. Also double check a target is specified before we attempt to search for entities to trigger. 2024-03-04 18:42:48 -08:00
Marco Cawthorne d405ff7e90
PropData: Change warning to a log. Not every model has to have PropData. 2024-03-04 18:42:05 -08:00
Marco Cawthorne 649ed825ad
Big commit, work over various triggers. Clean up debug prints and make
them more consistent. Warnings are in yellow, while errors are in red.

New cvar: g_developerTimestamp will display timestamps next to debug messages
originating from the game-logic. Set g_developer to 1 to see them.
A lot of useful into, such as which entity id messages originate from
should aid in debugging quite a bit.

SP level transitions should also be more reliable now in terms of
transferring entities and the like.

Some levels have awkward transition areas and you might find yourself
jumping between levels frequently. Workarounds are in the works.
2024-03-02 00:40:08 -08:00
Marco Cawthorne 0147278359
Client View: Ensure modelindex of the viewmodels get set to 0 when
we've got no valid weapon set.
2024-02-23 14:26:55 -08:00
Marco Cawthorne c44bf11e3b
View: helper function to prepare for weapon changes on the client-side 2024-02-23 14:01:43 -08:00
Marco Cawthorne 0792fbaee9
Server: add Skill_Init inside init() 2024-02-23 13:58:59 -08:00
Marco Cawthorne cb4ba0c201
env_spark: Fix spawnflag START_ON not implying TOGGLE, add Input() method and implement more stuff. 2024-02-23 13:57:28 -08:00
Marco Cawthorne ca318e29f9
button_target, trigger_changelevel, trigger_transition: doc improvements 2024-02-23 13:54:46 -08:00
Marco Cawthorne c60012b757
env_shooter: Add Input() method 2024-02-23 13:53:04 -08:00
Marco Cawthorne 8b2d484917
func_train: fix how we initially spawn, preventing the train from accidentally getting triggered on spawn 2024-02-23 13:50:52 -08:00
Marco Cawthorne 02551ed71b
env_shooter: Apparently 'scale' only works on sprites. So let's add some systems to detect that. 2024-02-23 13:41:04 -08:00
Marco Cawthorne ee58089a55
env_explosion: Get it up to Source Engine standards. 2024-02-23 13:23:19 -08:00
Marco Cawthorne 34884b68a3
ambient_generic: fix mix-up of small and medium radius.
also set s_nominaldistance to 1024.
2024-02-23 13:22:51 -08:00
Marco Cawthorne e2ee6987de
NSTraceAttack: save traceline endpos and plane_normal in case it gets set elsewhere 2024-02-23 13:21:44 -08:00
Marco Cawthorne 7d58b4a96a
NSRenderableEntity: Remove aggressive angle optimisation 2024-02-23 13:21:08 -08:00
Marco Cawthorne 8a18c2e992
PropData: gibs use a fixed angular velocity in fallback physics mode, and have a hitbox. 2024-02-23 13:20:53 -08:00
Marco Cawthorne 0f86ba61a1
DecalGroups_Place: cancel out if the group wasn't found. 2024-02-23 13:20:15 -08:00
Marco Cawthorne 5c90692873
SurfaceProperties: impacts now pass a proper dir vector to the particle system 2024-02-21 21:11:48 -08:00
Marco Cawthorne 6319f6166e
Skill.qc: readcmd() builtin usage replaced with a tiny config parser.
Context:
localcmd/stuffcmd are delayed enough that we can't use it to load
difficulty settings from skill.cfg before the game objects have spawned.

readcmd worked around this, but its usage is buggy and discouraged.

loading config files from the root game directory is forbidden by the
engine for security reasons (being able to read passwords etc.)
but we're allowed to do so from sub-directories.

by emulating the source engine behaviour we become compatible with their
convention, while also working around said incompatibility.
2024-02-21 21:08:57 -08:00
Marco Cawthorne 2f56725160
func_plat: nudge the platform the way way when no height is defined and we make up a position 2024-02-21 16:41:52 -08:00
Marco Cawthorne 29a997dbcf
Sound: add Sound_Stop() to make that task more slightly more accessible. 2024-02-21 16:11:14 -08:00
Marco Cawthorne 33e5038881
func_pushable: play the surfaceproperty specific scraping sound when being pushed around 2024-02-21 16:10:28 -08:00
Marco Cawthorne b2fc4d2918
env_muzzleflash: add cvar `cg_muzzleflashDLightColor` 2024-02-21 16:09:32 -08:00
Marco Cawthorne 3e182b3737
NSRenderableEntity: Ensure .skeletonindex is set to 0 after deleting the skeletal object 2024-02-21 14:50:44 -08:00
Marco Cawthorne 0e3eb491a6
NSClientPlayer: ensure pmodels have a shadow as well 2024-02-21 13:51:43 -08:00
Marco Cawthorne a9836563d1
trigger_teleport: add telefrag. 2024-02-21 13:43:43 -08:00
Marco Cawthorne 9847f3828e
NSGameRules: send a newly joined player to the intermission screen gently 2024-02-21 13:41:18 -08:00
Marco Cawthorne 08259f5652
make_mapdef.sh/trigger_changetarget: Minor fixes. 2024-02-19 13:23:46 -08:00
Marco Cawthorne 0df1e78cc3
Platform: Comment out debug strings. 2024-02-19 13:20:51 -08:00
Marco Cawthorne ea0b365037
SurfaceProperties: Insist on having a 'default' stage defined. Use that to initialize the various surface properties. 2024-02-19 13:20:08 -08:00
Marco Cawthorne f950dcaabb
func_pushable: Respect 'size' and improve movement direction math a little. 2024-02-15 14:49:44 -08:00
Marco Cawthorne 9e68e24d2e
trigger_teleport: Add filter for func_pushable entities. Test chamber can now be triggered. 2024-02-15 13:35:42 -08:00
Marco Cawthorne 99f513efdb
func_pushable: Remove hitcontentsmaski override, else the cart won't move up in the test chamber. 2024-02-15 13:35:13 -08:00
Marco Cawthorne 06d959ef02
func_tracktrain: Lots of improvements across the board. Enjoy c0a0-c0a0e!
func_trackchange/autochange: Initial implementation.
2024-02-13 22:51:36 -08:00
Marco Cawthorne 7e8d1aacdb
Fix various warnings. 2024-01-30 00:42:10 -08:00
Marco Cawthorne 31b88f63f2
Fixes for DAMAGE_AIM, so we can respect the `sv_aim` cvar. 2024-01-29 23:47:36 -08:00
Marco Cawthorne 08cac51d5f
NSClient: add `void SetInfoKeyFloat(string, float)` and `float GetInfoKeyFloat(string)` methods 2024-01-29 16:10:16 -08:00
Marco Cawthorne 4a8f4a6082
Add a whole bunch of new bot features, including bot profiles.
Developers: the internal class `bot` is now `NSBot`, and an entityDef
of the old name will be instantiated instead.

Override defs/bot.def in your mod and make it use any custom spawnclass
you wish. Now games don't have to override `addbot` or `bot_add` inside
the multiplayer game rules.

There's also more console commands. Clients now have access to:
addBot, killAllBots, killClass [classname], killMovables, trigger [targetname], input [entnum] [input] [data], listBotProfiles, listTargets, teleport [targetname], teleportToClass [classname], respawnEntities, spawn
2024-01-26 19:27:50 -08:00
Marco Cawthorne ba4ddbd3f6
Math_FixDelta: Make recursive. Rename pending... 2024-01-26 19:10:57 -08:00
Marco Cawthorne 2332fdd45f
Add Documentation/Bots/BotOverview.md 2024-01-26 19:10:16 -08:00
Marco Cawthorne 30903f7683
VGUIView: add missing return 2024-01-15 16:34:09 -08:00
Marco Cawthorne da194e8eed
VGUIWindow: migrate non Window specific bits into its own class: VGUIView 2024-01-15 16:28:46 -08:00
Marco Cawthorne d66ebc4fd9
Documentation: add DedicatedServer.md, EntityGuide.md, merge EAX/EFX within doxygen generated docs. 2024-01-15 15:46:41 -08:00
Marco Cawthorne 05af28180e
Server: Fix typos in various sound precache calls. 2024-01-15 15:45:48 -08:00
Marco Cawthorne fea60cd435
Client: add return to exit early when skyPath isn't set, solely to avoid an unnecessary print. 2024-01-15 15:44:46 -08:00
Marco Cawthorne 7b09f7cbc4
Menu-FN: Init String-Table before most of the other inits. 2024-01-15 15:43:43 -08:00
Marco Cawthorne e9700b31b9
Sound_Init: Remove precaches for anything other than common/null.wav 2024-01-15 15:42:54 -08:00
Marco Cawthorne 5bdbe2cc47
NSNavAI: Add method RouteToPositionDenyFlags(). Same as RouteToPosition() but will accept a link-flag filter mask. 2024-01-11 15:56:41 -08:00
Marco Cawthorne 40aee258ce
NSClientSpectator: new mode: overview which is work in progress.
Various misc fixes to code routines that negatively affect splitscreen.
We also set frametime/clframetime to 0.0 after the first player view has been drawn as to not run
predraw math more than once per frame. This should not cause any issues but if you are experiencing issues let us know.
2024-01-08 14:58:45 -08:00
Marco Cawthorne 2891bc061e
func_breakable: precache particleeffectnum before first use 2024-01-04 14:34:37 -08:00
Marco Cawthorne 2034eb1d45
ambient_generic: better logging. 2024-01-04 14:33:25 -08:00
Marco Cawthorne 0c7fc9abc6
NSRadar: add method InitEmpty() 2024-01-02 15:41:25 -08:00
Marco Cawthorne 1b21a6cf46
ambient_generic/speaker: force spawnflag MSF_MULTIPLAYER within Spawned() instead of the constructor. 2024-01-02 15:26:29 -08:00
Marco Cawthorne 177a1638f7
make_mapdef.sh: fix bashisms 2024-01-02 15:06:32 -08:00
Xylemon d662c12951 Test map for areaportalwindow 2024-01-02 13:15:39 -08:00
Xylemon dda946476f Add def for areaportalwindow 2024-01-02 12:40:40 -08:00
Marco Cawthorne eaee5f67a7
build_game.sh: fix entities.def not being generated when RADIANT_PATH is not set. 2024-01-02 12:38:10 -08:00
Marco Cawthorne 64a6a9007d
Add new cvar s_developer which prints sound related info from the game logic 2024-01-02 12:03:04 -08:00
Marco Cawthorne 21c27969f6
env_shooter: Correct the implementation of variance and repeatability. 2024-01-02 12:00:50 -08:00
Marco Cawthorne cca461effe
Platform/Menu: Migration of Server_IsLan() into the master-server related code 2024-01-02 11:59:16 -08:00
Marco Cawthorne 4600a03165
NSRadar: checking in initial work on the class 2024-01-01 21:23:09 -08:00
Marco Cawthorne bc05a07e50
NSRenderableEntity: rendermode RM_SOLID becomes invisible when renderamount is 0. 2024-01-01 21:21:31 -08:00
Marco Cawthorne d16e096306
Documentation improvements, cleaning up of misc files. 2024-01-01 21:20:02 -08:00
Marco Cawthorne 591d5821f9
NSMonster: document the various spawnflags more 2023-12-15 18:38:33 -08:00
Marco Cawthorne 6c1db1f4f6
Shared: add `bool FileExists(string filePath)` function 2023-12-15 17:00:13 -08:00
Marco Cawthorne 2530608b1f
NSInteractiveSurface: fix typo 2023-12-15 16:59:19 -08:00
Xylemon b8a56b3fb4 Documentation: Updated Building.md to have more explicit deps with Fedora/SUSE 2023-12-13 15:58:13 -08:00
Xylemon 89cb5e5139 AI Path Testmap
New base RGBY texlights
Static versions of base K texlights
2023-12-13 15:57:25 -08:00
Marco Cawthorne 65e491ce9c
base: make textures/measure/rail masked again 2023-12-13 15:37:17 -08:00
Marco Cawthorne 4b69949385
Server: Ensure r_meshpitch gets set to 1 on init. 2023-11-18 21:16:52 -08:00
Marco Cawthorne fa4f77aae0
NSMonster: SetOrigin() during Respawn at least once so monsters don't die in the same spot during multiplayer respawns, inside hurt triggers or whatever. 2023-11-18 20:30:10 -08:00
Marco Cawthorne 277b453c40
Server: when skill is invalid (0) then default to 2 (medium) 2023-11-18 19:58:29 -08:00
Marco Cawthorne faba64ad28
Menu-FN: Broadcast in Chat when a player is joining a server, and handle ACTION (/me) text output 2023-11-18 15:47:37 -08:00
Marco Cawthorne af4212987f
Menu-FN: Make Chat Rooms and Controls accessible from other menus, keeping track of where we originated from 2023-11-18 14:34:16 -08:00
Marco Cawthorne 1ccb640ce6
Menu-FN: List ping for ICE servers correctly, View Game Info will now return to the appropriate menu 2023-11-18 14:10:24 -08:00
Marco Cawthorne 602fa9fd93
Menu-FN: Hide menu upon connecting to a server, and automatically refresh serverlist when opening the Internet Games menu 2023-11-18 14:00:42 -08:00
Marco Cawthorne 07173b3c7b
Platform: add menu debug command 'listGameLibrary' to output all the currently indexed games/mods 2023-11-18 13:31:33 -08:00
Marco Cawthorne 29e7b84e4b
NSMonster: handle the check for MSF_MULTIPLAYER inside Spawned() instead of the constructor 2023-11-18 12:09:49 -08:00
Marco Cawthorne 0cd5d0e5a7
MapCycle: Initialize g_mapCycle with mapcycle.txt, handle empty mapcycle slightly better. 2023-11-18 12:02:41 -08:00
Marco Cawthorne 22460c5aa0
BotLib: new commands - 'offset [vector]', 'flipx', 'flipy', 'flipz', 'merge [filename.way]', 'loadpb [podbotwaypoint.pwf]', 'loadrich [jumbot.jrf]', 'loadfb [foxbot.fwp]'
Also make the bots use the soundDef when pressing '+use'.
2023-11-17 18:58:24 -08:00
Marco Cawthorne 8566a9a5a7
Base: build menu with base/src/progs.src as well 2023-11-17 18:55:07 -08:00
Marco Cawthorne 32f9d974bb
New commands: listClientSoundDef, listServerSoundDef
Merge various trigger fields from Source entities into NSTrigger
Rename default player related sounds to the Source Engine style for more parity with Half-Life 2 and later games
Various player physics code fixes, such as being unable to jump higher when pushing against solids and faster noclip speed
2023-11-17 18:54:46 -08:00
Marco Cawthorne bf705a9e31
speaker: now shared between client/server game
NSTalkMonster: Remove game specific PREDISASTER flag from the code, implement GAG instead
New entities: env_cascade_light (wip), logic_achievement, env_instructor_hint (wip)
2023-11-15 09:52:11 -08:00
Marco Cawthorne 4790e9d230
NSItem: Position entity after everything else has spawned, to avoid entity lump ordering messing with droptofloor() calls 2023-11-15 00:14:06 -08:00
Marco Cawthorne 038265dd64
trigger_teleport: Special offset rules for players when choosing their final teleport destination. 2023-11-14 23:45:43 -08:00
Marco Cawthorne 801742dd4c
Platform: add MAPINFO_PREVIEW query type to MapLibrary_GetInfo() so interfaces can get a proper preview for levels. 2023-11-06 14:27:05 -08:00
Marco Cawthorne e67d1b0da4
Server: add cvars mp_td_dmgToWarn and mp_td_dmgToKick 2023-11-06 08:46:22 -08:00
Marco Cawthorne 25cfc4938e
game_team_master/NSTrigger: GetValue() is now aware of who is querying for said information. Required for game_team_master. 2023-10-30 16:37:45 -07:00
Marco Cawthorne d65ab07cf1
NSProjectile: revert the default setting for the various detonate modes 2023-10-29 23:25:40 -07:00
Marco Cawthorne a6fb7767dc
Implement cycler_weapon, cycler_wreckage, game_end, game_player_hurt, game_score, game_team_master, game_team_set, game_player_team, game_zone_player 2023-10-25 00:46:04 -07:00
Marco Cawthorne 75d03f27fe
Add missing definitions for ENT_FUNNEL and ENT_SMOKER 2023-10-24 09:50:59 -07:00
Marco Cawthorne 97c2fdd778
env_smoker: Initial implementation. 2023-10-24 00:30:42 -07:00
Marco Cawthorne 01ebb973f2
env_funnel: Initial implementation. 2023-10-23 21:36:58 -07:00
Marco Cawthorne ca04a7d637
func_platrot: Cleanup and rewrite the essential parts. Now inherits most of func_plat. 2023-10-23 14:38:02 -07:00
Marco Cawthorne 29b6a200b8
NSProjectile: Quick support for light_color/light_radius 2023-10-23 00:17:02 -07:00
Marco Cawthorne 73bec53034
PropData: read info from Source Engine .phy files 2023-10-22 23:30:31 -07:00
Marco Cawthorne 8cd6d3967d
Shared: sanity check for when decalgroups are attempted to be placed, but not available. 2023-10-18 07:47:24 -07:00
Marco Cawthorne b7167a553e
Shared: don't mess with sound def names when precaching them. 2023-10-17 18:27:59 -07:00
Marco Cawthorne 11deea5b3d
Add the following physics entities from Source: phys_ballsocket, phys_constraint, phys_constraintsystem, phys_convert, phys_hinge, phys_keepupright, phys_slideconstraint & env_physexplosion
Add new class phys_rope, which will handle move_rope and keyframe_rope from Source.
2023-10-17 16:49:01 -07:00
Marco Cawthorne 81a498d49e
Client: update viewmodel bone count directly after switching models, needed for getting the right attachment positions 2023-10-13 08:23:12 -07:00
Marco Cawthorne ab9d66b2e4
BotLib: for goals and goalitem route search, use WorldSpaceCenter() and not their origin to deal with brush triggers and non-existant origins properly 2023-10-13 08:22:31 -07:00
Marco Cawthorne 900cf43bd0
!!! Mods/games should now remove modelevent.qc and view.qc from their csprogs !!!
env_muzzleflash: Initial implementation of this Half-Life 2 entity
Client: model events are for viewmodels are now handled by NSRenderableEntity.
2023-10-12 14:45:27 -07:00
Marco Cawthorne 05ed789f9a
trigger_camera: Hacks that'll make it work (for now) 2023-10-11 01:05:40 -07:00
Marco Cawthorne baa22e732c
Base: small cleanups of old unused code. 2023-10-11 01:05:38 -07:00
Marco Cawthorne f96b41bc2e
NSSurfacePropEntity: Ignore view_ofs in GetEyePos() when we're a spectator. 2023-10-11 01:05:37 -07:00
Marco Cawthorne b37afb1362
BotLib: break func_breakable entities within their path. 2023-10-11 01:05:35 -07:00
Marco Cawthorne 1bf829920f
NSRenderableEntity: Simplify RM_SOLID in RenderFXPass() 2023-10-11 01:05:34 -07:00
Marco Cawthorne 37eceb3677
vertexlit.glsl: add cvar r_showEnvCubemap from Source 2023-10-11 01:05:32 -07:00
Marco Cawthorne d75f5ec43b
Platform: textures named 'TRIGGER' are always invisible. 2023-10-11 01:05:31 -07:00
Marco Cawthorne 444d611068
defaultwall.glsl: Remove SCROLL permutation ifdef. 2023-10-11 01:05:29 -07:00
Marco Cawthorne a623b1e301
NSTalkMonster: pathfinding fixes that benefit following players around the maps. More failsafes. 2023-10-11 01:05:28 -07:00
Marco Cawthorne 7d9de3a2cc
NSEntity: new method GetNearbySpot() which will return a free position close to the entity. 2023-10-11 01:05:26 -07:00
Marco Cawthorne 9602d5eac8
Client: add new cheat cvar: r_skipWorld 2023-10-11 01:05:19 -07:00
Marco Cawthorne 1d7b6fe25f
PMove: added pm_noclipSpeed and pm_noclipAccelerate cvars which serve an obvious purpose. 2023-10-11 00:39:31 -07:00
Marco Cawthorne f183bfc571
ambient_generic: fix regression in the old style sound mechanism 2023-10-06 21:19:46 -07:00
Marco Cawthorne a5ecd18047
env_model: Initial implementation of this SoHL entity 2023-10-06 00:21:17 -07:00
Marco Cawthorne 9896b652c8
env_shockwave: Initial implementation of this SoHL entity 2023-10-06 00:20:48 -07:00
Marco Cawthorne 818a1a2155
scripted_sequence: support for 'killtarget' key 2023-10-04 14:55:02 -07:00
Marco Cawthorne 662e01c84d
monster_generic: Set alliance to neutral. 2023-10-04 08:56:46 -07:00
Marco Cawthorne 6f3b07ed34
NSNavAI: ensure everything is properly nulled when an empty chase path target is set. 2023-10-04 08:56:21 -07:00
Marco Cawthorne 07e70aa4c4
NSMonster: disable yaw interpolation for now. 2023-10-04 08:55:53 -07:00
Marco Cawthorne 47eb4fb88f
func_tracktrain: fixes to the way the angle delta is calculated, and restore the train to a position relative to its last target post level transition. 2023-10-04 08:55:03 -07:00
Marco Cawthorne 40adc77d66
scripted_sequence: Don't call FreeStateMoved() when SS_NO is set. 2023-10-04 08:53:07 -07:00
Marco Cawthorne b37893e660
Client: fix the typewriter text effect timing, where fadein controls the time for each character to fade in. 2023-10-04 07:55:55 -07:00
Marco Cawthorne 11797717ef
scripted_sentence: Use targets when triggered (fixes city2a in Gunman) 2023-10-04 07:55:18 -07:00
Marco Cawthorne aadc23356d
trigger_transition: Call method TransitionComplete() onto entities when applicable. 2023-10-04 07:54:43 -07:00
Marco Cawthorne 31553d9b5c
scripted_sequence: Fix the angles being overriden when move mode NO is set. 2023-10-03 23:33:09 -07:00
Marco Cawthorne 3f0f6b2d0f
NSMonster: add new alliance type: MAL_NEUTRAL 2023-10-03 20:18:10 -07:00
Marco Cawthorne a48498e5cf
env_glow: Fix warning. 2023-10-03 11:05:38 -07:00
Marco Cawthorne c59a76a53d
NSMonster: add the ability to chase path_corners and things. 2023-10-03 11:05:14 -07:00
Marco Cawthorne 19d6f22dc4
NSIO: add TransitionComplete() method for easier handling of entities post level-transition.
NSRenderableEntity: Default renderamt to 0.
Also use Read*() methods within all of the base classes their SpawnKey() methods.
2023-10-03 11:02:47 -07:00
Marco Cawthorne 9110da2cec
trigger_once/multiple/teleport/camera, prop_rope: Save/Restore fixes 2023-10-03 11:00:28 -07:00
Marco Cawthorne 367289df84
scripted_sequence: Play animation immediately when movetype is SS_NO. 2023-10-03 10:59:25 -07:00
Marco Cawthorne ae1f768689
path_corner: Only fire its targets when a message is actually set... 2023-10-03 10:57:20 -07:00
Marco Cawthorne 51f572378f
func_pushable: Save/Restore naming fixes 2023-10-03 10:56:36 -07:00
Marco Cawthorne 7d69ab96fc
func_door: Save m_waterType 2023-10-03 10:56:05 -07:00
Marco Cawthorne 6f2115c45f
GS-EntBase: Fix formatting in a few class definitions 2023-10-03 10:54:49 -07:00
Marco Cawthorne 530f25667b
func_smokevolume: fix warning in predraw. 2023-10-03 10:52:22 -07:00
Marco Cawthorne c531efaaf9
func_dustcloud: Fix warning in predraw. 2023-10-03 10:52:08 -07:00
Marco Cawthorne c1d6324153
VGUI: Redo the way input is handled, address focus changes between Windows etc. 2023-10-01 01:19:20 -07:00
Marco Cawthorne 5c5eedb665
NSGameRules: add method 'Title' which returns the print name for a given gamerule. 2023-09-29 16:10:21 -07:00
Marco Cawthorne 70bb77d2bb
trigger_changelevel/logic_auto: avoid use of the 'readcmd' builtin. 2023-09-28 23:25:26 -07:00
Marco Cawthorne 2fb002aab1
NSPhysicsEntity: Create identifier .isPhysics unique to physics based entities 2023-09-28 18:43:22 -07:00
Marco Cawthorne ee820f3ed1
logic_case: Initial implementation, missing from last commit. 2023-09-28 18:41:15 -07:00
Marco Cawthorne 4b36ec3bb0
trigger_transition: Handle the carrying-over of entity information based on 'globalname'. 2023-09-28 18:40:06 -07:00
Marco Cawthorne f76c169671
NSTrigger: read 'globalname' key, used for level transitions. 2023-09-28 18:38:16 -07:00
Marco Cawthorne 7d37cc228c
NSMoverEntity: fix mistake that prevents spawn values from being read properly 2023-09-28 18:37:08 -07:00
Marco Cawthorne 7420df0ec6
worldspawn: set 'gametitle' serverinfo when applicable 2023-09-27 14:07:08 -07:00
Marco Cawthorne 2dbfeb06b6
env_fade: fix bogus reading of key names in SpawnKey() 2023-09-27 13:31:50 -07:00
Marco Cawthorne 3d92491e54
NSMonster/NSTalkMonster: update bone count on the client whenever the modelindex changed. 2023-09-27 13:08:39 -07:00
Marco Cawthorne 9d6133054c
NSRenderableEntity: add inputs SetAnimation and SetBodyInGroup 2023-09-27 13:07:53 -07:00
Marco Cawthorne 4dcaefe368
trigger_changelevel: extra checks for funky behaviour 2023-09-27 13:03:03 -07:00
Marco Cawthorne cd8825c02a
ambient_generic: quick and dirty soundDef support 2023-09-27 13:02:04 -07:00
Marco Cawthorne 4ec4877360
Server: add new server command 'spawndef'. 2023-09-27 13:01:30 -07:00
Marco Cawthorne abea931460
trigger_once/multiple/teleport: Support for Source Engine game specific trigger filters 2023-09-27 13:00:46 -07:00
Marco Cawthorne 3ea74c3c3d
logic_auto/logic_relay/logic_timer: add some QUAKED comments 2023-09-27 12:59:41 -07:00
Marco Cawthorne a4693ff0f8
item_generic: add missing Save/Restore method declarations inside the class 2023-09-27 12:59:15 -07:00
Marco Cawthorne 91519b2706
func_tracktrain: Fix them automatically starting up. Differentiate between GoldSrc and Source engine spawnflags. 2023-09-27 12:58:51 -07:00
Marco Cawthorne 854c5907a6
NSTrigger: add method CanBeTriggeredBy() which filters out various entity types. 2023-09-27 12:57:25 -07:00
Marco Cawthorne e820e74dbc
logic_relay: Initial implementation of this Source SDK entity. 2023-09-27 00:32:16 -07:00
Marco Cawthorne e8a64da700
logic_timer: Initial implementation of this Source SDK entity 2023-09-27 00:30:13 -07:00
Marco Cawthorne 5b52c57a56
NSIO: new method CheckOutput(string), which will see if a given Output is ready to fire again. 2023-09-27 00:25:25 -07:00
Marco Cawthorne 9518a23f03
NSIO: Prevent firing an output when no activator is set 2023-09-27 00:14:44 -07:00
Marco Cawthorne d7ddfc1c87
SoundDef: add helper function int Sound_GetID(string) 2023-09-27 00:12:28 -07:00
Marco Cawthorne 49408b1342
NSMoverEntity: add 'movedir' key support for Source Engine based maps 2023-09-26 22:24:13 -07:00
Marco Cawthorne 01a7ffa56f
SoundDef: Parse 'scripts/game_sounds_manifest.txt' if present 2023-09-25 16:44:56 -07:00
Marco Cawthorne 33179a555d
Server: add `sv input [INPUTNAME] [DATA]` command to debug I/O system 2023-09-25 16:12:32 -07:00
Marco Cawthorne d749241081
func_monsterclip: Initial implementation 2023-09-22 17:08:02 -07:00
Marco Cawthorne 0be11bd948
NSMonster: call setorigin_safe after DropToFloor to get entities out the ground, if they're stuck in it (of1a1) 2023-09-22 16:34:08 -07:00
Marco Cawthorne a91122ccbe
item_generic: initial implementation of this Opposing Force entity 2023-09-22 16:21:40 -07:00
Marco Cawthorne e1fd04de05
trigger_once: spawnflag TO_PUSHABLES should also affect other func_ entities, it appears. 2023-09-22 16:21:01 -07:00
Marco Cawthorne b50b803b55
scripted_sequence: Only .ReleaseThink() when we're actually moving the entity... 2023-09-22 14:45:02 -07:00
Marco Cawthorne 6298688e05
worldspawn: Change the way worldspawn keys are read, and shared with the client.
Avoiding the need to read the world on the client-side altogether.
2023-09-22 14:39:45 -07:00
Marco Cawthorne 069557f350
func_wall/func_illusionary: get rid of this optimisation that messes with odd world data 2023-09-22 14:38:52 -07:00
Marco Cawthorne a90296864b
scripted_sequence: Call .ReleaseThink() before moving monster within InitIdle() 2023-09-22 14:37:43 -07:00
Marco Cawthorne 4f699aae6e
Monster spawning position and scripted sequence fixes. Also leave movetype of LEAVECORPSE scripted sequence entities alone or else it breaks of1a1's G-Man 2023-09-20 22:42:11 -07:00
Marco Cawthorne 5f7ea594b8
scripted_sequence & NSMonster: support for spawnflags LEAVECORPSE. Also safely position monsters upon spawning to avoid them getting stuck in the floor. 2023-09-20 20:54:13 -07:00
Marco Cawthorne f5308f6e08
env_beam/env_laser: Add ::RendererRestarted to fix textures upon video memory refreshes 2023-09-20 20:53:13 -07:00
Marco Cawthorne a1500166be
NSEntity: add method ::Relink() 2023-09-20 20:50:54 -07:00
Marco Cawthorne 65400fea2c
scripted_sequence: DropToFloor() after teleporting, and also only teleport in ::InitIdle when move mode is not 0 2023-09-20 20:08:08 -07:00
Marco Cawthorne e93dc09805
make_mapdef.sh: read mins/maxs/model only when editor_mins/maxs/model weren't explicitly set 2023-09-20 16:12:14 -07:00
Marco Cawthorne c314e880fd
Client: Fix the parameter order on a few classes' ReceiveEntity methods 2023-09-20 15:40:13 -07:00
Marco Cawthorne 724523ce2c
Server: Increase ENTITYDEF_MAX to 256 2023-09-20 15:10:49 -07:00
Marco Cawthorne 4a8df93395
PropData: debris/gibs can now create decals upon impact with a surface 2023-09-20 15:10:29 -07:00
Marco Cawthorne d9d3220833
NSRenderableEntity: various tweaks to networking, env_glow 2023-09-20 15:09:23 -07:00
Marco Cawthorne b7126fbadb
env_glow: from client-side only entity to shared. also support other rendermodes (accurate to GoldSrc) 2023-09-19 23:01:59 -07:00
Marco Cawthorne e44f56a56d
func_areaportal: Make work on Source Engine BSP by shoving the "portalnumber" key into .style 2023-09-18 19:37:36 -07:00
Marco Cawthorne c3f5e7a1c2
NSPhysicsEntity: move .geomtype into ODE ifdef 2023-09-18 19:36:15 -07:00
Marco Cawthorne c920dc2df0
NSMonster: add spawn key 'reserve_ammo', which should be self explanatory. See docs otherwise. 2023-09-18 17:57:47 -07:00
Marco Cawthorne c8d29078da
NSMonster: Add 'dead' boolean spawn key. Will decide if the monster starts 'dead' 2023-09-18 15:51:35 -07:00
Marco Cawthorne c71daa033e
NSTalkMonster: add detailed class documentation 2023-09-18 15:35:05 -07:00
Marco Cawthorne 4f35c7b6bf
NSMonster: Explicitly reset animation time before attack acts happen, add class documentation 2023-09-18 15:34:44 -07:00
Marco Cawthorne 9d29ad6635
point_spotlight: Optimize viewing angle alpha code a little bit 2023-09-13 12:32:51 -07:00
Marco Cawthorne 578a3038d0
Platform: add 'vtf' type as a suggested image extension in r_imageextensions 2023-09-13 10:40:31 -07:00
Marco Cawthorne 8150f0c080
env_steam: fix typo 2023-09-13 10:40:01 -07:00
Marco Cawthorne 5db3db539a
Client/Server: Handle 'skyname' universally and guess on the client whether we're using a Source Engine style skybox path 2023-09-13 07:56:11 -07:00
Marco Cawthorne b77ec906f6
env_steam: initial implementation of this Half-Life 2 entity. 2023-09-13 00:29:31 -07:00
Marco Cawthorne 5f070fa8c9
point_spotlight: give it a better texture (thanks Maxwell) and optimize some bits 2023-09-12 19:39:51 -07:00
Marco Cawthorne 54b73b3386
func_wall: add small alias to make func_reflective_glass entities show up 2023-09-12 15:59:04 -07:00
Marco Cawthorne 6957ff67b7
func_monitor: Network code cleanup 2023-09-12 15:58:40 -07:00
Marco Cawthorne 62426ba5d3
point_servercommand: initial implementation of this Half-Life 2 entity 2023-09-12 15:03:41 -07:00
Marco Cawthorne 59748adf86
point_spotlight: initial implementation of this Half-Life 2 entity; also fix env_projectedtexture, func_dustmotes and func_smokevolume not rendering 2023-09-12 15:00:56 -07:00
Marco Cawthorne 071548a000
Platform: Rename menu.dat.en_us.po to menu.dat.default.po to help with fallback under different locale 2023-09-08 16:49:42 -07:00
Marco Cawthorne f1141d3b11
Menu-FN: Throw up a panel for when you get disconnect from a server for one reason or another 2023-09-01 12:34:20 -07:00
Marco Cawthorne b7346e6593
Menu-FN: main buttons are now cut-up into different segments, using fallback text when using shorter btns_main files (like in older releases) 2023-08-31 15:40:05 -07:00
Marco Cawthorne 0dc3f19b1a
Menu-FN: Added the slightly buggy 'View game info' function. I now need to write a cache for the server entries, because the engine might clear its own cache by the time we want to display entries. 2023-08-23 08:21:53 -07:00
Marco Cawthorne ae8c2f16ba
Platform: refresh update strings more often while they're pending state changes. 2023-08-21 08:53:01 -07:00
Marco Cawthorne 9871e93a10
Platform: Documentation improvements. 2023-08-21 08:39:54 -07:00
Marco Cawthorne 225039f71f
Documentation: Various fixes and improvements that the wiki converter didn't handle 2023-08-21 08:39:01 -07:00
Marco Cawthorne 061cdbd257
Platform/Menu-FN: Move map library loading into platform/ to keep things simple for menu modules 2023-08-19 10:28:36 -07:00
Marco Cawthorne 412c8f984e
Platform/Menu-FN: Overhaul of game update handling. New Nuclide specific API to query update package states that avoids string comparisons and much more. 2023-08-18 17:49:10 -07:00
Marco Cawthorne 8422ddd26b
Menu-FN: Avoid poking the games[] struct directly 2023-08-16 21:27:37 -07:00
Marco Cawthorne 2576f803cd
Menu-FN/Platform: Move all the custom game parsing/install code into platform/, also clean up a bunch of routines in there 2023-08-16 15:28:41 -07:00
Marco Cawthorne 050db32a81
Platform: Improve the recommended package selection code 2023-08-15 15:00:48 -07:00
Marco Cawthorne 410e3fc34e
Menu-FN: Adjustments to the Updates menu, move code into platform/updates.{h,qc} 2023-08-15 14:24:46 -07:00
Marco Cawthorne 60128c6b1e
Server: add "Cheaters Lament", a proof of concept detection mechanism for suspicious player behaviour 2023-08-07 13:14:49 -07:00
Marco Cawthorne 0ea41d9304
Platform: functions Master_GetInternetServers() and Master_GetLANServers() return cached values now to avoid the engine touching the cache which may drop servers. 2023-08-07 12:54:55 -07:00
Marco Cawthorne 0bf9374016
SoundDef: implement `pointparticle` key, so that particle calls can happen within sound defs (lowering networking footprint further) 2023-08-07 12:53:47 -07:00
Marco Cawthorne 83202a6174
NSMonster: add spawn key "leap_damage", to define the sort of damage the monster can apply when leaping towards you. 2023-07-30 08:12:56 -07:00
Marco Cawthorne 571ef536a1
NSProjectile: add spawn key "decal_detonate" which can spawn a DecalGroup definition upon detonation. 2023-07-29 18:45:36 -07:00
Marco Cawthorne 35b427b84d
NSTalkMonster: bone controller for head turning is handled server-side now, so remove this code in predraw. 2023-07-29 18:20:19 -07:00
Marco Cawthorne 762d1667d0
NSProjectile: Fix how fuseOffset was applied in Launch() 2023-07-29 18:16:57 -07:00
Marco Cawthorne c9bd1eb514
NSRenderableEntity: Fix frame1time not being evaluated for networking 2023-07-29 18:00:42 -07:00
Marco Cawthorne f93f79e18c
NSProjectile: Respond to Trigger() 2023-07-27 23:47:22 -07:00
547 changed files with 34062 additions and 8774 deletions

View File

@ -0,0 +1,97 @@
# Bots
Bots are CPU controlled opponents. They can be useful for development, debugging but can also fun to play with.
They're fake clients, traversing the level, and acting upon objectives they either figure out themselves, or are told to to act a certain way.
We encourage any multiplayer game to support them, because they often also fill in the function of balancing teams. There's a whole slew of benefits of supporting bots, and players will generally thank you for including them.
## Technical Info
Bots are handled by BotLib, located under `src/botlib/` in the source tree.
Nuclide's BotLib takes some inspiration from **Quake III Arena** its bots, but shares no code or specific ideas or implementations. We do not use **AAS** for navigation, we leverage the route/pathfinding system **FTEQW** provides. Bots also share some code with regular NPC/Monster type entities through the use of the NSNavAI class.
Games are allowed to handle how they want to integrate bots themselves, but for development purposes there are ways to force bots to spawn also.
# Bot profiles
Nuclide has support for bot profiles, like in **Quake III Arena**. They work differently although they appear compatible by design. You can define them in a script that looks something like this and is located at `scripts/bots.txt` in your game directory:
```
{
name Albert
model zombie01
topcolor 0xeff
bottomcolor 0xff0020
}
{
name Susie
model police02
topcolor 0xff6b00
bottomcolor 0xff0b00
}
{
name Dog
funname ^4D^2o^1g
model dog01
topcolor 0x9200ff
bottomcolor 0xc800ff
}
```
Only the `name` key is required. The only other special key is `funname` which sets the nickname to be different from the internal name. The other keys are set as user info (setinfo) keys on the bot client.
This will allow games to add whatever extra keys they wish that they can then recognize anywhere in the client/server codebase. No additional networking or APIs necessary. Simply query bot properties via their userinfo.
# Bot Console Commands
## addBot [profile name]
Adds a bot to the current game.
## killAllBots
Force kills and respawns bots in the current game.
## resetAllBotsGoals
Force reset bots current trajectory and goals.
# Bot Console Variables
## bot_enable
Enable (1) or disable (0) usage of bots in the game. Default is 1.
## bot_pause
Enable (1) or disable (0) an interrupt for the Bot AIs thinking. Default is 0.
## bot_noChat
Enable (1) or disable (0) a suppression of any bot chatter. Default is 0.
## bot_fastChat
Enable (1) or disable (0) bot chatter that does not stop other inputs. Default is 0.
## bot_debug
Enable (1) or disable (0) bot debug features that otherwise won't work. Default is 0.
## bot_developer
Enable (1) or disable (0) bot debug text in console. Default is 0.
## bot_minClients
When set, ensures to fill the server with this many players/bots. Default is -1.
## bot_aimless
Enable (1) or disable (0) bot not knowing where to go. Will keep generating a new place to walk to.
## bot_crouch
Enable (1) or disable (0) the forcing of bots crouching down.
## bot_walk
Enable (1) or disable (0) the restriction of bots to walking speed.
## bot_prone
Enable (1) or disable (0) the forcing of bots to crawl/prone.
## bot_dont_shoot
Enable (1) or disable (0) bot pacifist mode.

View File

@ -180,7 +180,7 @@ zypper in git
#### FTE
```
zypper in make gcc gcc-c++ mesa-libGL-devel libgnutls-devel
zypper in make gcc gcc-c++ mesa-libGL-devel libgnutls-devel alsa-devel libopus-devel speex-devel libvorbis-devel
```
#### SDL2
@ -195,6 +195,12 @@ zypper in libSDL2-devel
zypper in libX11-devel libXcursor-devel libXrandr-devel
```
#### Plugin: ODE
```
zypper in autoconf automake libtool zip
```
#### Plugin: FFMPEG
```
@ -212,7 +218,7 @@ zypper in make gtkglext-devel libxml2-devel libjpeg8-devel minizip-devel
#### FTE
```
dnf install make gcc gcc-c++ mesa-libGL-devel gnutls-devel
dnf install make gcc gcc-c++ mesa-libGL-devel gnutls-devel alsa-devel libopus-devel speex-devel libvorbis-devel
```
#### SDL2
@ -230,7 +236,7 @@ dnf install libX11-devel libXcursor-devel libXrender-devel
#### Plugin: ODE
```
dnf install autoconf automake libtool
dnf install autoconf automake libtool zip
```
#### Plugin: FFMPEG

View File

@ -0,0 +1,34 @@
# Dedicated Server
# Usage
To initialize a dedicated server, you can run `./nuclide-ds -game yourGame`. It is generally advised to write and execute a server config file you have prepared ahead of time.
Here is an example:
```
hostname "Nuclide Test Server"
set sv_public 2 // 0 - not public, 1 = advertised on master server, 2 = ICE
set deathmatch 1 // request multiplayer modus
set coop 0 // deny coop modus
set maxplayers 16 // 16 players max
set timelimit 10 // 10 minutes per map
set fraglimit 30 // 30 frags per map
set pausable 0 // don't allow players to 'pause'
set rcon_password "" // no rcon
map dm_beck16 // start
```
You can then run the dedicated server like this:
`./nuclide-ds -game yourGame +exec server.cfg`
In production, the exact same style of commands applies to release builds. So if you have a standard engine binary (**fteqwgl64.exe** or a branded executable) things will be identical.
Keep in mind to set any game specific console variables.
# Remote Console (RCon)
In the above config, if you've set rcon_password to anything other than `""` you have access to remotely control the game server.
For example, you can (as a client, once connected) use the command `rcon yourPassword changelevel dm_beck16` to forcefully change the level on the server. Anything that's possible in a conventional dedicated server console is now accessible.

View File

@ -0,0 +1,364 @@
# Entity Guide
# Overview
[ambient_generic](@ref ambient_generic)
[button_target](@ref button_target)
[cycler](@ref cycler)
[cycler_sprite](@ref cycler_sprite)
[cycler_weapon](@ref cycler_weapon)
[cycler_wreckage](@ref cycler_wreckage)
[env_beam](@ref env_beam)
[env_beverage](@ref env_beverage)
[env_bubbles](@ref env_bubbles)
[env_cascade_light](@ref env_cascade_light)
[env_cubemap](@ref env_cubemap)
[env_explosion](@ref env_explosion)
[env_fade](@ref env_fade)
[env_fire](@ref env_fire)
[env_fog](@ref env_fog)
[env_fog_controller](@ref env_fog_controller)
[env_funnel](@ref env_funnel)
[env_global](@ref env_global)
[env_glow](@ref env_glow)
[env_hudhint](@ref env_hudhint)
[env_instructor_hint](@ref env_instructor_hint)
[env_laser](@ref env_laser)
[env_message](@ref env_message)
[env_model](@ref env_model)
[env_muzzleflash](@ref env_muzzleflash)
[env_particle](@ref env_particle)
[env_physexplosion](@ref env_physexplosion)
[env_projectedtexture](@ref env_projectedtexture)
[env_render](@ref env_render)
[env_shake](@ref env_shake)
[env_shockwave](@ref env_shockwave)
[env_shooter](@ref env_shooter)
[env_smoker](@ref env_smoker)
[env_sound](@ref env_sound)
[env_soundscape](@ref env_soundscape)
[env_spark](@ref env_spark)
[env_sprite](@ref env_sprite)
[env_steam](@ref env_steam)
[env_sun](@ref env_sun)
[func_areaportal](@ref func_areaportal)
[func_areaportalwindow](@ref func_areaportalwindow)
[func_breakable](@ref func_breakable)
[func_brush](@ref func_brush)
[func_button](@ref func_button)
[func_conveyor](@ref func_conveyor)
[func_detail](@ref func_detail)
[func_detail_illusionary](@ref func_detail_illusionary)
[func_door](@ref func_door)
[func_door_rotating](@ref func_door_rotating)
[func_dustcloud](@ref func_dustcloud)
[func_dustmotes](@ref func_dustmotes)
[func_friction](@ref func_friction)
[func_group](@ref func_group)
[func_guntarget](@ref func_guntarget)
[func_healthcharger](@ref func_healthcharger)
[func_illusionary](@ref func_illusionary)
[func_ladder](@ref func_ladder)
[func_lod](@ref func_lod)
[func_monitor](@ref func_monitor)
[func_monsterclip](@ref func_monsterclip)
[func_mortar_field](@ref func_mortar_field)
[func_pendulum](@ref func_pendulum)
[func_physbox](@ref func_physbox)
[func_plat](@ref func_plat)
[func_platrot](@ref func_platrot)
[func_pushable](@ref func_pushable)
[func_recharge](@ref func_recharge)
[func_rot_button](@ref func_rot_button)
[func_rotating](@ref func_rotating)
[func_smokevolume](@ref func_smokevolume)
[func_tank](@ref func_tank)
[func_tankcontrols](@ref func_tankcontrols)
[func_tankmortar](@ref func_tankmortar)
[func_trackchange](@ref func_trackchange)
[func_tracktrain](@ref func_tracktrain)
[func_train](@ref func_train)
[func_traincontrols](@ref func_traincontrols)
[func_vehicle](@ref func_vehicle)
[func_vehiclecontrols](@ref func_vehiclecontrols)
[func_wall](@ref func_wall)
[func_wall_toggle](@ref func_wall_toggle)
[game_counter](@ref game_counter)
[game_counter_set](@ref game_counter_set)
[game_end](@ref game_end)
[game_player_equip](@ref game_player_equip)
[game_player_hurt](@ref game_player_hurt)
[game_player_team](@ref game_player_team)
[game_score](@ref game_score)
[game_team_master](@ref game_team_master)
[game_team_set](@ref game_team_set)
[game_text](@ref game_text)
[game_zone_player](@ref game_zone_player)
[gibshooter](@ref gibshooter)
[info_hint](@ref info_hint)
[info_intermission](@ref info_intermission)
[info_landmark](@ref info_landmark)
[info_node](@ref info_node)
[info_node_air](@ref info_node_air)
[info_notnull](@ref info_notnull)
[info_null](@ref info_null)
[info_particle_system](@ref info_particle_system)
[info_player_coop](@ref info_player_coop)
[info_player_deathmatch](@ref info_player_deathmatch)
[info_player_start](@ref info_player_start)
[info_teleport_destination](@ref info_teleport_destination)
[info_waypoint](@ref info_waypoint)
[infodecal](@ref infodecal)
[item_food](@ref item_food)
[light](@ref light)
[light_dynamic](@ref light_dynamic)
[light_environment](@ref light_environment)
[light_surface](@ref light_surface)
[logic_achievement](@ref logic_achievement)
[logic_auto](@ref logic_auto)
[logic_case](@ref logic_case)
[logic_relay](@ref logic_relay)
[logic_timer](@ref logic_timer)
[momentary_door](@ref momentary_door)
[momentary_rot_button](@ref momentary_rot_button)
[monster_furniture](@ref monster_furniture)
[monster_generic](@ref monster_generic)
[monstermaker](@ref monstermaker)
[multi_manager](@ref multi_manager)
[multisource](@ref multisource)
[path_corner](@ref path_corner)
[path_track](@ref path_track)
[phys_ballsocket](@ref phys_ballsocket)
[phys_constraint](@ref phys_constraint)
[phys_constraintsystem](@ref phys_constraintsystem)
[phys_convert](@ref phys_convert)
[phys_hinge](@ref phys_hinge)
[phys_keepupright](@ref phys_keepupright)
[phys_rope](@ref phys_rope)
[phys_slideconstraint](@ref phys_slideconstraint)
[player_loadsaved](@ref player_loadsaved)
[player_weaponstrip](@ref player_weaponstrip)
[point_camera](@ref point_camera)
[point_message](@ref point_message)
[point_servercommand](@ref point_servercommand)
[point_spotlight](@ref point_spotlight)
[point_trigger](@ref point_trigger)
[prop_dynamic](@ref prop_dynamic)
[prop_physics](@ref prop_physics)
[prop_physics_multiplayer](@ref prop_physics_multiplayer)
[prop_rope](@ref prop_rope)
[prop_static](@ref prop_static)
[prop_vehicle_driveable](@ref prop_vehicle_driveable)
[random_speaker](@ref random_speaker)
[random_trigger](@ref random_trigger)
[script_brushmodel](@ref script_brushmodel)
[script_model](@ref script_model)
[script_origin](@ref script_origin)
[script_struct](@ref script_struct)
[script_vehicle](@ref script_vehicle)
[scripted_sentence](@ref scripted_sentence)
[scripted_sequence](@ref scripted_sequence)
[sky_camera](@ref sky_camera)
[speaker](@ref speaker)
[targ_speaker](@ref targ_speaker)
[target_cdaudio](@ref target_cdaudio)
[trigger_auto](@ref trigger_auto)
[trigger_autosave](@ref trigger_autosave)
[trigger_camera](@ref trigger_camera)
[trigger_cdaudio](@ref trigger_cdaudio)
[trigger_changelevel](@ref trigger_changelevel)
[trigger_changetarget](@ref trigger_changetarget)
[trigger_counter](@ref trigger_counter)
[trigger_endsection](@ref trigger_endsection)
[trigger_gravity](@ref trigger_gravity)
[trigger_hurt](@ref trigger_hurt)
[trigger_look](@ref trigger_look)
[trigger_monsterjump](@ref trigger_monsterjump)
[trigger_multiple](@ref trigger_multiple)
[trigger_once](@ref trigger_once)
[trigger_playerfreeze](@ref trigger_playerfreeze)
[trigger_push](@ref trigger_push)
[trigger_relay](@ref trigger_relay)
[trigger_teleport](@ref trigger_teleport)
[trigger_transition](@ref trigger_transition)
[worldspawn](@ref worldspawn)

View File

@ -9,6 +9,8 @@ This is a software development kit (SDK) and development environment created by
The Nuclide project produces a freely available game-logic component and
development platform on top of [FTEQW](https://www.fteqw.org); which is the engine we happen to use.
**The general idea is that Nuclide takes care of ~90% of the code you shouldn't have to worry about.**
The goal is to create a modern research base for new advancements, as well
as to have a stable base with a decent API for making games.
@ -16,13 +18,17 @@ It comes with a simple example game (simply referred to as 'Base') and some test
General feature overview:
- SDK in the spirit of 'id Tech' development environments
- Client-side predicted movement, predicted weapons and vehicle systems
- Implementations of well known, established entity classes as seen in popular and critically acclaimed games
- Reference implementations for a lot of features exlusive to the FTEQW engine
- Designed to be familar to developers who are used to GoldSrc and Source engine
project workflows
- Everything written from scratch with the modern QuakeC language advancements in mind
- The 'missing' SDK for engines like FTEQW
- Support for client-side predicted movement, weaponry and vehicles
- Documented APIs for everything you need to interface with the engine
- APIs and Frameworks for managing updates, mods, servers, and platform specific features
- Complete re-implementations of hundreds of entities, from GoldSrc/Source engine games
- Entity communication via traditional one-way triggers, or our Source Engine I/O compatible system
- Includes BotLib, a framework for multiplayer-AI that can receive game-specific overrides
- Includes VGUILib, a re-imagining of Valve's GUI library, which can also be used for in-game surface based interfaces
- Designed to be familar to developers coming from GoldSrc/Source
- VR/XR aware codebase
- All permissively licensed
### 1. Why might I want to use it? {#why}
@ -67,9 +73,9 @@ If you do posess a basic knowledge of the following:
Then you will have a good time.
We strive to keep the codebase portable and conform to open standards wherever possible.
This means that if you develop on Windows, you probably want to install something like [Cygwin](https://www.cygwin.com/) to make this bearable.
This means that if you develop on Windows, you probably want to install something like WSL or even [Cygwin](https://www.cygwin.com/) to make this bearable.
Please don't ask us how to learn UNIX/Cygwin.
Please don't ask us how to use WSL or Cygwin. We do not provide support for either. We do not develop on Windows.
**This is a development kit and a development environment. This is not a game.**

74
Documentation/MapC.md Normal file
View File

@ -0,0 +1,74 @@
# MapC Scripting
**Notice: This is an uncomitted document and is subject to change.**
Powered by the engine's multi-progs capability, maps can run their own isolated logic.
This is inspired by the original MapC effort by [Team Fortress Software/Valve](https://web.archive.org/web/19990221213004/http://www.teamfortress.com:80/tfii/mc2.html) that never got off the ground.
Ritual's ĂśberTools for Quake III also had a scripting system for each map, this is comparable to that also. The same extends to the **GSC** scripts found in Call of Duty that each map has.
If you're curious about use-cases, you should make yourself familar with what those games do.
## MapC versus QuakeC
MapC is basically a superset of QuakeC.
You essentially write valid SSQC, but there's extra helper functions that you can use to communicate with entities from the server-side progs. Concepts that are alien to regular QuakeC code.
If a `mapscript.dat` is next to the map of the same name (`mapscript.bsp`), it will be included into the game.
An example source file from Nuclide's `base/test_maps.pk3dir/maps/mapscript.mapC`:
```cpp
#pragma PROGS_DAT "mapscript.dat"
#include "../../../src/server/mapC.h"
void main()
{
entity spawnPoint = spawnClass("info_player_start", [0, 0, 128]);
spawnPoint.angles = [0, random(-180, 180), 0];
spawnPoint.targetname = "SPSpawn";
spawnPoint = spawnClass("info_player_deathmatch", [0, 0, 128]);
spawnPoint.angles = [0, random(-180, 180), 0];
spawnPoint.targetname = "MPSpawn";
}
```
Here you can see that while we stick to the `entity` base type, we do get to use a new function to spawn entities: `spawnclass(string className, desiredPosition)`.
This ensures that the server-side progs gets to load all available [EntityDef](EntityDef.md) based entities, as well as all internal, available, class-based entities - and sends those to our map-specific progs.
If you don't use spawnClass(), expect to not be able to use the I/O system with the entity.
To have access to all features, make sure to include `mapC.h` from Nuclide's `src/server` directory. That file will continously be updated to add more functionality.
You can compile the MapC file with fteqcc (`fteqcc mapscript.mapC`) to receive `mapscript.dat`.
Like with regular QuakeC progs, you only have to include the resulting .dat with your game - although we encourage you to release the sources to all progs for modders and tinkerers to enjoy. It's also a way for users to support the game themselves in case you're no longer able to support it.
## Use cases, benefits
When it comes to managing the complexity of events in games like the Call of Duty series, this is a desired substitute to hundreds (sometimes thousands) of entities.
Boxing the map-specific logic also aids portability. With less dependence on Nuclide or other internal functions to organize and schedule most of its logic, forward compatibility is easily achieved.
The design has been proven across dozens of games within the Call of Duty series, with little to no changes - serving for both single and multiplayer logic. Managing waves of enemies, or writing entire game-modes using this type of set-up has been proven.
## Extra features over Vanilla SSQC
These extra functions are available to MapC programs:
### spawnClass(className, desiredPos)
Spawns the specified entity class name at the desired position. If the classname does not exist, it will return a new info_notnull type entity with no model or collision for you to modify.
### sendInput(targetEntity, inputName, dataString, targetActivator)
Sends an input event to an NSEntity and with a specific activator. While that can be __NULL__, this, or world most of the time - some inputs very much depend on the activator being valid within their respective contexts.
## Map-specific entities
You can bundle an [EntityDef](EntityDef.md) file with your level, like with MapC progs they have to have the same filename as the map, but with the extension ending in '**def**' (e.g. `maps/mapscript.def`).
The entities within that EntityDef file will be exclusive to that map. No other map can spawn them. If you want to make an EntityDef available to all maps, move it into the `def/` directory of your game directory.

57
Documentation/MapTypes.md Normal file
View File

@ -0,0 +1,57 @@
# Map Making
## Which Format You Should Use
That depends on the job. If you want to work with a modern format, comparable to that of a 2004 game engine and beyond, any variant of Quake III Arena's BSP format can do.
We aim to support everything equally.
For a more authentic, 1990s experience you may want to use Quake II's format instead.
We have our own variant of the BSP format, which can be compiled by using [vmap](VMap.md).
### Quake BSP
This is the default format that all the Quake tools, such as [ericw-tools](https://ericwa.github.io/ericw-tools/) compile into. If you exceed limits, they generally will generate a **"BSP2"** file, which is something our engine also understands. The original engine and format only did monochrome color. This is no issue any longer because modern compilers output so called **lit** files, which contain colored lightmaps externally. If a Quake engine supports colored lights, they'll usually load them automatically.
However, creating non-planar surfaces or changing the lightmap quality on individual surfaces is not supported in this format. If you want to use features such as crouching or proning you have to compile your map with **BSPX** extensions. Other formats also include more features, which can help optimise the network and rendering performance of a level. So use of this format is discouraged by us.
You can totally use it if you're going for a certain aesthetic, just be aware of its limitations. You cannot optimise levels beyond a certain point due to a lack of area-portals which were introduced with Quake II BSP.
### Quake II BSP
A better choice over Quake's standard BSP format. These support area-portals and proper detail brushes can help optimise the level even further.
### Quake III Arena BSP
**The recommended format.** Support for everything Quake II's BSP does, but you can now put a lot of detailed geometry into so called triangle soup, and design your own content volumes (beyond water, lava, slime), and surface flags (make bullets ricochet, or leak water) - make use of curved surfaces, massive maps with terrain and texture blending. Support for different lightmap scales per surface, and alternative vertex-lit levels can also give you tigter controls about lighting performance and visual fidelity.
### VMAP compiled BSP
Our own version of the Quake III Arena BSP format. It supports a bunch of new things.
The compiler doesn't read .shader files from `scripts/` but instead `.mat` files alongside the textures within the textures directory, as well as a custom patch/curve format.
Only use this if you really, really want to use the things we developed. You will have a smoother experience with most other formats right now.
### Other Formats
While the engine can read other formats, such as BSP30 and beyond - please ensure you do have the rights to use the tools in such fashion. For example, for developers coming from the Half-Life SDK you are not allowed to use compilers and versions deriving from the original sources to make maps for Nuclide based projects. You will have to negotiate a license with Valve or use a free-software tool such as [ericw-tools](https://ericwa.github.io/ericw-tools/).
## Recommended Tools
We don't require you to use WorldSpawn or VMAP. You can use any of the above formats, and whatever editor you like to use to get the job done.
Here's a list of popular editors we've seen people use successfully:
- NetRadiant-Custom
- TrenchBroom
- NetRadiant
- GtkRadiant
- QuArK
- JACK (proprietary)
However we do not provide support for any of them. Please talk to the developers of the respective tools if you're experiencing issues. First ensure that you're able to make levels for your target format.
For example, create an example map for Quake, test it in Quake and then copy it into your Nuclide directory after verifying it works and that the workflow is right for you.
You may need to switch tools if you're not comfortable, and only once you're fully set and familar with the map-making toolchain should you attempt to run the maps in Nuclide.
As map-making is a complicated process, a lot of issues you can run into while making levels for Nuclide, may actually be issues with the toolchain you're using to make the map. So verify it works in the target format's game of choice first.

View File

@ -9,8 +9,8 @@
Determines the alpha test function used when rendering this surface.
Valid values are **GT0**, **LT128**, and **GE128**. These correspond to
**"GREATER THAN 0"**, **"LESS THAN 128"**, and **"GREATER THAN OR EQUAL
TO 128"**.
**GREATER THAN 0**, **LESS THAN 128**, and **GREATER THAN OR EQUAL
TO 128**.
This function is used when determining if a pixel should be written to
the frame-buffer. For example, if **GT0** is specified, the only the
@ -18,13 +18,12 @@ portions of the texture map with corresponding alpha values greater than
zero will be written to the framebuffer. **By default alpha testing is
disabled.**
Both alpha testing and normal [alpha
blending](blendFunc) can be used to get
Both alpha testing and normal [alpha blending](blendfunc.md) can be used to get
textures that have see-through parts. The difference is that
**alphaFunc** is an all-or-nothing test, while blending smoothly blends
between opaque and translucent at pixel edges.
Alpha test can also be used with
[depthWrite](depthWrite), allowing other
[depthWrite](depthwrite.md), allowing other
effects to be conditionally layered on top of just the opaque pixels by
setting [depthFunc](depthFunc) to equal.
setting [depthFunc](depthfunc.md) to equal.

View File

@ -6,8 +6,7 @@
### Overview
The alpha channel can be specified like the [rgb
channels](rgbGen). If not specified, it
The alpha channel can be specified like the [rgb channels](rgbgen.md). If not specified, it
defaults to 1.0.
### Functions {#functions}
@ -15,7 +14,7 @@ defaults to 1.0.
#### portal {#portal}
This rendering stage keyword is used in conjunction with the
[surfaceparm](surfaceparm) keyword
[surfaceparm](surfaceparm.md) keyword
portal. The function accomplishes the "fade" that causes the scene in
the portal to fade from view. Specifically, it means "Generate alpha
values based on the distance from the viewer to the portal."

View File

@ -23,10 +23,10 @@ It accepts the standard **wave** functions of the type: **sin**,
**triangle**, **square**, **sawtooth** or **inversesawtooth**.
The "div" parameter is used to control the wave "spread" - a value equal
to the [tessSize](vmap_tessSize) of the
to the [tessSize](vmap_tesssize.md) of the
surface is a good default value.
#### normal <siv> <func> <base> &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt; {#normal_amplitude_0.1_0.5_frequency_1.0_4.0}
#### normal <siv> <func> <base> <amplitude> <frequency> {#normal_amplitude}
This deformation affects the normals of a vertex without actually moving
it, which will effect later material options like lighting and
@ -43,14 +43,14 @@ rain, flags.
This forces a bulge to move along the given s and t directions. Designed
for use on curved pipes.
#### move<x> <y> <z> <func> <base> <amplitude> <phase> <freq> {#move}
#### move <x> <y> <z> <func> <base> <amplitude> <phase> <freq> {#move}
This keyword is used to make a brush, curve patch or model appear to
move together as a unit. The **<x>** **<y>** and **<z>** values are the
move together as a unit. The **x** **y** and **z** values are the
distance and direction in game units the object appears to move relative
to it's point of origin in the map.
The **<func> <base> <amplitude> <phase>** and **<freq>** values are the
The **func base amplitude phase** and **freq** values are the
same as found in other wave form manipulations.
The product of the function modifies the values x, y, and z.Therefore,
@ -101,9 +101,9 @@ smaller wave forms occurring in a given area. Larger values create a
lesser density of waves, or otherwise put, the appearance of larger
waves. To look correct this value should closely correspond to the value
(in pixels) set for
[tessSize](vmap_tessSize) of the texture.
[tessSize](vmap_tesssize.md) of the texture.
A value of 100.0 is a good default value (which means your
[tessSize](vmap_tessSize) should be close
[tessSize](vmap_tesssize.md) should be close
to that for things tolook "wavelike").
#### <func> {#section_1}

View File

@ -7,7 +7,7 @@
### Overview
By default, writes to the depth buffer when
[depthFunc](depthFunc) passes will happen
[depthFunc](depthfunc.md) passes will happen
for opaque surfaces and not for translucent surfaces.
Blended surfaces can have the depth writes forced with this function.

View File

@ -7,15 +7,15 @@
### Overview
**Note**: you must also specify "surfaceparm fog" to cause
[vmap](vmap) to identify the surfaces inside the volume.
[vmap](vmap.md) to identify the surfaces inside the volume.
Fogparms only describes how to render the fog on the surfaces.
**<red value> <green value> <blue value>** These are normalized values.
**red value, green value, blue value**: These are normalized values.
To obtain the values that define fog color divide the desired color's
Red, Green and Blue values by 255 to obtain three normalized numbers
within the 0.0 to 1.0 range.
**<distance toopaque>** This is the distance, in game units, until the
**distance to opaque**: This is the distance, in game units, until the
fog becomes totally opaque, as measured from the point of view of the
observer. By making the height of the fog brush shorter than the
distance to opaque, the apparent density of the fog can be reduced

View File

@ -7,7 +7,6 @@
### Overview
Similar to [vmap_surfaceModel (Material
Command)](vmap_surfaceModel), however
Similar to [vmap_surfaceModel (vmap_surfacemodel.md), however
it'll place models at runtime. The density can be controlled via the
cvar `r_clutter_density`.

View File

@ -9,17 +9,17 @@
The texture is essentially a fullbright overlay on top of the
diffuse/albedomap.
Not all [Shaders](Shaders) support them. In some, like the
[unlit](unlit_(Shader)) shader, the
[diffusemap](diffusemap) is always
Not all [Shaders](Shaders.md) support them. In some, like the
[unlit](unlit.md) shader, the
[diffusemap](diffusemap.md) is always
fullbright.
### See also {#see_also}
- [diffusemap](diffusemap)
- [normalmap](normalmap)
- [specularmap](specularmap)
- [uppermap](uppermap)
- [lowermap](lowermap)
- [reflectmask](reflectmask)
- [reflectcube](reflectcube)
- [diffusemap](diffusemap.md)
- [normalmap](normalmap.md)
- [specularmap](specularmap.md)
- [uppermap](uppermap.md)
- [lowermap](lowermap.md)
- [reflectmask](reflectmask.md)
- [reflectcube](reflectcube.md)

View File

@ -6,7 +6,7 @@
### Overview
This implies [noPicMip](noPicMip), but
This implies [noPicMip](nopicmip.md), but
also prevents the generation of any lower resolution mipmaps for use by
the 3d card. This will cause the texture to alias when it gets smaller,
but there are some cases where you would rather have this than a blurry

View File

@ -18,10 +18,10 @@ Check out our [Normal mapping guide](Normal_mapping_guide).
### See also {#see_also}
- [diffusemap](diffusemap)
- [specularmap](specularmap)
- [fullbrightmap](fullbrightmap)
- [uppermap](uppermap)
- [lowermap](lowermap)
- [reflectmask](reflectmask)
- [reflectcube](reflectcube)
- [diffusemap](diffusemap.md)
- [specularmap](specularmap.md)
- [fullbrightmap](fullbrightmap.md)
- [uppermap](uppermap.md)
- [lowermap](lowermap.md)
- [reflectmask](reflectmask.md)
- [reflectcube](reflectcube.md)

View File

@ -4,11 +4,11 @@
material. It also accepts arguments that will recompile a shader with
certain permutations. This is kinda ugly,
Starting in [The Wastes](The_Wastes) 1.2, there are the
Starting in **The Wastes 1.2**, there are the
following shader programs available to you:
- program [unlit](unlit_(Shader))
- program [lightmapped](lightmapped_(Shader))
- program [vertexlit](vertexlit_(Shader))
- program [water](water_(Shader))
- program [refract](refract_(Shader))
- program [unlit](unlit.md)
- program [lightmapped](lightmapped.md)
- program [vertexlit](vertexlit.md)
- program [water](water.md)
- program [refract](refract.md)

View File

@ -11,10 +11,10 @@ will pass the nearest in-world cubemap instead.
### See also {#see_also}
- [diffusemap](diffusemap)
- [normalmap](normalmap)
- [specularmap](specularmap)
- [fullbrightmap](fullbrightmap)
- [uppermap](uppermap)
- [lowermap](lowermap)
- [reflectmask](reflectmask)
- [diffusemap](diffusemap.md)
- [normalmap](normalmap.md)
- [specularmap](specularmap.md)
- [fullbrightmap](fullbrightmap.md)
- [uppermap](uppermap.md)
- [lowermap](lowermap.md)
- [reflectmask](reflectmask.md)

View File

@ -8,18 +8,18 @@
Defines a texture that specifies which parts of a material will reveal a
reflective material, such as a
[cubemap](reflectcube). This applies to
[cubemap](reflectcube.md). This applies to
standard FTEQW. In Nuclide the reflectmask is currently unused with the
included shaders. If you want to apply reflectivity to your materials,
use the alpha channel of your
[normalmap](normalmap) instead.
[normalmap](normalmap.md) instead.
### See also {#see_also}
- [diffusemap](diffusemap)
- [normalmap](normalmap)
- [specularmap](specularmap)
- [fullbrightmap](fullbrightmap)
- [uppermap](uppermap)
- [lowermap](lowermap)
- [reflectcube](reflectcube)
- [diffusemap](diffusemap.md)
- [normalmap](normalmap.md)
- [specularmap](specularmap.md)
- [fullbrightmap](fullbrightmap.md)
- [uppermap](uppermap.md)
- [lowermap](lowermap.md)
- [reflectcube](reflectcube.md)

View File

@ -13,20 +13,20 @@ to use for color, intensity etc.
The renderer will take it into account only if you do not supply any
Stages in the material.
**<farbox>** Specifies a set of files to use as an environment box
**farbox**: Specifies a set of files to use as an environment box
behind all cloudlayers. Specify "-" for no farbox, or a file base name.
A base name of "env/test" would look for files "env/test_rt.tga",
"env/test_lf.tga", "env/test_ft.tga", "env/test_bk.tga",
"env/test_up.tga", "env/test_dn.tga" to use as the right / left / front
/ back / up / down sides.
**<cloudheight>** controls apparent curvature of the cloud layers -
**cloudheight**: controls apparent curvature of the cloud layers -
lower numbers mean more curvature (and thus more distortion at the
horizons). Higher height values create "flatter" skies with less horizon
distortion. Think of height as the radius of a sphere on which the
clouds are mapped. Good ranges are 64 to 256. The default value is 128.
**<nearbox>** Specified as farbox, to be alpha blended ontop of the
**nearbox**: Specified as farbox, to be alpha blended ontop of the
clouds. This has not be tested in a long time, so it probably doesn't
actually work. Set to "-" to ignore.

View File

@ -13,10 +13,10 @@ texture it for other purposes, too.
### See also {#see_also}
- [diffusemap](diffusemap)
- [normalmap](normalmap)
- [fullbrightmap](fullbrightmap)
- [uppermap](uppermap)
- [lowermap](lowermap)
- [reflectmask](reflectmask)
- [reflectcube](reflectcube)
- [diffusemap](diffusemap.md)
- [normalmap](normalmap.md)
- [fullbrightmap](fullbrightmap.md)
- [uppermap](uppermap.md)
- [lowermap](lowermap.md)
- [reflectmask](reflectmask.md)
- [reflectcube](reflectcube.md)

View File

@ -8,9 +8,9 @@ by the renderer. A few keywords will only apply to any one of them.
All surfaceparm keywords are preceded by the word surfaceparm as
follows:
:
: surfaceparm **fog**
```
surfaceparm **fog**
```
### Behaviour Keywords {#behaviour_keywords}

View File

@ -2,7 +2,7 @@
## tcmod
### Syntax
**tcMod <func> &lt;…&gt;**
**tcMod <func> [...]**
### Overview
@ -26,7 +26,7 @@ specified. In otherwords, if you see:
 tcMod scroll 1 1
```
Then the texture coordinates will be **scaled then**scrolled'''.
Then the texture coordinates will be **scaled** then **scrolled**.
### Functions {#functions}
@ -81,20 +81,20 @@ Stretches the texture coordinates with the given function. Stretching is
defined as stretching the texture coordinate away from the center of the
polygon and then compressing it towards the center of the polygon.
**<base>**: A base value of one is the original dimension of the texture
**base**: A base value of one is the original dimension of the texture
when it reaches the stretch stage. Inserting other '''values positive or
negative in this variable will produce unknown effects.
**<amplitude>**: This is the measurement of distance the texture will
**amplitude**: This is the measurement of distance the texture will
stretch from the base size. It is measured, like scroll, in textures. A
value of 1 here will double the size of the texture at its peak.
**<phase>**: See the explanation for phase under the deform vertexes
**phase**: See the explanation for phase under the deform vertexes
keyword.
**<frequency>**: this is wave peaks per second.
**frequency**: this is wave peaks per second.
**<func>**:
**func**:
- **Sin**: the texture expands smoothly to its peak dimension and then
shrinks smoothly to its valley dimension in a flowing manner.
@ -122,13 +122,13 @@ forth churning and swirling effect on the texture.
The parameters for this are defined as follows:
- **<base>**: Currently undefined.
- **<amplitude>**: This is essentially the intensity of the
- **base**: Currently undefined.
- **amplitude**: This is essentially the intensity of the
disturbance or twisting and squiggling of the texture.
- **<phase>**: See the explanation for phase under the
- **phase**: See the explanation for phase under the
[deformvertexes](DeformVertexes)
keyword.
- **<freq>**: Frequency. This value is expressed as repetitions or
- **freq**: Frequency. This value is expressed as repetitions or
cycles of the wave per second. A value of one would cycle once per
second. A value of 10 would cycle 10 times per second. A value of
0.1 would cycle once every 10 seconds.

View File

@ -126,4 +126,15 @@ destruction.
this entity breaks.
- **breakable_model <string>**: Which models to spawn when it breaks.
- **breakable_count <int>**: The amount of models it'll spawn upon
breaking.
breaking.
- **surfaceprop <string>**: Surfaceprop override for the object.
## Physics Object Commands {#physcommands}
These are only relevant for when you want to use a phyics object, or rather an object that's handled by NSPhysicsEntity, such as prop_physics.
- **mass <float>**: Mass of the object, in kilograms.
- **volume <float>**: Volume of the object, in cubic meters.
- **inertia <float>**: Inertia multiplier.
- **damping <float>**: Linear movement damping multiplier.
- **rotdamping <float>**: Angular movement damping multiplier.

View File

@ -1,12 +1,7 @@
# Sound: EAX
# Sound: EFX {#EFX}
## EAX
Creative Technology's **Environmental Audio Extensions**, also known as **EAX**, attempted to create more ambiance within video games by more accurately simulating a real-world audio environment.
Due to the release of Windows Vista which deprecated the DirectSound3D API EAX was based on in 2007, Creative discouraged EAX implementation in favor of its [OpenAL](OpenAL.md)-based EFX equivalent.
EFX is fully supported in **FTEQW** and exposed via user-friendly entities and scripting language in **Nuclide**.
## See also
* [EFX](EFX.md)
* [OpenAL](OpenAL.md)
The release of Windows Vista deprecated the DirectSound3D API on which EAX relied on in 2007, so Creative Technology encouraged the move to OpenAL's EFX.

View File

@ -1,16 +1,18 @@
# Sound: EFX
# Sound: EFX {#EFX}
## EFX
EFX is a system in [OpenAL](OpenAL.md) that delivers high quality sound reverberation. It is the successor to Creative's [Environmental Audio Extensions](EAX.md).
**Nuclide** offers abstraction for new and old entities relying on **digital signal processing**.
## Entities
## Entities interacting with EFX
**env_sound** is most commonly used to change the environmental sound processing of a room/area.
In GoldSrc, it'll specify which enumeration of DSP preset to use for audio playback, in Nuclide however we just map it to a file in the filesystem.
In GoldSrc, it'll specify which enumeration of DSP preset to use for audio playback, in Nuclide however we just map it to a definitions file in the filesystem. See **EFX files** below.
## EFX files
## EFX defintion files
Entities that specify a EFX type, usually want to load one from a file.
@ -44,15 +46,17 @@ Here's an example one, `efx/city.efx`:
Most of the parameters are self explanatory.
## Debug cvars
## Console Variables
With the cvar `>s_al_debug` you'll get an overlay of information about which EFX file is currently being used, as well as what every single parameter is set to.
You can refresh EFX definitions with a simple map restart.
With the cvar `s_al_debug` set to 1 you'll get an overlay of information about which EFX file is currently being used, as well as what every single parameter is set to.
You can refresh EFX definitions with a map restart.
## Legacy translation table
Here you can see which **.efx file** is responsible for handling a legacy **env_sound** room-type.
*This section describes behaviour specific to converting entities from Half-Life based levels into the Nuclide environment.*
Here you can see which **efx file** is responsible for handling a legacy **env_sound** room-type.
**roomtype ID**|**EFX file**
:-----:|:-----:

15
Documentation/XR.md Normal file
View File

@ -0,0 +1,15 @@
# The XR Subsystem
To support XR (which is the support for Virtual, Augmented or Mixed Reality output) we have a few routines that help deal with this.
## Classes related to XR
We have 3 NSXRInput class instances per NSClient class, which itself belongs to a NSXRSpace.
### Head
The head is an NSXRInput of type XR_INPUT_HEAD. Yes, a head is just like any other XR compatible controller. It has a gyro and it potentially has buttons the user can press.
### Hands
We have two hands available, that will identify themselves as XR_INPUT_LEFT or XR_INPUT_RIGHT respectively. These are your primary tools for interacting with the 3D world.

View File

@ -878,8 +878,11 @@ INPUT = src/ \
Documentation/Main.md \
Documentation/Building.md \
Documentation/Launching.md \
Documentation/DedicatedServer.md \
Documentation/Filesystem.md \
Documentation/Networking.md \
Documentation/Bots/BotOverview.md \
Documentation/EntityGuide.md \
Documentation/Classes.md \
Documentation/Materials/MatOverview.md \
Documentation/Materials/MatCommands.md \
@ -890,6 +893,7 @@ INPUT = src/ \
Documentation/Shaders/ \
Documentation/Constants.md \
Documentation/EntityDef.md \
Documentation/MapC.md \
Documentation/Surf_data.md \
Documentation/Prop_data.md \
Documentation/MapTweaks.md \

View File

@ -1,12 +1,27 @@
# ![FTE Logo](Documentation/fte.svg) Nuclide - Software Development Kit
Software Development Kit, built around idTech with focus on advanced features and
Software Development Kit, built around id Technology with focus on advanced features and
clean-room implementations of true-and-tested game-logic frameworks.
It's been used to ship a commercial product. So it's proven to some extent.
*It's been used to ship a commercial product. So it's proven to some extent.*
All of this is written in QuakeC, but there's also some GLSL and shell scripts
in here. If you and your team are unfamilar with any of these, you may want something else.
## Features
- The missing SDK for engines like FTEQW
- Support for client-side predicted movement, weaponry and vehicles
- Documented APIs for everything you need to interface with the engine
- APIs and Frameworks for managing updates, mods, servers, and platform specific features
- Complete re-implementations of hundreds of entities, from GoldSrc/Source engine games
- Entity communication via traditional one-way triggers, or our Source Engine I/O compatible system
- Includes BotLib, a framework for multiplayer-AI that can receive game-specific overrides
- Includes VGUILib, a re-imagining of Valve's GUI library, which can also be used for in-game surface based interfaces
- Designed to be familar to developers coming from GoldSrc/Source
- VR/XR aware codebase
- All permissively licensed
## Documentation
You can find up-to-date documentation over at https://developer.vera-visions.com/
@ -14,10 +29,17 @@ You can find up-to-date documentation over at https://developer.vera-visions.com
This documentation is built entirely from this repository using doxygen.
You do not need to be on-line to view the documentation.
You can build the HTML documentation by running `doxygen` inside the root
of the repository. The output is located under `Documentation/html/index.html`
## Support
You can get personal support for Nuclide by negotiating a support contract with us. Reach out to marco@vera-visions.com if you want to know about our rates.
## Special Thanks
To id software and specifically John Carmack for having released the sources of
various pieces of id Technology under free licenses.
various works of id Technology under free licenses, without which a project like this would be unfeasible.
David Walton for **FTEQW** and the **FTEQCC** compiler, which is the brain of this SDK.

13
base/manifest.fmf Normal file
View File

@ -0,0 +1,13 @@
FTEMANIFEST 1
NAME "Test Game"
GAME base
BASEGAME platform
BASEGAME base
// you don't really want to change these
RTCBROKER master.frag-net.com:27950
PROTOCOLNAME "Nuclide"
MAINCONFIG nuclide.cfg
DOWNLOADSURL ""
-exec platform_default.cfg

26
base/radiant.game Normal file
View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<game
type="hl"
name="Nuclide"
enginepath_linux="/usr/local/games/nuclide/"
enginepath_win32="c:/vera/nuclide/"
engine_win32="fteqw.exe"
engine_linux="fteqw"
basegame="platform"
basegamename="Nuclide"
unknowngamename="Nuclide Game Directory"
default_scale="0.5"
no_patch="0"
no_bsp_monitor="0"
show_wads="0"
archivetypes="pk3"
texturetypes="tga ktx"
modeltypes="iqm"
maptypes="mapq3"
shaders="quake3"
entityclass="quake3"
entityclasstype="def"
entities="quake3"
brushtypes="quake"
patchtypes="quake3"
/>

26
base/radiiant.xml Normal file
View File

@ -0,0 +1,26 @@
<?xml version="1.0"?>
<project version="2.0">
<var name="vmap">"[RadiantPath]vmap" -v<cond value="[MonitorAddress]"> -connect [MonitorAddress]</cond> -game platform -fs_basepath "[EnginePath]"<cond value="[GameName]"> -fs_game [GameName]</cond></var>
<build name="Fast Fullbright">
<command>[vmap] -custinfoparms -threads 4 -samplesize 8 "[MapFile]"</command>
<command>[vmap] -vis -v -fast "[MapFile]"</command>
</build>
<build name="Fast">
<command>[vmap] -custinfoparms -threads 4 -samplesize 8 "[MapFile]"</command>
<command>[vmap] -vis -v -fast "[MapFile]"</command>
<command>[vmap] -light -custinfoparms -v -samplesize 8 -fast -threads 4 -samples 4 -shade -shadeangle 60 -patchshadows "[MapFile]"</command>
</build>
<build name="Full">
<command>[vmap] -custinfoparms -threads 4 -samplesize 8 "[MapFile]"</command>
<command>[vmap] -vis "[MapFile]"</command>
<command>[vmap] -light -custinfoparms -samplesize 8 -fast -threads 4 -samples 4 -shade -shadeangle 60 -patchshadows "[MapFile]"</command>
</build>
</build>
</project>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2022 Vera Visions LLC.
* Copyright (c) 2016-2021 Marco Cawthorne <marco@icculus.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -12,7 +12,7 @@
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
*/
struct
{
@ -25,11 +25,11 @@ struct
} g_camBobVars[4], *pCamBob;
/* tilts the camera for a head-bob like effect when moving */
void
Camera_RunBob(__inout vector camera_angle)
vector
Camera_RunBob(vector camera_angle)
{
if (!autocvar(v_cambob, 1, "Enables bobbing effect for the first-person camera"))
return;
return camera_angle;
int s = (float)getproperty(VF_ACTIVESEAT);
pCamBob = &g_camBobVars[s];
@ -39,13 +39,16 @@ Camera_RunBob(__inout vector camera_angle)
speed[2] = 0.0f;
pCamBob->m_flSpeed = vlen(speed);
if (pCamBob->m_flSpeed > 330.0f)
pCamBob->m_flSpeed = 330.0f;
/* don't bother on low speeds */
if ( pCamBob->m_flSpeed < 5.0f ) {
pCamBob->m_flMove = 0.0f;
pCamBob->m_flTime = 0.0f; /* progress has halted, start anew */
return;
} else if (pSeat->m_ePlayer.flags & FL_ONGROUND) {
pCamBob->m_flMove = clframetime * (pCamBob->m_flSpeed * 0.01);
return camera_angle;
} else {
pCamBob->m_flMove = frametime * (pCamBob->m_flSpeed * 0.01);
}
pCamBob->m_flTime = (pCamBob->m_flTime += pCamBob->m_flMove);
@ -60,14 +63,15 @@ Camera_RunBob(__inout vector camera_angle)
}
camera_angle[2] += pCamBob->m_flDelta;
return camera_angle;
}
/* applies a tilt to the camera for when we're strafing left to right */
void
Camera_StrafeRoll(__inout vector camera_angle)
vector
Camera_StrafeRoll(vector camera_angle)
{
if (!autocvar(v_camroll, 0, "Enables strafe-roll for the first-person camera"))
return;
return camera_angle;
float roll;
makevectors(camera_angle);
@ -76,4 +80,38 @@ Camera_StrafeRoll(__inout vector camera_angle)
roll *= 0.015f;
camera_angle[2] += roll;
return camera_angle;
}
vector
Camera_AddLean(vector viewAngle)
{
vector shift = anglesToRight(viewAngle);
vector output;
vector srcPos;
float heightChange;
player pl = (player)pSeat->m_ePlayer;
if (pSeat->m_iLeanDir > 0i) {
pSeat->m_flLeaning += frametime * 5;
} else if (pSeat->m_iLeanDir < 0i) {
pSeat->m_flLeaning -= frametime * 5;
} else {
pSeat->m_flLeaning = lerp(pSeat->m_flLeaning, 0.0, frametime * 10);
}
if (pSeat->m_flLeaning > 1.0) {
pSeat->m_flLeaning = 1.0f;
}
if (pSeat->m_flLeaning < -1.0) {
pSeat->m_flLeaning = -1.0f;
}
heightChange = cos(pSeat->m_flLeaning) * 4;
srcPos = pl.GetEyePos();
output = shift * (pSeat->m_flLeaning * 15.0);
tracebox(srcPos, [-8,-8,-8], [8,8,8], srcPos + output, MOVE_NORMAL, pl);
return output * trace_fraction + (shift * -1.0) + [0, 0, heightChange];
}

View File

@ -14,6 +14,9 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
const float baseIconSize = 32.0;
const float baseIconPadding = 16.0;
/* main entry */
void
HUD_Init(void)
@ -24,6 +27,18 @@ HUD_Init(void)
void
HUD_Draw(void)
{
vector hudSize = g_view.GetHUDCanvasSize();
vector iconPos = g_view.GetHUDCanvasPos() + (hudSize / 2);
iconPos[1] = (hudSize[1] - baseIconSize) - baseIconPadding;
/* health, armor icons */
drawpic(iconPos + [-((baseIconSize/2) + (baseIconPadding/2)), 0], "gfx/hud/health", [baseIconSize, baseIconSize], [1,1,1], 1.0f);
drawpic(iconPos + [(baseIconSize/2) + (baseIconPadding/2), 0], "gfx/hud/armor", [baseIconSize, baseIconSize], [1,1,1], 1.0f);
/* ammo icon */
iconPos[0] = (hudSize[0] - baseIconSize) - baseIconPadding;
drawpic(iconPos, "gfx/hud/armor", [baseIconSize, baseIconSize], [1,1,1], 1.0f);
Textmenu_Draw();
}
@ -31,4 +46,5 @@ HUD_Draw(void)
void
HUD_DrawSpectator(void)
{
}

View File

@ -1,5 +1,4 @@
#pragma target fte_5768
//#pragma flag enable assumeint
#pragma progs_dat "../../csprogs.dat"
#define CSQC
@ -23,15 +22,14 @@ defs.h
/* mod specific functions */
../shared/include.src
../../../base/src/client/draw.qc
draw.qc
init.qc
entities.qc
camera.qc
cmds.qc
game_event.qc
modelevent.qc
viewmodel.qc
view.qc
hud.qc
hud_weaponselect.qc
scoreboard.qc

View File

@ -1,48 +0,0 @@
/*
* Copyright (c) 2016-2022 Vera Visions LLC.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
void
View_UpdateWeapon(player pl, entity vm, entity mflash)
{
/* only bother upon change */
if (pSeat->m_iLastWeapon == pl.activeweapon) {
return;
}
pSeat->m_iOldWeapon = pSeat->m_iLastWeapon;
pSeat->m_iLastWeapon = pl.activeweapon;
if (!pl.activeweapon) {
return;
}
/* hack, we changed the wep, move this into Game_Input/PMove */
Weapons_Draw(pl);
/* we forced a weapon call outside the prediction,
* thus we need to update all the net variables to
* make sure these updates are recognized. this is
* vile but it'll have to do for now */
SAVE_STATE(pl.w_attack_next);
SAVE_STATE(pl.w_idle_next);
SAVE_STATE(pl.viewzoom);
SAVE_STATE(pl.weapontime);
/* figure out when the attachments start. in FTE attachments for
* HLMDL are treated as bones. they start at numbones + 1 */
skel_delete(mflash.skeletonindex);
mflash.skeletonindex = skel_create(vm.modelindex);
pSeat->m_iVMBones = skel_get_numbones(mflash.skeletonindex) + 1;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2022 Vera Visions LLC.
* Copyright (c) 2016-2021 Marco Cawthorne <marco@icculus.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -12,11 +12,18 @@
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
*/
var float autocvar_v_bob = 0.01f;
var float autocvar_v_bobcycle = 1.0f;
var float autocvar_v_bobup = 0.5f;
#define BOB_STRENGTH 0.02
#define BOB_CYCLE 1.0
#define BOB_UP 0.60
var vector autocvar_bg_bobAmplitudeDucked = [0.0075, 0.0065, 0.0000];
var vector autocvar_bg_bobAmplitudeProne = [0.02, 0.005, 0.0000];
var vector autocvar_bg_bobAmplitudeSprinting = [0.02, 0.014, 0.0000];
var vector autocvar_bg_bobAmplitudeStanding = [0.007, 0.007, 0.0000];
var float autocvar_bg_bobMax = 8.0;
var float autocvar_player_sprintCameraBob = 0.5;
struct
{
@ -27,6 +34,9 @@ struct
float m_flBobCycle;
float m_flBobCycle2;
float m_flSpeed;
float m_flViewBob;
float m_flViewBob2;
} g_viewBobVars[4], *pViewBob;
@ -45,13 +55,20 @@ Viewmodel_CalcBob(void)
float var_bob;
float var_cycle;
float var_up;
bool isSprinting = pSeat->m_ePlayer.vv_flags & VFL_SPRINTING;
bool isCrouching = pSeat->m_ePlayer.vv_flags & VFL_CROUCHING;
var_bob = autocvar_v_bob;
var_cycle = autocvar_v_bobcycle;
var_up = autocvar_v_bobup;
// if (pSeatLocal->m_iSprinting && vlen(pSeat->m_vecPredictedVelocity) > 240)
// isSprinting = true;
pViewBob->m_flBobTime += clframetime;
pViewBob->m_flBobTime2 += clframetime;
var_bob = BOB_STRENGTH;
var_cycle = BOB_CYCLE;
var_up = BOB_UP;
if (isSprinting)
var_cycle *= autocvar_player_sprintCameraBob;
pViewBob->m_flBobTime += frametime;
pViewBob->m_flBobCycle = pViewBob->m_flBobTime - (int)(pViewBob->m_flBobTime / var_cycle) * var_cycle;
pViewBob->m_flBobCycle /= var_cycle;
@ -66,10 +83,11 @@ Viewmodel_CalcBob(void)
pViewBob->m_flSpeed = vlen(vecVel);
flBob = pViewBob->m_flSpeed * var_bob;
flBob = flBob * 0.3 + flBob * 0.7 * sin(pViewBob->m_flBobCycle);
pViewBob->m_flBob = bound(-7, flBob, 4);
flBob = flBob * sin(pViewBob->m_flBobCycle);
pViewBob->m_flBob = flBob;
/* BOB2, which is half the cycle of bob1 */
pViewBob->m_flBobTime2 += frametime;
pViewBob->m_flBobCycle2 = pViewBob->m_flBobTime2 - (int)(pViewBob->m_flBobTime2 / (var_cycle * 0.5f)) * (var_cycle * 0.5f);
pViewBob->m_flBobCycle2 /= (var_cycle * 0.5f);
@ -79,12 +97,26 @@ Viewmodel_CalcBob(void)
pViewBob->m_flBobCycle2 = MATH_PI + MATH_PI * (pViewBob->m_flBobCycle2 - var_up)/(1.0 - var_up);
}
flBob = pViewBob->m_flSpeed * var_bob;
flBob = flBob * 0.3 + flBob * 0.7 * sin(pViewBob->m_flBobCycle2);
pViewBob->m_flBob2 = bound(-7, flBob, 4);
flBob = pViewBob->m_flSpeed * (var_bob * 0.5);
flBob = flBob * cos(pViewBob->m_flBobCycle2);
pViewBob->m_flBob2 = flBob;
/* make sure it's adjusted for scale */
pViewBob->m_flBob *= autocvar_cg_viewmodelScale;
if (isSprinting) {
pViewBob->m_flViewBob2 = pViewBob->m_flBob2 * autocvar_bg_bobAmplitudeSprinting[0] * 25.0f;
pViewBob->m_flViewBob = pViewBob->m_flBob * autocvar_bg_bobAmplitudeSprinting[1] * 25.0f;
pViewBob->m_flBob2 *= autocvar_bg_bobAmplitudeSprinting[0] * 20.0;
pViewBob->m_flBob *= autocvar_bg_bobAmplitudeSprinting[1] * 20.0;
} else if (isCrouching) {
pViewBob->m_flViewBob2 = pViewBob->m_flBob2 * autocvar_bg_bobAmplitudeDucked[0] * 25.0f;
pViewBob->m_flViewBob = pViewBob->m_flBob * autocvar_bg_bobAmplitudeDucked[1] * 25.0f;
pViewBob->m_flBob2 *= autocvar_bg_bobAmplitudeDucked[0] * 20.0;
pViewBob->m_flBob *= autocvar_bg_bobAmplitudeDucked[1] * 20.0;
} else {
pViewBob->m_flViewBob2 = pViewBob->m_flBob2 * autocvar_bg_bobAmplitudeStanding[0] * 25.0f;
pViewBob->m_flViewBob = pViewBob->m_flBob * autocvar_bg_bobAmplitudeStanding[1] * 25.0f;
pViewBob->m_flBob2 *= autocvar_bg_bobAmplitudeStanding[0] * 20.0;
pViewBob->m_flBob *= autocvar_bg_bobAmplitudeStanding[1] * 20.0;
}
}
void
@ -95,13 +127,18 @@ Viewmodel_ApplyBob(entity gun)
float sintime;
float strength;
gun.angles[2] = -pViewBob->m_flBob;
float kickUp;
//gun.angles[2] = pViewBob->m_flBob2 * -2.0f;
gun.angles[2] = pViewBob->m_flViewBob * 4.0f;
kickUp = pViewBob->m_flViewBob2 * 4.0f;
vector angmod = [0,0,0];
angmod[0] -= pViewBob->m_flBob2 * 0.5f;
angmod[1] += pViewBob->m_flBob * 2.5f;
angmod[2] += pViewBob->m_flBob * 3.0f;
gun.angles += angmod * 1.5f;
angmod[0] = pViewBob->m_flViewBob2 + kickUp;
angmod[1] = pViewBob->m_flViewBob;
//angmod[2] += pViewBob->m_flBob * 3.0f;
gun.angles += angmod;
/* sway with speed */
sintime = sin(time);
@ -111,19 +148,19 @@ Viewmodel_ApplyBob(entity gun)
strength = 240;
strength = 240 - strength;
strength *= 0.005f;
strength *= 0.01f;
#ifdef WASTES
float sprint;
if (pSeatLocal->m_iSprinting && vlen(pSeat->m_vecPredictedVelocity) > 240) {
pSeatLocal->m_flSprintLerp = bound(0.0f, pSeatLocal->m_flSprintLerp + clframetime, 1.0f);
if (pSeat->m_ePlayer.vv_flags & VFL_SPRINTING) {
pSeat->m_flSprintLerp = bound(0.0f, pSeat->m_flSprintLerp + clframetime, 1.0f);
} else {
pSeatLocal->m_flSprintLerp = bound(0.0f, pSeatLocal->m_flSprintLerp - clframetime, 1.0f);
pSeat->m_flSprintLerp = bound(0.0f, pSeat->m_flSprintLerp - clframetime, 1.0f);
}
sprint = 20 * pSeatLocal->m_flSprintLerp;
sprint = 20 * pSeat->m_flSprintLerp;
gun.angles[0] += sprint;
gun.angles[1] += sprint + (sprint * pViewBob->m_flBob) * 0.25f;
#ifdef WASTES
if (pSeat->m_ePlayer.gflags & GF_IS_HEALING) {
pSeatLocal->m_flHealLerp = bound(0.0f, pSeatLocal->m_flHealLerp + clframetime, 1.0f);
} else {
@ -135,6 +172,31 @@ Viewmodel_ApplyBob(entity gun)
gun.angles[0] += strength * sintime;
gun.angles[1] += strength * sintime;
gun.angles[2] += strength * sintime;
//gun.angles[2] += strength * sintime;
gun.origin += [0,0,-1];
makevectors(g_view.GetCameraAngle());
gun.origin += v_forward * cvar("cl_gunx");
gun.origin += v_right * cvar("cl_guny");
gun.origin += v_up * cvar("cl_gunz");
/* lower gun when moving */
if (pViewBob->m_flSpeed > 10.0) {
gun.origin += (v_up * -pViewBob->m_flSpeed * 0.005f);
gun.origin += (v_right * -pViewBob->m_flSpeed * 0.005f);
}
}
vector
Camera_AddCamBob(vector cameraAngle)
{
vector angmod = g_vec_null;
makevectors(cameraAngle);
angmod = (pViewBob->m_flBob2 * -v_up);
angmod += (pViewBob->m_flBob * -v_right);
return angmod;
}

1
base/src/progs.src Executable file → Normal file
View File

@ -1,2 +1,3 @@
#pragma sourcefile client/progs.src
#pragma sourcefile server/progs.src
#pragma sourcefile menu/progs.src

View File

@ -37,7 +37,7 @@ GameRules::LevelDecodeParms(NSClientPlayer pp)
pl.activeweapon = parm11;
pl.flags = parm64;
if (pl.flags & FL_CROUCHING) {
if (pl.vv_flags & VFL_CROUCHING) {
setsize(pl, VEC_CHULL_MIN, VEC_CHULL_MAX);
} else {
setsize(pl, VEC_HULL_MIN, VEC_HULL_MAX);

View File

@ -109,9 +109,6 @@ MultiplayerRules::ConsoleCommand(NSClientPlayer pp, string cmd)
tokenize(cmd);
switch (argv(0)) {
case "bot_add":
Bot_AddQuick();
break;
default:
return (0);
}
@ -129,4 +126,4 @@ Game_InitRules(void)
} else {
g_grMode = spawn(MultiplayerRules);
}
}
}

View File

@ -47,6 +47,7 @@ SingleplayerRules::PlayerSpawn(NSClientPlayer pl)
pl.viewzoom = 1.0;
pl.model = "models/player.mdl";
setmodel(pl, pl.model);
pl.AddEffects(EF_NOSHADOW);
setsize(pl, VEC_HULL_MIN, VEC_HULL_MAX);
pl.velocity = [0,0,0];

View File

@ -10,6 +10,7 @@
../../../src/shared/fteextensions.qc
../../../src/shared/defs.h
../../../src/server/defs.h
../../../src/botlib/botinfo.h
../../../src/gs-entbase/server.src
../../../src/gs-entbase/shared.src

View File

@ -1,15 +1,8 @@
#includelist
player.qc
weapon_common.h
weapons.h
flags.h
fx_explosion.qc
fx_spark.qc
fx_blood.qc
fx_breakmodel.qc
fx_corpse.qc
fx_gibhuman.qc
fx_impact.qc
weapons.qc
weapon_common.qc
#endlist

View File

@ -35,6 +35,7 @@ class player:NSClientPlayer
virtual void(float,float) ReceiveEntity;
virtual void(void) PredictPreFrame;
virtual void(void) PredictPostFrame;
virtual void(void) UpdateAliveCam;
#else
virtual void(void) EvaluateEntity;
virtual float(entity, float) SendEntity;
@ -42,6 +43,41 @@ class player:NSClientPlayer
};
#ifdef CLIENT
void Shake_Update(NSClientPlayer);
vector Camera_RunBob(vector);
vector Camera_StrafeRoll(vector);
vector Camera_AddCamBob(vector);
vector Camera_AddLean(vector);
void View_DisableViewmodel(void);
void
player::UpdateAliveCam(void)
{
vector cam_pos = GetEyePos();
g_view.SetCameraAngle(view_angles);
g_view.SetCameraOrigin(cam_pos + Camera_AddCamBob(view_angles) + Camera_AddLean(view_angles));
if (vehicle) {
NSVehicle veh = (NSVehicle)vehicle;
if (veh.UpdateView)
veh.UpdateView();
} else if (health) {
if (autocvar_pm_thirdPerson == TRUE) {
makevectors(view_angles);
vector vStart = [pSeat->m_vecPredictedOrigin[0], pSeat->m_vecPredictedOrigin[1], pSeat->m_vecPredictedOrigin[2] + 16] + (v_right * 4);
vector vEnd = vStart + (v_forward * -48) + [0,0,16] + (v_right * 4);
traceline(vStart, vEnd, FALSE, this);
g_view.SetCameraOrigin(trace_endpos + (v_forward * 5));
}
}
Shake_Update(this);
g_view.AddPunchAngle(punchangle);
}
/*
=================
player::ReceiveEntity

View File

@ -0,0 +1,268 @@
59
-496 -80 336.031 16.000000 2
1 464.000000 0
58 63.118530 0
-32 -80 336.031 48.000000 2
0 464.000000 0
2 196.116043 0
-32 -272 336 16.000000 2
1 196.116043 0
3 327.968750 0
-32 -272 48.0312 32.000000 3
2 327.968750 0
4 96.332756 0
25 260.461121 0
32 -344 48.0312 16.000000 3
3 96.332756 0
5 72.000000 0
25 320.898743 0
32 -416 48.0312 16.000000 3
4 72.000000 0
6 321.993774 0
47 448.000000 4
-256 -416 -95.9688 16.000000 3
5 321.993774 0
7 128.000000 0
9 324.863037 0
-256 -288 -95.9688 32.000000 3
6 128.000000 0
8 256.000000 0
9 265.932312 0
0 -288 -95.9688 32.000000 2
7 256.000000 0
9 72.000000 0
0 -216 -95.9688 16.000000 4
6 324.863037 0
7 265.932312 0
8 72.000000 0
10 72.000000 0
0 -144 -95.9688 16.000000 4
12 128.249756 0
21 96.332756 0
9 72.000000 0
11 113.701363 0
-88 -83 -95.9688 16.000000 6
16 264.484406 0
14 147.078217 0
21 80.399002 0
12 111.139549 0
24 68.818604 2
10 113.701363 0
8 -16 -95.9688 16.000000 5
10 128.249756 0
21 171.207474 0
13 115.377640 0
11 111.139549 0
24 104.000000 2
-88 48 -95.9688 16.000000 5
15 264.000000 0
19 456.000000 0
14 150.306351 0
12 115.377640 0
24 75.471855 2
-224 -16 -95.9688 32.000000 7
20 131.939377 0
13 150.306351 0
11 147.078217 0
24 141.760361 2
23 143.108353 6
16 146.860474 0
15 143.108353 0
-352 48 -95.9688 16.000000 4
13 264.000000 0
19 192.000000 0
23 90.509666 6
14 143.108353 0
-352 -88 -95.9688 16.000000 7
11 264.484406 0
17 146.860474 0
20 111.139549 0
22 132.181686 2
18 200.000000 0
14 146.860474 0
23 96.332756 0
-480 -16 -95.9688 16.000000 4
19 90.509666 0
16 146.860474 0
23 143.108353 6
22 71.554176 2
-544 -144 -95.9688 16.000000 4
20 288.000000 0
19 192.000000 0
22 96.000000 2
16 200.000000 0
-544 48 -95.9688 16.000000 4
13 456.000000 0
15 192.000000 0
17 90.509666 0
18 192.000000 0
-256 -144 -95.9688 16.000000 4
18 288.000000 0
16 111.139549 0
14 131.939377 0
48 293.720947 0
-96 -152 -95.9688 8.000000 3
10 96.332756 0
12 171.207474 0
11 80.399002 0
-480 -80 -63.9688 8.000000 1
23 146.642426 6
-352 -16 -31.9688 16.000000 4
14 143.108353 0
16 96.332756 0
15 90.509666 0
17 143.108353 0
-88 -16 -55.9688 8.000000 4
12 104.000000 0
13 75.471855 0
11 68.818604 0
14 141.760361 0
-288 -320 48.0312 32.000000 3
3 260.461121 0
4 320.898743 0
26 416.000000 0
-704 -320 48.0312 32.000000 4
25 416.000000 0
27 416.000000 0
30 640.000000 0
35 800.000000 0
-704 -736 48.0312 32.000000 7
26 416.000000 0
28 385.331024 0
30 224.000000 0
31 558.855957 0
34 257.992249 0
35 384.000000 0
29 390.609772 0
-320 -768 48.0312 32.000000 3
27 385.331024 0
29 202.385773 0
45 101.192886 0
-384 -960 48.0312 16.000000 5
28 202.385773 0
30 320.000000 0
36 160.000000 0
45 135.764496 0
27 390.609772 0
-704 -960 48.0312 48.000000 5
26 640.000000 0
27 224.000000 0
29 320.000000 0
34 320.000000 0
35 160.000000 0
-928 -1248 48.0312 32.000000 4
27 558.855957 0
32 163.168625 0
38 350.907410 0
34 481.065491 0
-960 -1408 48.0312 32.000000 2
31 163.168625 0
33 640.000000 0
-320 -1408 48.0312 32.000000 4
36 295.025421 0
37 275.274414 0
45 544.940369 0
32 640.000000 0
-960 -768 48.0312 32.000000 4
27 257.992249 0
30 320.000000 0
35 435.247070 0
31 481.065491 0
-704 -1120 48.0312 32.000000 5
26 800.000000 0
27 384.000000 0
30 160.000000 0
34 435.247070 0
37 204.899979 0
-384 -1120 48.0312 32.000000 3
29 160.000000 0
33 295.025421 0
45 273.408112 0
-544 -1248 48.0312 32.000000 2
33 275.274414 0
35 204.899979 0
-608 -1248 192.031 16.000000 2
31 350.907410 0
39 224.000000 0
-384 -1248 192.031 16.000000 4
38 224.000000 0
40 128.000000 0
41 416.000000 0
43 167.044907 0
-384 -1376 192.031 16.000000 2
39 128.000000 0
33 160.797836 2
-384 -832 192.031 16.000000 3
39 416.000000 0
42 384.000000 0
43 260.461121 0
-768 -832 192.031 16.000000 3
41 384.000000 0
34 248.386688 2
30 203.017105 2
-432 -1088 192.031 16.000000 3
39 167.044907 0
41 260.461121 0
44 65.969688 2
-496 -1088 176.031 32.000000 4
43 65.969688 0
30 275.738922 0
35 246.316772 0
27 428.429626 0
-288 -864 48.0312 16.000000 5
28 101.192886 0
29 135.764496 0
33 544.940369 0
36 273.408112 0
46 96.000000 4
-192 -864 48.0312 16.000000 2
47 224.000000 0
45 96.000000 0
32 -864 48.0312 16.000000 2
46 224.000000 0
5 448.000000 0
0 -144 48.0312 16.000000 4
49 96.000000 0
50 273.408112 0
51 265.932312 0
20 293.720947 0
0 -48 48.0312 32.000000 3
48 96.000000 0
50 256.000000 0
52 480.000000 0
-256 -48 48.0312 32.000000 4
48 273.408112 0
49 256.000000 0
51 108.811768 0
52 224.000000 0
-192 40 48.0312 16.000000 4
48 265.932312 0
50 108.811768 0
52 301.144470 0
56 266.413116 0
-480 -48 48.0312 32.000000 3
49 480.000000 0
50 224.000000 0
51 301.144470 0
-552 -80 192.031 16.000000 2
57 78.790863 0
58 163.712769 0
0 -48 192.031 32.000000 3
55 256.000000 0
56 101.192886 0
57 480.000000 0
-256 -48 192.031 32.000000 3
54 256.000000 0
57 224.000000 0
56 303.578644 0
32 48 192.031 16.000000 3
54 101.192886 0
51 266.413116 0
55 303.578644 0
-480 -48 192.031 32.000000 3
53 78.790863 0
54 480.000000 0
55 224.000000 0
-555.969 -78.9344 355.692 16.000000 2
0 63.118530 0
53 163.712769 0

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
// Vera Visions Material
{
program lightmapped
program lightmapped#MASK=0.5
surfaceParm alphashadow
diffusemap textures/measure/rail.tga
}

View File

@ -11,17 +11,21 @@ safe_copy()
radiant_build()
{
if [ "$SKIP_RADIANT" = "1" ]; then
exit 0
fi
./make_mapdef.sh "$1"
# copy files over to RADIANT
if [ ! -z "$RADIANT_PATH" ]
then
if [ -d "$RADIANT_PATH/gamepacks/games" ];
then
./make_mapdef.sh "$1"
mkdir -p "$RADIANT_PATH/gamepacks/$1.game/$1/"
safe_copy "./$1/radiant.game" "$RADIANT_PATH/gamepacks/games/$1.game"
safe_copy "./$1/entities.def" "$RADIANT_PATH/gamepacks/$1.game/$1/entities.def"
safe_copy "./$1/radiant.xml" "$RADIANT_PATH/gamepacks/$1.game/default_build_menu.xml"
exit
fi
fi
}
@ -34,7 +38,7 @@ fi
if [ "$BUILD_UPDATE" -eq 1 ]; then
if ! [ -x "$(command -v git)" ]; then
printf "'git' is not installed.\n"
exit
exit 1
fi
fi

View File

@ -4,7 +4,7 @@
ed_for_def()
{
printf -- "" > "/tmp/def_name"
printf -- "" > "/tmp/def_color"
printf -- "1 0 1" > "/tmp/def_color"
printf -- "" > "/tmp/def_mins"
printf -- "" > "/tmp/def_mins"
printf -- "" > "/tmp/def_maxs"
@ -15,54 +15,88 @@ printf -- "" > "/tmp/def_model"
do
SEG1=$(echo "$LINE" | awk '{ print $1 }')
SEG2=$(echo "$LINE" | awk '{ print $2 }')
KEY=$(echo "$LINE" | awk -F"\"" '{ print $2 }')
VAL=$(echo "$LINE" | awk -F"\"" '{ print $4 }')
KEY="$(echo "$LINE" | awk -F"\"" '{ print $2 }')"
VAL="$(echo "$LINE" | awk -F"\"" '{ print $4 }')"
if [ "$KEY" == "entityDef" ]
if [ "$KEY" = "entityDef" ]
then
printf -- "$VAL" > "/tmp/def_name"
fi
if [ "$SEG1" == "entityDef" ]
if [ "$SEG1" = "entityDef" ]
then
printf -- "$SEG2" > "/tmp/def_name"
fi
if [ "$KEY" == "editor_color" ]
if [ "$KEY" = "editor_color" ]
then
printf -- "$VAL" > "/tmp/def_color"
fi
if [ "$KEY" == "editor_mins" ]
if [ "$KEY" = "editor_mins" ]
then
printf -- "$VAL" > "/tmp/def_mins"
fi
if [ "$KEY" == "editor_maxs" ]
if [ "$KEY" = "editor_maxs" ]
then
printf -- "$VAL" > "/tmp/def_maxs"
fi
if [ "$KEY" == "editor_usage" ]
if [ "$KEY" = "mins" ]
then
if [ -z "$(cat /tmp/def_mins)" ]
then
printf -- "$VAL" > "/tmp/def_mins"
fi
fi
if [ "$KEY" = "maxs" ]
then
if [ -z "$(cat /tmp/def_maxs)" ]
then
printf -- "$VAL" > "/tmp/def_maxs"
fi
fi
if [ "$KEY" = "editor_usage" ]
then
printf -- "$VAL" > "/tmp/def_usage"
fi
if [ "$KEY" == "model" ]
if [ "$KEY" = "netname" ]
then
if [ -z "$(cat /tmp/def_usage)" ]
then
printf -- "$VAL" > "/tmp/def_usage"
fi
fi
if [ "$KEY" = "editor_model" ]
then
printf -- "$VAL" > "/tmp/def_model"
fi
if [ "$SEG1" == "}" ]
if [ "$KEY" = "model" ]
then
KEY_NAME=$(cat "/tmp/def_name")
KEY_COLOR=$(cat "/tmp/def_color")
KEY_MINS=$(cat "/tmp/def_mins")
KEY_MAXS=$(cat "/tmp/def_maxs")
KEY_USAGE=$(cat "/tmp/def_usage")
KEY_MODEL=$(cat "/tmp/def_model")
if [ -z "$(cat /tmp/def_model)" ]
then
printf -- "$VAL" > "/tmp/def_model"
fi
fi
if [ "$SEG1" = "}" ]
then
KEY_NAME="$(cat /tmp/def_name)"
KEY_COLOR="$(cat /tmp/def_color)"
KEY_MINS="$(cat /tmp/def_mins)"
KEY_MAXS="$(cat /tmp/def_maxs)"
KEY_USAGE="$(cat /tmp/def_usage)"
KEY_MODEL="$(cat /tmp/def_model)"
# reset defaults
printf -- "" > "/tmp/def_name"
printf -- "" > "/tmp/def_color"
printf -- "1 0 1" > "/tmp/def_color"
printf -- "" > "/tmp/def_mins"
printf -- "" > "/tmp/def_mins"
printf -- "" > "/tmp/def_maxs"

109
make_radiantshader.sh Executable file
View File

@ -0,0 +1,109 @@
#!/bin/sh
# Converts .mat files in a gamedir
# to a bunch of .shader files.
# It also overwrites scripts/shaderlist.txt
# So don't mix environments!
ROOT_DIR="$(pwd)"
LEGACY_OUT="$ROOT_DIR/$1/scripts"
SHADERLIST="$ROOT_DIR/$1/scripts/shaderlist.txt"
mkdir -p "$LEGACY_OUT"
echo "Dumping all ..mat files into one..."
if [ -f "$SHADERLIST" ]
then
rm "$SHADERLIST"
fi
# scan a dir inside textures/???/
scan_dir()
{
SHADER_FILE="$LEGACY_OUT/$1.shader"
cd "$1"
MAT_COUNT=$(ls | grep \.mat | wc -l | tr -d '\n')
echo "...$MAT_COUNT .mat files counted"
if [ "$MAT_COUNT" -eq 0 ]
then
exit
fi
echo "// THIS FILE HAS BEEN AUTOMATICALLY GENERATED!" > "$SHADER_FILE"
echo "// Please refer to the original documentation." >> "$SHADER_FILE"
echo "// This shader is for development purposes ONLY." >> "$SHADER_FILE"
echo "" >> "$SHADER_FILE"
find * -type f -name '*.mat'| while read SHADER_N; do
BASENAME=$(echo "$SHADER_N" | cut -d '.' -f 1)
NAME="textures/$1/$BASENAME"
echo "$NAME" >> "$SHADER_FILE"
cat "$SHADER_N" >> "$SHADER_FILE"
sed -i 's|$diffusemap|'"${NAME}".tga'|g' "$SHADER_FILE"
done;
#echo "Stripping GLSL parameters..."
sed -i '/Vera Visions Material/d' "$SHADER_FILE"
sed -i 's/.mat//g' "$SHADER_FILE"
sed -i '/if $programs/','/else/d' "$SHADER_FILE"
sed -i '/endif/d' "$SHADER_FILE"
sed -i '/nodraw2/d' "$SHADER_FILE"
sed -i '/program /d' "$SHADER_FILE"
sed -i '/normalmap/d' "$SHADER_FILE"
sed -i '/alphaGen portal/d' "$SHADER_FILE"
sed -i '/deformVertexes autoSprite/d' "$SHADER_FILE"
#echo "Replacing diffusemap calls with qer_editorimage..."
sed -i 's/diffusemap /qer_editorimage /g' "$SHADER_FILE"
#echo "Swapping DDS references with TARGA..."
sed -i 's/.dds/.tga/g' "$SHADER_FILE"
sed -i 's/$rt:base/textures\/dev\/rtsurface.tga/g' "$SHADER_FILE"
sed -i 's/.shader//g' "$SHADER_FILE"
echo "$1" >> "$SHADERLIST"
echo "...written $SHADER_FILE"
}
# iterate over all 'categories' inside textures/
scan_textures()
{
NEW_ROOT="$(pwd)/$1/textures"
cd "$NEW_ROOT"
ls | while read TEXTURE_DIR
do
cd "$NEW_ROOT"
if [ -d "$TEXTURE_DIR" ]
then
echo "Texture dir: $TEXTURE_DIR ($1)"
scan_dir "$TEXTURE_DIR" "$LEGACY_OUT"
fi
done
}
#mkdir -p "$(dirname "$LEGACY_OUT")"
# Start with any possible pk3dirs
find "$1" -type d -name '*.pk3dir'| while read PKDIR; do
cd "$ROOT_DIR"
if [ -d "$PKDIR/textures/" ]
then
scan_textures "$PKDIR"
fi
done
cd "$ROOT_DIR"
# Then look into the loose dir
if [ -d "$1/textures" ]
then
scan_textures "$1"
fi

View File

@ -53,11 +53,9 @@ varying mat3 invsurface;
tex_c = v_texcoord;
gl_Position = ftetransform();
#ifdef SCROLL
/* HACK: func_conveyor needs us to scroll this surface! */
if (e_glowmod.g == 0.5)
tex_c[0] += (e_time * (e_glowmod.b * 1024.0)) * -0.01;
#endif
#ifdef REFLECTCUBE
invsurface[0] = v_svector;

View File

@ -0,0 +1,56 @@
//======= Copyright (c) 2015-2020 Vera Visions LLC. All rights reserved. =======
//
// Purpose:
//
// Non-lit surface that predominantly offers environment cube reflection
// modulated by the diffusemap's RGB. This is used for glass, for example.
//==============================================================================
!!ver 110
!!permu FOG
!!samps diffusemap=0 normalmap=1 reflect=2
#include "sys/defs.h"
varying vec2 tex_c;
varying vec3 eyevector;
varying mat3 invsurface;
varying vec4 tf;
#ifdef VERTEX_SHADER
void main ()
{
tex_c = v_texcoord;
invsurface[0] = v_svector;
invsurface[1] = v_tvector;
invsurface[2] = v_normal;
vec3 eyeminusvertex = e_eyepos - v_position.xyz;
eyevector.x = dot( eyeminusvertex, v_svector.xyz );
eyevector.y = dot( eyeminusvertex, v_tvector.xyz );
eyevector.z = dot( eyeminusvertex, v_normal.xyz );
tf = ftetransform();
gl_Position = tf;
}
#endif
#ifdef FRAGMENT_SHADER
#include "sys/fog.h"
void main ()
{
vec2 stc;
vec3 out_f;
vec4 diffuse_f = texture2D(s_diffusemap, tex_c);
vec3 norm_f;
norm_f = ( texture2D( s_normalmap, tex_c + vec2( e_time * 0.01, 0.0 ) ).xyz);
norm_f += ( texture2D( s_normalmap, tex_c - vec2( 0, e_time * 0.01 ) ).xyz);
norm_f -= 1.0 - ( 4.0 / 256.0 );
norm_f = normalize( norm_f );
stc = (1.0 + (tf.xy / tf.w)) * 0.5;
diffuse_f.rgb = texture2D(s_reflect, stc + norm_f.st).rgb;
gl_FragColor = diffuse_f;
}
#endif

View File

@ -180,6 +180,12 @@ varying vec3 norm;
discard;
#endif
#if r_skipDetail == 0
#if defined(UPPERLOWER)
diffuse_f.rgb *= (texture2D(s_upper, tex_c * 4.0).rgb + 0.5);
#endif
#endif
#ifdef FAKESHADOWS
diffuse_f.rgb *= ShadowmapFilter(s_shadowmap, vtexprojcoord);
#endif
@ -234,13 +240,6 @@ varying vec3 norm;
if (alpha > 1.0)
alpha = 1.0;
#if r_skipDetail == 0
#if defined(UPPERLOWER)
diffuse_f.rgb *= (texture2D(s_upper, tex_c * 4.0).rgb + 0.5);
#endif
#endif
gl_FragColor = vec4(fog3(diffuse_f.rgb), alpha);
}
#endif

View File

@ -0,0 +1,36 @@
//======= Copyright (c) 2023 Vera Visions LLC. All rights reserved. =======
//
// Purpose:
//
// Unlit surface.
//==============================================================================
!!ver 110
!!permu FOG
!!samps diffuse
#include "sys/defs.h"
#include "sys/fog.h"
varying vec2 tex_c;
#ifdef VERTEX_SHADER
void main ()
{
tex_c = v_texcoord;
gl_Position = ftetransform();
}
#endif
#ifdef FRAGMENT_SHADER
void main ()
{
vec4 d_f = vec4(1.0, 1.0, 1.0, 1.0) - texture2D( s_diffuse, tex_c );
if (d_f.a > 0.5) {
discard;
}
gl_FragColor = fog4( d_f );
}
#endif

View File

@ -21,6 +21,7 @@
!!cvardf r_skipNormal
!!cvardf r_skipEnvmap
!!cvardf r_skipLightmap
!!cvardf r_showEnvCubemap
!!permu FAKESHADOWS
!!cvardf r_glsl_pcf
@ -123,10 +124,16 @@ varying mat3 invsurface;
#if defined(BUMP) && r_skipEnvmap==0
vec3 cube_c;
float refl = 1.0 - texture2D(s_normalmap, tex_c).a;
cube_c = reflect(normalize(eyevector), normal_f.rgb);
cube_c = reflect(normalize(eyevector), norm);
cube_c = cube_c.x * invsurface[0] + cube_c.y * invsurface[1] + cube_c.z * invsurface[2];
cube_c = (m_model * vec4(cube_c.xyz, 0.0)).xyz;
#if r_showEnvCubemap == 0
diff_f.rgb += textureCube(s_reflectcube, cube_c).rgb * refl;
#else
diff_f.rgb = textureCube(s_reflectcube, cube_c).rgb;
#endif
#endif
#if defined(FULLBRIGHT) && r_skipFullbright==0

View File

@ -0,0 +1,4 @@
entityDef bot
{
"spawnclass" "NSBot"
}

View File

@ -0,0 +1,4 @@
entityDef player
{
"spawnclass" "NSClientPlayer"
}

View File

@ -0,0 +1,26 @@
entityDef info_player_start
{
"editor_mins" "-16 -16 -36"
"editor_maxs" "16 16 36"
"editor_description" "Singleplayer Spawn Point"
"editor_color" "1 0 0"
"spawnclass" "NSSpawnPoint"
}
entityDef info_player_deathmatch
{
"editor_mins" "-16 -16 -36"
"editor_maxs" "16 16 36"
"editor_description" "Deathmatch Spawn Point"
"editor_color" "1 0 0"
"spawnclass" "NSSpawnPoint"
}
entityDef info_player_coop
{
"editor_mins" "-16 -16 -36"
"editor_maxs" "16 16 36"
"editor_description" "Cooperative Spawn Point"
"editor_color" "1 0 0"
"spawnclass" "NSSpawnPoint"
}

View File

@ -7,4 +7,9 @@ debugcone
alphaGen vertex
blendFunc blend
}
}
trigger
{
surfaceParm nodraw
}

View File

@ -0,0 +1,7 @@
{
{
map "gfx/playericon.tga"
rgbGen vertex
blendFunc blend
}
}

Binary file not shown.

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/ambient_generic.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/env_cubemap.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/env_explosion.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/env_global.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/env_laser.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/env_message.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/env_shake.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/env_spark.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/env_sprite.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/env_sun.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/game_counter.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/info_intermission.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/info_landmark.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/info_node.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/info_node_air.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/info_notnull.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/info_null.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/info_player_deathmatch.tga
{
map $diffuse
alphaFunc GE128
}
}

Some files were not shown because too many files have changed in this diff Show More