Actions

Difference between revisions of "Fangame How-to:SonicGDK/From installation to game deployment"

From Sonic Retro

m (Text replace - 'Category:Fan Gaming Tutorials' to 'Category:Fan game How-tos')
m
 
(10 intermediate revisions by one other user not shown)
Line 4: Line 4:
  
 
==Engine setup==
 
==Engine setup==
Unreal Development Kit (UDK) is the free edition of Unreal Engine 3, a binary-only version used to create games on the PC. Acquiring UDK is simple; head over to the [http://www.udk.com/download UDK download page] and download the "January 2012 UDK Beta" release. Execute the downloaded .exe file and follow the instructions. After the installation process, close the UDK Editor if it's opened.
+
Unreal Development Kit (UDK) is the free edition of Unreal Engine 3, a binary-only version used to create games on the PC. Acquiring UDK is simple; head over to the [https://www.unrealengine.com/download?dismiss=null UDK download page] and download the "February 2013 UDK Beta" release. Execute the downloaded .exe file and follow the instructions (choose UT3-derived game project). After the installation process, close the UDK Editor if it's opened.
  
 
In order to add Sonic gameplay elements and items to UDK, UnrealScripts defining these elements must be added. A new UnrealScript project must be created which consists of a separate package which contains the new scripts, making sure the engine knows to include those when compiling and using the editor.
 
In order to add Sonic gameplay elements and items to UDK, UnrealScripts defining these elements must be added. A new UnrealScript project must be created which consists of a separate package which contains the new scripts, making sure the engine knows to include those when compiling and using the editor.
Line 10: Line 10:
 
SonicGDK consists of an UnrealScript project, a test map and a pack of custom visual assets. {{LinkRetro|topic=19492|title=Get it}}, uncompress it and copy the SonicGDK's folders Development and UDKGame and the .bat file to the UDK directory. Run the Unreal Frontend tool application (found in the Binaries folder of your UDK directory), click on the "Script" button and choose the "Full recompile" option from the list. If errors appear, make sure the UDK Editor is closed and retry.
 
SonicGDK consists of an UnrealScript project, a test map and a pack of custom visual assets. {{LinkRetro|topic=19492|title=Get it}}, uncompress it and copy the SonicGDK's folders Development and UDKGame and the .bat file to the UDK directory. Run the Unreal Frontend tool application (found in the Binaries folder of your UDK directory), click on the "Script" button and choose the "Full recompile" option from the list. If errors appear, make sure the UDK Editor is closed and retry.
  
Installation is complete; just a note: the first time that you open the test map, it will compile all the material shaders and take a really long time.
+
Close the Unreal Frontend tool; installation is complete. A note: the first time that you open the test map, it will compile all the material shaders and take a really long time.
  
 
==Running a map==
 
==Running a map==
To test the game using a map named "MapName", you have to run the game executable with a special option like "MapName?game=CodePackage.GameInfoClass"; you usually do that with a shortcut. Examples with real maps and SonicGDK:
+
To play a level, just run the "Launch Game.bat" file that you copied to the UDK directory; the main menu will let you choose a level.
 +
 
 +
You can also run the game executable with a special option ("MapName?game=CodePackage.GameInfoClass") and load a level quickly; you usually do that with a shortcut. Examples:
 
   (UDK dir)\Binaries\Win32\UDK.exe SonicGDKTestMap?game=SonicGDK.SGDKGameInfo
 
   (UDK dir)\Binaries\Win32\UDK.exe SonicGDKTestMap?game=SonicGDK.SGDKGameInfo
 
   (UDK dir)\Binaries\Win32\UDK.exe DM-Deck?game=SonicGDK.SGDKGameInfo
 
   (UDK dir)\Binaries\Win32\UDK.exe DM-Deck?game=SonicGDK.SGDKGameInfo
 
   (UDK dir)\Binaries\Win32\UDK.exe VCTF-Necropolis?game=SonicGDK.SGDKGameInfo
 
   (UDK dir)\Binaries\Win32\UDK.exe VCTF-Necropolis?game=SonicGDK.SGDKGameInfo
  (UDK dir)\Binaries\Win32\UDK.exe FoliageMap?game=SonicGDK.SGDKGameInfo
+
You can also run a map if you open it with the editor, but you'll get worse performance.
Alternatively, you can run a map if you open it with the editor, but you'll get worse performance.
+
 
 +
==Building a map==
 +
Follow this [[Fangame How-to:SonicGDK/Building a map|tutorial]].
  
 
==Code project setup==
 
==Code project setup==
If you want to program a new code package (called "MyGame") to use your own assets properly, follow these instructions:
+
If you want to program a new code package (called "MyGame") to add new types of objects properly, follow these instructions:
 
# Close the editor if it's opened.
 
# Close the editor if it's opened.
 
# Open the '''DefaultEngine.ini''' file of ''UDKdir''\UDKGame\Config folder, add a new line "+EditPackages=MyGame" after "+EditPackages=SonicGDK".
 
# Open the '''DefaultEngine.ini''' file of ''UDKdir''\UDKGame\Config folder, add a new line "+EditPackages=MyGame" after "+EditPackages=SonicGDK".
# Add or modify files of the ''UDKdir''\Development\Src\MyGame\Classes folder.
+
# Create the ''UDKdir''\Development\Src\MyGame\Classes folder and add files with code there.
 
# Compile; run the Unreal Frontend tool (''UDKdir''\Binaries\UnrealFrontend.exe), click on the "Script" button and choose the "Compile scripts" option from the list.
 
# Compile; run the Unreal Frontend tool (''UDKdir''\Binaries\UnrealFrontend.exe), click on the "Script" button and choose the "Compile scripts" option from the list.
  
Line 35: Line 39:
 
# Open the '''DefaultEngine.ini''' file of ''UDKdir''\UDKGame\Config folder and change the "Map" and "LocalMap" lines; you must put the name of the first map to load there.
 
# Open the '''DefaultEngine.ini''' file of ''UDKdir''\UDKGame\Config folder and change the "Map" and "LocalMap" lines; you must put the name of the first map to load there.
 
# In case you're using custom code, open the '''DefaultGame.ini''' file of ''UDKdir''\UDKGame\Config folder and change the "DefaultGame", "DefaultServerGame" and "PlayerControllerClassName" lines; you must put the name of the classes you're using.
 
# In case you're using custom code, open the '''DefaultGame.ini''' file of ''UDKdir''\UDKGame\Config folder and change the "DefaultGame", "DefaultServerGame" and "PlayerControllerClassName" lines; you must put the name of the classes you're using.
 +
# ''(Optional)'' Remove '''Default.m4v''' and '''Default.mp4''' files from ''UDKdir''\UDKGame\Movies; they aren't used and are included in the installer by default.
 
# Cook and pack the game; run the Unreal Frontend tool (''UDKdir''\Binaries\UnrealFrontend.exe), clone the ''DM-Deck'' profile, replace ''DM-Deck.udk'' with a list of your maps from the "Maps to cook" section, click on the "Start" button and later on the "Package Game" button.
 
# Cook and pack the game; run the Unreal Frontend tool (''UDKdir''\Binaries\UnrealFrontend.exe), clone the ''DM-Deck'' profile, replace ''DM-Deck.udk'' with a list of your maps from the "Maps to cook" section, click on the "Start" button and later on the "Package Game" button.
  
 
[[Category:Fan game How-tos]]
 
[[Category:Fan game How-tos]]

Latest revision as of 02:41, 28 February 2017

(Original guide by Xaklse)

A version of UDK must be downloaded and installed. Then, a SonicGDK script project needs to be downloaded and added to the engine. In order to develop and test your fangame, code must be compiled at least once. After development is finished, the final step is the creation of an installer file for distribution of your fangame.

Engine setup

Unreal Development Kit (UDK) is the free edition of Unreal Engine 3, a binary-only version used to create games on the PC. Acquiring UDK is simple; head over to the UDK download page and download the "February 2013 UDK Beta" release. Execute the downloaded .exe file and follow the instructions (choose UT3-derived game project). After the installation process, close the UDK Editor if it's opened.

In order to add Sonic gameplay elements and items to UDK, UnrealScripts defining these elements must be added. A new UnrealScript project must be created which consists of a separate package which contains the new scripts, making sure the engine knows to include those when compiling and using the editor.

SonicGDK consists of an UnrealScript project, a test map and a pack of custom visual assets.
Sonic Retro
Get it
, uncompress it and copy the SonicGDK's folders Development and UDKGame and the .bat file to the UDK directory. Run the Unreal Frontend tool application (found in the Binaries folder of your UDK directory), click on the "Script" button and choose the "Full recompile" option from the list. If errors appear, make sure the UDK Editor is closed and retry.

Close the Unreal Frontend tool; installation is complete. A note: the first time that you open the test map, it will compile all the material shaders and take a really long time.

Running a map

To play a level, just run the "Launch Game.bat" file that you copied to the UDK directory; the main menu will let you choose a level.

You can also run the game executable with a special option ("MapName?game=CodePackage.GameInfoClass") and load a level quickly; you usually do that with a shortcut. Examples:

 (UDK dir)\Binaries\Win32\UDK.exe SonicGDKTestMap?game=SonicGDK.SGDKGameInfo
 (UDK dir)\Binaries\Win32\UDK.exe DM-Deck?game=SonicGDK.SGDKGameInfo
 (UDK dir)\Binaries\Win32\UDK.exe VCTF-Necropolis?game=SonicGDK.SGDKGameInfo

You can also run a map if you open it with the editor, but you'll get worse performance.

Building a map

Follow this tutorial.

Code project setup

If you want to program a new code package (called "MyGame") to add new types of objects properly, follow these instructions:

  1. Close the editor if it's opened.
  2. Open the DefaultEngine.ini file of UDKdir\UDKGame\Config folder, add a new line "+EditPackages=MyGame" after "+EditPackages=SonicGDK".
  3. Create the UDKdir\Development\Src\MyGame\Classes folder and add files with code there.
  4. Compile; run the Unreal Frontend tool (UDKdir\Binaries\UnrealFrontend.exe), click on the "Script" button and choose the "Compile scripts" option from the list.


You can then run a map with your custom code and assets. Example with SonicGDK test map:

 (UDK dir)\Binaries\Win32\UDK.exe SonicGDKTestMap?game=MyGame.MyGameInfo

Game deployment

In case you want to distribute your fangame with a single installer file, follow these instructions:

  1. Open the DefaultEngine.ini file of UDKdir\UDKGame\Config folder and change the "Map" and "LocalMap" lines; you must put the name of the first map to load there.
  2. In case you're using custom code, open the DefaultGame.ini file of UDKdir\UDKGame\Config folder and change the "DefaultGame", "DefaultServerGame" and "PlayerControllerClassName" lines; you must put the name of the classes you're using.
  3. (Optional) Remove Default.m4v and Default.mp4 files from UDKdir\UDKGame\Movies; they aren't used and are included in the installer by default.
  4. Cook and pack the game; run the Unreal Frontend tool (UDKdir\Binaries\UnrealFrontend.exe), clone the DM-Deck profile, replace DM-Deck.udk with a list of your maps from the "Maps to cook" section, click on the "Start" button and later on the "Package Game" button.