The Ship SDK: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Added deckplanner help)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The Ship SDK, an extension of the [[SDK Installation|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 [http://www.moddb.com/games/the-ship/downloads/the-ship-sdk Mod DB]. To run the deckplan script generator, you must have [http://www.microsoft.com/en-us/download/details.aspx?id=19 Microsoft .NET Framework Version 2.0], or later, installed.
{{back | The Ship Level Creation}}
{{DISPLAYTITLE: The Ship SDK Installation}}
{{toc-right}}


[http://www.moddb.com/games/the-ship/downloads/the-ship-sdk http://button.moddb.com/download/medium/7337.png]
The Ship SDK, an extension of the [[SDK Installation|Source SDK]], includes custom map compilation tools, a modified version of [[VMEX]], The Ship's FGD, and a custom tool called ''Deckplanner'' used to create decks for your maps. The tools is created to be used by the Source SDK Developer Tools rather than being a stand alone development kit, as such make sure that you have it installed beforehand.


==News==
{{clr}}
===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==
== Download ==
#Replace all instances of <SteamDir> in this document with your Steam directory (e.g. C:\Program Files (x86)\Steam).
The official The Ship development tools are not available via Steam, instead start off by downloading them from [http://www.moddb.com/downloads/the-ship-sdk ModDB] and extract the content using something like [http://www.7-zip.org/ 7-Zip] to somewhere on your computer like your desktop.  
#Extract all folders in The_Ship_SDK.zip to your "<SteamDir>\SteamApps\common" folder.
#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==
If you plan on using the deckplan script generator, you should also make sure you have the [http://www.microsoft.com/en-us/download/details.aspx?id=17851 Microsoft .NET Framework Version 4.0].
* 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
===Deck Planner===
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====
== Installation ==
The first stage in creating your deckplans is to create the background images. When creating the images, '''be sure to observe the following rules'''...
Before the installation process can begin, make sure you have run the Source SDK and hammer at least once. Then copy all the folders inside of the newly extracted folder  (SourceSDK,sourcesdk_content,The Ship) to the directory where your steam library is located (example ''C:\Program Files\Steam\steamapps\common\''), althrough you may skip ''SourceScheme.res'' if you are prompted to replace it.
*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>''.
Next you will have to tell Hammer where to look for these files you have just pasted. To do this, open the ''GameConfig.txt'' file located in the ''\bin\source2009\bin\'' folder inside of the Source SDK directory and add the following entry to the ''"Games"'' block. You also have to correct all instances of the ''$SteamUserDir'' strings, to the directory where your steam library is located on your computer:


=====Getting Reference Shots=====
<pre>
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.
"The Ship"
{
"GameDir"         "$SteamUserDir\The Ship\ship"
"hammer"
{
"GameData0" "$SteamUserDir\SourceSDK\bin\source2009\bin\ship.fgd"
"TextureFormat" "5"
"MapFormat" "4"
"DefaultTextureScale" "0.250000"
"DefaultLightmapScale" "16"
"GameExe" "$SteamUserDir\The Ship\ship.exe"
"DefaultSolidEntity" "func_detail"
"DefaultPointEntity" "info_player_deathmatch"
"BSP"         "$SteamUserDir\SourceSDK\bin\ship\bin\vbsp.exe"
"Vis"         "$SteamUserDir\SourceSDK\bin\ship\bin\vvis.exe"
"Light"         "$SteamUserDir\SourceSDK\bin\ship\bin\vrad.exe"
"GameExeDir" "$SteamUserDir\The Ship"
"MapDir" "$SteamUserDir\sourcesdk_content\ship\mapsrc"
"BSPDir" "$SteamUserDir\The Ship\ship\maps"
"CordonTexture" "tools\toolsskybox"
"MaterialExcludeCount" "0"
}
}
</pre>


=====A Note on Accuracy=====
== Accessing The Ship SDK ==
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.
To use to the map development tools, simply launch the Source SDK from your Steam library like any other game, then select "Source Engine 2009" for Engine Version and "The Ship" for Current Game. From here you should be able to create new maps by using the [[Hammer Editor]] and using the [[Prefab | prefabs]] that are a part of the sdk installation to easier make your first level.


=====Awkward Shaped Rooms=====
It is furthermore recommended that you decompile the official maps located in ''\The Ship\vpks\depot_2402_dir.vpk'' to get a sense of how to construct the map's gameplay and functionality. [[GCFScape]] is a handy tool for extracting the [[BSP]] map files which are found within the folder ''ship/maps'' in the [[VPK]] package. If you want to create deck plans, please see [[The Ship: Creating a Deckplan | How to create a Deckplan]] for the steps to putting together a deckplan for your maps.
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.


== Package includes ==
The package includes:
* The Ship [[FGD]] file.
* 28 premade frabrications for Hammer.
* Suite of Hammer map command line compiling utilities.
* The deckplan script generator, used to create deck plans.
* Resources required to get the tools running with Source SDK.


====Creating the Imagemaps====
== Where do I go from here? ==
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).
* The [[The Ship Level Creation]] is a good place to go if you are familiar with Source mapping already. If not, you will need to master the basics of Source level design first ([[:Category:Level Design|Level Design]]).  
* If you want to learn about how to create content for the Source Engine in general, the main page of the [[SDK Docs | Source SDK documentation]] is a good place to start.


=====Auto-Generating the Imagemaps=====
== Bugs and issues ==
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.
* If you have a bug specific to the The Ship SDK or game and perhaps know a fix, please add it as an entry to [[The Ship Bugs]].
* See the [[:Category:Source SDK FAQ | Source SDK FAQ]] for answers to general SDK questions.  
* For level design and Hammer editor issues, see the [[:Category:Level Design FAQ | Level Design FAQ]].


*Launch the game in windowed mode and run the map you wish to generate deckplans for.
[[Category:Level Design]][[Category:The Ship]]
*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==
* [[:Category:The Ship]]
* [[The Ship Single Player: Starting your Mod]]
 
[[Category:Third Party Tools]]

Latest revision as of 06:41, 17 August 2023

The Ship Level Creation

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 custom tool called Deckplanner used to create decks for your maps. The tools is created to be used by the Source SDK Developer Tools rather than being a stand alone development kit, as such make sure that you have it installed beforehand.

Download

The official The Ship development tools are not available via Steam, instead start off by downloading them from ModDB and extract the content using something like 7-Zip to somewhere on your computer like your desktop.

If you plan on using the deckplan script generator, you should also make sure you have the Microsoft .NET Framework Version 4.0.

Installation

Before the installation process can begin, make sure you have run the Source SDK and hammer at least once. Then copy all the folders inside of the newly extracted folder (SourceSDK,sourcesdk_content,The Ship) to the directory where your steam library is located (example C:\Program Files\Steam\steamapps\common\), althrough you may skip SourceScheme.res if you are prompted to replace it.

Next you will have to tell Hammer where to look for these files you have just pasted. To do this, open the GameConfig.txt file located in the \bin\source2009\bin\ folder inside of the Source SDK directory and add the following entry to the "Games" block. You also have to correct all instances of the $SteamUserDir strings, to the directory where your steam library is located on your computer:

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

Accessing The Ship SDK

To use to the map development tools, simply launch the Source SDK from your Steam library like any other game, then select "Source Engine 2009" for Engine Version and "The Ship" for Current Game. From here you should be able to create new maps by using the Hammer Editor and using the prefabs that are a part of the sdk installation to easier make your first level.

It is furthermore recommended that you decompile the official maps located in \The Ship\vpks\depot_2402_dir.vpk to get a sense of how to construct the map's gameplay and functionality. GCFScape is a handy tool for extracting the BSP map files which are found within the folder ship/maps in the VPK package. If you want to create deck plans, please see How to create a Deckplan for the steps to putting together a deckplan for your maps.

Package includes

The package includes:

  • The Ship FGD file.
  • 28 premade frabrications for Hammer.
  • Suite of Hammer map command line compiling utilities.
  • The deckplan script generator, used to create deck plans.
  • Resources required to get the tools running with Source SDK.

Where do I go from here?

  • The The Ship Level Creation is a good place to go if you are familiar with Source mapping already. If not, you will need to master the basics of Source level design first (Level Design).
  • If you want to learn about how to create content for the Source Engine in general, the main page of the Source SDK documentation is a good place to start.

Bugs and issues

  • If you have a bug specific to the The Ship SDK or game and perhaps know a fix, please add it as an entry to The Ship Bugs.
  • See the Source SDK FAQ for answers to general SDK questions.
  • For level design and Hammer editor issues, see the Level Design FAQ.