Skip to content

dibollinger/amcduke32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AMCDuke32 - Fork of EDuke32 for "The AMC Squad"

About

AMCDuke32 is a fork of the eduke32 engine, created for the game "AMC Squad". EDuke32 is based on the Duke Nukem 3D source, which was built on the Build engine by Ken Silverman, released under the Build license.

The main purpose of the fork is to raise engine limits and alter hardcoded game behaviour, to allow for greater flexibility with developing AMC Squad. It also adds a number of CON script commands that enable modification of features not available in base eduke32.

Note that, since AMC Squad makes extensive use of eduke32 modding features, much like Ion Fury and Ion Fury Aftershock, it will not be compatible with Raze.

The original eduke32 source port was created by Richard "TerminX" Gobeille. Its repository is hosted at:

https://voidpoint.io/terminx/eduke32

The AMC Squad

"The AMC Squad" is a free, story-driven first-person shooter built on the Build engine. It currently features four episodes, each episode spanning 8+ hours of gameplay. The story centers around the titular AMC Squad, a paramilitary group which is established after the EDF's number one agent disappeared without a trace.

The group attempts to defend Earth against threats of extraordinary nature, but soon realize that they may have inadvertently made things much worse...

The gameplay is mixture of classic FPS gameplay with a variety of modern features. The levels are arranged in a mission-based structure, which takes the player across a large variety of locations and themes.

The game is free and standalone, and can be downloaded at:

https://www.moddb.com/games/the-amc-tc

https://amcsquad.itch.io/game

Installation

Windows builds for the latest engine revisions can be found in the releases page, along with older versions for use with previous releases of the game. Note that you should always use the tagged release build for specific versions.

The latest engine revision will also be packaged together with the download of the game itself.

We provide binaries for Linux, compiled on Ubuntu 22.04. However, for optimal compatibility, we recommend compiling the binary from source, using the instructions given below.

The engine can in principle be compiled for Mac, but the game is currently untested on this OS.

Building from Source

Required packages:

 * Basic dev environment (GCC >= 4.8, GNU make, etc)
 * SDL2 >= 2.0 (SDL >= 1.2.10 also supported with SDL_TARGET=1)
 * SDL2_mixer >= 2.0 (SDL_mixer >= 1.2.7 also supported with SDL_TARGET=1)
 * NASM (highly recommended for i686/32-bit compilation to speed up 8-bit classic software renderer)
 * libGL and libGLU (required for OpenGL renderers)
 * libgtk+ >= 2.8.0 (required for the startup window)
 * libvorbis >= 1.1.2 (libvorbisfile, libogg)
    libvorbisfile
    libogg
 * libFLAC >= 1.2.1
 * libvpx >= 0.9.0

On Debian / Ubuntu

sudo apt-get install build-essential nasm libgl1-mesa-dev libglu1-mesa-dev libsdl1.2-dev libsdl-mixer1.2-dev libsdl2-dev libsdl2-mixer-dev flac libflac-dev libvorbis-dev libvpx-dev libgtk2.0-dev freepats

On Fedora 22-25

sudo dnf groupinstall "Development Tools"
sudo dnf install g++ nasm mesa-libGL-devel mesa-libGLU-devel SDL2-devel SDL2_mixer-devel alsa-lib-devel libvorbis-devel libvpx-devel gtk2-devel flac flac-devel

Freepats is not packaged in Fedora, you must download and install it by yourself if desired. See also the "timidity-patch-freepats" package on others RPM based distros.

Compiling

To compile, simply run the command make in the base folder (with parameter -j# to speed up compilation with multiple threads). If successful, this should produce the following binaries in the base folder:

  • amcsquad
  • mapster32

The amcsquad binaries do not support game autodetection like eduke32. Instead, you should copy the binaries into the folder that contains the AMC Squad data, i.e. the folder where the amcsquad.grpinfo file is located.

Additional build instructions can be found here:

Feature Differences

This section lists the major changes to the modding API, including new CON and DEF script commands, and how to use them.

General Changes

  • MAXTILES increased from 30720 to 44800
    • Previously was increased to 32512 with AMC 3.5 up to 4.0
    • The editor now alters the mapversion if there's a sprite with a tile above this value.
    • This is intended to prevent loading maps with the wrong editor version, which could delete sprites from the map.
  • MAXGAMEVARS increased from 2048 to 4096 (also doubles MAXGAMEARRAYS).
    • Doubled from 1024 to 2048 in the editor.
  • Increased MAXLABELS from 16384 to 24576. More script labels can now be defined.
  • Increased MAXQUOTES from 16384 to 32768, due to the large amount of cutscene text required.
  • Add additional startup logging to give better feedback on the slow startup process.
  • Mapster32: The key combination [' + Y] enables a pink tile selection background, to improve visibility of tiles in the selector.
  • Looping ambient sounds are now able to overlap with instances of themselves.
  • Added a lower bound for distance between menu items. This allows menus to scroll properly now.
  • Add PROJECTILE_WORKSLIKE flag PROJECTILE_RADIUS_PICNUM_EX:
    • Flag value is 1073741824 (0x40000000).
    • The flag changes the htpicnum of the projectile to the actual picnum, instead of using RADIUSEXPlOSION. However, it also preserves hardcoded behaviors specific to RADIUSEXPLOSION, including destroying spritewalls and spritefloors that have a hitag.
    • RPG projectiles can only burn trees, tires and boxes if this flag is set. Player will receive the same pushback as with RADIUSEXPLOSION when hit.
  • Hardcoded anti-cheat measure removed from skill 4.
  • Change crosshair size slider to range from 10 to 100.
  • Make save settings menu and reset progress options available.
  • Various smaller changes that affect AMC specifically, in particular to hardcoded Duke3D functions and player clipping behavior.

CON Commands

Commands that extend the functionality of the CON VM.


definesoundv

Usage: definesoundv <soundID> <filename> <pitch_lower> <pitch_upper> <priority> <flags> <distance> <volume>

Variant of the definesound command, with an added parameter to change the sound's actual volume.

Note: Since this command was added, the original command has been updated to also support volume adjustments. This command is kept for backwards-compatibility.

Defines a sound and assigns various properties to it. The maximum number of sounds that can be defined is 16384.

  • <value>: This can be either the sound's number or the name that has been defined for that number.
  • <filename>: The name of the sound file. Sound files are assumed to be in the same directory as the program unless a folder path is specified.
  • <pitch_lower> and <pitch_upper>: Range in which the sound pitch can vary. Values may be positive or negative.
  • <priority>: A value of 0 to 255 indicates the priority the sound has over other sounds that are playing simultaneously.
  • <flags>: Bitfield which indicates what type of sound you are defining.
    • 1: The sound repeats if continually played.
    • 2: The sound is an ambient effect.
      • 3: The sound will loop until instructed to stop.
    • 4: The sound is a player voice. Disabling "Duke Talk" in the menu will mute this sound.
    • 8: The sound contains offensive content. Disabling "Adult Mode" or enabling the parental lock in the menu will mute this sound.
    • 16: The sound will always be heard from anywhere in the level.
    • 32: If set, only one instance of the sound is allowed to play at a time. (also for definesound)
    • 128: The sound is used in Duke-Tag.
  • <distance>: Negative values increase the distance at which the sound is heard; positive ones reduce it. Can range from -32768 to 32767.
  • <volume>: Ranges from 0 to 16384, with 1024 being the default volume. Changes the actual volume of the sound being played.

ifcfgvar

Usage: ifcfgvar <var>

Can only be used with variables. Will check if the CFG contains the given variable, and if yes, follows the true path, false otherwise.

Its main use is to allow loading variables stored inside the CFG that have a nonzero default value. The problem is that loadgamevar will overwrite the value of the variable with 0 if the variable is not present. By using this conditional, we can prevent this.


ifpdistlvar and ifpdistgvar

Usage:

  • ifpdistlvar <var>
  • ifpdistgvar <var>

Branches if the distance from the actor to the player is less/greater than the value in the provided variable.

Variant of ifpdistl and ifpdistg that takes variables as arguments instead of a constant.

Required to allow customizing the particle effect distance at runtime, rather than at compile-time.


mkdir

Usage: mkdir <quote_label>

Creates a directory in the current moddir/profile directory/current working directory, with the given quote as path.

Does not throw an error if directory already exists.


profilenanostart

Usage: profilenanostart <idx>

This command is used for high-precision profiling of CON code. The maximum index is 31.

Running this command records an internal nanosecond timestamp at index <idx>, where <idx> is a label or a constant. This acts as the startpoint for timing the execution time of a sequence of CON commands.


profilenanoend

Usage: profilenanoend <idx>

This command is used for high-precision profiling of CON code. The maximum index is 31.

Records the endpoint nanosecond timestamp, and automatically computes the elapsed time between startpoint and endpoint for the given index. This assumes that profilenanostart was executed beforehand.

Timings that are recorded internally is the elapsed time in nanoseconds between start and stop, the cumulative sum of elapsed times, the square sum, as well as the number of timings that were sampled.

To print the results of the timing, use profilenanolog.


profilenanolog

Usage: profilenanolog <idx>

This command is used for high-precision profiling of CON code. The maximum index is 31.

Prints the current timing stats for index <idx>. This includes:

  • The most recent elapsed time sample recorded.
  • The number of measurements N in total since the last reset.
  • The mean timing over all N measurements, in nanoseconds.
  • The standard deviation over all N measurements, in nanoseconds.

profilenanoreset

Usage: profilenanoreset <idx>

This command is used for high-precision profiling of CON code. The maximum index is 31.

This command clears the recorded measurements, and resets all internal timestamps back to 0.


setmusicvolume

Usage: setmusicvolume <percent>

Allows the CON script to lower the music volume independently of the player's settings. This does not affect the player's settings.

This command is intended to allow scripts to temporarily lower the music volume, while preserving the user's chosen volume defined in the sound settings menu.

  • <percent>: Value from 0 to 100, acting as a percentage of the player's current music volume.

DEF Commands

Commands that extend the DEF script functionality.


customsettings

Can be used to define the structure of a custom settings menu. Has a maximum of 64 entries.

Usage:

customsettings
{
    title "Custom Settings"
    entry
    {
        name "Settings Entry 1"
        index 0
        font "small"
        type "on/off"
    }
    entry
    {
        name "Settings Entry 2"
        index 1
        font "big"
        type "yes/no"
    }
    entry
    {
        name "Settings Entry 3"
        index 2
        font "mini"
        type "multi"
        vstrings { "hello" "world" "foo" "bar" }
        values { 0 10 20 30 }
    }
    ...
}

For the token customsettings, the following subtokens are supported:

  • title: Defines the text shown on the menu entry that leads to the custom settings menu. This is always placed inside the "Options" menu.
  • entry: Defines an entry for the custom settings menu, see below.
    • The ordering of the menu is defined by the order in which these entries appear in the DEF file.
    • To make the system more robust, the order is independent of the index of the entry, see the index token.
  • link: NOT IMPLEMENTED YET. Defines a link to a subpage of menu options.

For the token entry, the following subtokens are supported:

  • name: Defines the text of the options entry.
  • index: This token defines a index to uniquely identify the custom settings entry. This index separates the entry from the order in the DEF script, allowing the menu to be reordered without needing to alter the CON code. Minimum index is 0, maximum index is 63.
  • font: Defines which type of font to use for the custom settings entry. Possible values are:
    • big | bigfont | redfont: Uses the large menu font, as seen on the title screen.
    • small | smallfont | bluefont: Uses the small menu font, as used in the Polymost settings.
    • mini | minifont: Uses the smallest menu font, as used in the keybind menu.
    • Other values are ignored. Default is small.
  • type: Defines the behavior of the menu entry. Multiple options are available:
    • button: Acts as a simple button, which makes a sound and runs EVENT_CSACTIVATELINK when activated.
      • Does not alter userdef[].cs_array.
    • yes/no | no/yes: Displays a boolean "Yes"/"No" toggle menu option.
      • When activated, changes the value of userdef[].cs_array from 0 to 1, and vice-versa.
      • Default is set to "No" unless altered in EVENT_CSPOPULATEMENU.
    • on/off | off/on | toggle: Displays a boolean "ON"/"OFF" toggle menu option.
      • When activated, changes the value of userdef[].cs_array from 0 to 1, and vice-versa.
      • Default is set to "OFF" unless altered in EVENT_CSPOPULATEMENU.
    • multi | choices: Defines a multiple choice menu entry.
      • When interacted with, displays a range of options to select.
      • Using the arrow keys cycles through the options.
      • Requires the tokens vstrings and values to be defined for the entry, see below.
      • Can define at most 32 choices per entry.
    • range, slider: NOT IMPLEMENTED YET.
      • In the future, these tokens will define a slider to adjust an integer value gradually, either by keyboard or by using the mouse.
    • spacer2 : 2 units of empty space. Cannot be selected.
    • spacer4 : 4 units of empty space. Cannot be selected.
    • spacer6 : 6 units of empty space. Cannot be selected.
    • spacer8 : 8 units of empty space. Cannot be selected.
  • vstrings {...}: Only used for multiple choice menu entries. Defines a list of strings to represent the values inside the selection.
    • Each entry must be defined in the order of appearance in the menu.
    • Entries in values and vstrings must appear in matching order.
  • values {...}: Only used for multiple choice menu entries. Defines the list of integers that userdef[].cs_array will be set to when an option is selected.
    • Each entry must be defined in the order of appearance in the menu.
    • Entries in values and vstrings must appear in matching order.

The logic of these entries is furthermore controlled through the events:

  • EVENT_CSACTIVATELINK : Triggered when a link entry is activated.
  • EVENT_CSPREMODIFYOPTION : Triggered on activation of an option entry, before the value is modified.
  • EVENT_CSPOSTMODIFYOPTION : Triggered on activation of an option entry, after the value is modified.
  • EVENT_CSPOPULATEMENU : Triggered when opening the custom settings menu, before entries are set up.

Game Events

Game events not present in regular eduke32.

EVENT_CSACTIVATELINK

Used in conjunction with the DEF command customsettings.

This event is called each time a link entry or button is activated, i.e. an entry that is not a toggleable option.

Can be used to define behavior for buttons, e.g. a "set to default" button.


EVENT_CSPREMODIFYOPTION

Used in conjunction with the DEF command customsettings.

This event is called each time a custom settings entry option is modified, before userdef[].cs_array is updated. This includes the Yes/No, On/Off and multiple choice entries.

Can be used to perform actions before userdef[].cs_array is modified.


EVENT_CSPOSTMODIFYOPTION

Used in conjunction with the DEF command customsettings.

This event is called each time a custom settings entry option is modified, after userdef[].cs_array is updated. This includes the Yes/No, On/Off and multiple choice entries.

Can be used to perform actions after userdef[].cs_array is modified, e.g. to update gamevars and save them in the CFG.


EVENT_CSPOPULATEMENU

Used in conjunction with the DEF command customsettings.

This event is called each time the custom settings menu is opened. Altering the values in userdef[].cs_array in this event will directly affect the chosen values shown inside the menu.

For instance, this can be used to change the default values of the menu, and/or to load values from the CFG, and update the cs_array entries with those values.


EVENT_POSTACTORDAMAGE

This event is called when an actor runs A_IncurDamage(), just after decreasing sprite[].extra, resetting htextra to -1 and updating htowner.

i.e. it occurs after the actor has taken damage and its health was updated.

  • Currently, this event is not executed when the player takes damage.

Struct Members

New struct members added by the fork.

  • userdef[].userquote_xoffset and userdef[].userquote_yoffset: Alters the x and y position of the userquote text. Can be positive and negative.
  • userdef[].voicetoggle: Read-only userdefs struct member, which acts as a bitfield.
    • 1: If set, character voices are enabled (Duke-Talk).
    • 2: Dummy value, reserved.
    • 4: Character voices from other players are enabled.
  • userdef[].csarray : This is an array for the custom settings menu, stores the current state of each entry in the menu by index.
    • Update the values of this struct inside event EVENT_CSPOPULATEMENU, and the entries will reflect the contents of the array.
    • In order to apply settings, retrieve the value from this array for the corresponding list entry in EVENT_CSPOSTMODIFYOPTION, and update your gamevars with it.
    • To store settings between game launches, use savegamevar and loadgamevar on your actual option variables.
  • userdef[].m_customsettings : Index for the currently selected custom settings entry.
    • IMPORTANT: Uses the index defined inside the DEF, not the ordering of the items!
    • The index will be set to -1 if the index was not defined within the DEF.

Credits and Licenses

The AMCDuke32 fork was created and is being maintained by Dino Bollinger.

  • eduke32 was created by Richard "TerminX" Gobeille, and is maintained the eduke32 contributors. It is licensed under the GPL v2.0, see gpl-2.0.txt.
  • The Build Engine was created by Ken Silverman and is licensed under the BUILD license. See source/build/buildlic.txt.
  • The AMC Squad was created by James Stanfield and the AMC team.

The maintainers of the game and the engine fork thank the developers of eduke32 for their continued assistance and support over the years.

THIS SOFTWARE IS PROVIDED ''AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.