Gah - a solution with more questions. – EntropicLqd

Legacy:Assault Mapping Tutorial/PlayerStarts And The PlayerSpawnManager

From Unreal Wiki, The Unreal Engine Documentation Site
< Legacy:Assault Mapping Tutorial
Revision as of 11:36, 5 June 2007 by Kirk (Talk) (Added a comment about ForcedPawnClass and spacefighters)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page is a section of the Assault Mapping Tutorial. If you have arrived here from some other place, this page will likely make more sense if you start at the above link and read the tutorial through from beginning to end.

Previous Section: Legacy:Assault Mapping Tutorial/Creating A Destroyable Objective

Next Section: Legacy:Assault Mapping Tutorial/Attacking And Defending


PlayerStarts and the PlayerSpawnManager[edit]

Now it's time to set up how we're going to get players into this nice map of ours. As you may have guessed, we're going to need two groups of PlayerStarts, one for the attackers and one for the defenders.

It's important to note here that you want to have at least as many PlayerSpawns in any given spot as you will have people on one team. If there are too few PlayerSpawns for a given team somewhere, this can cause a bottleneck in gameplay, annoying players, and potentially throwing off the balance of the game. The game engine will also complain bitterly in the log if it can't find somewhere to spawn somebody when it needs to.

Attacker Spawns[edit]

Let's start by placing some PlayerStarts for the attacking team at the far end of the valley from the base. It's always better to have too many than too few, and we've deliberately left ourselves a reasonable space for it, so let's put down around 16 or so (16 for each side, so our map can support up to 32 players in a game, which should be more than people will usually want to do). The next thing we want to do is set the PlayerStart->TeamNumber property on all of the PlayerStarts in this group to a unique number. In this case, they should all default to 0, which is fine for here, so we'll leave that (but it doesn't hurt to check to make sure they all actually are set to 0).

That should do it, right? Well, not quite. Unlike for other game types, PlayerSpawn management for Assault is a bit more complicated. Despite the name of the property, in Assault, PlayerStart->TeamNumber does not actually determine what team uses a PlayerStart. Instead, the TeamNumber property is actually used to group PlayerStarts into groups (all PlayerStarts with the same TeamNumber are in the same group), and we use another actor to actually control how each group is used (you'll see why this is useful later). What we need to do now is tell the game that "PlayerSpawns in group 0" (that is, all the PlayerSpawns in the game with a TeamNumber of 0) should be where the attacking team initially spawns. To do this, add an Actor>>Info>>PlayerSpawnManager actor to the map (it doesn't matter where, but put it close to the PlayerSpawns we just created so that it's easy to find later). Open up the PlayerSpawnManager Properties, and set the following properties:

  • PlayerSpawnManager->AssaultTeam = EPSM_Attackers
  • PlayerSpawnManager->bEnabled = True
  • PlayerSpawnManager->PlayerStartTeam = 0

Setting PlayerStartTeam to 0 tells the game that this PlayerSpawnManager will affect any PlayerSpawns which have a TeamNumber of 0. bEnabled tells it that this group of PlayerStarts will be active as soon as the game starts, and setting AssaultTeam to EPSM_Attackers, tells it that the attacking team should spawn here.

Defender Spawns[edit]

Next, we'll set up the PlayerSpawns for the defenders. We'll have them spawn on top of the base roof, so go there and put down the same number of PlayerSpawn actors as we gave to the attackers (16). Now, select all of the defender PlayerSpawns, bring up their properties, and set PlayerSpawn->TeamNumber to 1. We now have a group of PlayerSpawns which are part of "group 1" instead of the "group 0" we created for the attackers.

Now create a PlayerSpawnManager actor for the defending team, somewhere near group 1. Open up its properties, and set the following:

  • PlayerSpawnManager->AssaultTeam = EPSM_Defenders
  • PlayerSpawnManager->bEnabled = True
  • PlayerSpawnManager->PlayerStartTeam = 1

Now we have a second PlayerSpawnManager, which affects all PlayerSpawns with a TeamNumber of 1 ("group 1"), is initially active when the game starts, and tells the game that defenders should spawn here.

Equipment and Supplies[edit]

With a lot of other game types, obtaining the right weapons and ammo are part of the challenge, and thus they're scattered about the map in various locations where people can track down and grab what they want. Assault is a timed challenge, however, and spending a lot of time running all over the place to stock up on weapons every time you die before you can rejoin the assault is both annoying to players and problematic to game flow, so most Assault maps make a point of placing most of the stuff players are going to need conveniently right next to where they're going to spawn, so they can load up quickly and get back into the fight.

The compact way to go about this for weapons and ammo is to use a few WeaponLockers at each spawn area with appropriate weapons for the task at hand. You will generally want at least a couple of WeaponLockers in each spawn area, so that everybody isn't rushing to one point as soon as they spawn and causing a big traffic accident. For each of our two spawn areas, let's add an Actor>>Pickup>>WeaponLocker or two. For each WeaponLocker, we will now need to tell the game what type of weapons we should be supplying. To do this, open the properties, go to the WeaponLocker->Weapons property, and extend the dynamic array for each weapon type you want the given locker to carry. For each new array entry, select the WeaponClass property and choose what type of weapon to use (Note: "SniperRifle" is actually the Lightning Gun. The real sniper rifle is "ClassicSniperRifle"). That's about all there is to it!

You will want to put a bit of thought into what weapons you will have in which lockers, of course. The choice of available weapons can affect not only the enjoyability of the game for the players but how the balance works out (for example, if the defenders all get rocket launchers and shock rifles, and the attackers only get bio rifles, it can make it a lot harder for the attackers to actually get close enough to complete the objective. This isn't necessarily a bad thing, though. Tweaking available weapons is a good way to make adjustments if you find out that part of your map has balance issues). You also don't want to just give everybody everything off the bat, because part of Assault is also the challenge of using what you've been given to achieve a goal. Realism also plays a role too, of course. What self-respecting army would go in to blow up a blast door but arm their soldiers with only flak cannons?

Also, keep in mind that just because you've got WeaponLockers in place doesn't mean you can't hide a goodie or two elsewhere in the map for people to discover and pick up (such as sticking a Flak Cannon behind the crates in RobotFactory, for example). Be creative. Is there some weapon that would be really useful in a particular scenario? Make people put some effort into finding or obtaining it.

For the purposes of our map, we will give the attackers:

Rocket Launcher
We are going to be blowing things up after all..
Lightning Gun ("SniperRifle" in the properties)
To pick off pesky defenders from a safe distance.
Flak Cannon
Challenging for attacking with, but might be useful to those skilled with it.
Link Gun
Good at doing damage to doors as a backup for the rocket launcher, and a decent short-to-mid range weapon for those who can use it.
Minigun
Just because it's always a fun choice for mowing down opposition.

For a little variety, let's give our defenders:

Lightning Gun ("SniperRifle")
For picking off pesky attackers as they come over the hill.
Bio Rifle
Very useful for defending things, for those who know how to use it.
Flak Cannon
For those not skilled enough for the Bio Rifle :)
Shock Rifle
Handy for keeping an oncoming horde at a distance.

Proceed to the next section: Legacy:Assault Mapping Tutorial/Attacking And Defending


This tutorial was originally written and contributed to the Wiki community by Foogod. Questions and comments are welcome! Please either leave them on my personal page or at the bottom of the relevant tutorial page. If you see something which is wrong or unclear and you think needs some correction, please feel free to edit the text directly (that's what the Wiki is for!), but please try to keep the tutorial flow intact (no thread discussions in the middle of the tutorial text, please).

Note: To reduce clutter, comments on the tutorial pages will be periodically moved to the Legacy:Assault Mapping Tutorial/Discussion page. Look there for older comments and thread discussions.

Comments:[edit]

Kirk: Not truly related to the topic at hand, but the PlayerSpawnManager also has something called a ForcedPawnClass. Here you can enter the Pawn you want the player to spawn as. This is particularly useful to spawn a player as/in a vehicle, most notably an ASVehicle_SpaceFighter. The spawnmanager assigns the player to a spawn group as described, so the spacefighter spawns at one of the PlayerStarts that have that group set as their team number. Don't forget to set OverridePawnClass to ESPM_ForcedPawnClass (or at least I think that is necessary for it to work).