Pirates, Vikings, & Knights II

Pirates, Vikings, & Knights II

Otillräckligt med betyg
Getting started with mapping for PVKII 3.0
Av Lewis Laswell
Learn how to configure the map editor and set up each game mode. This guide was originally posted on the official PVKII forum by Lhorkan in 2014, but is no longer available there due to the website being down.
   
Utmärkelse
Favorit
Favoritmarkerad
Avfavoritmarkerad
1.0 Setting up Hammer
So, you've decided to create a custom map? Great! Let's get you set up. The Source engine world editor is called Hammer, and it now ships with every Source game instead of being stand alone in the Source SDK package.

1.1 Start Hammer for the first time

You will find hammer.exe in \Steam\SteamApps\common\Pirates, Vikings and Knights II\sdkbase_pvkii\bin. You'll do well to create a shortcut to it. Start it, then go to Tools -> Options. You'll see the following:


[new image]

Hammer does a guess at what files and paths to use, but many of them are wrong. You will need to change them accordingly for Hammer to work:

  1. Select the item in Game Data Files and remove it.
  2. Still under Game Data Files, click Add, and browse to \Steam\SteamApps\common\Pirates, Vikings and Knights II\pvkii. Select pvkii.fgd and hit OK.
  3. At the bottom of the window, under Game Directory, hit Browse and navigate to \Steam\SteamApps\common\Pirates, Vikings and Knights II\pvkii. Hit OK.
  4. The VMF directoy can be freely chosen (.vmf is what Hammer saves maps in - not to be confused with the compiled maps you can play on, those are .bsp). However, it is common practice to place them in \Steam\SteamApps\common\Pirates, Vikings and Knights II\pvkii\mapsrc. You'll probably have to make this directory first.
  5. Lastly, go to the final tab, Build Programs. All the executables should already be filled out correctly (if they aren't, they are all located in \Steam\SteamApps\common\pirates, vikings and knights ii\sdkbase_pvkii\bin\). However, the compiled maps directory is wrong. Change it to \Steam\SteamApps\common\pirates, vikings and knights ii\pvkii\maps.
  6. Hit OK to close the options window, and restart Hammer. You're good to go!

1.3 Start mapping

To get to know Hammer, I will refer you to the very capable hands of Interlopers[www.interlopers.net]. You can find an extended list of tutorials here[unavailable forum post]. I am assuming you have basic Hammer knowledge from here on out.

Editor's comment
TopHATTwaffle's version 2 tutorial series[www.tophattwaffle.com] is a great video based source for complete beginners.

The Valve developer wiki should be your go-to site whenever you need info about how a specific brush or entity works, or about general mapping concepts. For instance, it has great articles on lighting.

In the next post[section], I'll show you how to create a map that uses one of PVKII's game modes.
2.0 PVKII Game modes (part 1)
2.1 info_pvk



Every PVKII map needs to have the point entity info_pvk. It defines what game mode the map uses, and gives access to some useful events and parameters. It can be placed at any location in the map.

Hint
If you quickly want to select or navigate to an entity, go to Map -> Entity Report..., and enter the class of the entity in the "by class" textbox. You can also search by targetname or other properties in the key/value field. This is very useful if your map grows in size and you don't remember where you put a certain object.

With the info_pvk in place, I'll show you what a map needs for every game mode in order to work, with the exception of Deathmatch; that is the lack of a game mode, as it just lets the teams kill each other without any type of scoring system.

2.2 Booty



2.2.1 info_pvk settings

The first step in creating a booty map is setting the game mode to Booty in your info_pvk. By default, all teams will have an equal amount of tickets (the actual round time is a server setting, and can't be changed by the mapper). However, in some scenarios you want a certain team to take longer to win. Take bt_island, for instance. This is where the P / V / K Timer Add (minutes) property in the info_pvk comes in. Another Booty related property is Booty Chest Lock Time; I don't think you need an explanation on what this does.

2.2.2 Adding the booty

With the game mode set up, it's time to add chests o' booty to your map. This is as simple as adding the weapon_chest point entity at the location where you want a chest to spawn at round start. PVKII will automatically count the amount of chests you have in the map, so you don't need to worry about a thing.

2.2.3 Defining chest zones

No use in having booty without a place to drop it off. Each team needs a func_chestzone brush entity, with the tools/tooltrigger texture applied to it. Intuitively, the volume of the brush marks the area in which chests will be captured. All you have to change in its properties is the Team Number property.

With a chest zone for every team and booty to put in it, you're good to go!

Hint
When you're testing your map in single player through the Create Game menu option, you will still get the "Waiting for players" message. To start the round and see if everything is in order, you can add bots. Open up the console, enter sv_cheats 1, then sv_lan 1 and finally spam bot_add a number of times. You'll still have to wait a bit for the round to start.

If you're like me and don't have a keyboard that allows the console to open, the easiest way around this is opening Steam, right clicking on PVKII, opening its Properties and adding

-toconsole

to its Launch Options.

Editor's comment
The correct command is addbot. Alternatively, you can use bot_quota # or set up a single player game with bots via the main menu. To remove all bots, return bot_kick_all or bot_quota 0.

2.3 Trinket Wars



2.3.1 info_pvk settings

Trinket wars maps are by far the easiest in the game mode preparations department: All it takes is setting the game mode in the info_pvk to Trinket Wars. PVKII will take care of the rest.
2.0 PVKII Game Modes (part 2)
2.4 Territory



2.4.1 info_pvk settings

Set the game mode to Territory in the info_pvk. By default, a team can only win by decreasing its tickets to 0. By changing the Territory Win Condition property, you can also make a team win that's holding all territories for a set amount of time; the Territory Win Delay.

2.4.2 Adding territories

You create a territory by making a func_territory brush entity at the desired location, with the tools/toolstrigger texture. The volume of the brush marks the bounds of the territory.

When making more than one territory, keep in mind that each territory must have a unique Territory Index. All the necessary info on that and the territory icon are provided in the Help section of the properties window.

Since the map update patch, territory bounds are displayed visually with a semi transparent ring that changes color along with the owning team. On top of that, the team holding a territory will get their health regenerated while standing in it. This is all done in Hammer. To make it easy for you and to promote uniformity, I attached a sample .vmf with four territories ready to be used, fully equipped with these two features. Don't forget to copy the three filter_activator_teams if you decide to use this template. [The map file isn't included in the Steam version.]

Hint
If you look at the template .vmf, you'll see that the func_territory, trigger_hurt and func_brush brush entities are all inside of each other, making it hard to select the right one. You can click and hold with the Select tool in the Perspective view to cycle through every object under your cursor. It's a good idea to keep the Properties windows open while doing this, so you can quickly see what object you have currently selected.

Hint
If you want a fifth territory with the two additional features, you don't have to go through the effort of manually remaking every brush entity and setting up the Input/Output chain. Simply select the group of objects you wish to duplicate, hit Ctrl-C, and then go to Edit -> Paste special.... Check the Add this prefix to all named entities option, and enter a meaningful prefix there. Hammer will then not only add that prefix to every copied object, but also automatically fix the names in the Input/Output chain for all the new copies.

Editor's comment
The template uses a trigger_hurt in combination with a filter_activator_team to heal players whose faction controls the territory. This approach is obsolete: nowadays, func_territory contains keyvalues and flags related to regenerating HP, AP and SP.

The template also includes a glowing perimeter, which you can create as follows:
  1. duplicate the func_territory
  2. change its class to func_brush
  3. give it a unique name
  4. set the entity's solidity to Never Solid
  5. apply the NoDraw material
  6. texture the perimeter with territory_border
  7. resize the brush (e.g. 32 units high)
  8. add four outputs to the func_territory, which set the colour of the func_brush based on what faction controls it

2.5 Last Team Standing



2.5.1 info_pvk settings

Set the game mode to Last Team Standing. The property Sudden Death Duration (seconds) overwrites the time to round draw after sudden death has started.

2.5.2 Sudden Death

Just changing the game mode is enough to make a working LTS map, but it's not going to be a very interesting one. The star of any LTS map is the sudden death, in which you can get as creative as you like. You can make anything happen that's possible with Source through the OnSuddenDeath output in info_pvk.

The info_point_vulture which used to spawn vultures at sudden death no longer works.

2.6 Objective push



2.6.1 info_pvk settings

Set the game mode to Objective Push. You can't set the round time in the properties, but you can change it with an input to the entity: OnRoundRestart -> info_pvk -> SetRoundTimer <value in seconds>.

2.6.2 Complete freedom

Objective push is a very special game mode: It allows the mapper to invent his own victory conditions. Only your skill with Hammer limits what you can do with it. You control everything through entity i/o, and the commands you need for the game mode are explained in Crackapolly's thread[unavailable forum post].
3.0 Best Practices
Will2k's Source Optimization Tutorials[www.mapcore.org]

And more resources[unavailable forum post]
Editor's addendum
With BSPSource, you can decompile both official and custom maps for learning purposes. Furthermore, you can join the official PVKII Discord server[discord.gg] and/or the Source Engine Discord server[discord.gg] to discuss the art of mapping and ask for help when stuck.

I recommend using Hammer++ instead of the default editor. To make it work, you must follow the instructions to set up Hammer++ for Source SDK Base 2013 Multiplayer. Next, you point at the relevant PVKII files in the editor's Configuration window (tools > options). If you've set up the default editor already, you can simply copy the file paths from there.