Makefile: manage targets netradiant-custom and add NRC gamepack integration.

This commit is contained in:
Marco Cawthorne 2025-01-24 15:02:23 -08:00
parent 10697cfb7a
commit 041d2ed2bb
3 changed files with 267 additions and 12 deletions

82
BUILDING Normal file
View file

@ -0,0 +1,82 @@
# Building Manual
## Introduction
The Makefile (tested with GNU Make) contains an assortment of targets
that will make building of assets and code into the game easier.
Here we will discuss the various targets mentioned, you can build
any of them at any time (dependencies should resolve themselves)
using the usual `make` syntax:
make _target_ GAME=id1
Where `_target_` is to be substituted with a valid target.
The `GAME=` override decides which game directory to target.
Generally, you want to make a copy of either `id1`, `qw` or `data1`,
name it something original (say `foobar`) and then you would
pass `GAME=foobar` instead of `GAME=id1`.
If the GAME variable isn't passed, `id1` is assumed.
## Targets
### help
Will display some short help information on important targets
that are available.
### all
Build all of the code, models, maps, textures and 2D graphics for
a given game.
### pak
Will build pak0.pak and pak1.pak files (shareware and registered archives) for your
game. Ensure you use the right Precache_* APIs so the tool knows which data belongs
to shareware and which to registered versions of your game.
### wad
Builds all texture wads for a given game.
### maps
Builds all the maps (and texture wads) for a given game.
### GAME/maps/mapname.bsp
Will compile GAME/maps/mapname.bsp. So if you were to run `make id1/maps/start.bsp`, that would be valid - as long as `id1/mapsrc/start.map` was to exist.
### models
Builds all models for a given game using FTEQW's iqmtool.
### defs
Builds an entities.def file for use in QED/Radiant and integrates it.
### gfx
Builds all the 2D graphics (menu mainy) for a given game.
### palette
Rebuilds the palette for the given game. Reads from GAME/gfxsrc/palette.png and will ensure to build a new palette.lmp for use in the engine, as well as a colormap.lmp for software renderers as well as a palette.pal for use in WorldCraft based editors.
### update
Updates ThirdParty repos.
### radiant
Builds GtkRadiant and integrates it with a launcher: ./radiant
### launcher
Builds a launcher for your game. Will accept command-line arguments and will execute a config
file with your username if present. This way developers can stay out of each others way, even
on a non-versioned filesystem.

186
Makefile
View file

@ -16,7 +16,12 @@ RADIANT_XLINK="$(NUCLIDE_DIR)/ThirdParty/gtkradiant/install/installs/$(NAME)Pack
RADIANT_SYNAPSE="$(NUCLIDE_DIR)/ThirdParty/gtkradiant/install/installs/$(NAME)Pack/game/synapse.config"
RADIANT_PROJECT="$(NUCLIDE_DIR)/ThirdParty/gtkradiant/install/installs/$(NAME)Pack/install/$(GAME)/scripts/default_project.proj"
RADIANT_TEXTURES="$(NUCLIDE_DIR)/ThirdParty/gtkradiant/install/installs/$(NAME)Pack/install/$(GAME)/textures"
ENTITY_DEF="$(NUCLIDE_DIR)/ThirdParty/gtkradiant/install/installs/$(NAME)Pack/install/$(GAME)/scripts/entities.def"
RADIANT_DEF="$(NUCLIDE_DIR)/ThirdParty/gtkradiant/install/installs/$(NAME)Pack/install/$(GAME)/scripts/entities.def"
NRC_GAME="$(NUCLIDE_DIR)/ThirdParty/netradiant-custom/install/gamepacks/games/$(NAME).game"
NRC_GAMEDIR="$(NUCLIDE_DIR)/ThirdParty/netradiant-custom/install/gamepacks/$(NAME).game/$(GAME)/"
NRC_DEF="$(NRC_GAMEDIR)/entities.ent"
NRC_SYNAPSE="$(NRC_GAMEDIR)/../default_build_menu.xml"
EDITOR_QBSP="$(ARGSTR)TEMPLATEenginepath/qbsp"
EDITOR_QVIS="$(ARGSTR)TEMPLATEenginepath/qvis"
@ -53,10 +58,10 @@ pak: game qfiles
run: fteqw game
./fteqw -basedir `pwd` -netquake -game $(GAME)
wad: imgtool palette
wads: imgtool palette
./Tools/build_wads.sh $(GAME)
maps: wad
maps: wads
./Tools/build_maps.sh $(GAME)
$(GAME)/maps/%.bsp: qbsp qrad qvis
@ -65,9 +70,6 @@ $(GAME)/maps/%.bsp: qbsp qrad qvis
models: iqmtool palette
./Tools/build_models.sh $(GAME)
edef:
Tools/make_mapdef.sh $(GAME)
gfx: imgtool palette
cd $(GAME)/gfxsrc/ && ls | grep -v palette\.lmp | grep \.xcf | xargs ../../imgtool --rgb8 --ext png
cd $(GAME)/gfxsrc/ && ls | grep -v palette\.png | grep \.png | xargs mogrify -type TrueColor -compress None -flip -format tga
@ -142,13 +144,22 @@ qrad:
radiant: update
if [ ! -d ThirdParty/gtkradiant ];then git clone https://github.com/TTimo/gtkradiant ThirdParty/gtkradiant;fi
cd ThirdParty/gtkradiant && scons
cd ./ThirdParty/gtkradiant && scons target="radiant"
mkdir -p ./ThirdParty/gtkradiant/install/games
mkdir -p ./ThirdParty/gtkradiant/install/installs
Tools/make_launcher.sh ./ThirdParty/gtkradiant/install/ ./radiant.bin radiant
netradiant-custom:
if [ ! -d ThirdParty/netradiant-custom ];then git clone https://github.com/Garux/netradiant-custom ThirdParty/netradiant-custom;fi
cd ThirdParty/netradiant-custom && $(MAKE) DOWNLOAD_GAMEPACKS=no BUILD=debug RADIANT_ABOUTMSG="NuclideLite managed build."
mkdir -p ./ThirdParty/netradiant-custom/install/gamepacks/games
Tools/make_launcher.sh ./ThirdParty/netradiant-custom/install/ ./radiant.x86_64 netradiant-custom
launcher:
Tools/make_launcher.sh "./" "./fteqw -readonly -basedir ./ -netquake -game $(GAME) +exec $(USER).cfg" $(GAME).sh
radiant-game: radiant edef
defs: radiant netradiant-custom
Tools/make_mapdef.sh $(GAME)
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>" > "$(RADIANT_GAME)"
echo "<game" >> "$(RADIANT_GAME)"
echo " name=\"$(NAME)\"" >> "$(RADIANT_GAME)"
@ -192,7 +203,7 @@ radiant-game: radiant edef
echo "wad" >> "$(RADIANT_SYNAPSE)"
echo "</api></client></synapseconfig>" >> "$(RADIANT_SYNAPSE)"
mkdir -p "$(NUCLIDE_DIR)/ThirdParty/gtkradiant/install/installs/$(NAME)Pack/install/$(GAME)/scripts"
cp "$(GAME)/scripts/entities.def" "$(ENTITY_DEF)"
cp "$(GAME)/scripts/entities.def" "$(RADIANT_DEF)"
echo "<?xml version=\"1.0\"?>" > "$(RADIANT_PROJECT)"
echo "<!DOCTYPE project SYSTEM \"dtds/project.dtd\">" >> "$(RADIANT_PROJECT)"
echo "<project>" >> "$(RADIANT_PROJECT)"
@ -214,3 +225,160 @@ radiant-game: radiant edef
mkdir -p "$(HOME)/.$(GAME)/$(GAME)/scripts"
rsync -rva "$(NUCLIDE_DIR)/ThirdParty/gtkradiant/install/installs/$(NAME)Pack/install/$(GAME)/." "$(HOME)/.$(GAME)/$(GAME)/."
rsync -rva "$(NUCLIDE_DIR)/ThirdParty/gtkradiant/install/installs/$(NAME)Pack/install/$(GAME)/." "./$(GAME)/."
mkdir -p "$(NRC_GAMEDIR)"
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>" > "$(NRC_GAME)"
echo "<game" >> "$(NRC_GAME)"
echo " type=\"q1\"" >> "$(NRC_GAME)"
echo " name=\"$(NAME)\"" >> "$(NRC_GAME)"
echo " enginepath_linux=\"c:$(NUCLIDE_DIR)\"" >> "$(NRC_GAME)"
echo " enginepath_win32=\"c:$(NUCLIDE_DIR)\"" >> "$(NRC_GAME)"
echo " engine_win32=\"fteqw.exe\"" >> "$(NRC_GAME)"
echo " engine_linux=\"fteqw\"" >> "$(NRC_GAME)"
echo " basegame=\"$(GAME)\"" >> "$(NRC_GAME)"
echo " basegamename=\"$(NAME)\"" >> "$(NRC_GAME)"
echo " unknowngamename=\"Custom Quake modification\"" >> "$(NRC_GAME)"
echo " default_scale=\"1.0\"" >> "$(NRC_GAME)"
echo " no_patch=\"1\"" >> "$(NRC_GAME)"
echo " no_bsp_monitor=\"1\"" >> "$(NRC_GAME)"
echo " show_wads=\"1\"" >> "$(NRC_GAME)"
echo " archivetypes=\"pak wad\"" >> "$(NRC_GAME)"
echo " texturetypes=\"tga jpg mip hlw\"" >> "$(NRC_GAME)"
echo " modeltypes=\"mdl\"" >> "$(NRC_GAME)"
echo " maptypes=\"mapq1\"" >> "$(NRC_GAME)"
echo " shaders=\"quake3\"" >> "$(NRC_GAME)"
echo " entityclass=\"quake3\"" >> "$(NRC_GAME)"
echo " entityclasstype=\"def xml\"" >> "$(NRC_GAME)"
echo " entities=\"quake3\"" >> "$(NRC_GAME)"
echo " brushtypes=\"quake\"" >> "$(NRC_GAME)"
echo " patchtypes=\"quake3\"" >> "$(NRC_GAME)"
echo "/>" >> "$(NRC_GAME)"
cp "$(GAME)/scripts/entities.def" "$(NRC_DEF)"
echo "<?xml version=\"1.0\"?>" > $(NRC_SYNAPSE)
echo "<project version=\"2.0\">" >> $(NRC_SYNAPSE)
echo " <var name=\"bsp\">\"[EnginePath]qbsp\"</var>" >> $(NRC_SYNAPSE)
echo " <var name=\"vis\">\"[EnginePath]qvis\"</var>" >> $(NRC_SYNAPSE)
echo " <var name=\"light\">\"[EnginePath]qrad\"</var>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp -onlyents\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] -onlyents \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qvis\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qvis -fast\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] -fast \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qvis -noambient\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] -noambient \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qvis -noambient -fast\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] -noambient -fast \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qrad\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qrad -extra\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] -extra \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qrad -extra4x4\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] -extra4x4 \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qrad\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qrad -extra\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] -extra \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qrad -extra4x4\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] -extra4x4 \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis, qrad\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] \"[MapFile]\"</command> </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis, qrad -extra\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] -extra \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis, qrad -extra4x4\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] -extra4x4 \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis -fast\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] -fast \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis -fast, qrad\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] -fast \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis -fast, qrad -extra\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] -fast \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] -extra \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis -fast, qrad -extra4x4\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] -fast \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] -extra4x4 \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis -noambient\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] -noambient \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis -noambient, qrad\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] -noambient \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis -noambient, qrad -extra\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] -noambient \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] -extra \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis -noambient, qrad -extra4x4\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] -noambient \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] -extra4x4 \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis -noambient -fast\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] -noambient -fast \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis -noambient -fast, qrad\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] -noambient -fast \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] \"[MapFile]\"</command> </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis -noambient -fast, qrad -extra\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] -noambient -fast \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] -extra \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo " <build name=\"qbsp, qvis -noambient -fast, qrad -extra4x4\">" >> $(NRC_SYNAPSE)
echo " <command>[bsp] \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[vis] -noambient -fast \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " <command>[light] -extra4x4 \"[MapFile]\"</command>" >> $(NRC_SYNAPSE)
echo " </build>" >> $(NRC_SYNAPSE)
echo "</project>" >> $(NRC_SYNAPSE)

11
README
View file

@ -1,4 +1,4 @@
Nuclide-Vanilla
Nuclide-Lite
This is a tiny pet project that will offer you a bit of Nuclide
for the most barebone Quake engine on planet Earth: Quake.
@ -12,7 +12,7 @@ such as the Dreamcast without doing any heavy engine modifications.
Games can then query a very simple API and get started making games rather quickly!
There are 3 sample directories. Each has a different engine/protocol target:
q1 = Quake, qw = QuakeWorld, h2 = Hexen II.
id1 = Quake, qw = QuakeWorld, data1 = Hexen II.
Copy the base you'd like to target. If you need to switch targets later down the
line simply either this to your progs.src:
@ -24,5 +24,10 @@ This will make Nuclide target those protocol standards instead.
Games should ideally not break. Nuclide tries its best to ensure the code
builds, but the behaviour may be slightly different between the targets.
Read BUILDING for details on how to make use of the Makefile switches
available in the project.
Hope you enjoy,
Marco
Marco Cawthorne
Vera Visions, LLC