Capture the Flag Doom(CTFD) v0.80(FINAL Part 2 :) ) (With 3 team support).

CTFDoom Homepage : http://www.captured.com/ctfdoom

CTF Modification by John Cole [jcole@eisa.net.au]
DOSDoom Port by Chi Hoang     [cyhoang@acs.ucalgary.ca]
id Software

Also thanks to Ryan Nunn [triforce@merlin.net.au] who came up with MidDoom 0.02. In
which I used this as a guide for modifying the Heads Up Display code.

-------------------------------------------------------------------------------------

DISCLAIMER

  The author of the modification takes NO responsiblity for any damages/data loss
  that may occur from the use of this software. Use at your own risk.

-------------------------------------------------------------------------------------
PLEASE DO NOT email id Software about this modification as they have nothing to do
with it.
-------------------------------------------------------------------------------------

** FINAL NOTE ***

Well this is the final version of CTFDoom, I just have no time whatsoever
to work on it, so I would like to take the opportunity to thank everybody who
gave me input, contributed to it with maps/graphics etc. or just criticised
what I was doing :), it's been very interesting to say the least working on it
and I hope in some way or another CTF for Doom will live on wheteher it be
from my code or someone elses.


Now on to the real stuff.

Remember to rename DOSDOOM.EXE to either DOOM.EXE or DOOM2.EXE depending on the
maps you are using. (So IPXSETUP can detect it!)

or use the DOOMENV environment variable for IPXSETUP. (set DOOMENV=ctfdoom.exe)

Okay so here it is capture the flag for DOOM.

    CTFDoom(CTFD) is a modification of Chi Hoang's 0.61 DOSDoom to allow 4
on 4 or 2 on 2 (if you REALLY want to?) etc, games of capture the flag. I have 
attempted to keep the rules and playablility similar to it's Quake counterpart
but due to restrictions some things were left out or had to be compromised.

---> All other modes of doom run normally with this modification.


** Quick Parameter List for CTFDoom **

-ctf              2 Team Capture the Flag
-ctf 3            3 Team Capture The Flag
-oldsetup         Use the original Doom Setup Packet
-teamlimit <n>    Set the CTF Game Limit (Based on Team score)
-fraglimit <n>    Set the CTF Game Limit (Based on Player score)
-wstat            Write the game stats to the ctfdstat.log


** How to start CTFD **

It's Simple : 
    IPXSETUP -ctf -file <wad's> -nodes <numnodes> .....

or if you are using your own names :
    IPXSETUP -ctf -name <playername> -file <wad's> -nodes <numnodes> .....

or if you are playing three teams with names:
    IPXSETUP -ctf 3 -name <playername> -file <wad's> -nodes <numnodes> .....


** REMEMBER **

"-altctf" is now "-ctf", I have decided it's was not worth keeping the
original "-ctf" option anymore.

Names are set through the new IPXSETUP, failure to use the new IPXSETUP on
every machine will cause the old naming convention to be used.

Also DOSDoomSetup (David Leatherdale, David@Leatherdale.demon.co.uk) now
supports CTFDOOM. (See my links page for the location of DOSDoomSetup)

To use it : ddsetup ctf


** Features **
     - Now supports up to 3 teams. Using "-ctf 3" will enable the 3 team
       mode the format for the 3 teams are :
            1,4,7    Blue Flag (Green Team)
            2,5,8    Red  Flag (Indigo Team)
            3,6      Gold Flag (Brown Team)

       Because the brown team has only two player I suggest that the two
       best players go on this team to make things even.

     - Extended network setup packet.
       Sends all GAMEPLAY information from the key player to the others,
       avoids all players having to make sure the OPTIONS/GAMEPLAY Menu
       is identical on all machines.

       If you wish to use the old setup packet style use the "-oldset"
       parameter. (Remeber to check the above on each machine though!)

       * OPTIONS/GAMEPLAY Menu is disabled now within a netgame, set it
         up before you start the netgame.

     - There are now 3 lines available for scrollable messages, players
       now also have the additional information on who killed who, or
       whether they suicided.

            eg.
                FRED HAS TAKEN THE BLUE FLAG
                JOE_BLOW CHOSE THE WRONG STRAW
                FRED DESTROYED XTRACTOR

     - Because of this the HUD has changed slightly to accomodate the
       extra 2 lines of text. MUG Names have moved down slightly so they
       do not overwrite messages as they are displayed.
     - Swing Bar?(Don't know what to call it exactly). This sits above
       the timer (in full screen mode) and gives you an indication as to
       who is leading and by how much. When it's to the left it's Green
       and when it's to the right it's Indigo. (was in 0.73 but I forgot
       to mention it)
       (Disabled in 3 team mode)
     - Added to options to the OPTIONS/GAMEPLAY Menu which might make
       things interesting:

            TELEPORTABLE MISSILES : OFF/ON/SILENT
            (Rockets/Plasma/Bfg)

                ON     : Looks like a player teleport.
                SILENT : No Sound or flash is made.

            TELEPORT DELAY (PLAYER) : NORMAL/QUICK/QUICKEST

                QUICK    : Time halved from original delay time.
                QUICKEST : Instantaneous movement off a teleporter.

            * These two options can be mixed with one another.
            * Don't abuse the TELEPORTABLE MISSILES option, eg two teleports
              facing one another. Unless you want the game to reduce to 5fps,
              after 2.5 million rockets/plasma/bfg blasts are moving between
              them!

    - Demo's are now storing all the OPTIONS/GAMEPLAY options. Note
      all the CTF parameters will still be needed on the demo command
      line, because of the way the CTFD.WAD file is loaded. It is still
      backwards compatible with previous demo versions.
    - Totally new full screen HUD.
      - Revamped mugs display (See Below).
      - Team faces are located in each corner(bottom) of the screen.
           * Green Left
           * Indigo Right
      - Large numbers used to display team scores, used for easier 
        recognition.
      - Percentage Bars used to display :
          - Current weapons ammo status (Yellow Bar)
          - Armour Status               (Blue Bar =< 100) (DKBlue > 100)
          - Health                      (Red Bar  =< 100) (DKRed  > 100)
      - The percentage bars appear above the face of the team you are on, just
        so you don't forget who you playing for :)
      - A timer is now displayed showing either the time in the level or the
        amount of time left "-timer n".
      - Crosshairs fixed in fullscreen mode. They now also pulsate so they
        stand out more effectiviely.
    - If the status bar is used the old style HUD is used to save screen space.
      (May change in the near future)
    - Shotgun, Supershotgun, Chaingun and pistol now can shoot at any angle.
      (This was not implemented for these weapons in the original DOSDoom
       0.60, need to set shoot up/down to on in options menu)

    - Sorted player score list, can be toggled with " ` ", or when you die
      it is displayed. (Automatically adjusts to the number of players in
      game, their scores etc.)
      (Also works in Deathmatch)

    - Flag holder names are now located next to the mug shots at the top right
      of the screen instead of on the old status bar.
      - Mugs toggle option has now been removed, it is left on permanently now
        so you can see who on your team has the opposition flag.
      - If the consoleplayer(you) have the flag the face in the mugs display
        is different to the others, the face is looking to the right edge of
        the screen.

     - Players in "altctf" mode can now specify customised player names
       through the new IPXSETUP 2.00 and the "-name <playername>" parameter.
       - Demo's automatically record the names in the LMP files, but
         compatibility is retained with the previous versions.
     - "-wstat" Write detailed stats at the end of the level to CTFDOOM.LOG.
       Contains :
           - Replay / Record Filename
           - Wad files used
           - Additional parameters eg. teamlimit / fraglimit.
           - Team Scores.
           - MVP
           - Individual Scores       (Pickups / Returns / Captures)
           - Individual Frag Counts  (Frags)
     - "-altctf" alternative capture the flag mode. (!! NOW "-ctf" !!)
       - Players drop weapons when killed.
       - Uses team colours Green / Indigo, players change to the flag
         colour that they are holding for easy target practice when they
         have the flag :)
     - Use F12 to toggle through your teammates (but not the opposition!)
     - The automap only shows where you're teammates are not the opposition.     
     - Intermission screen, shows Green/Indigo team Totals (returns/pickups/
       captures/total score), and Most valuable player (MVP) with his/her
       scores.
     - Flag holder if killed drops the flag at the point of death,
       if a flag holder dies under a crushing sector, the flag is
       respawned back in the teams base who owns it.
     - Mugs Display, show the players face who has the flag.
     - Speech, notifies all players when a flag event occurs.
       - "Red/Blue/Gold Taken"
       - "Red/Blue/Gold Returned"
       - "Red/Blue/Gold Captured"
     - 8 Player Network (CTF/Deathmatch/Co-Op)
       - CTF & Co-Op Require Modified Starts / Deathmatch just needs 8
         deathmatch starts.

         Co-op / Deathmatch Colours
             - Gold
             - Blue
             - Dark Blue
             - Pink

     - Level Fraglimits & TeamLimits added through "-fraglimit <X>" or
       "-teamlimit <X>" (CTF Only)
     - Weapons stay put, whereas items respawn like in -altdeath mode.
     - Only one person can grab a flag at a time (Player is then 
       marked as flag carrier).
     - The ability to force IPXSETUP to start up under a different player
       id, through the "-player <X>" command (good for playing CTFD between
       two rooms, if the machine id's do not get set correctly).
     - Ability to set DOOMENV so you can launch multiple .EXE's without
       having to rename the CTFDOOM.EXE.


** Players ID **

"-ctf"
[DoomGuy]
[TheGun]
[Fragman]
[Camper]  :)
[ImpyBoy]
[-X-]
[Hot]
[Intense]

When "-name" is used then all this changes.


** Heads up display (NEW HUD) **

Layout
-------------------------------------------------
|Info Text                               |      |
|Message Text                            | MUG  | <- Who has your flag
|                                        |      |    (Opponents)
|                            Player Name |      |
|                                        -------|
|                                        |      |
|                                        | MUG  | <- Who has their flag
|                                        |      |    (Your Team)
|                            Player Name |      |
|                                        -------|
|                                        |      |
|                                        | MUG  | <- Who has the other flag
|                                        |      |    (Your Team, 3 Teams only)
|-------                     Player Name -------|
| Opp. |                                 =======| <- Ammo (Curren Weapon)
| Team |(3 Teams only!)                  =======| <- Armor
| 2 MUG|                                 =======| <- Health
|-------                                 -------|
| Opp. |             Swing Bar           | Your |
| Team | Team     (2 Teams only)    Team | Team |
| 1 MUG|  Score  =======|=======  Score  | MUG  |
|      |              TIMER              |      |
-------------------------------------------------


** Flag Capturing and Returning **

   To Capture : Just make sure your flag is at it's base position, and that
                you have one of the opponents flags then just run over your
                own one for the capture.

   To Return  : Just touch your flag that was dropped by the opposition and
                it will be returned back to base.


** Scoring **

    5 Frags/Points - Per Player in team for a successful capture.
    1   "     "    - Per Player for a successful return.
    1   "     "    - For a kill to the inflictor.
   -1   "     "    - For killing yourself, (whether it be by toxic slime
                     or just by using a rocket at close range)

Notes:
    I may change the scoring for self inflicted kills or environment kill
because in the test runs the opposition team decided that the easiest way to get
back to their flag was to commit suicide. I am open to opinions though.

** POWER JUMPING **
(See the demo altctf5.lmp for examples)

This is the ability to jump 3 to 4 times the height & length of a normal jump,
you do not have to change the gravity in doom and it works in all modes. The 
way to do it is to jump just as you are hitting a step, now depending on the
height of that step depends on the height and length of the jump. You can go
to places where no Marine has gone before :)

Pretty neat huh?


** Map Creation Tips **

    Because it uses a modified co-op mode all that is needed is the four player
co-op start points. Usually you would set them out as players 1,3,5,7 in one base and
the other two (2,4,6,8) in the other base. (I did it this way to have the ability
to test the game on only two computers.) For three teams thought it would be :
  Green  Team : 1,4,7
  Indigo Team : 2,5,8
  Brown  Team : 3,6

    When creating player spawns if at all possible make them at a height at which
the player is unable to climb onto, I say this because Doom will spawn a player to the
next free co-op point, if the normal spawn point is occupied by an actor then the
next free spawn point may just be in the opponents base!!! Which I'd say is
a definate no no (and if deliberately used could be seen as a form of cheating).
(Not really a nescessary practise anymore, but good to keep in mind)

    Try not to use any keys for locking doors as it just complicates the gameplay
(it's not free flowing) and DO NOT use the RED, GOLD and BLUE Skull keys for
anything other than the flags for the game as they will not work as anything
else in this mode and you need them to play the game.

   As an example I have slightly modified E1M1 from Doom to accomodate CTF mode, it
is on the website(This is the map I did my original testing on).

   If anyone comes up with some maps for this please let me know I'd be really
interested to see how they turned out.


** Miscellaneous Info **
0.78 (10-apr-98) Final Release, Long live CTFDoom :)

0.75 (??-mar-98)

Can't remember

0.72 (15-mar-98)
    - Totally new full screen HUD.
      - Revamped mugs display (See Below).
      - Team faces are located in each corner(bottom) of the screen.
           * Green Left
           * Indigo Right
      - Large numbers used to display team scores now used for easier 
        recognition.
      - Percentage Bars used to display :
          - Current weapons ammo status (Yellow Bar)
          - Armour Status               (Blue Bar =< 100) (DKBlue > 100)
          - Health                      (Red Bar  =< 100) (DKRed  > 100)
      - The percentage bars appear above the face of the team you are on, just
        so you don't forget who you playing for :)
      - A clock is now displayed showing either the time in the level or the
        amount of time left "-timer n".
      - Crosshairs fixed in fullscreen mode. They now also pulsate so they
        stand out more effectiviely.
    - If the status bar is used the old style HUD is used to save screen space.
      (May change in the near future)
    - Shotgun, Supershotgun, Chaingun and pistol now can shoot at any angle.
      (This was not implemented for these weapons in the original DOSDoom
       0.60, need to set shoot up/down to on in options menu)

    - Sorted player score list, can be toggled with " ` ", or when you die
      it is displayed. (Automatically adjusts to the number of players in
      game, their scores etc.)
      (Also works in Deathmatch)

    - Flag holder names are now located next to the mug shots at the top right
      of the screen instead of on the old status bar.
      - Mugs toggle option has now been removed, it is left on permanently now
        so you can see who on your team has the opposition flag.
      - If the consoleplayer(you) have the flag the face in the mugs display
        is different to the others, the face is looking to the right edge of
        the screen.

    - "-altctf" now enhances the beserker, as well as getting mega strength in
      the arms you also get mega strength in the legs, a 5 second speed boost
      at the equivalent speed of "-turbo 170". (Similar to Dukes steriods
      powerup)

    - "-turbo" parameter is not allowed in "-altctf" mode now.


0.70 (10-mar-98)
     - Players in "altctf" mode can now specify customised player names
       through the new IPXSETUP 2.00 and the "-name <playername>" parameter.
       - Demo's automatically record the names in the LMP files, but
         compatibility is retained with the previous versions.
     - "-wstat" Write detailed stats at the end of the level to CTFDOOM.LOG.
       Contains :
           - Replay / Record Filename
           - Wad files used
           - Additional parameters eg. teamlimit / fraglimit.
           - CTF Version played.
           - Team Scores.
           - MVP
           - Individual Scores       (Pickups / Returns / Captures)
           - Individual Frag Counts  (Frags)

0.6d (1-mar-98)

.exe release only. Removed the Extender from the exe.


0.6

What is new:

     - Merged into DOSDoom 0.51
     - "-altctf" alternative capture the flag mode.
       - Players drop weapons when killed. (As long as they don't have a flag)
       - Uses team colours Green / Indigo, players change to the flag
         colour that they are holding for easy target practice when they
         have the flag :)
     - Cleaned up some more code.

What is fixed:
     - There is a bug(really a typo) in DOSDoom's key handling code, if
       you accidently hit Insert/Delete...... the game would get stuck
       in an infinite loop. (INTRODUCED with the center look key) [FIXED]



0.5b (20-feb-98)

---------------
What is new:

	- Not much :), just merged it with DOSDoom 0.50, and did some
          optimisations to the Flag handling code.
        - Playback.wad now only holds the players backgrounds.
        - CTFD.WAD this replaces CTFSND.WAD and stores all the speech,
          and intermission screen patches.



---------------
0.5 (15-feb-98)

What is new :

  - New 5 player demo.
  - Updated playback.wad file.
  - Intermission screen is easier to understand now (Use of titles).
  - Key '\' brings up mugs display, (shows who on your team has the flag)
  - Fixed (AGAIN!!) HUD, GT = Green Team, IT = Indigo Team.

What is fixed :

  - MVP Players face is shown if the player # is greater than 4.
    (was still using 0.4a8 code)       [FIXED]
  - Opposition mugshot(who has your flag) was not displaying the players
    face for the same reason as above. [FIXED]


I think I'll ease off of the releases a bit now, I know for a fact the
8 player network works, in all DOOM Modes and I've got all the errors
I know of out of the code. Will probably do 1 release a week rather
than 300 :) (Unless something drastic is found to be wrong) I will keep 
updating the page though as to let everyone know what I am doing.


0.4aT8 (14-feb-98)

Whats new in CTF Doom:
     - Player Colours
           Player 5 : Gold
           Player 6 : Blue
           Player 7 : Dark Blue (This looks really good)
           Player 8 : Pink

     - HUD Display displays teams now.
     - CTFSND.WAD & PLAYBACK.WAD Automatically load if needed.
     - Now Supports 8 Players.
       - CTF mode work's (of course!!)
       - Deathmatch mode works
       - Co-op mode works.
     - status bar now updates properly when a player is killed while holding
       the opposition flag.
     - F12 Now toggles between teammates.
     - Team members are only displayed in automap mode now.
     - "-fraglimit" added, allows the setting of a fraglimit to finish a level.
     - "-teamlimit" same as above but works on team scores rather than an
       individuals score.
     - Picking up a weapon now gives the player the same amount of ammo as if
       they were playing in deathmatch mode.

---
8 Player notes.

New THING types added :

            THING #       What it is
            4001          Player 5 Start
            4002          Player 6 Start
            4003          Player 7 Start
            4004          Player 8 Start

If you try to play a normal DOOM/DOOM2 Level with more than 4 players it will
crash as their are not enough start positions or deathmatch positions (depending
on the mode you are playing), the map will have add the extra co-op start
points or if in deathmatch at least put in 8 deathmatch starts (max 10).

If playing a deathmatch when an level is exited, only the first 4 players are
shown, I deliberately did this as at the moment I don't have time to work on
stuff outside of CTF mode. (Same goes for the co-op stats screen)

Example for firing up a 8 player game using "-teamlimit".

ipxsetup -file dm2018.wad -ctf -nodes 8 -teamlimit 100

----

NOTE : From now on you don't need to specify the ctfsnd.wad file, CTFD will
       check to see if it's in the current directory and add it to the file
       list automatically and enable Speech.


0.3c8 (8-feb-98) (unreleased)

- My original 8 Player version.


0.3 (5-feb-98)

- Merged into the DOSDoom 0.47 source.
- "-ctfs" has been removed, "-ctf" now does everything.

Fixed :

- The HUD Display does not overwrite the status bar when using the normal
  map mode.
- I got sick of the record/playdemo/timedemo not using extensions, so I
  fixed it, you can use extensions or no extensions. It now friendly
  for interpreters that do filename completions, eg 4dos.

Modified :

- CTF HUD Display. (Minor cosmetic changes to it)

- ctfsnd.wad sound files are alot smaller reducing the chances of the
  sound being terminated prematurely. (Now that it's this small I think
  I'll just leave it in the .zip files from now on)

Now says :
            Red/Blue Taken
             "   "   Returned
             "   "   Captured

Added :

- Top right hand corner now shows which player has your flag. (Player
  colour with and overlaid grinning face) Alot easier to determine who
  has your flag with the icon displayed and the added speech.


The ctfsnd.wad is included in this zip, but future releases will not
have it, it will be a separate file.


0.2c (1-feb-98)

It fixes :
         - Player scoring, wasn't being calculated properly
         - Resetting of MVP between levels.

Added :
         - Now if -ctf or -ctfs is used nomonsters and deathmatch is
           set to false.
         - "-timer" now works with CTFD.

         - Speech (through -ctfs), now when a flag event occurs it will
           say on everyones machine:

               Red/Blue Flag has been captured.
                "    "    "  has been taken.
                "    "    "  has been returned.

To use this feature you would do :

     IPXSETUP -ctfs -file ctfsnd.wad  ......
or without sounds
     IPXSETUP -ctf -file  ......


0.2a (1-feb-98)

     - Added player frag statistics and Timer to CTF HUD, toggle with
       the "`" key.
     - Now stores statistics such as pickups, returns, captures.
     - Level intermission scores now shown.

       [green  team] <pickups> <returns> <captures> <total>
       [indigo team] <pickups> <returns> <captures> <total>

       [MVP        ] <pickups> <returns> <captures> <frags>

     - All players are notified if an event occurs.

       eg. "GREEN HAS TAKEN THE RED FLAG"
           "GREEN HAS LOST THE RED FLAG"
           "INDIGO HAS RETURNED THE RED FLAG"
           .
           .
           etc.

     - Fixed scoring up, was incrementing the wrong players frags.

     - IPXSETUP can now have a different exe specified rather than just
       doom.exe / doom2.exe through the environment variable DOOMENV.

       eg. To use ctfdoom.exe :

           SET DOOMENV=ctfdoom.exe

BTW : I would like to thank everyone who has been giving feedback, making
      maps and so on, I have been taking note of everything said or done,
      but I just haven't had the time to reply.


0.1c (29-jan-98)

   - 0.1b  b=broken, There was a bug where if you slaughtered someone with the
     chain gun, it would try to spawn an invalid object and make the system die
     not very graciously instead of the player :). [FIXED]

**   If you grabbed 0.1b delete it, as it's basically useless.

   - Now when returning a flag from a dead player the team returning it 
     receives 1 point each.
   - When the level is exited the teams scores are shown as the intermission
     screen rather than the co-op stats. eg. Green Team & Indigo Team

0.1b (28-jan-98)
  
  [in no particular order]

  - Looking more like what CTF should be (IMO).
  - When a player has a flag in their possesion and they die the flag is
    dropped at the point of death.
  - For the the other team to recover the flag they just have to touch it
    and it returns to their base. (Ala Quake CTF)
  - If a player dies under a crushing sector while holding the opponents
    flag, eg a door. the flag will stay there until it is crushed, when
    this occurs it return to the owning teams base.
  - Made the code more modularised. It's now alot easier for me to
    understand :)
  - Re-Implemented the warp function, to allow warps to your teammates start
    point if yours is occupied(otherwise is returns to the old doom code for
    a warp position). This is the part I'm a bit worried about, if anyone get's
    into a situation where the continuously warp into the same position then
    LET ME KNOW PLEASE!!
  - Made some modifications to the new AutoMap HUD (It's like DUKE3D Automap
    overlay) that was incorporated into DOSDoom 0.46, made sure the status
    bar was refreshed, and let the CTF HUD know about the new mode.

0.1a (27-jan-98)
  - Internal test. Just a merge of CTFDoom 0.1 into DOSDoom 0.46. To make
    sure all was well :)

Miscellaneous Notes:

  ** Map Makers try not to place areas on the map where the player can get
     trapped, it will make it near impossible to capture or return keys.
     (At least for the moment)

** Known Bugs **




** Todo's **




** Copyrights **

Doom and Quake is Copyright id Software.


Send Comments and suggestions to :
                                   John Cole
                                   jcole@eisa.net.au
                                   http://www.captured.com/ctfdoom
