CTF4 1.0b4 - by David Catmull - uncommon@uncommonplace.com - http://www.uncommonplace.com/


What's this thing?
------------------
As you might have guessed, this is a 4-team version of Capture the Flag. The CTF game that comes with Unreal Tournament only works with 2 teams. Having more than 2 teams makes a big difference in how you play the game, and makes more variations possible. When you are setting up a game, go to the Rules panel and you will see these options:

- Carry flags back: In order to return your flag, you must carry it all the way back, instead of just touching it.

- Subtraction: Each time your flag is captured, you lose a point.

- Elimination: Must be played with Subtraction or Distribution (or both), and works a bit differently 
with and without Distribution. Without it, if the capture limit is 3, and your score hits -3, your team is eliminated. With Distribution, when every team has hit the limit on capturing your flag, you are eliminated.

- Distribution: The Capture Limit is how many times you must capture *each* enemy flag. Once you hit your limit on a particular flag, you can't pick it up anymore. The number of captures left on each enemy flag is displayed next to each team's flag in the HUD, in place of a numeric score.

- Designation: At the beginning of the game your team is given a designated enemy flag to capture. You can't pick up or capture any other flag until you capture your assigned one, and when you do you will be assigned a new target. Normally, no more than two teams are assigned to any particular flag an a time, but sometimes it's unavoidable. Especially if you play with Distribution.

Notice that they are checkboxes, which means you can mix and match any way you like, or leave them all blank to use normal scoring. Combining Subtraction and Distribution changes things a bit: when you capture a flag, not only is it one less time that you have to get that flag to win (like usual), but the other team now has to capture your flag one more time. And with Elimination combined with Distribution, when everyone has hit their capture limit on your flag, your team team is eliminated.

Another option is that instead of just touching a flag to return it, you have to carry it all the way back. Be prepared to fight for your flags!

There is also a Carry Multiple Flags option, allowing you to carry more than one flag at once. If Carry Flags Back is also on, then you can carry your flag and enemy flags, and you score when you reach your flag base. With this combination it's possible to carry all four flags!


Installation
------------
CTF4.u and CTF4.int go in your UnrealTournament\System directory. CTF4-Crossroads goes in Maps.


In progress
-----------
I almost called this version 1.0 final, but I decided to play it safe :) Please send me a detailed description of any bugs you find.

New in this version:
- Fixed the "scored" messages that would appear when you return a flag with "carry flags back" turned off
- Distribution score markers have been changed from dots to bars so they look better at higher resolutions.. actually I think they look better all around
- Bots should now be a bit bolder about picking up additional flags
- Fixed the location and color of the "You have some flags" and "Your flag is out" messages
- Fixed a bug that could cause bots to run in place on top of their own flag base

Bugs & issues:
- The help text for Distribution doesn't show
- Bots sometimes get stuck trying to pick up a flag (sometimes it's because they're dead but they don't know it yet)
- The icon for a held flag draws as a big black square on some machines
- Bots sometimes pass up easy chances to pick up extra flags


Making maps
-----------
Making CTF4 maps is almost the same as making a regular CTF map, just with more flags. When you place the FlagBases for the Green and Gold teams, set the Team value to 2 and 3 respectively. It is no longer necessary to use the FlagBase4 class, but it's still there if you want it. Using regular FlagBases will cause some errors to be generated in the log file, but they're nothing to worry about and I can't get rid of them anyway.

When placing AlternatePaths, their Team value must match the base they're in. For example, AlternatePaths in the Green base should always have a Team value of 2. This is necessarily different from regular CTF maps, where the Team value matches the attacking team.

I have a set of Green and Gold textures to go with the default Red and Blue team textures. You can get them at my site (see top).


Some notes about the map
------------------------
Crossroads is mainly intended to be a test map. The reverse-gravity pit is there just because I was feeling silly. It's fun though - rather like a roller coaster where you die at the end... unless you get really really lucky :)

If you want to mess with the map, there are some tricks you need to know about, mostly in the Gold and Blue bases. Notice how the gold flag is on a floating pedestal. Normally, the editor would not connect the path nodes on either side of the gap, even though it can easily be jumped. So I made temporary bridges (you'll find them stowed above the base) to trick the editor into putting paths there, and then I take the bridges out. There are also a couple of blocks that eliminate unwanted paths, plus a spare platform for the Blue base so bots will jump down from the flag. If you need to rebuild the paths, here's the method:

- Move the objects into place; you can select them all and move them all at once
- Rebuild geomentry
- Rebuild paths
- Stow the objects back in their hiding place
- Rebuild geometry


Technical details (or why this mod is necessary)
-----------------
In examining the UT code for CTF, I noticed that some parts actually allowed for four teams, while other parts assumed there would be only two. You could almost make a 4-way CTF map, except for a few obstacles:

- You can't specify the number of teams when you set up the game
- There are no skins for Green and Gold flags. You may notice that there are GreenFlag and GoldFlag classes in Unrealed, but they use skins that don't match the usual flag mesh.
- When a flag base goes to generate its flag object at the beginning of the game, it assumes there are only two teams. If its team is not Red or Blue, it doesn't make a flag.
- There's nothing to prevent you from picking up a flag when you already have one, but if you do this, things go funny. You can only capture the last flag you picked up, and the others are in limbo.
- Bots assume there are two teams. If there were Green and Gold bots, they would always go after the Red flag. The logic is "if I'm not red, I must be blue."
- The messages like "Minnie has the red flag" were designed around the two-team assumption. Before I fixed this, I played a game where I was blue and I grabbed the green flag; the game announced that I had the blue flag. When I scored with the green flag, it told me that I had captured the blue flag and the red team had scored, even though the blue team (rightfully) got the point.

I've fixed all of these problems in this mod, and I'm experimenting with gameplay variations that are only possible with more than 2 teams.

CTF4 maps will show up in the regular CTF map list. They might even be sort of playable, except for the picking-up-multiple-flags bug in CTF. Maybe I should change the prefix to CF4 or something to prevent this.