Difference between revisions of "The Ship SDK"

From Valve Developer Community
Jump to: navigation, search
(Added deckplanner help)
(Removed redundant content)
Line 59: Line 59:
 
* It is recommended that you first decompile a few maps in "<SteamDir>\SteamApps\common\The Ship\vpks\depot_2402_dir.vpk" to get a sense of how to construct the map's gameplay & functionality. [[GCFScape]] is a handy tool for extracting the [[BSP]] files which are found within the folder ship/maps in the [[VPK]].
 
* It is recommended that you first decompile a few maps in "<SteamDir>\SteamApps\common\The Ship\vpks\depot_2402_dir.vpk" to get a sense of how to construct the map's gameplay & functionality. [[GCFScape]] is a handy tool for extracting the [[BSP]] files which are found within the folder ship/maps in the [[VPK]].
 
* All tools are located in folder ...\SourceSDK\bin\ship\bin
 
* All tools are located in folder ...\SourceSDK\bin\ship\bin
===Deck Planner===
+
* See [[The Ship: Creating a Deckplan]] for the steps to putting together a deckplan for your maps.
The following explanation was provided by [OL]Subs.
 
====Introduction====
 
=====Tools=====
 
To make a deckplan you'll need...
 
*Everything required to make a regular Source engine texture.
 
*A web image-mapping tool (something that converts rectangular areas of an image with individual attributes into HTML).
 
**Try [http://www.boutell.com/mapedit/ Mapedit] - it's the best we've come across, and has a free trial.
 
*A script to convert HTML image map data to a Source key-values file.
 
**''SourceSDK/bin/ship/bin/deckplanner/deckplanner.exe'' (see below).
 
{{note|Although this guide is roughly sequential, you'll probably jump back and forth between hot-spotting and checking results in-game - run the game windowed and you can do everything at the same time.}}
 
 
 
====Creating the Deckplan Images====
 
The first stage in creating your deckplans is to create the background images. When creating the images, '''be sure to observe the following rules'''...
 
*Each deck should be contained within a separate 1024x256 targa image.
 
**Leave at least 100 pixels at the right of the image empty.
 
**Leave at least 10 pixels at the top and bottom of the image empty.
 
*The ship should be pointing to the right.
 
*Images must use the correct filename and directory. Using the example of Batavier (batavier.bsp)...
 
**Deckplan images would be ''batavier_deck_a.tga'', ''batavier_deck_b.tga'', etc...
 
**Compiled materials must be in the folder ''materials/vgui/deckplans/batavier''.
 
**Also export BMP versions of the images into ''scripts/deckplans/batavier''.
 
*An 8-bit alpha channel is used to define transparency.
 
 
 
Once you have your images, use your preferred method of creating source engine materials to turn your TGA's into VMTs/VTFs for use in the game. Ensure they are in the folder ''materials/vgui/deckplans/<mapname>''.
 
 
 
=====Getting Reference Shots=====
 
In order to make drawing the deckplan images simpler, you will want to get some reference screenshots of the level which you can then paint over. There are a few methods you may want to adopt to do this, but the general idea is to open your level in Hammer and create views of only one deck at a time. You may do this by separating the map into various visgroups, allowing you to look at only one deck at a time by simply turning the others off. On the other hand, you could try using the cordon tool to cull out any elements of the map outside of a resizeable bounding box. Regardless of the method, you can then either take a screenshot of the deck directly within Hammer (either the orthographic top-down view, or from the 3D perspective view), or you can compile the map and get a screenshot in-game by flying above it using noclip.
 
 
 
=====A Note on Accuracy=====
 
These images can be thought of "artists interpretations" of the ship - they DO NOT have to mimic the ship 100% accurately. Feel free to draw the deckplans in a way that makes them easy to interpret and pleasant to look at rather than being completely accurate or to scale.
 
 
 
=====Awkward Shaped Rooms=====
 
When in-game, the rooms on the deckplan flash due to certain events. These flashing areas are defined by axis-aligned rectangular boxes, as will be covered later. Rooms that cannot be defined by a combination of axis-aligned rectangles alone (e.g. those with curved or angled sections) must have masks created for them. It would be sensible to create masks for these awkward rooms at the same time as you are drawing the deckplan images. Each mask should be seperate TGA file, with a alpha channel defining the shape of the room.
 
 
 
 
 
====Creating the Imagemaps====
 
With the images created, we need to define the rooms within each deck such that they represent the rooms in the map defined as by the level designer. We do this through HTML imagemaps, which allows us to use tools such as [http://www.boutell.com/mapedit/ Mapedit] to define areas on an image and assign them with properties (normally the URL to link to, but in our case the name of the room).
 
 
 
=====Auto-Generating the Imagemaps=====
 
The first step is to auto-generate HTML imagemaps for each of the decks. Though the output will not match your deckplan images, it provides a good starting point and saves you entering room names and numbers manually. This is done in-game by running the "deckplan_generate_all" and "deckplan_generate_deck" console commands. These commands look at all of the ship_trigger_room entities placed in the level (or within the given deck) by the level designer and use their boundaries to build an accurate representation of the ship's room layout.
 
 
 
*Launch the game in windowed mode and run the map you wish to generate deckplans for.
 
*Bring up the console and run the command "deckplan_generate_all <rotation> <scale>".
 
**<rotation> is a value, in degrees, to rotate the deckplans through. This should be a multiple of 90.
 
**<scale> is the value you wish to scale the resulting coordinates by to make them more suited to the size of the deckplan images. Typically this should be around 0.2, but varies depending on the map.
 
*If you wish to generate the image map for a single deck, use the command "deckplan_generate_deck <deckname> <rotation> <scale>"
 
**<deckname> is the name of the deck, using the format "#Ship_Deck<deck>", e.g. "#Ship_DeckA".
 
*Use MapEdit to open the generated HTML file for one of the largest decks.
 
**Check that the generated image map is oriented correctly.
 
**Check that all of the rooms fit on the image.
 
**If both of those checks are passed, then we are done with auto-generating our initial deckplans.
 
**If you get a message saying MapEdit cannot find the image, you haven't got the BMP of the deckplan in your ''scripts/deckplans/<mapname>'' folder.
 
 
 
=====Tweaking the Imagemaps=====
 
With the deckplan imagemaps generated, the next job is to tidy them up.
 
 
 
*Open the first HTML deckplan file.
 
*Use the "Move or resize ENTIRE imagemap" tool to approximately line up the imagemap with the image.
 
**Rather than aligning with one of the extremities, try and line up the rooms in the center - this will even out the inaccuracies between each end.
 
*Use the "Test and Edit Hotspots" tool to view a hotspot's properties.
 
**The only property we care about is the URL, which is where we define the room properties.
 
**Following the room name, a room number may be specified as a parameter with "\<room_number>".
 
***e.g. "corridor \3".
 
**Hotspots on the same deck with the same room name and room number are treated as one room in-game.
 
*Use the "Move points (resize hotspot)" tool to select each hotspot, move it into position, and resize it as necessary.
 
**Remember that rooms will often be made up of more than one hotspot.
 
**Sometimes 2 or more hotspots with identical properties cover an area that could be safely covered with just one hotspot - feel free to use just one and delete the others.
 
**Be careful not to ignore room numbers - they are just as important as room names!
 
 
 
=====Using Image Masks=====
 
*Rooms that require masks should have their hotspot cover the entire room, even if this means overlapping other rooms.
 
*You can define the mask in the URL by adding the parameter "\image <mask_image>".
 
**<mask_image> is the filename of the mask image
 
**e.g. "davy_jones_bar \image bar1_mask"
 
 
 
=====Adding Needs Icons=====
 
We can add icons to the deckplan that can be toggled on and off in-game by the player in order to help them find ways to fulfill their needs. We define these icons by adding them as a parameter to a hotspot URL, just in the same way as we do with room numbers and image masks. The icons will appear in the centre of the hotspot to which we assign them. Below are the various icons we can use; a hotspot can use as many or as few of these as necessary...
 
 
 
  /icon_meal
 
  /icon_drink
 
  /icon_wcmale
 
  /icon_wcfemale
 
  /icon_shower
 
  /icon_sleep
 
  /icon_dance
 
  /icon_cash
 
  /icon_shop
 
  /icon_health
 
  /icon_elevator
 
 
 
*e.g. "corridor \7 \icon_drink \icon_meal"
 
 
 
 
 
====Bringing it Together In-Game====
 
Once you are happy with the HTML deckplans, you need to get them into the format used by the game engine.
 
 
 
*Run the program ''...\SourceSDK\bin\ship\bin\deckplanner\deckplanner.exe''
 
*You will be prompted to enter the "BSP name".
 
*You will then be prompted to enter the level's "display name" - this is the name to be shown on the deckplan.
 
*Provided you have all of the HTML files in the correct directory, this should now generate a .txt file in the same place.
 
*Run the game, and your deckplan will be functional for you to test.
 
 
 
=====Testing and Making Corrections=====
 
It is likely that during your testing you will notice some things are not correct in your deckplan. By running the game in windowed mode you can easily make changes to the deckplan and check them immediately, making the deckplans very easy to debug.
 
 
 
*To assist in debugging, force the game to display room numbers in your position info for all room types with "ship_force_show_all_room_numbers 1".
 
**By default only cabins and a few other room types show their room numbers.
 
*If you find a problem with the deckplans, alt-tab out of the game and into MapEdit.
 
**Make the necessary changes to whatever deck you are correcting.
 
**Save the HTML file.
 
*Re-run the deckplan script on your level.
 
*Alt-tab back into the game.
 
**Open the console and type "ship_cl_reload_deckplan".
 
**Check your changes and continue testing.
 
  
 
==See Also==
 
==See Also==

Revision as of 05:28, 21 January 2014

The Ship SDK, an extension of the Source SDK, includes custom map compilation tools, a modified version of VMEX, The Ship's FGD, and a tool called Deckplanner. The Ship SDK is available at Mod DB. To run the deckplan script generator, you must have Microsoft .NET Framework Version 2.0, or later, installed.

7337.png

News

Sunday, January 19, 2014 SDK Update

  • Resolved issues with using The Ship SDK with the latest Source SDK. Once installed, "The Ship" can be found under "Source SDK 2009" in the Source SDK launcher.
  • Ship tools are now based in folder ...\SourceSDK\bin\ship\bin

Tuesday, January 15, 2007 SDK Update

  • Fixed errors with running The Ship SDK with the Orange Box release of the Source SDK.

Saturday, March 31, 2007 SDK Update

  • Adopted the official Outerlight FGD provided by [OL]Subs (Neil Davidson from Outerlight)
  • Added a tool called deckplanner which can be found in folder ...\sourcesdk\bin\deckplanner
    • Algorithm provided by [OL]Subs
  • Added some sample deckplan files provided by [OL]Subs

Tuesday, April 3, 2007 SDK Update

  • Minor update to deckplan generator utility
  • Added Atalanta's deckplan source files to folder ...\sourcesdk_content\ship

Sunday, May 20, 2007 SDK Update

  • Ship tools are now based in folder ...\sourcesdk\ship
  • Official compilation tools are included

Monday, June 1th, 2009 SDK Update

  • Folder structure modified to accommodate Source SDK folder structure changes

Installation

  1. Replace all instances of <SteamDir> in this document with your Steam directory (e.g. C:\Program Files (x86)\Steam).
  2. Extract all folders in The_Ship_SDK.zip to your "<SteamDir>\SteamApps\common" folder.
  3. Open "<SteamDir>\SteamApps\common\SourceSDK\bin\source2009\bin\GameConfig.txt" and add the following entry.
    Note:If no such file exists, run the Source SDK once.

Before

	}
	"SDKVersion"		"4"

Add

		"The Ship"
		{
			"GameDir"		"<SteamDir>\SteamApps\common\The Ship\ship"
			"hammer"
			{
				"GameData0"		"<SteamDir>\SteamApps\common\SourceSDK\bin\source2009\bin\ship.fgd"
				"TextureFormat"		"5"
				"MapFormat"		"4"
				"DefaultTextureScale"		"0.250000"
				"DefaultLightmapScale"		"16"
				"GameExe"		"<SteamDir>\SteamApps\common\The Ship\ship.exe"
				"DefaultSolidEntity"		"func_detail"
				"DefaultPointEntity"		"info_player_deathmatch"
				"BSP"		"<SteamDir>\SteamApps\common\SourceSDK\bin\ship\bin\vbsp.exe"
				"Vis"		"<SteamDir>\SteamApps\common\SourceSDK\bin\ship\bin\vvis.exe"
				"Light"		"<SteamDir>\SteamApps\common\SourceSDK\bin\ship\bin\vrad.exe"
				"GameExeDir"		"<SteamDir>\SteamApps\common\The Ship"
				"MapDir"		"<SteamDir>\SteamApps\common\sourcesdk_content\ship\mapsrc"
				"BSPDir"		"<SteamDir>\SteamApps\common\The Ship\ship\maps"
				"CordonTexture"		"tools\toolsskybox"
				"MaterialExcludeCount"		"0"
			}
		}

Usage

  • Launch Source SDK from Steam. Select "Source Engine 2009" for Engine Version. Select "The Ship" for Current Game.
  • It is recommended that you first decompile a few maps in "<SteamDir>\SteamApps\common\The Ship\vpks\depot_2402_dir.vpk" to get a sense of how to construct the map's gameplay & functionality. GCFScape is a handy tool for extracting the BSP files which are found within the folder ship/maps in the VPK.
  • All tools are located in folder ...\SourceSDK\bin\ship\bin
  • See The Ship: Creating a Deckplan for the steps to putting together a deckplan for your maps.

See Also