Commit e117c0dc authored by dylan's avatar dylan Committed by Dylan Grafmyre
Browse files

readme some thoughts

parent a00ed24b
ttt_terrorcon
=============
Ridiculous airbus hosting a gmod ttt convention.
Getting Started
---------------
Working with hl2, gmod, steam, and windows.
Environment Requirements
compile bsp:
- Windows
- Steam
- Garrysmod
- Counter Strike: Source
- git-bash
- gnu make (winmake)
- python3
create texture:
- gimp or other
- vtfedit
- vim or texteditor
create a static model:
- blender
- blender source tools (smd export)
Build Environment Setup Notes
.............................
- the project checkout was authored in a prefix with no spaces
- a python virtual environment is used to provide the pyvmf library to the
build toolchain. this library is based entirely on the stdlib with no
external dependencies
.. code::
# from project root (ttt_terrorcon/)
python3 -m venv env
./env/scripts/python -m pip install -e .
- the normal make target recommended is 'all'
.. code::
make all
- useful make targets
.. code::
# build the bsp in fast mode and skip all hl2.exe compilation steps,
# run the game on the map as if it were a stand-alone gmod addon
# this is helpful for testing changes to the vmf file
make -B ttt_terrorcon_v2_fast.game-mount
# simmilar as above with full hdr lightin (and build cube maps)
make -B ttt_terrorcon_v2_hdr_final.{cubehdr,game-mount}
- building nav appears to always remake, probably this is a cyclic-issue where
generating the .nav file alters the .bsp file and therefore invalidates the
.nav file in gnu make
- is building the nav fails, a crude 15-min itmeout is used to determine the
failure, more sophisticated ipc is desired
Engine Setup Notes
..................
- css needs to be mounted in garrysmod/cfg/mount.cfg
- use the hammer bin in the normal non-beta gmod install Garrysmod/bin/hammer.exe
- configure hammer, add the ttt cfg garrysmod/gamemodes/terrortown.fgd
- gimp created jpeg's are incompatible with gmpublish, be sure to open and save
with mspaint to make them compatible
Modeling Setup Notes
....................
- use the decimate modifier + triangulate modifier as the last step of all ref
(visual) models, hl2.exe does not handle polygons correctly, all pologons
must be triangualted.
- be sure to convex-hull each seperate mesh object that composites a phys
(collision) model and then triangulate.
- it can be helpful to name the blender materials to match the hl2.exe material
name (this is mandatory) and then load the materials vtfedit import format
(normally tga) as the blender materials albedo/base color's image texture.
this helps preview uv maps (or edit them with texture paint) in blender.
Settle Physics Notes
....................
- vfm documents must be located in garrysmod/mapsrc (not mapsssrc)
- bsp documents must have the same basename as the vmf and be located in
garrysmod/maps
- hammer (garrysmod/bin/hammer.exe) must be open with the vmf document before
map_edit console command is used.
the make task '%52.setphys' will automatically setup and settle the physics,
but saving the map with hammer is left as a manual step, a n interactive rm
prompt is left in the make file so that after the map is saved, the operator
can confirm the removal of the working file by entering 'y' and '<enter>', the
remainder of the build will resume normally.
Custom Tools
------------
The following tools were created to work around limitations of hl2, gmod,
steam, and windows.
.. list-table::
:header-rows: 1
- - relpath
- description
- - contrib/
- a collection of non-essential programs which aid developers
- - contrib/blender-render-model
- automate the blender process: blend -> SMD -> MDL
- - contrib/bspzip-all
- automate the bsppack process
- - contrib/bspzip-lint
- report issues with the bzppack database
- - contrib/epoll-then
- poll a file, when the document matches a reference, run a command
- - contrib/gen-bspzip-addlist
- generate a bspzip-addlist file from a vmf file
- - contrib/gma-install-bspzip-addlist
- convert standard bsp zip to gma content where content is illigal in
gmod
- - contrib/gmad-tar
- create a gma file and matching tar file, gma format isn't portable
- - contrib/j2
- format a string using jinja2 (named replacement), fancier than
sprintf
- - contrib/mount
- garrysmod/cfg/mount.cfg cli interface
- - contrib/prefab-gen-cargo.py
- generate vmf fragments
- - contrib/prefab-gen-cargo_bak.py
- generate vmf fragments
- - contrib/prefab-gen-entity-array.py
- generate vmf fragments
- - contrib/shlex
- translate a windows-managled argv into a heuristically
reconstructed argv and escape correctly for windows
- - contrib/supervise-v
- supervise vbins, report issues, and fail if the input-output file
remains unchanged
- - contrib/vmt-lint
- report issues with a vmf database
- - contrib/winpgrep
- poor-mans pgrep for windows, note under high load, "tasklist" is
prohibitivy slow
Project Files
-------------
Descriptions of the files here
.. list-table::
:header-rows: 1
- - relpath
- description
- - addons-src/
- filesystem folder managed by the build tool used to create gma
files
- - contrib/
- a collection of non-essential programs which aid developers
- - lua/
- lua scripts, normallys these are injected into gmod to automate
parts of the hl2.exe bsp compilation process. note, gmod does not
mount lua/ like other hl2.exe engine content
- - maps/.git-keep
- when using dev-mount, bsp files must be loaded here for gmod to
locate them
- - materials-src/
- source files for materials/
- - materials/
- hl2.exe formatted texture files, when using dev-mount accessible in
hammer
- - models-src/
- sources files for models/
- - models/
- hl2.exe formamated 3d spatial files, using using dev-mount
accessible in hammer
- - prefabs/
- vmf snippets
- - pyvmf/
- python library for interacting with hl2.exe engine file formats
- - pyvmf/bsp.py
- load data out of binary bsp files
- - pyvmf/cfg.py
- work with valve cfg file format
- - pyvmf/mdl.py
- load data from binary mdl files
- - pyvmf/rcon.py
- work with binary rcon documents
- - pyvmf/vmf.py
- load data from vmf documents
- - pyvmf/vmt.py
- load data from vmt documents
- - %52.bspzip-addlist
- bsppack input file for adding custom content to a bsp document.
note, gmod prohibits loading any hl2.exe engine content except
cubemaps from this named data set.
- - ttt_terrorcon_v2.vmf
- the source vmf document for this project
- - workarounds/
- frustatingly bad work-arounds used to automate otherwise
unautomatble processes
- - workarounds/buildcubemaps.ahk
- type 'buildcubemaps;quit', assumedly hl2.exe is running and has a
map loaded when this is run. note: gmod lua is prohibited from
running 'buildcubemaps'
- - workarounds/setphys.ahk
- type `hammer_update_entity prop_physics;hammer_update_entity
prop_physics_multiplayer;quit`, assumedly hl2.exe is running and
has map_edit loaded when this is run
custom content in hammer
------------------------
[obsolete] before the use of 'make dev-mount' and 'make
ttt_terrorcon_v2_hdr_final.game-mount', this document was authored.
option 1 - edit mount.cfg, add path to this repo
# Garrys Mod\garrysmod\cfg\mount.cfg
......@@ -17,7 +248,7 @@ option 2 - copy resources into garrysmod
models
materials
./path-to/Garrys Mod/garrysmod/
option 3 - build release
......@@ -30,7 +261,17 @@ option 3 - build release
modeling notes
--------------
[obsolete] before a reference 1m vmf cube and reference 1m blender/qc cube were
compared, this value was used. Presently the scale value "52.49" is
recommended.
one blender unit == 1 meter:
# *.qc
$scale = 19.680119
tips
----
when trying to solve complex logic programs in hammer, lay out your problem in 2d with nodes like a spreadsheet, I find this helpful.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment