<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://zero-k.info/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=HigherFlyer</id>
	<title>Zero-K - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://zero-k.info/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=HigherFlyer"/>
	<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/Special:Contributions/HigherFlyer"/>
	<updated>2026-05-19T09:55:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://zero-k.info/mediawiki/index.php?title=Zero-K_Infra_Guide&amp;diff=7221</id>
		<title>Zero-K Infra Guide</title>
		<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/index.php?title=Zero-K_Infra_Guide&amp;diff=7221"/>
		<updated>2021-01-20T15:41:43Z</updated>

		<summary type="html">&lt;p&gt;HigherFlyer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Zero-K Infrastructure is complicated and understanding it is most of the battle, this is an overview of the structure and contents of ZK Infra.&lt;br /&gt;
&lt;br /&gt;
It's always a good idea to review dev Philosophy.&lt;br /&gt;
== ZK's Devving Philosophy (social rules) ==&lt;br /&gt;
* &amp;quot;War is a product of anticommunication&amp;quot;&lt;br /&gt;
** Communicate with other devs about your changes/fixes, let them understand the issue. Do not make 'random' changes.&lt;br /&gt;
* &amp;quot;Do not create work for other people.&amp;quot;&lt;br /&gt;
** Have responsibility for your changes/commit. Do not leave bugs that require other people to fix.&lt;br /&gt;
* &amp;quot;Readability &amp;amp; performance are equally important.&amp;quot; &lt;br /&gt;
** Optimize code but not to the point of unreadability. [http://c2.com/cgi/wiki?RulesOfOptimization Remember the rules of optimization]:&lt;br /&gt;
*** Don't.&lt;br /&gt;
*** Don't (yet).&lt;br /&gt;
*** Profile before doing it.&lt;br /&gt;
* &amp;quot;If it ain't broke, don't fix it.&amp;quot;&lt;br /&gt;
** Don't code fixes that nobody wants to problems that don't exist.&lt;br /&gt;
&lt;br /&gt;
== General overview ==&lt;br /&gt;
* What's in what folder etc, goes here&lt;br /&gt;
&lt;br /&gt;
== More in depth look at each folder ===&lt;br /&gt;
&lt;br /&gt;
== What's happening with this page ==&lt;br /&gt;
To be filled in as I go and as I learn, right now I don't know anything for concrete so I'm hesitant to fill anything out here... yet.&lt;/div&gt;</summary>
		<author><name>HigherFlyer</name></author>
		
	</entry>
	<entry>
		<id>https://zero-k.info/mediawiki/index.php?title=Zero-K_Infra_Guide&amp;diff=7220</id>
		<title>Zero-K Infra Guide</title>
		<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/index.php?title=Zero-K_Infra_Guide&amp;diff=7220"/>
		<updated>2021-01-20T15:22:39Z</updated>

		<summary type="html">&lt;p&gt;HigherFlyer: Creating a skeleton of this page to change as I go&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Zero-K Infrastructure is complicated and understanding it is most of the battle, this is an overview of the structure and contents of ZK Infra.&lt;br /&gt;
&lt;br /&gt;
It's always a good idea to review&lt;br /&gt;
== ZK's Devving Philosophy (social rules) ==&lt;br /&gt;
* &amp;quot;War is a product of anticommunication&amp;quot;&lt;br /&gt;
** Communicate with other devs about your changes/fixes, let them understand the issue. Do not make 'random' changes.&lt;br /&gt;
* &amp;quot;Do not create work for other people.&amp;quot;&lt;br /&gt;
** Have responsibility for your changes/commit. Do not leave bugs that require other people to fix.&lt;br /&gt;
* &amp;quot;Readability &amp;amp; performance are equally important.&amp;quot; &lt;br /&gt;
** Optimize code but not to the point of unreadability. [http://c2.com/cgi/wiki?RulesOfOptimization Remember the rules of optimization]:&lt;br /&gt;
*** Don't.&lt;br /&gt;
*** Don't (yet).&lt;br /&gt;
*** Profile before doing it.&lt;br /&gt;
* &amp;quot;If it ain't broke, don't fix it.&amp;quot;&lt;br /&gt;
** Don't code fixes that nobody wants to problems that don't exist.&lt;br /&gt;
&lt;br /&gt;
== General overview ==&lt;br /&gt;
* What's in what folder etc, goes here&lt;br /&gt;
&lt;br /&gt;
== More in depth look at each folder ===&lt;br /&gt;
&lt;br /&gt;
== What's happening with this page ==&lt;br /&gt;
To be filled in as I go and as I learn, right now I don't know anything for concrete so I'm hesitant to fill anything out here... yet.&lt;/div&gt;</summary>
		<author><name>HigherFlyer</name></author>
		
	</entry>
	<entry>
		<id>https://zero-k.info/mediawiki/index.php?title=Zero-K:Developing&amp;diff=7219</id>
		<title>Zero-K:Developing</title>
		<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/index.php?title=Zero-K:Developing&amp;diff=7219"/>
		<updated>2021-01-20T15:15:33Z</updated>

		<summary type="html">&lt;p&gt;HigherFlyer: Adding in links to a potential page about the structure of Zero-K infra.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New developers should read this before touching the source.&lt;br /&gt;
&lt;br /&gt;
== ZK's Devving Philosophy (social rules) ==&lt;br /&gt;
* &amp;quot;War is a product of anticommunication&amp;quot;&lt;br /&gt;
** Communicate with other devs about your changes/fixes, let them understand the issue. Do not make 'random' changes.&lt;br /&gt;
* &amp;quot;Do not create work for other people.&amp;quot;&lt;br /&gt;
** Have responsibility for your changes/commit. Do not leave bugs that require other people to fix.&lt;br /&gt;
* &amp;quot;Readability &amp;amp; performance are equally important.&amp;quot; &lt;br /&gt;
** Optimize code but not to the point of unreadability. [http://c2.com/cgi/wiki?RulesOfOptimization Remember the rules of optimization]:&lt;br /&gt;
*** Don't.&lt;br /&gt;
*** Don't (yet).&lt;br /&gt;
*** Profile before doing it.&lt;br /&gt;
* &amp;quot;If it ain't broke, don't fix it.&amp;quot;&lt;br /&gt;
** Don't code fixes that nobody wants to problems that don't exist.&lt;br /&gt;
&lt;br /&gt;
== What is in source codes ==&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K Zero-K] contains the game proper&lt;br /&gt;
** units folder contains unit definition files&lt;br /&gt;
*** You can read the wiki about game development for [http://springrts.com/wiki/Main_Page Spring Engine] &lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K-Infrastructure]&lt;br /&gt;
** Zero-K.info: Website sources&lt;br /&gt;
** ZkLobbyServer: Lobby server (for MP)&lt;br /&gt;
** ZkData: Website/server database structure&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Chobby Chobby] contains the lobby client&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Artwork Zero-K-Artwork] contains sources for 2D art, 3D art and sounds&lt;br /&gt;
* [https://github.com/ZeroK-RTS/SpringRTS-Tools SpringRTS-tools] contains various dev tools&lt;br /&gt;
** Upspring - required to edit the .3do and .s3o model files used in the game&lt;br /&gt;
** MapIconBuilder - unit map icon sources are here&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Missions Zero-K-Missions] contains source files for official ZK missions&lt;br /&gt;
&lt;br /&gt;
=== Style Guide===&lt;br /&gt;
The lua in the menu (chobby) and game proper should use the following whitespace:&lt;br /&gt;
* Indent with tabs.&lt;br /&gt;
* A tab may only follow a newline or another tab.&lt;br /&gt;
* If the text across two lines is being aligned (such as for a long function) then the two lines must have the same number of tabs.&lt;br /&gt;
* Don't try stack flow of control into one line. For example, put newlines after &amp;lt;code&amp;gt;then&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt;.&lt;br /&gt;
* End files with a newline.&lt;br /&gt;
* Commas should be followed by whitespace. Relations (=, &amp;lt;, &amp;lt;=, &amp;gt;=, ==, ~=) should have whitespace on each side.&lt;br /&gt;
* if a conditional is to take up multiple lines, double indent the extra lines and end the line with a conjunction (See Gallery below)&lt;br /&gt;
These guidelines are not necessarily followed in old files so updating them with a separate commit is a good idea prior to making large changes. Also, unitdefs use two-space indentation instead of tabs.          &lt;br /&gt;
&lt;br /&gt;
There are a few guildines for dealing with Spring functions.&lt;br /&gt;
* Localisation of Spring.Function should be named spFunction.&lt;br /&gt;
* Localisation of Spring.MoveCtrl.Function should be named spMoveCtrlFunction.&lt;br /&gt;
* Spring.GetCommandQueue should be used rather than Spring.GetUnitCommands (it's an alias, we just picked one).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Styleguide-if-example.JPG|Proper multiline if statement&lt;br /&gt;
Styleguide-stackflow.JPG|Example of stacked flow control&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting sources ==&lt;br /&gt;
This is a guide to downloading Zero-K sources from [https://github.com/ GitHub] using [https://tortoisegit.org/ TortoiseGit]. The game sources are used as an example, however this method applies to other subprojects as well.&lt;br /&gt;
* Install [https://tortoisegit.org/download/ TortoiseGit].&lt;br /&gt;
* Create a [https://github.com/ GitHub] account.&lt;br /&gt;
[[File:ForkZK.jpg]]&lt;br /&gt;
* Log in to GitHub and [https://github.com/ZeroK-RTS Locate] the repository you want to edit.&lt;br /&gt;
* Click the &amp;quot;Fork&amp;quot; button on the GitHub website to create your own copy on GitHub.&lt;br /&gt;
[[File:ZKCloneCopy.png|1103px]]&lt;br /&gt;
* Locate your fork on GitHub and click &amp;quot;Code&amp;quot;.&lt;br /&gt;
* Copy the web URL to your clipboard.&lt;br /&gt;
[[File:localCloneZK.jpg]]&lt;br /&gt;
* Create a folder called 'zk.sdd' in your Zero-K install under games.&lt;br /&gt;
* Right click on 'zk.sdd' and select 'Git Clone...' from the context menu.&lt;br /&gt;
[[File:cloneUIZK.jpg]]&lt;br /&gt;
* Copy the web URL into the 'URL:' field of the clone interface.&lt;br /&gt;
* Ensure that the 'Directory:' field ends in 'zk.sdd'. It is likely to automatically contain the path '...\Zero-K\games\zk.sdd\Zero-K' so be sure to delete the '\Zero-K' at the end.&lt;br /&gt;
[[File:cloneSuccess.jpg]]&lt;br /&gt;
* Wait for the sources to download.&lt;br /&gt;
* Your 'zk.sdd' folder should look something like the image above.&lt;br /&gt;
&lt;br /&gt;
== Updating sources ==&lt;br /&gt;
Keep your sources up to date by periodically syncing your fork to the original repository (using 'compare', see: https://github.com/KirstieJane/STEMMRoleModels/wiki/Syncing-your-fork-to-the-original-repository-via-the-browser, then do &amp;quot;rebase and merge&amp;quot; instead of &amp;quot;merge&amp;quot;) and doing TortoiseGit -&amp;gt; Pull on your repository folder to take the changes from GitHub to your local files.&lt;br /&gt;
&lt;br /&gt;
== Modifying the game ==&lt;br /&gt;
:''For personal modding, see [[Mod Creation]]''&lt;br /&gt;
Follow the instructions in 'Getting sources' the download the Zero-K game sources. Feel free to inspect and edit the game files. Most developers using Windows edit lua files with [https://notepad-plus-plus.org/download/v7.6.6.html Notepad++].&lt;br /&gt;
&lt;br /&gt;
To test your changes:&lt;br /&gt;
* (If using Windows make sure your file explorer has file name extensions enabled; for example the chobby_wrapper_port file should have a .txt on the end of its name.)&lt;br /&gt;
* Create an empty text file named 'devmode.txt' in the same directory as Zero-K.exe.&lt;br /&gt;
* Launch Zero-K.exe.&lt;br /&gt;
[[File:enableDevMode.jpg]]&lt;br /&gt;
* Select 'Zero-K Dev' in Settings -&amp;gt; Developer -&amp;gt; Singleplayer (you may need to scroll down).&lt;br /&gt;
[[File:startTest.jpg]]&lt;br /&gt;
* From the main menu select Singleplayer -&amp;gt; Skirmish -&amp;gt; Advanced -&amp;gt; Start to launch a test game. Note that the game type should be automatically set to 'Zero-K $VERSION'.&lt;br /&gt;
* In the game, press F8 to open debug console. It'll display errors and output to the log.&lt;br /&gt;
&lt;br /&gt;
== Modifying the lobby menu ==&lt;br /&gt;
Follow the instructions in 'Getting sources' with the following adjustments:&lt;br /&gt;
* The repository that you want to edit is https://github.com/ZeroK-RTS/Chobby.&lt;br /&gt;
* It is best to call the folder something like 'zkmenu.sdd', to avoid confusion.&lt;br /&gt;
Make sure that the 'Directory:' field ends in '.sdd'. You should end up with something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:zkmenufolder.jpg]]&lt;br /&gt;
&lt;br /&gt;
To test your changes launch Zero-K.exe with the &amp;lt;tt&amp;gt;dev&amp;lt;/tt&amp;gt; arg (i.e. &amp;lt;code&amp;gt;Zero-K.exe dev&amp;lt;/code&amp;gt;). On windows this is best done by creating a shortcut and changing the target, as shown below.&lt;br /&gt;
[[File:targetZK.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Submitting changes ==&lt;br /&gt;
Git provides a systematic way to review and merge changes into the main repositories. The main game repository is used as example, but this method works for other repositories as well.&lt;br /&gt;
&lt;br /&gt;
The simple way to commit changes is as follows.&lt;br /&gt;
* Make some changes to your local files.&lt;br /&gt;
* Right click on 'zk.sdd' and select 'Git Commit'.&lt;br /&gt;
* Write a description of the changes and click 'Commit'.&lt;br /&gt;
* Right click on 'zk.sdd' and select TortiseGit -&amp;gt; Push.&lt;br /&gt;
* Enter your GitHub login and password when prompted. The changes should now appear on your fork in GitHub.&lt;br /&gt;
* Navigate to https://github.com/ZeroK-RTS/Zero-K/pulls and click &amp;quot;New Pull Request&amp;quot;.&lt;br /&gt;
* Click &amp;quot;compare across forks&amp;quot; to make your fork visible.&lt;br /&gt;
* Set your fork to be the head repository.&lt;br /&gt;
* Write a title and description of the changes, then create the pull request.&lt;br /&gt;
This creates a proposal to apply your changes to the main game. Be sure to check up on it and respond to comments.&lt;br /&gt;
&lt;br /&gt;
A more advanced method involves creating branches locally with TortiseGit -&amp;gt; Create Branch and committing blocks of related changes to a single branch. You are then able to make pull requests from branches. This allows branches to be smaller and more focused, which is desirable when merging.&lt;br /&gt;
&lt;br /&gt;
Make sure to keep your repository up to date to make merges less difficult.&lt;br /&gt;
&lt;br /&gt;
== Zero-K.exe launch flags ==&lt;br /&gt;
&amp;lt;pre&amp;gt;Zero-K.exe [rapid tag] [engine version]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that the engine specified in arg won't automatically use the main Zero-K folder as its datadir. Add a &amp;lt;tt&amp;gt;springsettings.cfg&amp;lt;/tt&amp;gt; file to the engine version's folder with the tag &amp;lt;code&amp;gt;SpringData = path_to_Zero-K_folder&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modifying infrastructure/tools == &lt;br /&gt;
* Install [https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx Visual Studio Community edition]&lt;br /&gt;
* Install the developer or express edition, whichever works best for [https://www.microsoft.com/en-us/sql-server/sql-server-downloads SQL Server express]&lt;br /&gt;
* Recommended but perhaps not strictly necessary: Install [https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver15 SQL Server Management Studio]&lt;br /&gt;
* Clone to desktop [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K infrastructure]&lt;br /&gt;
* Test by opening Zero-K.sln in Visual Studio&lt;br /&gt;
* Infra overview/structure [[Zero-K Infra Guide]] (Incomplete/WIP)&lt;br /&gt;
&lt;br /&gt;
=== Initializing Website Database ===&lt;br /&gt;
You may need to setup the database connection for the website. In order to do that: Open Visual Studio, open the Server Explorer panel (under the View menu), right click Data Connections -&amp;gt; Add Connection -&amp;gt; Sql Server. Enter &amp;lt;code&amp;gt;(localdb)\mssqllocaldb&amp;lt;/code&amp;gt; in the Server Name field, after which zero-k_local will appear in the dropdown list of databases. &lt;br /&gt;
&lt;br /&gt;
(If zero-k_local does not appear, type it in the text box and press OK; Visual Studio will ask whether you would like to create the database. This may require you to have administrator rights on the computer.)&lt;br /&gt;
&lt;br /&gt;
[[File:zk-database-setup.png]]&lt;br /&gt;
&lt;br /&gt;
=== Debugging infrastructure ===&lt;br /&gt;
* To run a project right click it, choose &amp;quot;set as startup project&amp;quot; and hit F5 to run using debugger.&lt;br /&gt;
* You can enable multiple startup projects to test entire infrastructure locally (game servers, lobby etc). Enable asp.net, springie and ZeroKLobby projects to test it all together. [http://i.imgur.com/2mgizUJ.png Setup]&lt;br /&gt;
* To run asp.net:&lt;br /&gt;
** It's required that you install MS SQL Server on your local PC. &lt;br /&gt;
*** You can get SQL Server 2019 (For Windows 10) [https://www.microsoft.com/en-us/sql-server/sql-server-downloads here] or SQL Server 2017 (for Windows 8 and later) [https://www.microsoft.com/en-us/sql-server/sql-server-2017 here] or SQL Server 2014 (for Windows 7) [https://www.microsoft.com/en-ie/download/details.aspx?id=42299 here]. For SQL Server 2014, the file you will need is called SQLEXPR_x64_ENU or SQLEXPR_x86_ENU. Make sure you install version that matches your version of Windows (i.e. x86 vs x64). &lt;br /&gt;
*** During the installation, set collation to &amp;lt;code&amp;gt;SQL_Latin1_General_CP1_CI_AS&amp;lt;/code&amp;gt;. Leave all the parameters default except that I changed server name to SQLSERVER in one of the first steps of wizard.&lt;br /&gt;
[[File:SQL server collation.png|405px]]&lt;br /&gt;
** Right click asp.net -&amp;gt; properties -&amp;gt; web -&amp;gt; check &amp;quot;Specific Page&amp;quot; and leave it blank. Otherwise you get errors when trying to host locally.&lt;br /&gt;
** Make sure SQL Server is running (check the Sql Server Configuration Manager in the Start Menu). If you can't connect, edit the data source for &amp;lt;code&amp;gt;ModeType.Local&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;GlobalConst.cs&amp;lt;/code&amp;gt; (currently line 46) to say something like:&amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;Data Source=&amp;lt;hostname (usually your computer name)&amp;gt;\SQLSERVER&amp;lt;/code&amp;gt;&lt;br /&gt;
** To make things run smoothly the following changes might also be a good idea: In &amp;lt;code&amp;gt;Shared/PlasmaShared/GlobalConst.cs&amp;lt;/code&amp;gt; (currently line 137) replace the DefaultEngineOverride with whatever engine version is current. Comment out lines 190 and 238-298 of &amp;lt;code&amp;gt;Zero-K.info/AppCode/PlasmaServer.cs&amp;lt;/code&amp;gt; unless somebody can supply instructions on how to make the torrent errors go away.&lt;br /&gt;
&lt;br /&gt;
TODO: add download links for sample database tables here. Users and clans are probably easier to make yourself for most purposes. For now, if you need this ask Licho, Histidine, DeinFreund or Anarchid. Aquanim has sample tables for maps and Planetwars structures, if that is all that you need.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
* When you run the server locally a browser window with the website should appear. You can connect to your local server with the normal lobby by going to Settings and setting the target to &amp;quot;localhost&amp;quot; rather than &amp;quot;zero-k.info&amp;quot;.&lt;br /&gt;
* Once you have created an account you can make it an admin account by editing the database with SQL Server Management Studio. Open the list of databases in the tree on the left, open the Zero-K database, then in the Tables folder right-click on dbo.Accounts and select &amp;quot;Edit Top 200 Rows&amp;quot;. Set the &amp;quot;AdminLevel&amp;quot; of your account to 2 for full admin powers.&lt;br /&gt;
&lt;br /&gt;
=== Modifying The Database Structure ===&lt;br /&gt;
* Modify the appropriate files in ./ZkData/Ef/...  and elsewhere ( [https://github.com/ZeroK-RTS/Zero-K-Infrastructure/commit/61addee11e74b09dd5dd73e12d31a28030d84e81 this commit] should be a reasonable guide; don't worry about the migration files, they are created later )&lt;br /&gt;
* In Visual Studio open Tools &amp;gt; NuGet Package Manager &amp;gt; Package Manager Console&lt;br /&gt;
* At the top of the window which appears, there is a &amp;quot;Default project&amp;quot; dropdown box. Set this to ZkData.&lt;br /&gt;
* Type the command &amp;lt;code&amp;gt;Add-Migration [description-of-change-here]&amp;lt;/code&amp;gt; into the package manager console. This should create some migration files with your description and a timestamp in the name in the Migrations folder of ZkData.&lt;br /&gt;
* In some cases you may now need to manually edit the created migration files to set defaults and the like?&lt;br /&gt;
* Type the command &amp;lt;code&amp;gt;Update-Database&amp;lt;/code&amp;gt; into the package manager console. This should update the database structure.&lt;br /&gt;
* To revert a migration that has not yet been pushed to the main repository, run &amp;lt;code&amp;gt;Update-Database –TargetMigration: TheLastGoodMigration&amp;lt;/code&amp;gt; then delete your bad migration files.&lt;br /&gt;
&lt;br /&gt;
== Artwork ==&lt;br /&gt;
See [http://zero-k.info/Wiki/Development_Artwork Development Artwork] (outdated)&lt;br /&gt;
&lt;br /&gt;
[[Blender_To_Zero-K|Blender To Zero-K]]&lt;br /&gt;
&lt;br /&gt;
== Missions ==&lt;br /&gt;
=== Campaign ===&lt;br /&gt;
Campaign planets/missions are defined in [//github.com/ZeroK-RTS/Chobby/tree/master/campaign/sample Chobby/campaign/sample]&lt;br /&gt;
&lt;br /&gt;
=== Standalone missions ===&lt;br /&gt;
See [[Mission Editor|Mission Editor start page]]&lt;br /&gt;
&lt;br /&gt;
== Updating PlanetWars for new round ==&lt;br /&gt;
:''TODO''&lt;br /&gt;
Changing faction:&lt;br /&gt;
* Faction ID, name, color in dbo.Faction&lt;br /&gt;
* Faction blurb &amp;lt;tt&amp;gt;Faction&amp;lt;Name&amp;gt;&amp;lt;/tt&amp;gt; on sitewiki&lt;br /&gt;
* Add/change icons if needed&lt;br /&gt;
** Site: img/factions/&amp;lt;name&amp;gt;.png&lt;br /&gt;
** Game: LuaUI/Configs/Factions&lt;br /&gt;
** Chobby: LuaMenu/Images/Factions&lt;br /&gt;
** Does chobby download them automatically? Presumably not&lt;br /&gt;
&lt;br /&gt;
Using [https://zero-k.info/PlanetwarsAdmin Planetwars admin interface]: Change to a different galaxy if desired, reset PW&lt;br /&gt;
&lt;br /&gt;
== Wiki ==&lt;br /&gt;
See [[Editing Help]]&lt;br /&gt;
&lt;br /&gt;
=== Making/Editing a unit ===&lt;br /&gt;
See the Blender to Zero-K page for a comprehensive guide on modelling, texturing, and baking aoplates for Zero-K units: [https://zero-k.info/mediawiki/index.php?title=Blender_To_Zero-K Blender to Zero-K Page]&lt;br /&gt;
&lt;br /&gt;
=== Unit pages ===&lt;br /&gt;
Part of each unit page is autogenerated by the [//github.com/ZeroK-RTS/SpringRTS-Tools/tree/master/unitguide Unit Guide tool], and uploaded by the [//github.com/ZeroK-RTS/Zero-K-Infrastructure/blob/master/Fixer/WikiPortingMW.cs Wiki bot].&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt;export_unit_templates.sh&amp;lt;/code&amp;gt; to generate wiki templates for each unit (see &amp;lt;code&amp;gt;export_unit_templates.lua&amp;lt;/code&amp;gt; for some configuration options), then have the bot read the generated text files and edit the unit pages accordingly (requires Visual Studio setup as detailed above). The text output can also be used to manually edit pages.&lt;br /&gt;
&lt;br /&gt;
Unit buildicons and radar icons should be uploaded by FTP to manual.zero-k.info (&amp;lt;code&amp;gt;zero-k.info/zkmanual/www/unitpics&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/icons&amp;lt;/code&amp;gt; respectively). Contact Licho or Histidine for login details.&lt;br /&gt;
&lt;br /&gt;
== itch.io builds ==&lt;br /&gt;
Instructions for updating the portable build on [https://itch.io/ itch.io]:&lt;br /&gt;
&lt;br /&gt;
* Download latest Zero-K portable from https://zerok.itch.io/zero-k, extract to a folder&lt;br /&gt;
* Download butler (see guide at https://itch.io/docs/butler/)&lt;br /&gt;
* Modify extracted portable folder so that its contents are the same as what the user will download&lt;br /&gt;
* Run butler with command: &amp;lt;code&amp;gt;butler push &amp;lt;portable folder&amp;gt; zerok/zero-k:portable&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Engine ==&lt;br /&gt;
See [https://springrts.com/wiki/Development:Getting_Started Spring Engine Development]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>HigherFlyer</name></author>
		
	</entry>
	<entry>
		<id>https://zero-k.info/mediawiki/index.php?title=Zero-K:Developing&amp;diff=7218</id>
		<title>Zero-K:Developing</title>
		<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/index.php?title=Zero-K:Developing&amp;diff=7218"/>
		<updated>2021-01-20T14:16:39Z</updated>

		<summary type="html">&lt;p&gt;HigherFlyer: Fixes Server 2017 download link, adds server 2019 download link, removes text stating you have to have express edition/referencing express&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New developers should read this before touching the source.&lt;br /&gt;
&lt;br /&gt;
== ZK's Devving Philosophy (social rules) ==&lt;br /&gt;
* &amp;quot;War is a product of anticommunication&amp;quot;&lt;br /&gt;
** Communicate with other devs about your changes/fixes, let them understand the issue. Do not make 'random' changes.&lt;br /&gt;
* &amp;quot;Do not create work for other people.&amp;quot;&lt;br /&gt;
** Have responsibility for your changes/commit. Do not leave bugs that require other people to fix.&lt;br /&gt;
* &amp;quot;Readability &amp;amp; performance are equally important.&amp;quot; &lt;br /&gt;
** Optimize code but not to the point of unreadability. [http://c2.com/cgi/wiki?RulesOfOptimization Remember the rules of optimization]:&lt;br /&gt;
*** Don't.&lt;br /&gt;
*** Don't (yet).&lt;br /&gt;
*** Profile before doing it.&lt;br /&gt;
* &amp;quot;If it ain't broke, don't fix it.&amp;quot;&lt;br /&gt;
** Don't code fixes that nobody wants to problems that don't exist.&lt;br /&gt;
&lt;br /&gt;
== What is in source codes ==&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K Zero-K] contains the game proper&lt;br /&gt;
** units folder contains unit definition files&lt;br /&gt;
*** You can read the wiki about game development for [http://springrts.com/wiki/Main_Page Spring Engine] &lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K-Infrastructure]&lt;br /&gt;
** Zero-K.info: Website sources&lt;br /&gt;
** ZkLobbyServer: Lobby server (for MP)&lt;br /&gt;
** ZkData: Website/server database structure&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Chobby Chobby] contains the lobby client&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Artwork Zero-K-Artwork] contains sources for 2D art, 3D art and sounds&lt;br /&gt;
* [https://github.com/ZeroK-RTS/SpringRTS-Tools SpringRTS-tools] contains various dev tools&lt;br /&gt;
** Upspring - required to edit the .3do and .s3o model files used in the game&lt;br /&gt;
** MapIconBuilder - unit map icon sources are here&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Missions Zero-K-Missions] contains source files for official ZK missions&lt;br /&gt;
&lt;br /&gt;
=== Style Guide===&lt;br /&gt;
The lua in the menu (chobby) and game proper should use the following whitespace:&lt;br /&gt;
* Indent with tabs.&lt;br /&gt;
* A tab may only follow a newline or another tab.&lt;br /&gt;
* If the text across two lines is being aligned (such as for a long function) then the two lines must have the same number of tabs.&lt;br /&gt;
* Don't try stack flow of control into one line. For example, put newlines after &amp;lt;code&amp;gt;then&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt;.&lt;br /&gt;
* End files with a newline.&lt;br /&gt;
* Commas should be followed by whitespace. Relations (=, &amp;lt;, &amp;lt;=, &amp;gt;=, ==, ~=) should have whitespace on each side.&lt;br /&gt;
* if a conditional is to take up multiple lines, double indent the extra lines and end the line with a conjunction (See Gallery below)&lt;br /&gt;
These guidelines are not necessarily followed in old files so updating them with a separate commit is a good idea prior to making large changes. Also, unitdefs use two-space indentation instead of tabs.          &lt;br /&gt;
&lt;br /&gt;
There are a few guildines for dealing with Spring functions.&lt;br /&gt;
* Localisation of Spring.Function should be named spFunction.&lt;br /&gt;
* Localisation of Spring.MoveCtrl.Function should be named spMoveCtrlFunction.&lt;br /&gt;
* Spring.GetCommandQueue should be used rather than Spring.GetUnitCommands (it's an alias, we just picked one).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Styleguide-if-example.JPG|Proper multiline if statement&lt;br /&gt;
Styleguide-stackflow.JPG|Example of stacked flow control&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting sources ==&lt;br /&gt;
This is a guide to downloading Zero-K sources from [https://github.com/ GitHub] using [https://tortoisegit.org/ TortoiseGit]. The game sources are used as an example, however this method applies to other subprojects as well.&lt;br /&gt;
* Install [https://tortoisegit.org/download/ TortoiseGit].&lt;br /&gt;
* Create a [https://github.com/ GitHub] account.&lt;br /&gt;
[[File:ForkZK.jpg]]&lt;br /&gt;
* Log in to GitHub and [https://github.com/ZeroK-RTS Locate] the repository you want to edit.&lt;br /&gt;
* Click the &amp;quot;Fork&amp;quot; button on the GitHub website to create your own copy on GitHub.&lt;br /&gt;
[[File:ZKCloneCopy.png|1103px]]&lt;br /&gt;
* Locate your fork on GitHub and click &amp;quot;Code&amp;quot;.&lt;br /&gt;
* Copy the web URL to your clipboard.&lt;br /&gt;
[[File:localCloneZK.jpg]]&lt;br /&gt;
* Create a folder called 'zk.sdd' in your Zero-K install under games.&lt;br /&gt;
* Right click on 'zk.sdd' and select 'Git Clone...' from the context menu.&lt;br /&gt;
[[File:cloneUIZK.jpg]]&lt;br /&gt;
* Copy the web URL into the 'URL:' field of the clone interface.&lt;br /&gt;
* Ensure that the 'Directory:' field ends in 'zk.sdd'. It is likely to automatically contain the path '...\Zero-K\games\zk.sdd\Zero-K' so be sure to delete the '\Zero-K' at the end.&lt;br /&gt;
[[File:cloneSuccess.jpg]]&lt;br /&gt;
* Wait for the sources to download.&lt;br /&gt;
* Your 'zk.sdd' folder should look something like the image above.&lt;br /&gt;
&lt;br /&gt;
== Updating sources ==&lt;br /&gt;
Keep your sources up to date by periodically syncing your fork to the original repository (using 'compare', see: https://github.com/KirstieJane/STEMMRoleModels/wiki/Syncing-your-fork-to-the-original-repository-via-the-browser, then do &amp;quot;rebase and merge&amp;quot; instead of &amp;quot;merge&amp;quot;) and doing TortoiseGit -&amp;gt; Pull on your repository folder to take the changes from GitHub to your local files.&lt;br /&gt;
&lt;br /&gt;
== Modifying the game ==&lt;br /&gt;
:''For personal modding, see [[Mod Creation]]''&lt;br /&gt;
Follow the instructions in 'Getting sources' the download the Zero-K game sources. Feel free to inspect and edit the game files. Most developers using Windows edit lua files with [https://notepad-plus-plus.org/download/v7.6.6.html Notepad++].&lt;br /&gt;
&lt;br /&gt;
To test your changes:&lt;br /&gt;
* (If using Windows make sure your file explorer has file name extensions enabled; for example the chobby_wrapper_port file should have a .txt on the end of its name.)&lt;br /&gt;
* Create an empty text file named 'devmode.txt' in the same directory as Zero-K.exe.&lt;br /&gt;
* Launch Zero-K.exe.&lt;br /&gt;
[[File:enableDevMode.jpg]]&lt;br /&gt;
* Select 'Zero-K Dev' in Settings -&amp;gt; Developer -&amp;gt; Singleplayer (you may need to scroll down).&lt;br /&gt;
[[File:startTest.jpg]]&lt;br /&gt;
* From the main menu select Singleplayer -&amp;gt; Skirmish -&amp;gt; Advanced -&amp;gt; Start to launch a test game. Note that the game type should be automatically set to 'Zero-K $VERSION'.&lt;br /&gt;
* In the game, press F8 to open debug console. It'll display errors and output to the log.&lt;br /&gt;
&lt;br /&gt;
== Modifying the lobby menu ==&lt;br /&gt;
Follow the instructions in 'Getting sources' with the following adjustments:&lt;br /&gt;
* The repository that you want to edit is https://github.com/ZeroK-RTS/Chobby.&lt;br /&gt;
* It is best to call the folder something like 'zkmenu.sdd', to avoid confusion.&lt;br /&gt;
Make sure that the 'Directory:' field ends in '.sdd'. You should end up with something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:zkmenufolder.jpg]]&lt;br /&gt;
&lt;br /&gt;
To test your changes launch Zero-K.exe with the &amp;lt;tt&amp;gt;dev&amp;lt;/tt&amp;gt; arg (i.e. &amp;lt;code&amp;gt;Zero-K.exe dev&amp;lt;/code&amp;gt;). On windows this is best done by creating a shortcut and changing the target, as shown below.&lt;br /&gt;
[[File:targetZK.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Submitting changes ==&lt;br /&gt;
Git provides a systematic way to review and merge changes into the main repositories. The main game repository is used as example, but this method works for other repositories as well.&lt;br /&gt;
&lt;br /&gt;
The simple way to commit changes is as follows.&lt;br /&gt;
* Make some changes to your local files.&lt;br /&gt;
* Right click on 'zk.sdd' and select 'Git Commit'.&lt;br /&gt;
* Write a description of the changes and click 'Commit'.&lt;br /&gt;
* Right click on 'zk.sdd' and select TortiseGit -&amp;gt; Push.&lt;br /&gt;
* Enter your GitHub login and password when prompted. The changes should now appear on your fork in GitHub.&lt;br /&gt;
* Navigate to https://github.com/ZeroK-RTS/Zero-K/pulls and click &amp;quot;New Pull Request&amp;quot;.&lt;br /&gt;
* Click &amp;quot;compare across forks&amp;quot; to make your fork visible.&lt;br /&gt;
* Set your fork to be the head repository.&lt;br /&gt;
* Write a title and description of the changes, then create the pull request.&lt;br /&gt;
This creates a proposal to apply your changes to the main game. Be sure to check up on it and respond to comments.&lt;br /&gt;
&lt;br /&gt;
A more advanced method involves creating branches locally with TortiseGit -&amp;gt; Create Branch and committing blocks of related changes to a single branch. You are then able to make pull requests from branches. This allows branches to be smaller and more focused, which is desirable when merging.&lt;br /&gt;
&lt;br /&gt;
Make sure to keep your repository up to date to make merges less difficult.&lt;br /&gt;
&lt;br /&gt;
== Zero-K.exe launch flags ==&lt;br /&gt;
&amp;lt;pre&amp;gt;Zero-K.exe [rapid tag] [engine version]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that the engine specified in arg won't automatically use the main Zero-K folder as its datadir. Add a &amp;lt;tt&amp;gt;springsettings.cfg&amp;lt;/tt&amp;gt; file to the engine version's folder with the tag &amp;lt;code&amp;gt;SpringData = path_to_Zero-K_folder&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modifying infrastructure/tools == &lt;br /&gt;
* Install [https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx Visual Studio Community edition]&lt;br /&gt;
* Install the developer or express edition, whichever works best for [https://www.microsoft.com/en-us/sql-server/sql-server-downloads SQL Server express]&lt;br /&gt;
* Recommended but perhaps not strictly necessary: Install [https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver15 SQL Server Management Studio]&lt;br /&gt;
* Clone to desktop [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K infrastructure]&lt;br /&gt;
* Test by opening Zero-K.sln in Visual Studio&lt;br /&gt;
&lt;br /&gt;
=== Initializing Website Database ===&lt;br /&gt;
You may need to setup the database connection for the website. In order to do that: Open Visual Studio, open the Server Explorer panel (under the View menu), right click Data Connections -&amp;gt; Add Connection -&amp;gt; Sql Server. Enter &amp;lt;code&amp;gt;(localdb)\mssqllocaldb&amp;lt;/code&amp;gt; in the Server Name field, after which zero-k_local will appear in the dropdown list of databases. &lt;br /&gt;
&lt;br /&gt;
(If zero-k_local does not appear, type it in the text box and press OK; Visual Studio will ask whether you would like to create the database. This may require you to have administrator rights on the computer.)&lt;br /&gt;
&lt;br /&gt;
[[File:zk-database-setup.png]]&lt;br /&gt;
&lt;br /&gt;
=== Debugging infrastructure ===&lt;br /&gt;
* To run a project right click it, choose &amp;quot;set as startup project&amp;quot; and hit F5 to run using debugger.&lt;br /&gt;
* You can enable multiple startup projects to test entire infrastructure locally (game servers, lobby etc). Enable asp.net, springie and ZeroKLobby projects to test it all together. [http://i.imgur.com/2mgizUJ.png Setup]&lt;br /&gt;
* To run asp.net:&lt;br /&gt;
** It's required that you install MS SQL Server on your local PC. &lt;br /&gt;
*** You can get SQL Server 2019 (For Windows 10) [https://www.microsoft.com/en-us/sql-server/sql-server-downloads here] or SQL Server 2017 (for Windows 8 and later) [https://www.microsoft.com/en-us/sql-server/sql-server-2017 here] or SQL Server 2014 (for Windows 7) [https://www.microsoft.com/en-ie/download/details.aspx?id=42299 here]. For SQL Server 2014, the file you will need is called SQLEXPR_x64_ENU or SQLEXPR_x86_ENU. Make sure you install version that matches your version of Windows (i.e. x86 vs x64). &lt;br /&gt;
*** During the installation, set collation to &amp;lt;code&amp;gt;SQL_Latin1_General_CP1_CI_AS&amp;lt;/code&amp;gt;. Leave all the parameters default except that I changed server name to SQLSERVER in one of the first steps of wizard.&lt;br /&gt;
[[File:SQL server collation.png|405px]]&lt;br /&gt;
** Right click asp.net -&amp;gt; properties -&amp;gt; web -&amp;gt; check &amp;quot;Specific Page&amp;quot; and leave it blank. Otherwise you get errors when trying to host locally.&lt;br /&gt;
** Make sure SQL Server is running (check the Sql Server Configuration Manager in the Start Menu). If you can't connect, edit the data source for &amp;lt;code&amp;gt;ModeType.Local&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;GlobalConst.cs&amp;lt;/code&amp;gt; (currently line 46) to say something like:&amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;Data Source=&amp;lt;hostname (usually your computer name)&amp;gt;\SQLSERVER&amp;lt;/code&amp;gt;&lt;br /&gt;
** To make things run smoothly the following changes might also be a good idea: In &amp;lt;code&amp;gt;Shared/PlasmaShared/GlobalConst.cs&amp;lt;/code&amp;gt; (currently line 137) replace the DefaultEngineOverride with whatever engine version is current. Comment out lines 190 and 238-298 of &amp;lt;code&amp;gt;Zero-K.info/AppCode/PlasmaServer.cs&amp;lt;/code&amp;gt; unless somebody can supply instructions on how to make the torrent errors go away.&lt;br /&gt;
&lt;br /&gt;
TODO: add download links for sample database tables here. Users and clans are probably easier to make yourself for most purposes. For now, if you need this ask Licho, Histidine, DeinFreund or Anarchid. Aquanim has sample tables for maps and Planetwars structures, if that is all that you need.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
* When you run the server locally a browser window with the website should appear. You can connect to your local server with the normal lobby by going to Settings and setting the target to &amp;quot;localhost&amp;quot; rather than &amp;quot;zero-k.info&amp;quot;.&lt;br /&gt;
* Once you have created an account you can make it an admin account by editing the database with SQL Server Management Studio. Open the list of databases in the tree on the left, open the Zero-K database, then in the Tables folder right-click on dbo.Accounts and select &amp;quot;Edit Top 200 Rows&amp;quot;. Set the &amp;quot;AdminLevel&amp;quot; of your account to 2 for full admin powers.&lt;br /&gt;
&lt;br /&gt;
=== Modifying The Database Structure ===&lt;br /&gt;
* Modify the appropriate files in ./ZkData/Ef/...  and elsewhere ( [https://github.com/ZeroK-RTS/Zero-K-Infrastructure/commit/61addee11e74b09dd5dd73e12d31a28030d84e81 this commit] should be a reasonable guide; don't worry about the migration files, they are created later )&lt;br /&gt;
* In Visual Studio open Tools &amp;gt; NuGet Package Manager &amp;gt; Package Manager Console&lt;br /&gt;
* At the top of the window which appears, there is a &amp;quot;Default project&amp;quot; dropdown box. Set this to ZkData.&lt;br /&gt;
* Type the command &amp;lt;code&amp;gt;Add-Migration [description-of-change-here]&amp;lt;/code&amp;gt; into the package manager console. This should create some migration files with your description and a timestamp in the name in the Migrations folder of ZkData.&lt;br /&gt;
* In some cases you may now need to manually edit the created migration files to set defaults and the like?&lt;br /&gt;
* Type the command &amp;lt;code&amp;gt;Update-Database&amp;lt;/code&amp;gt; into the package manager console. This should update the database structure.&lt;br /&gt;
* To revert a migration that has not yet been pushed to the main repository, run &amp;lt;code&amp;gt;Update-Database –TargetMigration: TheLastGoodMigration&amp;lt;/code&amp;gt; then delete your bad migration files.&lt;br /&gt;
&lt;br /&gt;
== Artwork ==&lt;br /&gt;
See [http://zero-k.info/Wiki/Development_Artwork Development Artwork] (outdated)&lt;br /&gt;
&lt;br /&gt;
[[Blender_To_Zero-K|Blender To Zero-K]]&lt;br /&gt;
&lt;br /&gt;
== Missions ==&lt;br /&gt;
=== Campaign ===&lt;br /&gt;
Campaign planets/missions are defined in [//github.com/ZeroK-RTS/Chobby/tree/master/campaign/sample Chobby/campaign/sample]&lt;br /&gt;
&lt;br /&gt;
=== Standalone missions ===&lt;br /&gt;
See [[Mission Editor|Mission Editor start page]]&lt;br /&gt;
&lt;br /&gt;
== Updating PlanetWars for new round ==&lt;br /&gt;
:''TODO''&lt;br /&gt;
Changing faction:&lt;br /&gt;
* Faction ID, name, color in dbo.Faction&lt;br /&gt;
* Faction blurb &amp;lt;tt&amp;gt;Faction&amp;lt;Name&amp;gt;&amp;lt;/tt&amp;gt; on sitewiki&lt;br /&gt;
* Add/change icons if needed&lt;br /&gt;
** Site: img/factions/&amp;lt;name&amp;gt;.png&lt;br /&gt;
** Game: LuaUI/Configs/Factions&lt;br /&gt;
** Chobby: LuaMenu/Images/Factions&lt;br /&gt;
** Does chobby download them automatically? Presumably not&lt;br /&gt;
&lt;br /&gt;
Using [https://zero-k.info/PlanetwarsAdmin Planetwars admin interface]: Change to a different galaxy if desired, reset PW&lt;br /&gt;
&lt;br /&gt;
== Wiki ==&lt;br /&gt;
See [[Editing Help]]&lt;br /&gt;
&lt;br /&gt;
=== Making/Editing a unit ===&lt;br /&gt;
See the Blender to Zero-K page for a comprehensive guide on modelling, texturing, and baking aoplates for Zero-K units: [https://zero-k.info/mediawiki/index.php?title=Blender_To_Zero-K Blender to Zero-K Page]&lt;br /&gt;
&lt;br /&gt;
=== Unit pages ===&lt;br /&gt;
Part of each unit page is autogenerated by the [//github.com/ZeroK-RTS/SpringRTS-Tools/tree/master/unitguide Unit Guide tool], and uploaded by the [//github.com/ZeroK-RTS/Zero-K-Infrastructure/blob/master/Fixer/WikiPortingMW.cs Wiki bot].&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt;export_unit_templates.sh&amp;lt;/code&amp;gt; to generate wiki templates for each unit (see &amp;lt;code&amp;gt;export_unit_templates.lua&amp;lt;/code&amp;gt; for some configuration options), then have the bot read the generated text files and edit the unit pages accordingly (requires Visual Studio setup as detailed above). The text output can also be used to manually edit pages.&lt;br /&gt;
&lt;br /&gt;
Unit buildicons and radar icons should be uploaded by FTP to manual.zero-k.info (&amp;lt;code&amp;gt;zero-k.info/zkmanual/www/unitpics&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/icons&amp;lt;/code&amp;gt; respectively). Contact Licho or Histidine for login details.&lt;br /&gt;
&lt;br /&gt;
== itch.io builds ==&lt;br /&gt;
Instructions for updating the portable build on [https://itch.io/ itch.io]:&lt;br /&gt;
&lt;br /&gt;
* Download latest Zero-K portable from https://zerok.itch.io/zero-k, extract to a folder&lt;br /&gt;
* Download butler (see guide at https://itch.io/docs/butler/)&lt;br /&gt;
* Modify extracted portable folder so that its contents are the same as what the user will download&lt;br /&gt;
* Run butler with command: &amp;lt;code&amp;gt;butler push &amp;lt;portable folder&amp;gt; zerok/zero-k:portable&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Engine ==&lt;br /&gt;
See [https://springrts.com/wiki/Development:Getting_Started Spring Engine Development]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>HigherFlyer</name></author>
		
	</entry>
	<entry>
		<id>https://zero-k.info/mediawiki/index.php?title=Zero-K:Developing&amp;diff=7215</id>
		<title>Zero-K:Developing</title>
		<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/index.php?title=Zero-K:Developing&amp;diff=7215"/>
		<updated>2021-01-20T14:00:59Z</updated>

		<summary type="html">&lt;p&gt;HigherFlyer: Adds guidance for what edition of SQL Server to download&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New developers should read this before touching the source.&lt;br /&gt;
&lt;br /&gt;
== ZK's Devving Philosophy (social rules) ==&lt;br /&gt;
* &amp;quot;War is a product of anticommunication&amp;quot;&lt;br /&gt;
** Communicate with other devs about your changes/fixes, let them understand the issue. Do not make 'random' changes.&lt;br /&gt;
* &amp;quot;Do not create work for other people.&amp;quot;&lt;br /&gt;
** Have responsibility for your changes/commit. Do not leave bugs that require other people to fix.&lt;br /&gt;
* &amp;quot;Readability &amp;amp; performance are equally important.&amp;quot; &lt;br /&gt;
** Optimize code but not to the point of unreadability. [http://c2.com/cgi/wiki?RulesOfOptimization Remember the rules of optimization]:&lt;br /&gt;
*** Don't.&lt;br /&gt;
*** Don't (yet).&lt;br /&gt;
*** Profile before doing it.&lt;br /&gt;
* &amp;quot;If it ain't broke, don't fix it.&amp;quot;&lt;br /&gt;
** Don't code fixes that nobody wants to problems that don't exist.&lt;br /&gt;
&lt;br /&gt;
== What is in source codes ==&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K Zero-K] contains the game proper&lt;br /&gt;
** units folder contains unit definition files&lt;br /&gt;
*** You can read the wiki about game development for [http://springrts.com/wiki/Main_Page Spring Engine] &lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K-Infrastructure]&lt;br /&gt;
** Zero-K.info: Website sources&lt;br /&gt;
** ZkLobbyServer: Lobby server (for MP)&lt;br /&gt;
** ZkData: Website/server database structure&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Chobby Chobby] contains the lobby client&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Artwork Zero-K-Artwork] contains sources for 2D art, 3D art and sounds&lt;br /&gt;
* [https://github.com/ZeroK-RTS/SpringRTS-Tools SpringRTS-tools] contains various dev tools&lt;br /&gt;
** Upspring - required to edit the .3do and .s3o model files used in the game&lt;br /&gt;
** MapIconBuilder - unit map icon sources are here&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Missions Zero-K-Missions] contains source files for official ZK missions&lt;br /&gt;
&lt;br /&gt;
=== Style Guide===&lt;br /&gt;
The lua in the menu (chobby) and game proper should use the following whitespace:&lt;br /&gt;
* Indent with tabs.&lt;br /&gt;
* A tab may only follow a newline or another tab.&lt;br /&gt;
* If the text across two lines is being aligned (such as for a long function) then the two lines must have the same number of tabs.&lt;br /&gt;
* Don't try stack flow of control into one line. For example, put newlines after &amp;lt;code&amp;gt;then&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt;.&lt;br /&gt;
* End files with a newline.&lt;br /&gt;
* Commas should be followed by whitespace. Relations (=, &amp;lt;, &amp;lt;=, &amp;gt;=, ==, ~=) should have whitespace on each side.&lt;br /&gt;
* if a conditional is to take up multiple lines, double indent the extra lines and end the line with a conjunction (See Gallery below)&lt;br /&gt;
These guidelines are not necessarily followed in old files so updating them with a separate commit is a good idea prior to making large changes. Also, unitdefs use two-space indentation instead of tabs.          &lt;br /&gt;
&lt;br /&gt;
There are a few guildines for dealing with Spring functions.&lt;br /&gt;
* Localisation of Spring.Function should be named spFunction.&lt;br /&gt;
* Localisation of Spring.MoveCtrl.Function should be named spMoveCtrlFunction.&lt;br /&gt;
* Spring.GetCommandQueue should be used rather than Spring.GetUnitCommands (it's an alias, we just picked one).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Styleguide-if-example.JPG|Proper multiline if statement&lt;br /&gt;
Styleguide-stackflow.JPG|Example of stacked flow control&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting sources ==&lt;br /&gt;
This is a guide to downloading Zero-K sources from [https://github.com/ GitHub] using [https://tortoisegit.org/ TortoiseGit]. The game sources are used as an example, however this method applies to other subprojects as well.&lt;br /&gt;
* Install [https://tortoisegit.org/download/ TortoiseGit].&lt;br /&gt;
* Create a [https://github.com/ GitHub] account.&lt;br /&gt;
[[File:ForkZK.jpg]]&lt;br /&gt;
* Log in to GitHub and [https://github.com/ZeroK-RTS Locate] the repository you want to edit.&lt;br /&gt;
* Click the &amp;quot;Fork&amp;quot; button on the GitHub website to create your own copy on GitHub.&lt;br /&gt;
[[File:ZKCloneCopy.png|1103px]]&lt;br /&gt;
* Locate your fork on GitHub and click &amp;quot;Code&amp;quot;.&lt;br /&gt;
* Copy the web URL to your clipboard.&lt;br /&gt;
[[File:localCloneZK.jpg]]&lt;br /&gt;
* Create a folder called 'zk.sdd' in your Zero-K install under games.&lt;br /&gt;
* Right click on 'zk.sdd' and select 'Git Clone...' from the context menu.&lt;br /&gt;
[[File:cloneUIZK.jpg]]&lt;br /&gt;
* Copy the web URL into the 'URL:' field of the clone interface.&lt;br /&gt;
* Ensure that the 'Directory:' field ends in 'zk.sdd'. It is likely to automatically contain the path '...\Zero-K\games\zk.sdd\Zero-K' so be sure to delete the '\Zero-K' at the end.&lt;br /&gt;
[[File:cloneSuccess.jpg]]&lt;br /&gt;
* Wait for the sources to download.&lt;br /&gt;
* Your 'zk.sdd' folder should look something like the image above.&lt;br /&gt;
&lt;br /&gt;
== Updating sources ==&lt;br /&gt;
Keep your sources up to date by periodically syncing your fork to the original repository (using 'compare', see: https://github.com/KirstieJane/STEMMRoleModels/wiki/Syncing-your-fork-to-the-original-repository-via-the-browser, then do &amp;quot;rebase and merge&amp;quot; instead of &amp;quot;merge&amp;quot;) and doing TortoiseGit -&amp;gt; Pull on your repository folder to take the changes from GitHub to your local files.&lt;br /&gt;
&lt;br /&gt;
== Modifying the game ==&lt;br /&gt;
:''For personal modding, see [[Mod Creation]]''&lt;br /&gt;
Follow the instructions in 'Getting sources' the download the Zero-K game sources. Feel free to inspect and edit the game files. Most developers using Windows edit lua files with [https://notepad-plus-plus.org/download/v7.6.6.html Notepad++].&lt;br /&gt;
&lt;br /&gt;
To test your changes:&lt;br /&gt;
* (If using Windows make sure your file explorer has file name extensions enabled; for example the chobby_wrapper_port file should have a .txt on the end of its name.)&lt;br /&gt;
* Create an empty text file named 'devmode.txt' in the same directory as Zero-K.exe.&lt;br /&gt;
* Launch Zero-K.exe.&lt;br /&gt;
[[File:enableDevMode.jpg]]&lt;br /&gt;
* Select 'Zero-K Dev' in Settings -&amp;gt; Developer -&amp;gt; Singleplayer (you may need to scroll down).&lt;br /&gt;
[[File:startTest.jpg]]&lt;br /&gt;
* From the main menu select Singleplayer -&amp;gt; Skirmish -&amp;gt; Advanced -&amp;gt; Start to launch a test game. Note that the game type should be automatically set to 'Zero-K $VERSION'.&lt;br /&gt;
* In the game, press F8 to open debug console. It'll display errors and output to the log.&lt;br /&gt;
&lt;br /&gt;
== Modifying the lobby menu ==&lt;br /&gt;
Follow the instructions in 'Getting sources' with the following adjustments:&lt;br /&gt;
* The repository that you want to edit is https://github.com/ZeroK-RTS/Chobby.&lt;br /&gt;
* It is best to call the folder something like 'zkmenu.sdd', to avoid confusion.&lt;br /&gt;
Make sure that the 'Directory:' field ends in '.sdd'. You should end up with something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:zkmenufolder.jpg]]&lt;br /&gt;
&lt;br /&gt;
To test your changes launch Zero-K.exe with the &amp;lt;tt&amp;gt;dev&amp;lt;/tt&amp;gt; arg (i.e. &amp;lt;code&amp;gt;Zero-K.exe dev&amp;lt;/code&amp;gt;). On windows this is best done by creating a shortcut and changing the target, as shown below.&lt;br /&gt;
[[File:targetZK.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Submitting changes ==&lt;br /&gt;
Git provides a systematic way to review and merge changes into the main repositories. The main game repository is used as example, but this method works for other repositories as well.&lt;br /&gt;
&lt;br /&gt;
The simple way to commit changes is as follows.&lt;br /&gt;
* Make some changes to your local files.&lt;br /&gt;
* Right click on 'zk.sdd' and select 'Git Commit'.&lt;br /&gt;
* Write a description of the changes and click 'Commit'.&lt;br /&gt;
* Right click on 'zk.sdd' and select TortiseGit -&amp;gt; Push.&lt;br /&gt;
* Enter your GitHub login and password when prompted. The changes should now appear on your fork in GitHub.&lt;br /&gt;
* Navigate to https://github.com/ZeroK-RTS/Zero-K/pulls and click &amp;quot;New Pull Request&amp;quot;.&lt;br /&gt;
* Click &amp;quot;compare across forks&amp;quot; to make your fork visible.&lt;br /&gt;
* Set your fork to be the head repository.&lt;br /&gt;
* Write a title and description of the changes, then create the pull request.&lt;br /&gt;
This creates a proposal to apply your changes to the main game. Be sure to check up on it and respond to comments.&lt;br /&gt;
&lt;br /&gt;
A more advanced method involves creating branches locally with TortiseGit -&amp;gt; Create Branch and committing blocks of related changes to a single branch. You are then able to make pull requests from branches. This allows branches to be smaller and more focused, which is desirable when merging.&lt;br /&gt;
&lt;br /&gt;
Make sure to keep your repository up to date to make merges less difficult.&lt;br /&gt;
&lt;br /&gt;
== Zero-K.exe launch flags ==&lt;br /&gt;
&amp;lt;pre&amp;gt;Zero-K.exe [rapid tag] [engine version]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that the engine specified in arg won't automatically use the main Zero-K folder as its datadir. Add a &amp;lt;tt&amp;gt;springsettings.cfg&amp;lt;/tt&amp;gt; file to the engine version's folder with the tag &amp;lt;code&amp;gt;SpringData = path_to_Zero-K_folder&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modifying infrastructure/tools == &lt;br /&gt;
* Install [https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx Visual Studio Community edition]&lt;br /&gt;
* Install the developer or express edition, whichever works best for [https://www.microsoft.com/en-us/sql-server/sql-server-downloads SQL Server express]&lt;br /&gt;
* Recommended but perhaps not strictly necessary: Install [https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver15 SQL Server Management Studio]&lt;br /&gt;
* Clone to desktop [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K infrastructure]&lt;br /&gt;
* Test by opening Zero-K.sln in Visual Studio&lt;br /&gt;
&lt;br /&gt;
=== Initializing Website Database ===&lt;br /&gt;
You may need to setup the database connection for the website. In order to do that: Open Visual Studio, open the Server Explorer panel (under the View menu), right click Data Connections -&amp;gt; Add Connection -&amp;gt; Sql Server. Enter &amp;lt;code&amp;gt;(localdb)\mssqllocaldb&amp;lt;/code&amp;gt; in the Server Name field, after which zero-k_local will appear in the dropdown list of databases. &lt;br /&gt;
&lt;br /&gt;
(If zero-k_local does not appear, type it in the text box and press OK; Visual Studio will ask whether you would like to create the database. This may require you to have administrator rights on the computer.)&lt;br /&gt;
&lt;br /&gt;
[[File:zk-database-setup.png]]&lt;br /&gt;
&lt;br /&gt;
=== Debugging infrastructure ===&lt;br /&gt;
* To run a project right click it, choose &amp;quot;set as startup project&amp;quot; and hit F5 to run using debugger.&lt;br /&gt;
* You can enable multiple startup projects to test entire infrastructure locally (game servers, lobby etc). Enable asp.net, springie and ZeroKLobby projects to test it all together. [http://i.imgur.com/2mgizUJ.png Setup]&lt;br /&gt;
* To run asp.net:&lt;br /&gt;
** It's required that you install MS SQL Express on your local PC. &lt;br /&gt;
*** You can get SQL Server 2017 (for Windows 8 and later) [https://www.microsoft.com/en-us/sql-server/sql-server-editions-express here] or SQL Server 2014 (for Windows 7) [https://www.microsoft.com/en-ie/download/details.aspx?id=42299 here]. For SQL Server 2014, the file you will need is called SQLEXPR_x64_ENU or SQLEXPR_x86_ENU. Make sure you install version that matches your version of Windows (i.e. x86 vs x64). &lt;br /&gt;
*** During the installation, set collation to &amp;lt;code&amp;gt;SQL_Latin1_General_CP1_CI_AS&amp;lt;/code&amp;gt;. Leave all the parameters default except that I changed server name to SQLEXPRESS in one of the first steps of wizard.&lt;br /&gt;
[[File:SQL server collation.png|405px]]&lt;br /&gt;
** Right click asp.net -&amp;gt; properties -&amp;gt; web -&amp;gt; check &amp;quot;Specific Page&amp;quot; and leave it blank. Otherwise you get errors when trying to host locally.&lt;br /&gt;
** Make sure SQL Server is running (check the Sql Server Configuration Manager in the Start Menu). If you can't connect, edit the data source for &amp;lt;code&amp;gt;ModeType.Local&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;GlobalConst.cs&amp;lt;/code&amp;gt; (currently line 46) to say something like:&amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;Data Source=&amp;lt;hostname (usually your computer name)&amp;gt;\SQLEXPRESS&amp;lt;/code&amp;gt;&lt;br /&gt;
** To make things run smoothly the following changes might also be a good idea: In &amp;lt;code&amp;gt;Shared/PlasmaShared/GlobalConst.cs&amp;lt;/code&amp;gt; (currently line 137) replace the DefaultEngineOverride with whatever engine version is current. Comment out lines 190 and 238-298 of &amp;lt;code&amp;gt;Zero-K.info/AppCode/PlasmaServer.cs&amp;lt;/code&amp;gt; unless somebody can supply instructions on how to make the torrent errors go away.&lt;br /&gt;
&lt;br /&gt;
TODO: add download links for sample database tables here. Users and clans are probably easier to make yourself for most purposes. For now, if you need this ask Licho, Histidine, DeinFreund or Anarchid. Aquanim has sample tables for maps and Planetwars structures, if that is all that you need.&lt;br /&gt;
&lt;br /&gt;
=== Modifying The Database Structure ===&lt;br /&gt;
* Modify the appropriate files in ./ZkData/Ef/...  and elsewhere ( [https://github.com/ZeroK-RTS/Zero-K-Infrastructure/commit/61addee11e74b09dd5dd73e12d31a28030d84e81 this commit] should be a reasonable guide; don't worry about the migration files, they are created later )&lt;br /&gt;
* Open Tools &amp;gt; NuGet Package Manager &amp;gt; Package Manager Console&lt;br /&gt;
* At the top of the window which appears, there is a &amp;quot;Default project&amp;quot; dropdown box. Set this to ZkData.&lt;br /&gt;
* Type the command &amp;lt;code&amp;gt;Add-Migration [description-of-change-here]&amp;lt;/code&amp;gt; into the package manager console. This should create some migration files with your description and a timestamp in the name in the Migrations folder of ZkData.&lt;br /&gt;
* In some cases you may now need to manually edit the created migration files to set defaults and the like?&lt;br /&gt;
* Type the command &amp;lt;code&amp;gt;Update-Database&amp;lt;/code&amp;gt; into the package manager console. This should update the database structure.&lt;br /&gt;
* To revert a migration that has not yet been pushed to the main repository, run &amp;lt;code&amp;gt;Update-Database –TargetMigration: TheLastGoodMigration&amp;lt;/code&amp;gt; then delete your bad migration files.&lt;br /&gt;
&lt;br /&gt;
== Artwork ==&lt;br /&gt;
See [http://zero-k.info/Wiki/Development_Artwork Development Artwork] (outdated)&lt;br /&gt;
&lt;br /&gt;
[[Blender_To_Zero-K|Blender To Zero-K]]&lt;br /&gt;
&lt;br /&gt;
== Missions ==&lt;br /&gt;
=== Campaign ===&lt;br /&gt;
Campaign planets/missions are defined in [//github.com/ZeroK-RTS/Chobby/tree/master/campaign/sample Chobby/campaign/sample]&lt;br /&gt;
&lt;br /&gt;
=== Standalone missions ===&lt;br /&gt;
See [[Mission Editor|Mission Editor start page]]&lt;br /&gt;
&lt;br /&gt;
== Updating PlanetWars for new round ==&lt;br /&gt;
:''TODO''&lt;br /&gt;
Changing faction:&lt;br /&gt;
* Faction ID, name, color in dbo.Faction&lt;br /&gt;
* Faction blurb &amp;lt;tt&amp;gt;Faction&amp;lt;Name&amp;gt;&amp;lt;/tt&amp;gt; on sitewiki&lt;br /&gt;
* Add/change icons if needed&lt;br /&gt;
** Site: img/factions/&amp;lt;name&amp;gt;.png&lt;br /&gt;
** Game: LuaUI/Configs/Factions&lt;br /&gt;
** Chobby: LuaMenu/Images/Factions&lt;br /&gt;
** Does chobby download them automatically? Presumably not&lt;br /&gt;
&lt;br /&gt;
Using [https://zero-k.info/PlanetwarsAdmin Planetwars admin interface]: Change to a different galaxy if desired, reset PW&lt;br /&gt;
&lt;br /&gt;
== Wiki ==&lt;br /&gt;
See [[Editing Help]]&lt;br /&gt;
&lt;br /&gt;
=== Making/Editing a unit ===&lt;br /&gt;
See the Blender to Zero-K page for a comprehensive guide on modelling, texturing, and baking aoplates for Zero-K units: [https://zero-k.info/mediawiki/index.php?title=Blender_To_Zero-K Blender to Zero-K Page]&lt;br /&gt;
&lt;br /&gt;
=== Unit pages ===&lt;br /&gt;
Part of each unit page is autogenerated by the [//github.com/ZeroK-RTS/SpringRTS-Tools/tree/master/unitguide Unit Guide tool], and uploaded by the [//github.com/ZeroK-RTS/Zero-K-Infrastructure/blob/master/Fixer/WikiPortingMW.cs Wiki bot].&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt;export_unit_templates.sh&amp;lt;/code&amp;gt; to generate wiki templates for each unit (see &amp;lt;code&amp;gt;export_unit_templates.lua&amp;lt;/code&amp;gt; for some configuration options), then have the bot read the generated text files and edit the unit pages accordingly (requires Visual Studio setup as detailed above). The text output can also be used to manually edit pages.&lt;br /&gt;
&lt;br /&gt;
Unit buildicons and radar icons should be uploaded by FTP to manual.zero-k.info (&amp;lt;code&amp;gt;zero-k.info/zkmanual/www/unitpics&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/icons&amp;lt;/code&amp;gt; respectively). Contact Licho or Histidine for login details.&lt;br /&gt;
&lt;br /&gt;
== itch.io builds ==&lt;br /&gt;
Instructions for updating the portable build on [https://itch.io/ itch.io]:&lt;br /&gt;
&lt;br /&gt;
* Download latest Zero-K portable from https://zerok.itch.io/zero-k, extract to a folder&lt;br /&gt;
* Download butler (see guide at https://itch.io/docs/butler/)&lt;br /&gt;
* Modify extracted portable folder so that its contents are the same as what the user will download&lt;br /&gt;
* Run butler with command: &amp;lt;code&amp;gt;butler push &amp;lt;portable folder&amp;gt; zerok/zero-k:portable&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Engine ==&lt;br /&gt;
See [https://springrts.com/wiki/Development:Getting_Started Spring Engine Development]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>HigherFlyer</name></author>
		
	</entry>
	<entry>
		<id>https://zero-k.info/mediawiki/index.php?title=Economy_Guide&amp;diff=7171</id>
		<title>Economy Guide</title>
		<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/index.php?title=Economy_Guide&amp;diff=7171"/>
		<updated>2021-01-10T17:15:02Z</updated>

		<summary type="html">&lt;p&gt;HigherFlyer: Nanotower &amp;gt; Caretaker&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Basic Economic Management ==&lt;br /&gt;
http://zero-k.info/img/luaui/ibeam.png&lt;br /&gt;
&lt;br /&gt;
'''Metal''' is the most important resource. It is limited by your territory, obtained from metal extractors on metal spots, but is relatively cheap to get. You should always acquire it ruthlessly and spend it as soon as possible - your metal bar should always be empty.&lt;br /&gt;
&lt;br /&gt;
http://zero-k.info/img/luaui/energy.png&lt;br /&gt;
&lt;br /&gt;
'''Energy''' can be made anywhere and there is no limit to the amount you can have, though it takes an investment. It is used for tasks other than construction, so you should always have more energy than you do metal. Excess energy is automatically used to [[Overdrive]] your metal extractors.&lt;br /&gt;
&lt;br /&gt;
'''Build Power''' is the ability of your constructors to build locally at a fixed rate. Having too much of the other resources just means you don't have enough constructors. Some excess buildpower is good, so that you can move it around or perform other tasks.&lt;br /&gt;
&lt;br /&gt;
In order to build anything, you need all three resources in equal quantities (an exact 1:1:1 ratio). Constructors drain the same amount of resources at a fixed rate no matter what they are building. In your resource bars, income of each is shown in the small green number, and drain in red. The balance of these numbers is the larger number, added or subtracted from your storage. Unlike some other RTS games, the goal is to balance your income vs your expenditure- storage exists only to give you a buffer. If your storage is full and the green number is larger than the red, you're excessing, and wasting the resource. If your storage is empty and the red number is larger than the green, you're stalling, and production involving the resource is slowed.&lt;br /&gt;
&lt;br /&gt;
===Guard/Repeat Method to a Smooth Economy===&lt;br /&gt;
One of the keys to running a smooth economy is to automate it. Here is one method:&lt;br /&gt;
# Click the ''factory guard'' button (&amp;lt;img src=&amp;quot;https://raw.githubusercontent.com/ZeroK-RTS/Zero-K/master/LuaUI/Images/commands/states/autoassist_off.png&amp;quot; height=&amp;quot;24&amp;quot; width=&amp;quot;24&amp;quot; alt=&amp;quot;Guard on.&amp;quot;&amp;gt;/&amp;lt;img src=&amp;quot;https://raw.githubusercontent.com/ZeroK-RTS/Zero-K/master/LuaUI/Images/commands/states/autoassist_on.png&amp;quot; height=&amp;quot;24&amp;quot; width=&amp;quot;24&amp;quot; alt=&amp;quot;Guard off.&amp;quot;&amp;gt;) on your factory. This will make all constructors guard (and assist) your factory.&lt;br /&gt;
# Press the ''repeat'' button (&amp;lt;img src=&amp;quot;https://raw.githubusercontent.com/ZeroK-RTS/Zero-K/master/LuaUI/Images/commands/states/repeat_off.png&amp;quot; height=&amp;quot;24&amp;quot; width=&amp;quot;24&amp;quot; alt=&amp;quot;Repeat off.&amp;quot;&amp;gt;/&amp;lt;img src=&amp;quot;https://raw.githubusercontent.com/ZeroK-RTS/Zero-K/master/LuaUI/Images/commands/states/repeat_on.png&amp;quot; height=&amp;quot;24&amp;quot; width=&amp;quot;24&amp;quot; alt=&amp;quot;Repeat on.&amp;quot;&amp;gt;) on your factory. Your factory should almost never be idle, and repeat greatly reduces the amount of micro you need to manage your factory. It also allows you to mix units more easily. (Alternately [as tip via Steel_Blue &amp;quot;Default unit states are amazing and you should configure them how you like when you want them a certain way&amp;quot;]: F10/Setttings/Unit Behavior/Default States. You'll see a list of every factory and hub. You're gonna have to do this one by one for every factory, set the checkbox next to repeat and auto assist to a check then every factory will be on repeat and auto assist and it will do this for you every game unless you have overridden the orders manually.)&lt;br /&gt;
# Queue up offensive units and constructors. Constructors should generally comprise around 1/4th of all your spending, but this varies by map and situation. Lots of constructors allows you to react to a varying and slowly expanding economy.&lt;br /&gt;
# Expand with your constructors, guarding them with units and building defences as you go, gradually and smoothly increasing your metal income. Make energy constantly, non-stop over the course of the game, and in pace with your metal production. Making a Solar Collector next to every Metal Extractor is a good practice.&lt;br /&gt;
&lt;br /&gt;
If you find yourself in a crisis and need to rebalance your economy, remember these tips:&lt;br /&gt;
&lt;br /&gt;
* If you stall energy, build energy structures and set them on [[Economy_Guide#Priority| high priority]]. Always watch out if your energy storage starts to dip. Turn off any cloaking units, cloak generators or shields until out of the stall.&lt;br /&gt;
* When you have too many constructors working on your factory and you are stalling heavily, send some out to expand, reclaim, make defenses, and repair.&lt;br /&gt;
* If you ever find yourself heading towards an excess of metal due to a sudden glut, make [[Caretaker | Caretakers]] in your base or construct a new factory on the frontline if you have your commander or some idle constructors there.&lt;br /&gt;
*Swim in energy and be short of metal, '''never the reverse.'''&lt;br /&gt;
&lt;br /&gt;
That's the practical advice. Now, some theory and specific data:&lt;br /&gt;
&lt;br /&gt;
== Metal ==&lt;br /&gt;
Metal is directly tied to territorial acquisition and military conquest.&lt;br /&gt;
&lt;br /&gt;
http://manual.zero-k.info/unitpics/cormex.png &lt;br /&gt;
&lt;br /&gt;
'''[[Metal Extractor|Metal Extractors]]''' (mexes) are the most efficient way to get metal, and can only be placed on metal spots. As such, you should expand quickly and rapidly get as many metal spots under your control as possible. Metal extractors are cheap, and pay themselves back quickly. Remember that any metal spot that doesn't have an extractor on it is just wasted metal. If you ever lose territory or get raided, quickly re-expand into the area with extractors again.&lt;br /&gt;
&lt;br /&gt;
'''Reclamation''' can make up a significant portion of your metal income. For everything that dies, a corpse is left behind with up to 40% of the metal it took to produce the unit. Securing an area after an assault and getting the reclaim from both your units and the enemies (an 80% payback on your investment) can decide the outcome of a game. Since it takes a constructor to reclaim things, you can think of reclamation as a way of turning buildpower directly into metal - reclaiming is a very good use of an excess of buildpower.&lt;br /&gt;
Also note that unlike mex income, reclaimed metal is not shared.&lt;br /&gt;
&lt;br /&gt;
'''[[Overdrive]]''' makes your mexes produce more metal, with diminishing returns as you pump more and more energy into them. Due to this, the more mexes the energy is spread over, the more efficiently you can overdrive them, and the more metal you get for invested energy - so always try and take territory. Overdrive requires an energy structure near the extractor to work, but as long as the colour of your overdrive circles are the same, the efficiency is the same - don't worry about linking your whole grid together (but that would still be good). Rather, make a solar panel next to each extractor for maximum returns.&lt;br /&gt;
&lt;br /&gt;
'''Communism mode''' distributes all metal from mexes - basic output and overdrive - at equal quantities to all members of your team. This is the default mode for all team games.&lt;br /&gt;
&lt;br /&gt;
== Energy ==&lt;br /&gt;
Energy can be made anywhere. It is generally built in your base, and having energy is required for a number of things, including making all units and structures and running some special units (jammers, shields, etc). Since it is such an investment, losing your energy can cripple your whole economy, so always try to protect your energy and hit the enemy's when possible. If you stall energy for any reason, get it back up again as quickly as possible by making small energy structures (solars, winds - not fusions).&lt;br /&gt;
&lt;br /&gt;
http://manual.zero-k.info/unitpics/armsolar.png &lt;br /&gt;
&lt;br /&gt;
'''[[Solar Collector]]s''' (Solars) give a fixed income and are well armoured, closing up when under attack for a defensive bonus. They are the least efficient energy structure in terms of investment, but they are cheap, have good HP and don't rely on the varying winds and geothermal vents of the map.&lt;br /&gt;
&lt;br /&gt;
http://manual.zero-k.info/unitpics/armwin.png &lt;br /&gt;
&lt;br /&gt;
'''[[Wind/Tidal Generator|Wind Generators]]''' are fragile and have a variable output. By default, the wind average on all maps is 1.25, so wind is discretionary. Building wind on higher altitudes raises the minimum that they produce. A tall, flat mountain can be of great economic value. The wind min/max values and altitude bonus are shown in your console at the start of the game and when you build a wind generator it will show you the altitude bonus to its generation in the tooltip.&lt;br /&gt;
&lt;br /&gt;
Wind is very fragile, so its best to space it out rather than build it in tight blocks - it will chain explode. Refer to the [[Wind Farm Guide]] to find out how to do this.&lt;br /&gt;
&lt;br /&gt;
Even when wind is more efficient, you might wish to also have some Solars as backup, due to the fragility and unpredictability of wind.&lt;br /&gt;
&lt;br /&gt;
When placed in water, wind generators become the sturdier tidal generators, with a high cost efficiency.&lt;br /&gt;
&lt;br /&gt;
http://manual.zero-k.info/unitpics/geo.png &lt;br /&gt;
&lt;br /&gt;
'''[[Geothermal Generator]]s''' are almost always the most efficient source of energy (more so than even Fusions), but they are not very cheap and can only be placed on geothermal vents. They are volatile, detonating in a moderate explosion.&lt;br /&gt;
&lt;br /&gt;
http://manual.zero-k.info/unitpics/amgeo.png&lt;br /&gt;
&lt;br /&gt;
Morphing a Geothermal Generator creates an '''[[Advanced Geothermal]]''', an even more efficient energy structure. These are very volatile and explode like a nuke when destroyed. Still, it is almost always worthwhile to take the risk of building them - just keep other buildings and units away from it.&lt;br /&gt;
&lt;br /&gt;
http://manual.zero-k.info/unitpics/armfus.png  &lt;br /&gt;
&lt;br /&gt;
'''[[Fusion Reactor]]s''' (Fusions) are efficient but expensive. They tend to explode in a small radius when killed, so don't put them directly right next to anything (especially not each other).&lt;br /&gt;
&lt;br /&gt;
http://manual.zero-k.info/unitpics/cafus.png&lt;br /&gt;
&lt;br /&gt;
'''[[Singularity Reactor]]s''' (Singularities) are even more expensive and efficient than Fusions, but are extremely volatile. When destroyed, they implode, dealing massive damage in a wide radius and pulling in any surviving units.&lt;br /&gt;
&lt;br /&gt;
== Buildpower == &lt;br /&gt;
Buildpower is mostly used for spending metal and energy, but it can also be used to reclaim, which gives you metal (reclaiming for energy is usually inefficient but good in desperation) and to repair, which costs energy equal to the constructors buildpower. You can also think of moving buildpower around as a way of 'using' it that doesn't require you to spend other resources. You should always have extra buildpower around, as it regulates the rest of your economy. Metal gluts can quickly be turned into energy with buildpower, and metal stalls can be alleviated through reclaim or mex expansion with buildpower, but getting more buildpower requires a factory or a constructor, and all three resources. Remember though that you cannot spend more resources than you actually have. Don't go crazy with the Caretakers until you have the economy to actually run them.&lt;br /&gt;
&lt;br /&gt;
Build power is shown in the units tooltip.&lt;br /&gt;
* [[Conjurer|Cloakbot]], [[Convict|Shieldbot]], [[Constable|Jumpbot]], [[Quill|Hovercraft]] and [[Mason|Rover]] Constructors drain -5 (e and m).&lt;br /&gt;
* [[Welder|Tank]], [[Mariner|Ship]], [[Wasp|Gunship]], [[Weaver|Spider]] and [[Conch|Amphbot]] Constructors drain -7.5.&lt;br /&gt;
* [[Caretaker|Caretakers]], [[Commander|Commanders]] (unupgraded), and Factories drain -10.&lt;br /&gt;
* [[Crane|Airplane]] constructors drain - 4.&lt;br /&gt;
* [[Athena|Athenas]] drain - 15.&lt;br /&gt;
&lt;br /&gt;
This means you can very easily look at your income and expenditure numbers and know just how many constructors or caretakers you need to bring your economy back into equilibrium.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Another way to explain it is that buildpower is the amount of metal and energy your builders allow you to spend per second. For example, a Caretaker spends at 10 m/s meaning its buildpower is 10.&lt;br /&gt;
&lt;br /&gt;
Since all builders have limited range, it is possible to talk about local buildpower as part of logistics. For example, if you have 10 Caretakers at home but only a few mobile builders, it may be more practical to make a few Fusions or even a Singularity rather than walk a long distance with builders you still have to make. &lt;br /&gt;
&lt;br /&gt;
This is also why at least in small density games such as 1v1, a builder is worth more the further from base it is (unless it's so far that it's in enemy territory and dead).&lt;br /&gt;
&lt;br /&gt;
== Priority ==&lt;br /&gt;
https://raw.githubusercontent.com/ZeroK-RTS/Zero-K/master/LuaUI/Images/commands/states/wrench_low.png https://raw.githubusercontent.com/ZeroK-RTS/Zero-K/master/LuaUI/Images/commands/states/wrench_med.png https://raw.githubusercontent.com/ZeroK-RTS/Zero-K/master/LuaUI/Images/commands/states/wrench_high.png&lt;br /&gt;
&lt;br /&gt;
All constructors and partially built structures have a button called '''Priority''' that can be set to low, medium or high. Constructors that are currently building a non-normal priority structure inherit its priority. Constructors set to high priority will receive resources before those with normal priority and those with normal receive before those with low. Assuming you are stalling metal (as you should be, explained above), high priority build projects will build faster than normal priority projects, and so on. This feature will save you the time of pausing all less important construction when you need to build something more quickly than others.&lt;br /&gt;
&lt;br /&gt;
Below is a table detailing priority inheritance. The builder and structure priority result in the builder receiving resources with the priority shown in the main body of the table.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; rowspan=&amp;quot;2&amp;quot; | !! colspan=&amp;quot;4&amp;quot; | Builder&lt;br /&gt;
|-&lt;br /&gt;
| '''High''' || '''Normal''' || '''Low'''&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot; | Struct &lt;br /&gt;
| '''High''' || High || High || High&lt;br /&gt;
|-&lt;br /&gt;
| '''Normal''' || High ||Normal ||Low&lt;br /&gt;
|-&lt;br /&gt;
| '''Low''' ||Low || Low || Low&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Team income distribution ==&lt;br /&gt;
&lt;br /&gt;
Commanders and innate income are split evenly.&lt;br /&gt;
&lt;br /&gt;
Reclaim is gained by the reclaiming player.&lt;br /&gt;
&lt;br /&gt;
Mexes produces base metal. The metal is split almost evenly, with more going to players who recently built a mex until 50% of that cost is paid off.&lt;br /&gt;
&lt;br /&gt;
Overdrive produces some amount of metal. The metal is split almost evenly, with more going to players who recently built energy until 50% of that cost is paid off. There is no concept of personal overdrive.&lt;br /&gt;
&lt;br /&gt;
{{Navbox manual}}&lt;/div&gt;</summary>
		<author><name>HigherFlyer</name></author>
		
	</entry>
	<entry>
		<id>https://zero-k.info/mediawiki/index.php?title=Zero-K:Developing&amp;diff=7117</id>
		<title>Zero-K:Developing</title>
		<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/index.php?title=Zero-K:Developing&amp;diff=7117"/>
		<updated>2020-11-12T13:59:06Z</updated>

		<summary type="html">&lt;p&gt;HigherFlyer: Updated the screenshot for copying the repositories link to clipboard.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New developers should read this before touching the source.&lt;br /&gt;
&lt;br /&gt;
== ZK's Devving Philosophy (social rules) ==&lt;br /&gt;
* &amp;quot;War is a product of anticommunication&amp;quot;&lt;br /&gt;
** Communicate with other devs about your changes/fixes, let them understand the issue. Do not make 'random' changes.&lt;br /&gt;
* &amp;quot;Do not create work for other people.&amp;quot;&lt;br /&gt;
** Have responsibility for your changes/commit. Do not leave bugs that require other people to fix.&lt;br /&gt;
* &amp;quot;Readability &amp;amp; performance are equally important.&amp;quot; &lt;br /&gt;
** Optimize code but not to the point of unreadability. [http://c2.com/cgi/wiki?RulesOfOptimization Remember the rules of optimization]:&lt;br /&gt;
*** Don't.&lt;br /&gt;
*** Don't (yet).&lt;br /&gt;
*** Profile before doing it.&lt;br /&gt;
* &amp;quot;If it ain't broke, don't fix it.&amp;quot;&lt;br /&gt;
** Don't code fixes that nobody wants to problems that don't exist.&lt;br /&gt;
&lt;br /&gt;
== What is in source codes ==&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K Zero-K] contains the game proper&lt;br /&gt;
** units folder contains unit definition files&lt;br /&gt;
*** You can read the wiki about game development for [http://springrts.com/wiki/Main_Page Spring Engine] &lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K-Infrastructure]&lt;br /&gt;
** Zero-K.info: Website sources&lt;br /&gt;
** ZkLobbyServer: Lobby server (for MP)&lt;br /&gt;
** ZkData: Website/server database structure&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Chobby Chobby] contains the lobby client&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Artwork Zero-K-Artwork] contains sources for 2D art, 3D art and sounds&lt;br /&gt;
* [https://github.com/ZeroK-RTS/SpringRTS-Tools SpringRTS-tools] contains various dev tools&lt;br /&gt;
** Upspring - required to edit the .3do and .s3o model files used in the game&lt;br /&gt;
** MapIconBuilder - unit map icon sources are here&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Missions Zero-K-Missions] contains source files for official ZK missions&lt;br /&gt;
&lt;br /&gt;
=== Style Guide===&lt;br /&gt;
The lua in the menu (chobby) and game proper should use the following whitespace:&lt;br /&gt;
* Indent with tabs.&lt;br /&gt;
* A tab may only follow a newline or another tab.&lt;br /&gt;
* If the text across two lines is being aligned (such as for a long function) then the two lines must have the same number of tabs.&lt;br /&gt;
* Don't try stack flow of control into one line. For example, put newlines after &amp;lt;code&amp;gt;then&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt;.&lt;br /&gt;
* End files with a newline.&lt;br /&gt;
* Commas should be followed by whitespace. Relations (=, &amp;lt;, &amp;lt;=, &amp;gt;=, ==, ~=) should have whitespace on each side.&lt;br /&gt;
* if a conditional is to take up multiple lines, double indent the extra lines and end the line with a conjunction (See Gallery below)&lt;br /&gt;
These guidelines are not necessarily followed in old files so updating them with a separate commit is a good idea prior to making large changes. Also, unitdefs use two-space indentation instead of tabs.          &lt;br /&gt;
&lt;br /&gt;
There are a few guildines for dealing with Spring functions.&lt;br /&gt;
* Localisation of Spring.Function should be named spFunction.&lt;br /&gt;
* Localisation of Spring.MoveCtrl.Function should be named spMoveCtrlFunction.&lt;br /&gt;
* Spring.GetCommandQueue should be used rather than Spring.GetUnitCommands (it's an alias, we just picked one).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Styleguide-if-example.JPG|Proper multiline if statement&lt;br /&gt;
Styleguide-stackflow.JPG|Example of stacked flow control&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting sources ==&lt;br /&gt;
This is a guide to downloading Zero-K sources from [https://github.com/ GitHub] using [https://tortoisegit.org/ TortoiseGit]. The game sources are used as an example, however this method applies to other subprojects as well.&lt;br /&gt;
* Install [https://tortoisegit.org/download/ TortoiseGit].&lt;br /&gt;
* Create a [https://github.com/ GitHub] account.&lt;br /&gt;
[[File:ForkZK.jpg]]&lt;br /&gt;
* Log in to GitHub and [https://github.com/ZeroK-RTS Locate] the repository you want to edit.&lt;br /&gt;
* Click the &amp;quot;Fork&amp;quot; button on the GitHub website to create your own copy on GitHub.&lt;br /&gt;
[[File:ZKCloneCopy.png|1103px]]&lt;br /&gt;
* Locate your fork on GitHub and click &amp;quot;Code&amp;quot;.&lt;br /&gt;
* Copy the web URL to your clipboard.&lt;br /&gt;
[[File:localCloneZK.jpg]]&lt;br /&gt;
* Create a folder called 'zk.sdd' in your Zero-K install under games.&lt;br /&gt;
* Right click on 'zk.sdd' and select 'Git Clone...' from the context menu.&lt;br /&gt;
[[File:cloneUIZK.jpg]]&lt;br /&gt;
* Copy the web URL into the 'URL:' field of the clone interface.&lt;br /&gt;
* Ensure that the 'Directory:' field ends in 'zk.sdd'. It is likely to automatically contain the path '...\Zero-K\games\zk.sdd\Zero-K' so be sure to delete the '\Zero-K' at the end.&lt;br /&gt;
[[File:cloneSuccess.jpg]]&lt;br /&gt;
* Wait for the sources to download.&lt;br /&gt;
* Your 'zk.sdd' folder should look something like the image above.&lt;br /&gt;
&lt;br /&gt;
== Updating sources ==&lt;br /&gt;
Keep your sources up to date by periodically syncing your fork to the original repository (using 'compare', see: https://github.com/KirstieJane/STEMMRoleModels/wiki/Syncing-your-fork-to-the-original-repository-via-the-browser, then do &amp;quot;rebase and merge&amp;quot; instead of &amp;quot;merge&amp;quot;) and doing TortoiseGit -&amp;gt; Pull on your repository folder to take the changes from GitHub to your local files.&lt;br /&gt;
&lt;br /&gt;
== Modifying the game ==&lt;br /&gt;
:''For personal modding, see [[Mod Creation]]''&lt;br /&gt;
Follow the instructions in 'Getting sources' the download the Zero-K game sources. Feel free to inspect and edit the game files. Most developers using Windows edit lua files with [https://notepad-plus-plus.org/download/v7.6.6.html Notepad++].&lt;br /&gt;
&lt;br /&gt;
To test your changes:&lt;br /&gt;
* (If using Windows make sure your file explorer has file name extensions enabled; for example the chobby_wrapper_port file should have a .txt on the end of its name.)&lt;br /&gt;
* Create an empty text file named 'devmode.txt' in the same directory as Zero-K.exe.&lt;br /&gt;
* Launch Zero-K.exe.&lt;br /&gt;
[[File:enableDevMode.jpg]]&lt;br /&gt;
* Select 'Zero-K Dev' in Settings -&amp;gt; Developer -&amp;gt; Singleplayer (you may need to scroll down).&lt;br /&gt;
[[File:startTest.jpg]]&lt;br /&gt;
* From the main menu select Singleplayer -&amp;gt; Skirmish -&amp;gt; Advanced -&amp;gt; Start to launch a test game. Note that the game type should be automatically set to 'Zero-K $VERSION'.&lt;br /&gt;
* In the game, press F8 to open debug console. It'll display errors and output to the log.&lt;br /&gt;
&lt;br /&gt;
== Modifying the lobby menu ==&lt;br /&gt;
Follow the instructions in 'Getting sources' with the following adjustments:&lt;br /&gt;
* The repository that you want to edit is https://github.com/ZeroK-RTS/Chobby.&lt;br /&gt;
* It is best to call the folder something like 'zkmenu.sdd', to avoid confusion.&lt;br /&gt;
Make sure that the 'Directory:' field ends in '.sdd'. You should end up with something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:zkmenufolder.jpg]]&lt;br /&gt;
&lt;br /&gt;
To test your changes launch Zero-K.exe with the &amp;lt;tt&amp;gt;dev&amp;lt;/tt&amp;gt; arg (i.e. &amp;lt;code&amp;gt;Zero-K.exe dev&amp;lt;/code&amp;gt;). On windows this is best done by creating a shortcut and changing the target, as shown below.&lt;br /&gt;
[[File:targetZK.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Submitting changes ==&lt;br /&gt;
Git provides a systematic way to review and merge changes into the main repositories. The main game repository is used as example, but this method works for other repositories as well.&lt;br /&gt;
&lt;br /&gt;
The simple way to commit changes is as follows.&lt;br /&gt;
* Make some changes to your local files.&lt;br /&gt;
* Right click on 'zk.sdd' and select 'Git Commit'.&lt;br /&gt;
* Write a description of the changes and click 'Commit'.&lt;br /&gt;
* Right click on 'zk.sdd' and select TortiseGit -&amp;gt; Push.&lt;br /&gt;
* Enter your GitHub login and password when prompted. The changes should now appear on your fork in GitHub.&lt;br /&gt;
* Navigate to https://github.com/ZeroK-RTS/Zero-K/pulls and click &amp;quot;New Pull Request&amp;quot;.&lt;br /&gt;
* Click &amp;quot;compare across forks&amp;quot; to make your fork visible.&lt;br /&gt;
* Set your fork to be the head repository.&lt;br /&gt;
* Write a title and description of the changes, then create the pull request.&lt;br /&gt;
This creates a proposal to apply your changes to the main game. Be sure to check up on it and respond to comments.&lt;br /&gt;
&lt;br /&gt;
A more advanced method involves creating branches locally with TortiseGit -&amp;gt; Create Branch and committing blocks of related changes to a single branch. You are then able to make pull requests from branches. This allows branches to be smaller and more focused, which is desirable when merging.&lt;br /&gt;
&lt;br /&gt;
Make sure to keep your repository up to date to make merges less difficult.&lt;br /&gt;
&lt;br /&gt;
== Zero-K.exe launch flags ==&lt;br /&gt;
&amp;lt;pre&amp;gt;Zero-K.exe [rapid tag] [engine version]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that the engine specified in arg won't automatically use the main Zero-K folder as its datadir. Add a &amp;lt;tt&amp;gt;springsettings.cfg&amp;lt;/tt&amp;gt; file to the engine version's folder with the tag &amp;lt;code&amp;gt;SpringData = path_to_Zero-K_folder&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modifying infrastructure/tools == &lt;br /&gt;
* Install [https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx Visual Studio Community edition]&lt;br /&gt;
* Install [https://www.microsoft.com/en-us/sql-server/sql-server-downloads SQL Server express]&lt;br /&gt;
* Clone to desktop [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K infrastructure]&lt;br /&gt;
* Test by opening Zero-K.sln in Visual Studio&lt;br /&gt;
&lt;br /&gt;
=== Initializing Website Database ===&lt;br /&gt;
You may need to setup the database connection for the website. In order to do that: Open Visual Studio, open the Server Explorer panel (under the View menu), right click Data Connections -&amp;gt; Add Connection -&amp;gt; Sql Server. Enter &amp;lt;code&amp;gt;(localdb)\mssqllocaldb&amp;lt;/code&amp;gt; in the Server Name field, after which zero-k_local will appear in the dropdown list of databases. &lt;br /&gt;
&lt;br /&gt;
(If zero-k_local does not appear, type it in the text box and press OK; Visual Studio will ask whether you would like to create the database. This may require you to have administrator rights on the computer.)&lt;br /&gt;
&lt;br /&gt;
[[File:zk-database-setup.png]]&lt;br /&gt;
&lt;br /&gt;
=== Debugging infrastructure ===&lt;br /&gt;
* To run a project right click it, choose &amp;quot;set as startup project&amp;quot; and hit F5 to run using debugger.&lt;br /&gt;
* You can enable multiple startup projects to test entire infrastructure locally (game servers, lobby etc). Enable asp.net, springie and ZeroKLobby projects to test it all together. [http://i.imgur.com/2mgizUJ.png Setup]&lt;br /&gt;
* To run asp.net:&lt;br /&gt;
** It's required that you install MS SQL Express on your local PC. &lt;br /&gt;
*** You can get SQL Server 2017 (for Windows 8 and later) [https://www.microsoft.com/en-us/sql-server/sql-server-editions-express here] or SQL Server 2014 (for Windows 7) [https://www.microsoft.com/en-ie/download/details.aspx?id=42299 here]. For SQL Server 2014, the file you will need is called SQLEXPR_x64_ENU or SQLEXPR_x86_ENU. Make sure you install version that matches your version of Windows (i.e. x86 vs x64). &lt;br /&gt;
*** During the installation, set collation to &amp;lt;code&amp;gt;SQL_Latin1_General_CP1_CI_AS&amp;lt;/code&amp;gt;. Leave all the parameters default except that I changed server name to SQLEXPRESS in one of the first steps of wizard.&lt;br /&gt;
[[File:SQL server collation.png|405px]]&lt;br /&gt;
** Right click asp.net -&amp;gt; properties -&amp;gt; web -&amp;gt; check &amp;quot;Specific Page&amp;quot; and leave it blank. Otherwise you get errors when trying to host locally.&lt;br /&gt;
** Make sure SQL Server is running (check the Sql Server Configuration Manager in the Start Menu). If you can't connect, edit the data source for &amp;lt;code&amp;gt;ModeType.Local&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;GlobalConst.cs&amp;lt;/code&amp;gt; (currently line 46) to say something like:&amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;Data Source=&amp;lt;hostname (usually your computer name)&amp;gt;\SQLEXPRESS&amp;lt;/code&amp;gt;&lt;br /&gt;
** To make things run smoothly the following changes might also be a good idea: In &amp;lt;code&amp;gt;Shared/PlasmaShared/GlobalConst.cs&amp;lt;/code&amp;gt; (currently line 137) replace the DefaultEngineOverride with whatever engine version is current. Comment out lines 190 and 238-298 of &amp;lt;code&amp;gt;Zero-K.info/AppCode/PlasmaServer.cs&amp;lt;/code&amp;gt; unless somebody can supply instructions on how to make the torrent errors go away.&lt;br /&gt;
&lt;br /&gt;
TODO: add download links for sample database tables here. Users and clans are probably easier to make yourself for most purposes. For now, if you need this ask Licho, Histidine, DeinFreund or Anarchid. Aquanim has sample tables for maps and Planetwars structures, if that is all that you need.&lt;br /&gt;
&lt;br /&gt;
=== Modifying The Database Structure ===&lt;br /&gt;
* Modify the appropriate files in ./ZkData/Ef/...  and elsewhere ( [https://github.com/ZeroK-RTS/Zero-K-Infrastructure/commit/61addee11e74b09dd5dd73e12d31a28030d84e81 this commit] should be a reasonable guide; don't worry about the migration files, they are created later )&lt;br /&gt;
* Open Tools &amp;gt; NuGet Package Manager &amp;gt; Package Manager Console&lt;br /&gt;
* At the top of the window which appears, there is a &amp;quot;Default project&amp;quot; dropdown box. Set this to ZkData.&lt;br /&gt;
* Type the command &amp;lt;code&amp;gt;Add-Migration [description-of-change-here]&amp;lt;/code&amp;gt; into the package manager console. This should create some migration files with your description and a timestamp in the name in the Migrations folder of ZkData.&lt;br /&gt;
* In some cases you may now need to manually edit the created migration files to set defaults and the like?&lt;br /&gt;
* Type the command &amp;lt;code&amp;gt;Update-Database&amp;lt;/code&amp;gt; into the package manager console. This should update the database structure.&lt;br /&gt;
* To revert a migration that has not yet been pushed to the main repository, run &amp;lt;code&amp;gt;Update-Database –TargetMigration: TheLastGoodMigration&amp;lt;/code&amp;gt; then delete your bad migration files.&lt;br /&gt;
&lt;br /&gt;
== Artwork ==&lt;br /&gt;
See [http://zero-k.info/Wiki/Development_Artwork Development Artwork] (outdated)&lt;br /&gt;
&lt;br /&gt;
[[Blender_To_Zero-K|Blender To Zero-K]]&lt;br /&gt;
&lt;br /&gt;
== Missions ==&lt;br /&gt;
=== Campaign ===&lt;br /&gt;
Campaign planets/missions are defined in [//github.com/ZeroK-RTS/Chobby/tree/master/campaign/sample Chobby/campaign/sample]&lt;br /&gt;
&lt;br /&gt;
=== Standalone missions ===&lt;br /&gt;
See [[Mission Editor|Mission Editor start page]]&lt;br /&gt;
&lt;br /&gt;
== Updating PlanetWars for new round ==&lt;br /&gt;
:''TODO''&lt;br /&gt;
Changing faction:&lt;br /&gt;
* Faction ID, name, color in dbo.Faction&lt;br /&gt;
* Faction blurb &amp;lt;tt&amp;gt;Faction&amp;lt;Name&amp;gt;&amp;lt;/tt&amp;gt; on sitewiki&lt;br /&gt;
* Add/change icons if needed&lt;br /&gt;
** Site: img/factions/&amp;lt;name&amp;gt;.png&lt;br /&gt;
** Game: LuaUI/Configs/Factions&lt;br /&gt;
** Chobby: LuaMenu/Images/Factions&lt;br /&gt;
** Does chobby download them automatically? Presumably not&lt;br /&gt;
&lt;br /&gt;
Using [https://zero-k.info/PlanetwarsAdmin Planetwars admin interface]: Change to a different galaxy if desired, reset PW&lt;br /&gt;
&lt;br /&gt;
== Wiki ==&lt;br /&gt;
See [[Editing Help]]&lt;br /&gt;
&lt;br /&gt;
=== Making/Editing a unit ===&lt;br /&gt;
See the Blender to Zero-K page for a comprehensive guide on modelling, texturing, and baking aoplates for Zero-K units: [https://zero-k.info/mediawiki/index.php?title=Blender_To_Zero-K Blender to Zero-K Page]&lt;br /&gt;
&lt;br /&gt;
=== Unit pages ===&lt;br /&gt;
Part of each unit page is autogenerated by the [//github.com/ZeroK-RTS/SpringRTS-Tools/tree/master/unitguide Unit Guide tool], and uploaded by the [//github.com/ZeroK-RTS/Zero-K-Infrastructure/blob/master/Fixer/WikiPortingMW.cs Wiki bot].&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt;export_unit_templates.sh&amp;lt;/code&amp;gt; to generate wiki templates for each unit (see &amp;lt;code&amp;gt;export_unit_templates.lua&amp;lt;/code&amp;gt; for some configuration options), then have the bot read the generated text files and edit the unit pages accordingly (requires Visual Studio setup as detailed above). The text output can also be used to manually edit pages.&lt;br /&gt;
&lt;br /&gt;
Unit buildicons and radar icons should be uploaded by FTP to manual.zero-k.info (&amp;lt;code&amp;gt;zero-k.info/zkmanual/www/unitpics&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/icons&amp;lt;/code&amp;gt; respectively). Contact Licho or Histidine for login details.&lt;br /&gt;
&lt;br /&gt;
== itch.io builds ==&lt;br /&gt;
Instructions for updating the portable build on [https://itch.io/ itch.io]:&lt;br /&gt;
&lt;br /&gt;
* Download latest Zero-K portable from https://zerok.itch.io/zero-k, extract to a folder&lt;br /&gt;
* Download butler (see guide at https://itch.io/docs/butler/)&lt;br /&gt;
* Modify extracted portable folder so that its contents are the same as what the user will download&lt;br /&gt;
* Run butler with command: &amp;lt;code&amp;gt;butler push &amp;lt;portable folder&amp;gt; zerok/zero-k:portable&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Engine ==&lt;br /&gt;
See [https://springrts.com/wiki/Development:Getting_Started Spring Engine Development]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>HigherFlyer</name></author>
		
	</entry>
	<entry>
		<id>https://zero-k.info/mediawiki/index.php?title=File:ZKCloneCopy.png&amp;diff=7116</id>
		<title>File:ZKCloneCopy.png</title>
		<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/index.php?title=File:ZKCloneCopy.png&amp;diff=7116"/>
		<updated>2020-11-12T13:56:00Z</updated>

		<summary type="html">&lt;p&gt;HigherFlyer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A better version of the updated screenshot for showing how to copy a repo to clone it.&lt;/div&gt;</summary>
		<author><name>HigherFlyer</name></author>
		
	</entry>
	<entry>
		<id>https://zero-k.info/mediawiki/index.php?title=File:ZKCloneCopyRepo.png&amp;diff=7115</id>
		<title>File:ZKCloneCopyRepo.png</title>
		<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/index.php?title=File:ZKCloneCopyRepo.png&amp;diff=7115"/>
		<updated>2020-11-12T13:44:32Z</updated>

		<summary type="html">&lt;p&gt;HigherFlyer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an updated screenshot showing people how to copy the link to their repository on Github.&lt;/div&gt;</summary>
		<author><name>HigherFlyer</name></author>
		
	</entry>
	<entry>
		<id>https://zero-k.info/mediawiki/index.php?title=Zero-K:Developing&amp;diff=7031</id>
		<title>Zero-K:Developing</title>
		<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/index.php?title=Zero-K:Developing&amp;diff=7031"/>
		<updated>2020-10-15T13:45:57Z</updated>

		<summary type="html">&lt;p&gt;HigherFlyer: Fixed a mistake on formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New developers should read this before touching the source.&lt;br /&gt;
&lt;br /&gt;
== ZK's Devving Philosophy (social rules) ==&lt;br /&gt;
* &amp;quot;War is a product of anticommunication&amp;quot;&lt;br /&gt;
** Communicate with other devs about your changes/fixes, let them understand the issue. Do not make 'random' changes.&lt;br /&gt;
* &amp;quot;Do not create work for other people.&amp;quot;&lt;br /&gt;
** Have responsibility for your changes/commit. Do not leave bugs that require other people to fix.&lt;br /&gt;
* &amp;quot;Readability &amp;amp; performance are equally important.&amp;quot; &lt;br /&gt;
** Optimize code but not to the point of unreadability. [http://c2.com/cgi/wiki?RulesOfOptimization Remember the rules of optimization]:&lt;br /&gt;
*** Don't.&lt;br /&gt;
*** Don't (yet).&lt;br /&gt;
*** Profile before doing it.&lt;br /&gt;
* &amp;quot;If it ain't broke, don't fix it.&amp;quot;&lt;br /&gt;
** Don't code fixes that nobody wants to problems that don't exist.&lt;br /&gt;
&lt;br /&gt;
== What is in source codes ==&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K Zero-K] contains the game proper&lt;br /&gt;
** units folder contains unit definition files&lt;br /&gt;
*** You can read the wiki about game development for [http://springrts.com/wiki/Main_Page Spring Engine] &lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K-Infrastructure]&lt;br /&gt;
** Zero-K.info: Website sources&lt;br /&gt;
** ZkLobbyServer: Lobby server (for MP)&lt;br /&gt;
** ZkData: Website/server database structure&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Chobby Chobby] contains the lobby client&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Artwork Zero-K-Artwork] contains sources for 2D art, 3D art and sounds&lt;br /&gt;
* [https://github.com/ZeroK-RTS/SpringRTS-Tools SpringRTS-tools] contains various dev tools&lt;br /&gt;
** Upspring - required to edit the .3do and .s3o model files used in the game&lt;br /&gt;
** MapIconBuilder - unit map icon sources are here&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Missions Zero-K-Missions] contains source files for official ZK missions&lt;br /&gt;
&lt;br /&gt;
=== Style Guide===&lt;br /&gt;
The lua in the menu (chobby) and game proper should use the following whitespace:&lt;br /&gt;
* Indent with tabs.&lt;br /&gt;
* A tab may only follow a newline or another tab.&lt;br /&gt;
* If the text across two lines is being aligned (such as for a long function) then the two lines must have the same number of tabs.&lt;br /&gt;
* Don't try stack flow of control into one line. For example, put newlines after &amp;lt;code&amp;gt;then&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt;.&lt;br /&gt;
* End files with a newline.&lt;br /&gt;
* Commas should be followed by whitespace. Relations (=, &amp;lt;, &amp;lt;=, &amp;gt;=, ==, ~=) should have whitespace on each side.&lt;br /&gt;
* if a conditional is to take up multiple lines, double indent the extra lines and end the line with a conjunction (See Gallery below)&lt;br /&gt;
These guidelines are not necessarily followed in old files so updating them with a separate commit is a good idea prior to making large changes. Also, unitdefs use two-space indentation instead of tabs.          &lt;br /&gt;
&lt;br /&gt;
There are a few guildines for dealing with Spring functions.&lt;br /&gt;
* Localisation of Spring.Function should be named spFunction.&lt;br /&gt;
* Localisation of Spring.MoveCtrl.Function should be named spMoveCtrlFunction.&lt;br /&gt;
* Spring.GetCommandQueue should be used rather than Spring.GetUnitCommands (it's an alias, we just picked one).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Styleguide-if-example.JPG|Proper multiline if statement&lt;br /&gt;
Styleguide-stackflow.JPG|Example of stacked flow control&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting sources ==&lt;br /&gt;
This is a guide to downloading Zero-K sources from [https://github.com/ GitHub] using [https://tortoisegit.org/ TortoiseGit]. The game sources are used as an example, however this method applies to other subprojects as well.&lt;br /&gt;
* Install [https://tortoisegit.org/download/ TortoiseGit].&lt;br /&gt;
* Create a [https://github.com/ GitHub] account.&lt;br /&gt;
[[File:ForkZK.jpg]]&lt;br /&gt;
* Log in to GitHub and [https://github.com/ZeroK-RTS Locate] the repository you want to edit.&lt;br /&gt;
* Click the &amp;quot;Fork&amp;quot; button on the GitHub website to create your own copy on GitHub.&lt;br /&gt;
[[File:cloneZK.jpg]]&lt;br /&gt;
* Locate your fork on GitHub and click &amp;quot;Clone or Download&amp;quot;.&lt;br /&gt;
* Copy the web URL to your clipboard.&lt;br /&gt;
[[File:localCloneZK.jpg]]&lt;br /&gt;
* Create a folder called 'zk.sdd' in your Zero-K install under games.&lt;br /&gt;
* Right click on 'zk.sdd' and select 'Git Clone...' from the context menu.&lt;br /&gt;
[[File:cloneUIZK.jpg]]&lt;br /&gt;
* Copy the web URL into the 'URL:' field of the clone interface.&lt;br /&gt;
* Ensure that the 'Directory:' field ends in 'zk.sdd'. It is likely to automatically contain the path '...\Zero-K\games\zk.sdd\Zero-K' so be sure to delete the '\Zero-K' at the end.&lt;br /&gt;
[[File:cloneSuccess.jpg]]&lt;br /&gt;
* Wait for the sources to download.&lt;br /&gt;
* Your 'zk.sdd' folder should look something like the image above.&lt;br /&gt;
&lt;br /&gt;
== Updating sources ==&lt;br /&gt;
Keep your sources up to date by periodically syncing your fork to the original repository (using 'compare', see: https://github.com/KirstieJane/STEMMRoleModels/wiki/Syncing-your-fork-to-the-original-repository-via-the-browser, then do &amp;quot;rebase and merge&amp;quot; instead of &amp;quot;merge&amp;quot;) and doing TortoiseGit -&amp;gt; Pull on your repository folder to take the changes from GitHub to your local files.&lt;br /&gt;
&lt;br /&gt;
== Modifying the game ==&lt;br /&gt;
:''For personal modding, see [[Mod Creation]]''&lt;br /&gt;
Follow the instructions in 'Getting sources' the download the Zero-K game sources. Feel free to inspect and edit the game files. Most developers using Windows edit lua files with [https://notepad-plus-plus.org/download/v7.6.6.html Notepad++].&lt;br /&gt;
&lt;br /&gt;
To test your changes:&lt;br /&gt;
* Create an empty file named 'devmode.txt' in the same directory as Zero-K.exe.&lt;br /&gt;
* Launch Zero-K.exe.&lt;br /&gt;
[[File:enableDevMode.jpg]]&lt;br /&gt;
* Select 'Zero-K Dev' in Settings -&amp;gt; Developer -&amp;gt; Singleplayer (you may need to scroll down).&lt;br /&gt;
[[File:startTest.jpg]]&lt;br /&gt;
* From the main menu select Singleplayer -&amp;gt; Skirmish -&amp;gt; Advanced -&amp;gt; Start to launch a test game. Note that the game type should be automatically set to 'Zero-K $VERSION'.&lt;br /&gt;
* In the game, press F8 to open debug console. It'll display errors and output to the log.&lt;br /&gt;
&lt;br /&gt;
== Modifying the lobby menu ==&lt;br /&gt;
Follow the instructions in 'Getting sources' with the following adjustments:&lt;br /&gt;
* The repository that you want to edit is https://github.com/ZeroK-RTS/Chobby.&lt;br /&gt;
* It is best to call the folder something like 'zkmenu.sdd', to avoid confusion.&lt;br /&gt;
Make sure that the 'Directory:' field ends in '.sdd'. You should end up with something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:zkmenufolder.jpg]]&lt;br /&gt;
&lt;br /&gt;
To test your changes launch Zero-K.exe with the &amp;lt;tt&amp;gt;dev&amp;lt;/tt&amp;gt; arg (i.e. &amp;lt;code&amp;gt;Zero-K.exe dev&amp;lt;/code&amp;gt;). On windows this is best done by creating a shortcut and changing the target, as shown below.&lt;br /&gt;
[[File:targetZK.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Submitting changes ==&lt;br /&gt;
Git provides a systematic way to review and merge changes into the main repositories. The main game repository is used as example, but this method works for other repositories as well.&lt;br /&gt;
&lt;br /&gt;
The simple way to commit changes is as follows.&lt;br /&gt;
* Make some changes to your local files.&lt;br /&gt;
* Right click on 'zk.sdd' and select 'Git Commit'.&lt;br /&gt;
* Write a description of the changes and click 'Commit'.&lt;br /&gt;
* Right click on 'zk.sdd' and select TortiseGit -&amp;gt; Push.&lt;br /&gt;
* Enter your GitHub login and password when prompted. The changes should now appear on your fork in GitHub.&lt;br /&gt;
* Navigate to https://github.com/ZeroK-RTS/Zero-K/pulls and click &amp;quot;New Pull Request&amp;quot;.&lt;br /&gt;
* Click &amp;quot;compare across forks&amp;quot; to make your fork visible.&lt;br /&gt;
* Set your fork to be the head repository.&lt;br /&gt;
* Write a title and description of the changes, then create the pull request.&lt;br /&gt;
This creates a proposal to apply your changes to the main game. Be sure to check up on it and respond to comments.&lt;br /&gt;
&lt;br /&gt;
A more advanced method involves creating branches locally with TortiseGit -&amp;gt; Create Branch and committing blocks of related changes to a single branch. You are then able to make pull requests from branches. This allows branches to be smaller and more focused, which is desirable when merging.&lt;br /&gt;
&lt;br /&gt;
Make sure to keep your repository up to date to make merges less difficult.&lt;br /&gt;
&lt;br /&gt;
== Zero-K.exe launch flags ==&lt;br /&gt;
&amp;lt;pre&amp;gt;Zero-K.exe [rapid tag] [engine version]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that the engine specified in arg won't automatically use the main Zero-K folder as its datadir. Add a &amp;lt;tt&amp;gt;springsettings.cfg&amp;lt;/tt&amp;gt; file to the engine version's folder with the tag &amp;lt;code&amp;gt;SpringData = path_to_Zero-K_folder&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modifying infrastructure/tools == &lt;br /&gt;
* Install [https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx Visual Studio Community edition]&lt;br /&gt;
* Install [https://www.microsoft.com/en-us/sql-server/sql-server-downloads SQL Server express]&lt;br /&gt;
* Clone to desktop [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K infrastructure]&lt;br /&gt;
* Test by opening Zero-K.sln in Visual Studio&lt;br /&gt;
&lt;br /&gt;
=== Initializing Website Database ===&lt;br /&gt;
You may need to setup the database connection for the website. In order to do that: Open Visual Studio, open the Server Explorer panel (under the View menu), right click Data Connections -&amp;gt; Add Connection -&amp;gt; Sql Server. Enter &amp;lt;code&amp;gt;(localdb)\mssqllocaldb&amp;lt;/code&amp;gt; in the Server Name field, after which zero-k_local will appear in the dropdown list of databases. &lt;br /&gt;
&lt;br /&gt;
(If zero-k_local does not appear, type it in the text box and press OK; Visual Studio will ask whether you would like to create the database. This may require you to have administrator rights on the computer.)&lt;br /&gt;
&lt;br /&gt;
[[File:zk-database-setup.png]]&lt;br /&gt;
&lt;br /&gt;
=== Debugging infrastructure ===&lt;br /&gt;
* To run a project right click it, choose &amp;quot;set as startup project&amp;quot; and hit F5 to run using debugger.&lt;br /&gt;
* You can enable multiple startup projects to test entire infrastructure locally (game servers, lobby etc). Enable asp.net, springie and ZeroKLobby projects to test it all together. [http://i.imgur.com/2mgizUJ.png Setup]&lt;br /&gt;
* To run asp.net:&lt;br /&gt;
** It's required that you install MS SQL Express on your local PC. &lt;br /&gt;
*** You can get SQL Server 2017 (for Windows 8 and later) [https://www.microsoft.com/en-us/sql-server/sql-server-editions-express here] or SQL Server 2014 (for Windows 7) [https://www.microsoft.com/en-ie/download/details.aspx?id=42299 here]. For SQL Server 2014, the file you will need is called SQLEXPR_x64_ENU or SQLEXPR_x86_ENU. Make sure you install version that matches your version of Windows (i.e. x86 vs x64). &lt;br /&gt;
*** During the installation, set collation to &amp;lt;code&amp;gt;SQL_Latin1_General_CP1_CI_AS&amp;lt;/code&amp;gt;. Leave all the parameters default except that I changed server name to SQLEXPRESS in one of the first steps of wizard.&lt;br /&gt;
[[File:SQL server collation.png|405px]]&lt;br /&gt;
** Right click asp.net -&amp;gt; properties -&amp;gt; web -&amp;gt; check &amp;quot;Specific Page&amp;quot; and leave it blank. Otherwise you get errors when trying to host locally.&lt;br /&gt;
** Make sure SQL Server is running (check the Sql Server Configuration Manager in the Start Menu). If you can't connect, edit the data source for &amp;lt;code&amp;gt;ModeType.Local&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;GlobalConst.cs&amp;lt;/code&amp;gt; (currently line 46) to say something like:&amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;Data Source=&amp;lt;hostname (usually your computer name)&amp;gt;\SQLEXPRESS&amp;lt;/code&amp;gt;&lt;br /&gt;
** To make things run smoothly the following changes might also be a good idea: In &amp;lt;code&amp;gt;Shared/PlasmaShared/GlobalConst.cs&amp;lt;/code&amp;gt; (currently line 137) replace the DefaultEngineOverride with whatever engine version is current. Comment out lines 190 and 238-298 of &amp;lt;code&amp;gt;Zero-K.info/AppCode/PlasmaServer.cs&amp;lt;/code&amp;gt; unless somebody can supply instructions on how to make the torrent errors go away.&lt;br /&gt;
&lt;br /&gt;
TODO: add download links for sample database tables here. Users and clans are probably easier to make yourself for most purposes. For now, if you need this ask Licho, Histidine, DeinFreund or Anarchid. Aquanim has sample tables for maps and Planetwars structures, if that is all that you need.&lt;br /&gt;
&lt;br /&gt;
=== Modifying The Database Structure ===&lt;br /&gt;
* Modify the appropriate files in ./ZkData/Ef/...  and elsewhere ( [https://github.com/ZeroK-RTS/Zero-K-Infrastructure/commit/61addee11e74b09dd5dd73e12d31a28030d84e81 this commit] should be a reasonable guide; don't worry about the migration files, they are created later )&lt;br /&gt;
* Open Tools &amp;gt; NuGet Package Manager &amp;gt; Package Manager Console&lt;br /&gt;
* At the top of the window which appears, there is a &amp;quot;Default project&amp;quot; dropdown box. Set this to ZkData.&lt;br /&gt;
* Type the command &amp;lt;code&amp;gt;Add-Migration [description-of-change-here]&amp;lt;/code&amp;gt; into the package manager console. This should create some migration files with your description and a timestamp in the name in the Migrations folder of ZkData.&lt;br /&gt;
* In some cases you may now need to manually edit the created migration files to set defaults and the like?&lt;br /&gt;
* Type the command &amp;lt;code&amp;gt;Update-Database&amp;lt;/code&amp;gt; into the package manager console. This should update the database structure.&lt;br /&gt;
* To revert a migration that has not yet been pushed to the main repository, run &amp;lt;code&amp;gt;Update-Database –TargetMigration: TheLastGoodMigration&amp;lt;/code&amp;gt; then delete your bad migration files.&lt;br /&gt;
&lt;br /&gt;
== Artwork ==&lt;br /&gt;
See [http://zero-k.info/Wiki/Development_Artwork Development Artwork] (outdated)&lt;br /&gt;
&lt;br /&gt;
[[Blender_To_Zero-K|Blender To Zero-K]]&lt;br /&gt;
&lt;br /&gt;
== Missions ==&lt;br /&gt;
=== Campaign ===&lt;br /&gt;
Campaign planets/missions are defined in [//github.com/ZeroK-RTS/Chobby/tree/master/campaign/sample Chobby/campaign/sample]&lt;br /&gt;
&lt;br /&gt;
=== Standalone missions ===&lt;br /&gt;
See [[Mission Editor|Mission Editor start page]]&lt;br /&gt;
&lt;br /&gt;
== Updating PlanetWars for new round ==&lt;br /&gt;
:''TODO''&lt;br /&gt;
Changing faction:&lt;br /&gt;
* Faction ID, name, color in dbo.Faction&lt;br /&gt;
* Faction blurb &amp;lt;tt&amp;gt;Faction&amp;lt;Name&amp;gt;&amp;lt;/tt&amp;gt; on sitewiki&lt;br /&gt;
* Add/change icons if needed&lt;br /&gt;
** Site: img/factions/&amp;lt;name&amp;gt;.png&lt;br /&gt;
** Game: LuaUI/Configs/Factions&lt;br /&gt;
** Chobby: LuaMenu/Images/Factions&lt;br /&gt;
** Does chobby download them automatically? Presumably not&lt;br /&gt;
&lt;br /&gt;
Using [https://zero-k.info/PlanetwarsAdmin Planetwars admin interface]: Change to a different galaxy if desired, reset PW&lt;br /&gt;
&lt;br /&gt;
== Wiki ==&lt;br /&gt;
See [[Editing Help]]&lt;br /&gt;
&lt;br /&gt;
=== Making/Editing a unit ===&lt;br /&gt;
See the Blender to Zero-K page for a comprehensive guide on modelling, texturing, and baking aoplates for Zero-K units: [https://zero-k.info/mediawiki/index.php?title=Blender_To_Zero-K Blender to Zero-K Page]&lt;br /&gt;
&lt;br /&gt;
=== Unit pages ===&lt;br /&gt;
Part of each unit page is autogenerated by the [//github.com/ZeroK-RTS/SpringRTS-Tools/tree/master/unitguide Unit Guide tool], and uploaded by the [//github.com/ZeroK-RTS/Zero-K-Infrastructure/blob/master/Fixer/WikiPortingMW.cs Wiki bot].&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt;export_unit_templates.sh&amp;lt;/code&amp;gt; to generate wiki templates for each unit (see &amp;lt;code&amp;gt;export_unit_templates.lua&amp;lt;/code&amp;gt; for some configuration options), then have the bot read the generated text files and edit the unit pages accordingly (requires Visual Studio setup as detailed above). The text output can also be used to manually edit pages.&lt;br /&gt;
&lt;br /&gt;
Unit buildicons and radar icons should be uploaded by FTP to manual.zero-k.info (&amp;lt;code&amp;gt;zero-k.info/zkmanual/www/unitpics&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/icons&amp;lt;/code&amp;gt; respectively). Contact Licho or Histidine for login details.&lt;br /&gt;
&lt;br /&gt;
== itch.io builds ==&lt;br /&gt;
Instructions for updating the portable build on [https://itch.io/ itch.io]:&lt;br /&gt;
&lt;br /&gt;
* Download latest Zero-K portable from https://zerok.itch.io/zero-k, extract to a folder&lt;br /&gt;
* Download butler (see guide at https://itch.io/docs/butler/)&lt;br /&gt;
* Modify extracted portable folder so that its contents are the same as what the user will download&lt;br /&gt;
* Run butler with command: &amp;lt;code&amp;gt;butler push &amp;lt;portable folder&amp;gt; zerok/zero-k:portable&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Engine ==&lt;br /&gt;
See [https://springrts.com/wiki/Development:Getting_Started Spring Engine Development]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>HigherFlyer</name></author>
		
	</entry>
	<entry>
		<id>https://zero-k.info/mediawiki/index.php?title=Zero-K:Developing&amp;diff=7030</id>
		<title>Zero-K:Developing</title>
		<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/index.php?title=Zero-K:Developing&amp;diff=7030"/>
		<updated>2020-10-15T13:44:12Z</updated>

		<summary type="html">&lt;p&gt;HigherFlyer: Added Making/Editing unit section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New developers should read this before touching the source.&lt;br /&gt;
&lt;br /&gt;
== ZK's Devving Philosophy (social rules) ==&lt;br /&gt;
* &amp;quot;War is a product of anticommunication&amp;quot;&lt;br /&gt;
** Communicate with other devs about your changes/fixes, let them understand the issue. Do not make 'random' changes.&lt;br /&gt;
* &amp;quot;Do not create work for other people.&amp;quot;&lt;br /&gt;
** Have responsibility for your changes/commit. Do not leave bugs that require other people to fix.&lt;br /&gt;
* &amp;quot;Readability &amp;amp; performance are equally important.&amp;quot; &lt;br /&gt;
** Optimize code but not to the point of unreadability. [http://c2.com/cgi/wiki?RulesOfOptimization Remember the rules of optimization]:&lt;br /&gt;
*** Don't.&lt;br /&gt;
*** Don't (yet).&lt;br /&gt;
*** Profile before doing it.&lt;br /&gt;
* &amp;quot;If it ain't broke, don't fix it.&amp;quot;&lt;br /&gt;
** Don't code fixes that nobody wants to problems that don't exist.&lt;br /&gt;
&lt;br /&gt;
== What is in source codes ==&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K Zero-K] contains the game proper&lt;br /&gt;
** units folder contains unit definition files&lt;br /&gt;
*** You can read the wiki about game development for [http://springrts.com/wiki/Main_Page Spring Engine] &lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K-Infrastructure]&lt;br /&gt;
** Zero-K.info: Website sources&lt;br /&gt;
** ZkLobbyServer: Lobby server (for MP)&lt;br /&gt;
** ZkData: Website/server database structure&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Chobby Chobby] contains the lobby client&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Artwork Zero-K-Artwork] contains sources for 2D art, 3D art and sounds&lt;br /&gt;
* [https://github.com/ZeroK-RTS/SpringRTS-Tools SpringRTS-tools] contains various dev tools&lt;br /&gt;
** Upspring - required to edit the .3do and .s3o model files used in the game&lt;br /&gt;
** MapIconBuilder - unit map icon sources are here&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Missions Zero-K-Missions] contains source files for official ZK missions&lt;br /&gt;
&lt;br /&gt;
=== Style Guide===&lt;br /&gt;
The lua in the menu (chobby) and game proper should use the following whitespace:&lt;br /&gt;
* Indent with tabs.&lt;br /&gt;
* A tab may only follow a newline or another tab.&lt;br /&gt;
* If the text across two lines is being aligned (such as for a long function) then the two lines must have the same number of tabs.&lt;br /&gt;
* Don't try stack flow of control into one line. For example, put newlines after &amp;lt;code&amp;gt;then&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt;.&lt;br /&gt;
* End files with a newline.&lt;br /&gt;
* Commas should be followed by whitespace. Relations (=, &amp;lt;, &amp;lt;=, &amp;gt;=, ==, ~=) should have whitespace on each side.&lt;br /&gt;
* if a conditional is to take up multiple lines, double indent the extra lines and end the line with a conjunction (See Gallery below)&lt;br /&gt;
These guidelines are not necessarily followed in old files so updating them with a separate commit is a good idea prior to making large changes. Also, unitdefs use two-space indentation instead of tabs.          &lt;br /&gt;
&lt;br /&gt;
There are a few guildines for dealing with Spring functions.&lt;br /&gt;
* Localisation of Spring.Function should be named spFunction.&lt;br /&gt;
* Localisation of Spring.MoveCtrl.Function should be named spMoveCtrlFunction.&lt;br /&gt;
* Spring.GetCommandQueue should be used rather than Spring.GetUnitCommands (it's an alias, we just picked one).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Styleguide-if-example.JPG|Proper multiline if statement&lt;br /&gt;
Styleguide-stackflow.JPG|Example of stacked flow control&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting sources ==&lt;br /&gt;
This is a guide to downloading Zero-K sources from [https://github.com/ GitHub] using [https://tortoisegit.org/ TortoiseGit]. The game sources are used as an example, however this method applies to other subprojects as well.&lt;br /&gt;
* Install [https://tortoisegit.org/download/ TortoiseGit].&lt;br /&gt;
* Create a [https://github.com/ GitHub] account.&lt;br /&gt;
[[File:ForkZK.jpg]]&lt;br /&gt;
* Log in to GitHub and [https://github.com/ZeroK-RTS Locate] the repository you want to edit.&lt;br /&gt;
* Click the &amp;quot;Fork&amp;quot; button on the GitHub website to create your own copy on GitHub.&lt;br /&gt;
[[File:cloneZK.jpg]]&lt;br /&gt;
* Locate your fork on GitHub and click &amp;quot;Clone or Download&amp;quot;.&lt;br /&gt;
* Copy the web URL to your clipboard.&lt;br /&gt;
[[File:localCloneZK.jpg]]&lt;br /&gt;
* Create a folder called 'zk.sdd' in your Zero-K install under games.&lt;br /&gt;
* Right click on 'zk.sdd' and select 'Git Clone...' from the context menu.&lt;br /&gt;
[[File:cloneUIZK.jpg]]&lt;br /&gt;
* Copy the web URL into the 'URL:' field of the clone interface.&lt;br /&gt;
* Ensure that the 'Directory:' field ends in 'zk.sdd'. It is likely to automatically contain the path '...\Zero-K\games\zk.sdd\Zero-K' so be sure to delete the '\Zero-K' at the end.&lt;br /&gt;
[[File:cloneSuccess.jpg]]&lt;br /&gt;
* Wait for the sources to download.&lt;br /&gt;
* Your 'zk.sdd' folder should look something like the image above.&lt;br /&gt;
&lt;br /&gt;
== Updating sources ==&lt;br /&gt;
Keep your sources up to date by periodically syncing your fork to the original repository (using 'compare', see: https://github.com/KirstieJane/STEMMRoleModels/wiki/Syncing-your-fork-to-the-original-repository-via-the-browser, then do &amp;quot;rebase and merge&amp;quot; instead of &amp;quot;merge&amp;quot;) and doing TortoiseGit -&amp;gt; Pull on your repository folder to take the changes from GitHub to your local files.&lt;br /&gt;
&lt;br /&gt;
== Modifying the game ==&lt;br /&gt;
:''For personal modding, see [[Mod Creation]]''&lt;br /&gt;
Follow the instructions in 'Getting sources' the download the Zero-K game sources. Feel free to inspect and edit the game files. Most developers using Windows edit lua files with [https://notepad-plus-plus.org/download/v7.6.6.html Notepad++].&lt;br /&gt;
&lt;br /&gt;
To test your changes:&lt;br /&gt;
* Create an empty file named 'devmode.txt' in the same directory as Zero-K.exe.&lt;br /&gt;
* Launch Zero-K.exe.&lt;br /&gt;
[[File:enableDevMode.jpg]]&lt;br /&gt;
* Select 'Zero-K Dev' in Settings -&amp;gt; Developer -&amp;gt; Singleplayer (you may need to scroll down).&lt;br /&gt;
[[File:startTest.jpg]]&lt;br /&gt;
* From the main menu select Singleplayer -&amp;gt; Skirmish -&amp;gt; Advanced -&amp;gt; Start to launch a test game. Note that the game type should be automatically set to 'Zero-K $VERSION'.&lt;br /&gt;
* In the game, press F8 to open debug console. It'll display errors and output to the log.&lt;br /&gt;
&lt;br /&gt;
== Modifying the lobby menu ==&lt;br /&gt;
Follow the instructions in 'Getting sources' with the following adjustments:&lt;br /&gt;
* The repository that you want to edit is https://github.com/ZeroK-RTS/Chobby.&lt;br /&gt;
* It is best to call the folder something like 'zkmenu.sdd', to avoid confusion.&lt;br /&gt;
Make sure that the 'Directory:' field ends in '.sdd'. You should end up with something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:zkmenufolder.jpg]]&lt;br /&gt;
&lt;br /&gt;
To test your changes launch Zero-K.exe with the &amp;lt;tt&amp;gt;dev&amp;lt;/tt&amp;gt; arg (i.e. &amp;lt;code&amp;gt;Zero-K.exe dev&amp;lt;/code&amp;gt;). On windows this is best done by creating a shortcut and changing the target, as shown below.&lt;br /&gt;
[[File:targetZK.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Submitting changes ==&lt;br /&gt;
Git provides a systematic way to review and merge changes into the main repositories. The main game repository is used as example, but this method works for other repositories as well.&lt;br /&gt;
&lt;br /&gt;
The simple way to commit changes is as follows.&lt;br /&gt;
* Make some changes to your local files.&lt;br /&gt;
* Right click on 'zk.sdd' and select 'Git Commit'.&lt;br /&gt;
* Write a description of the changes and click 'Commit'.&lt;br /&gt;
* Right click on 'zk.sdd' and select TortiseGit -&amp;gt; Push.&lt;br /&gt;
* Enter your GitHub login and password when prompted. The changes should now appear on your fork in GitHub.&lt;br /&gt;
* Navigate to https://github.com/ZeroK-RTS/Zero-K/pulls and click &amp;quot;New Pull Request&amp;quot;.&lt;br /&gt;
* Click &amp;quot;compare across forks&amp;quot; to make your fork visible.&lt;br /&gt;
* Set your fork to be the head repository.&lt;br /&gt;
* Write a title and description of the changes, then create the pull request.&lt;br /&gt;
This creates a proposal to apply your changes to the main game. Be sure to check up on it and respond to comments.&lt;br /&gt;
&lt;br /&gt;
A more advanced method involves creating branches locally with TortiseGit -&amp;gt; Create Branch and committing blocks of related changes to a single branch. You are then able to make pull requests from branches. This allows branches to be smaller and more focused, which is desirable when merging.&lt;br /&gt;
&lt;br /&gt;
Make sure to keep your repository up to date to make merges less difficult.&lt;br /&gt;
&lt;br /&gt;
== Zero-K.exe launch flags ==&lt;br /&gt;
&amp;lt;pre&amp;gt;Zero-K.exe [rapid tag] [engine version]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that the engine specified in arg won't automatically use the main Zero-K folder as its datadir. Add a &amp;lt;tt&amp;gt;springsettings.cfg&amp;lt;/tt&amp;gt; file to the engine version's folder with the tag &amp;lt;code&amp;gt;SpringData = path_to_Zero-K_folder&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modifying infrastructure/tools == &lt;br /&gt;
* Install [https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx Visual Studio Community edition]&lt;br /&gt;
* Install [https://www.microsoft.com/en-us/sql-server/sql-server-downloads SQL Server express]&lt;br /&gt;
* Clone to desktop [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K infrastructure]&lt;br /&gt;
* Test by opening Zero-K.sln in Visual Studio&lt;br /&gt;
&lt;br /&gt;
=== Initializing Website Database ===&lt;br /&gt;
You may need to setup the database connection for the website. In order to do that: Open Visual Studio, open the Server Explorer panel (under the View menu), right click Data Connections -&amp;gt; Add Connection -&amp;gt; Sql Server. Enter &amp;lt;code&amp;gt;(localdb)\mssqllocaldb&amp;lt;/code&amp;gt; in the Server Name field, after which zero-k_local will appear in the dropdown list of databases. &lt;br /&gt;
&lt;br /&gt;
(If zero-k_local does not appear, type it in the text box and press OK; Visual Studio will ask whether you would like to create the database. This may require you to have administrator rights on the computer.)&lt;br /&gt;
&lt;br /&gt;
[[File:zk-database-setup.png]]&lt;br /&gt;
&lt;br /&gt;
=== Debugging infrastructure ===&lt;br /&gt;
* To run a project right click it, choose &amp;quot;set as startup project&amp;quot; and hit F5 to run using debugger.&lt;br /&gt;
* You can enable multiple startup projects to test entire infrastructure locally (game servers, lobby etc). Enable asp.net, springie and ZeroKLobby projects to test it all together. [http://i.imgur.com/2mgizUJ.png Setup]&lt;br /&gt;
* To run asp.net:&lt;br /&gt;
** It's required that you install MS SQL Express on your local PC. &lt;br /&gt;
*** You can get SQL Server 2017 (for Windows 8 and later) [https://www.microsoft.com/en-us/sql-server/sql-server-editions-express here] or SQL Server 2014 (for Windows 7) [https://www.microsoft.com/en-ie/download/details.aspx?id=42299 here]. For SQL Server 2014, the file you will need is called SQLEXPR_x64_ENU or SQLEXPR_x86_ENU. Make sure you install version that matches your version of Windows (i.e. x86 vs x64). &lt;br /&gt;
*** During the installation, set collation to &amp;lt;code&amp;gt;SQL_Latin1_General_CP1_CI_AS&amp;lt;/code&amp;gt;. Leave all the parameters default except that I changed server name to SQLEXPRESS in one of the first steps of wizard.&lt;br /&gt;
[[File:SQL server collation.png|405px]]&lt;br /&gt;
** Right click asp.net -&amp;gt; properties -&amp;gt; web -&amp;gt; check &amp;quot;Specific Page&amp;quot; and leave it blank. Otherwise you get errors when trying to host locally.&lt;br /&gt;
** Make sure SQL Server is running (check the Sql Server Configuration Manager in the Start Menu). If you can't connect, edit the data source for &amp;lt;code&amp;gt;ModeType.Local&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;GlobalConst.cs&amp;lt;/code&amp;gt; (currently line 46) to say something like:&amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;Data Source=&amp;lt;hostname (usually your computer name)&amp;gt;\SQLEXPRESS&amp;lt;/code&amp;gt;&lt;br /&gt;
** To make things run smoothly the following changes might also be a good idea: In &amp;lt;code&amp;gt;Shared/PlasmaShared/GlobalConst.cs&amp;lt;/code&amp;gt; (currently line 137) replace the DefaultEngineOverride with whatever engine version is current. Comment out lines 190 and 238-298 of &amp;lt;code&amp;gt;Zero-K.info/AppCode/PlasmaServer.cs&amp;lt;/code&amp;gt; unless somebody can supply instructions on how to make the torrent errors go away.&lt;br /&gt;
&lt;br /&gt;
TODO: add download links for sample database tables here. Users and clans are probably easier to make yourself for most purposes. For now, if you need this ask Licho, Histidine, DeinFreund or Anarchid. Aquanim has sample tables for maps and Planetwars structures, if that is all that you need.&lt;br /&gt;
&lt;br /&gt;
=== Modifying The Database Structure ===&lt;br /&gt;
* Modify the appropriate files in ./ZkData/Ef/...  and elsewhere ( [https://github.com/ZeroK-RTS/Zero-K-Infrastructure/commit/61addee11e74b09dd5dd73e12d31a28030d84e81 this commit] should be a reasonable guide; don't worry about the migration files, they are created later )&lt;br /&gt;
* Open Tools &amp;gt; NuGet Package Manager &amp;gt; Package Manager Console&lt;br /&gt;
* At the top of the window which appears, there is a &amp;quot;Default project&amp;quot; dropdown box. Set this to ZkData.&lt;br /&gt;
* Type the command &amp;lt;code&amp;gt;Add-Migration [description-of-change-here]&amp;lt;/code&amp;gt; into the package manager console. This should create some migration files with your description and a timestamp in the name in the Migrations folder of ZkData.&lt;br /&gt;
* In some cases you may now need to manually edit the created migration files to set defaults and the like?&lt;br /&gt;
* Type the command &amp;lt;code&amp;gt;Update-Database&amp;lt;/code&amp;gt; into the package manager console. This should update the database structure.&lt;br /&gt;
* To revert a migration that has not yet been pushed to the main repository, run &amp;lt;code&amp;gt;Update-Database –TargetMigration: TheLastGoodMigration&amp;lt;/code&amp;gt; then delete your bad migration files.&lt;br /&gt;
&lt;br /&gt;
== Artwork ==&lt;br /&gt;
See [http://zero-k.info/Wiki/Development_Artwork Development Artwork] (outdated)&lt;br /&gt;
&lt;br /&gt;
[[Blender_To_Zero-K|Blender To Zero-K]]&lt;br /&gt;
&lt;br /&gt;
== Missions ==&lt;br /&gt;
=== Campaign ===&lt;br /&gt;
Campaign planets/missions are defined in [//github.com/ZeroK-RTS/Chobby/tree/master/campaign/sample Chobby/campaign/sample]&lt;br /&gt;
&lt;br /&gt;
=== Standalone missions ===&lt;br /&gt;
See [[Mission Editor|Mission Editor start page]]&lt;br /&gt;
&lt;br /&gt;
== Updating PlanetWars for new round ==&lt;br /&gt;
:''TODO''&lt;br /&gt;
Changing faction:&lt;br /&gt;
* Faction ID, name, color in dbo.Faction&lt;br /&gt;
* Faction blurb &amp;lt;tt&amp;gt;Faction&amp;lt;Name&amp;gt;&amp;lt;/tt&amp;gt; on sitewiki&lt;br /&gt;
* Add/change icons if needed&lt;br /&gt;
** Site: img/factions/&amp;lt;name&amp;gt;.png&lt;br /&gt;
** Game: LuaUI/Configs/Factions&lt;br /&gt;
** Chobby: LuaMenu/Images/Factions&lt;br /&gt;
** Does chobby download them automatically? Presumably not&lt;br /&gt;
&lt;br /&gt;
Using [https://zero-k.info/PlanetwarsAdmin Planetwars admin interface]: Change to a different galaxy if desired, reset PW&lt;br /&gt;
&lt;br /&gt;
== Wiki ==&lt;br /&gt;
See [[Editing Help]]&lt;br /&gt;
&lt;br /&gt;
== Making/Editing a unit ==&lt;br /&gt;
See the Blender to Zero-K page for a comprehensive guide on modelling, texturing, and baking aoplates for Zero-K units: [https://zero-k.info/mediawiki/index.php?title=Blender_To_Zero-K]&lt;br /&gt;
&lt;br /&gt;
=== Unit pages ===&lt;br /&gt;
Part of each unit page is autogenerated by the [//github.com/ZeroK-RTS/SpringRTS-Tools/tree/master/unitguide Unit Guide tool], and uploaded by the [//github.com/ZeroK-RTS/Zero-K-Infrastructure/blob/master/Fixer/WikiPortingMW.cs Wiki bot].&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt;export_unit_templates.sh&amp;lt;/code&amp;gt; to generate wiki templates for each unit (see &amp;lt;code&amp;gt;export_unit_templates.lua&amp;lt;/code&amp;gt; for some configuration options), then have the bot read the generated text files and edit the unit pages accordingly (requires Visual Studio setup as detailed above). The text output can also be used to manually edit pages.&lt;br /&gt;
&lt;br /&gt;
Unit buildicons and radar icons should be uploaded by FTP to manual.zero-k.info (&amp;lt;code&amp;gt;zero-k.info/zkmanual/www/unitpics&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/icons&amp;lt;/code&amp;gt; respectively). Contact Licho or Histidine for login details.&lt;br /&gt;
&lt;br /&gt;
== itch.io builds ==&lt;br /&gt;
Instructions for updating the portable build on [https://itch.io/ itch.io]:&lt;br /&gt;
&lt;br /&gt;
* Download latest Zero-K portable from https://zerok.itch.io/zero-k, extract to a folder&lt;br /&gt;
* Download butler (see guide at https://itch.io/docs/butler/)&lt;br /&gt;
* Modify extracted portable folder so that its contents are the same as what the user will download&lt;br /&gt;
* Run butler with command: &amp;lt;code&amp;gt;butler push &amp;lt;portable folder&amp;gt; zerok/zero-k:portable&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Engine ==&lt;br /&gt;
See [https://springrts.com/wiki/Development:Getting_Started Spring Engine Development]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>HigherFlyer</name></author>
		
	</entry>
	<entry>
		<id>https://zero-k.info/mediawiki/index.php?title=Blender_To_Zero-K&amp;diff=7029</id>
		<title>Blender To Zero-K</title>
		<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/index.php?title=Blender_To_Zero-K&amp;diff=7029"/>
		<updated>2020-10-15T13:29:17Z</updated>

		<summary type="html">&lt;p&gt;HigherFlyer: Trying to touch up Grammar and fixing description of buildingGroundDecaySpeed.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here is a tutorial covering all of the steps to make or edit a model in [https://www.blender.org/ Blender] (a free 3d modelling program) and transfer it to the Spring engine, then have Zero-K load it as a mutator so you can test it in-game.&lt;br /&gt;
&lt;br /&gt;
The contents page here will also act as a quick reference for all of the necessary steps, in order:&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Make or Edit the model in Blender ==&lt;br /&gt;
=== Setting up Blender for use in Zero-K ===&lt;br /&gt;
If you are totally new to blender there are a few things you probably ought to do to set up blender for use with Zero-K.  Additionally, this tutorial will assume you are using left-click to select (the new default) and a fairly typical window layout similar to the default.&lt;br /&gt;
&lt;br /&gt;
Blender comes with several add-ons and scripts, not all of which are enabled by default.  While there are many additional ones you might have to pay for that could prove useful (meshmachine, decalmachine and hard ops are probably the most well known three) there are a few free add-ons you may wish to consider.  You should absolutely go to the Edit-&amp;amp;gt;Preferences-&amp;amp;gt;Add-ons submenu and enable Node Wrangler, and Looptools.&lt;br /&gt;
&lt;br /&gt;
To import s3o models from spring, you will need an addon which can be found [https://github.com/sanguinariojoe/blender_s3o_import here].  You need to download the python (.py) file and then use the Install button inside blender's add-ons submenu, pointing it at that .py file, so that blender knows how to import .s3o models.  Make sure to enable the add-on after installation.&lt;br /&gt;
&lt;br /&gt;
If you want to export animations, you will also need [https://github.com/Anarchid/blender2lus this] animation exporter, though the output it produces will likely still require manual adjustment and will not be covered by this tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Importing a model (optional) ===&lt;br /&gt;
With the s3o importer installed and enabled, you should be able to import s3o models from spring into blender by using the File-&amp;amp;gt;Import-&amp;amp;gt;s3o option.  Then navigate to your model file and select it.&lt;br /&gt;
&lt;br /&gt;
s3o models often come in rotated to one side, as Spring uses Y-axis-up and Blender uses Z-axis-up.  You can rotate them to look right in Blender, and then when exporting them there are options to deal with this so that they export rotated correctly.&lt;br /&gt;
&lt;br /&gt;
If the importer can find them, it will also import textures and the UV map along with the model.  The texture files may need to be placed appropriately or in the same directory as the model file for this to work.&lt;br /&gt;
&lt;br /&gt;
=== Importing textures ===&lt;br /&gt;
To open a texture you need to set a window to either the Image Editor or UV Editor mode, and then press the Open button in the top menu bar.  This will bring up a file menu where you can select a texture to bring into Blender.  Blender supports .dds textures by default, as well as most other image formats.  &lt;br /&gt;
&lt;br /&gt;
You can certainly import any old texture and work with it, but if you are importing textures already used by Spring you should know that they are somewhat unusual.&lt;br /&gt;
&lt;br /&gt;
Spring has two separate texture formats.  The first of these, referred to as tex1 or colour texture, uses Red Green Blue (RGB) channels to store colour data, and Alpha (A) to store whether that part of the file is teamcolour or not.  This means that by default a tex1 texture looks mostly blank(transparent) with some odd black bits scattered around.  You can fix this in Blender by scrolling the menu bar (hold middle button with cursor on menu, drag mouse to side) all the way to the right, and clicking the little drop down which says Display Channels [[File:Blender_display_channels.png]].  By default it is set to ''Colour and Alpha'' but you should set it to ''Colour'' when working with tex1 files to ignore the alpha channel.&lt;br /&gt;
&lt;br /&gt;
Tex2 files are the ones in greenyblue with bits of red.  In those files the Red channel is how much that part of the texture emits light, the Green channel is how rough or smooth that part of the texture is (which determines how it reacts to light), and the Blue channel is how metallic and reflective that part of the texture is.  Areas which are cyan (full green and full blue) are mirror-smooth metal, so reflect the environment perfectly.  These should always have their colourspace set to non-colour data as they use each channel separately.  You can find that option in the right hand popout menu when in an image editor viewing them (shortcut key N by default) under the Image tab.&lt;br /&gt;
&lt;br /&gt;
You may also need or want to use Normal map textures, which are the ones that look mostly blue with some oddly coloured parts around the edges.  Whenever you use these normal map textures you should always change the colourspace to non-colour data as it can cause visual errors if you do not, since it will process the channels differently in the render pipeline.&lt;br /&gt;
&lt;br /&gt;
If nothing in the scene uses your texture it will be discarded from the file when you save and exit.  You may click the shield icon next to the file name to prevent this, if you want to have the textures kept around even with nothing using it.  As long as you've assigned the texture to a material, and the material to a model (see below) this will not be a problem, but it's useful to know this option exists and why a texture might be dropped.&lt;br /&gt;
&lt;br /&gt;
Blend files do not by default contain the textures referenced in them, but you 'can' optionally pack the textures into them for easy transfer between users or computers.   Explore the File-&amp;amp;gt;External Data menu for those options.&lt;br /&gt;
&lt;br /&gt;
=== Modelling for Zero-K ===&lt;br /&gt;
There are not many special considerations when modelling for Zero-K, and a general explanation of modelling and blender is too detailed to go here.  However, you could consult tutorials such as [https://www.youtube.com/watch?v=7MRonzqYJgw&amp;amp;list=PLn3ukorJv4vs_eSJUQPxBRaDS8PrVmIri Grant Abbitt's beginner series] or [https://www.youtube.com/watch?v=1jHUY3qoBu8 Imphenzia's introduction and low poly modelling] tutorial.&lt;br /&gt;
&lt;br /&gt;
Generally, you should attempt to keep the number of triangles used in a model as low as is reasonable.  That number varies depending on how frequent the unit is planned to be - a commander or other functionally unique unit would be fine with up to 30,000 triangles, but for a very spammable unit such as a flea this would be extremely excessive, as you can build a vast number of fleas.  Something in the region of 500-1000 would be more appropriate, with less being ideal as long as the model still looks good.&lt;br /&gt;
&lt;br /&gt;
The size of the model (or part of model) and how visible it is also has an impact on how many polygons you should be using.  A large model covering a lot of screen space should use more polygons and texels than a small one or a part of the model that people rarely or never see.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Texturing for Zero-K, and Spring texture oddities ===&lt;br /&gt;
As mentioned earlier, spring uses two textures per model and cannot use multiple UV Maps, cannot use vertex colours, and cannot use additional textures other than a normal map.&lt;br /&gt;
&lt;br /&gt;
The tex1 format covers the diffuse colour and whether a pixel is teamcoloured or not, wheras tex2 covers the emissivity, roughness, and metalness of the model in its RGB channels respectively.&lt;br /&gt;
&lt;br /&gt;
Remember that most DDS normal maps are slightly different from typical OpenGL normal maps, and adjust appropriately as needed.  Typically inverting the Red and Green channels does the trick.&lt;br /&gt;
&lt;br /&gt;
If you import a texture then the importer will set up the nodes for you, however, if you are starting from scratch then you probably just want to replicate this node setup.  This mostly approximates what Spring will do in-engine, giving you a workable preview in Blender when you use a lookdev(Material Preview) view mode.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring_shader.png]]&lt;br /&gt;
&lt;br /&gt;
There are three textures referenced here, which in this case happen to be atlas textures which can be reused for multiple models. The core_color.dds is tex1 and has colours and teamcolours - the alpha channel is split off, inverted, and used to colour the alpha areas green (you can click the green colour to replace it with any other colour, if you like).&lt;br /&gt;
&lt;br /&gt;
The core_other.dds is the tex2 file, so it is split into RGB channels and each of these channels appropriately processed and connected to the relevant part of the material.&lt;br /&gt;
&lt;br /&gt;
Finally the core_normals.dds contains a direct-x formatted normal map, so it is converted to an openGL format by inverting just the Red and Green channels and is then passed through the normal calculation node to convert the image into a vector map, and then the vector map passed to the shader.&lt;br /&gt;
&lt;br /&gt;
TODO: Provide a blend file here that already has this material set up, just need to plug in textures.  Or just include atlas texture.  Airpad_packed.blend is sadly larger than 2mb so the wiki will not host it.&lt;br /&gt;
&lt;br /&gt;
== Export the model to .dae format ==&lt;br /&gt;
Nowadays Spring can read .dae (Collada) files directly via the use of Assimp (Asset Importer).  This means the export process is reasonably simple. &lt;br /&gt;
&lt;br /&gt;
Either clean your scene of everything you do not want to be exported, or select only the things you want exported.  Go to the File-&amp;amp;gt;Export menu and select Collada (.dae) format.  A file browser will open with various export settings on the right hand side.&lt;br /&gt;
&lt;br /&gt;
You should pick Selection Only from the Main tab of export options if you want to limit it to selection.&lt;br /&gt;
&lt;br /&gt;
Make sure that the orientation settings are correct.  You want to tell the exporter what axes you've been modelling with, not the axes you're looking for.  These are the default options and should usually be right, Spring/Assimp will then adjust them for use in engine, but if after checking things in Spring your object is oriented wrongly, you can try adjusting these and exporting again.  If all else fails, you can parent the root object(s) to an empty placed at the origin and rotate that. [[File:collada_default_export.png]]&lt;br /&gt;
&lt;br /&gt;
=== A note on animation ===&lt;br /&gt;
Although Collada (.dae) files do support exporting animation, you should not do this as Spring cannot read the animation data.  Instead, animations in Zero-K are handled by a lua animation script known as LUS.&lt;br /&gt;
&lt;br /&gt;
Although you cannot export the animations to Collada, you can still do your animations in Blender and use the Blender2Lus export script linked earlier to export a starting animation script.  It has several limitations, such as only exporting the active action from each object in the scene, but running it several times and tweaking and combining the generated scripts can reduce the amount of work in generating animation scripts immensely.  Further use of this script is, for the moment, outside the scope of this tutorial (because I haven't done it myself yet - feel free to replace this with detailed explanation if you have, though!)&lt;br /&gt;
&lt;br /&gt;
== Set up texture associations and .dae.lua metadata ==&lt;br /&gt;
Although Spring can read .dae files and the contained UV map, it does not support any sort of material or texture import, so you have to specify these manually.  Since at this point you have already set Blender up with a reasonable approximation of the texture process it should not be especially difficult.&lt;br /&gt;
&lt;br /&gt;
You will need to provide a .dae.lua file with the same name as your model file, in the same directory, to tell Spring which texture files and associated data to use with the model.&lt;br /&gt;
&lt;br /&gt;
For example, if your model export is snazzyUnit.dae and it is present under the /objects3d folder of your testing mod, you should make a snazzyUnit.dae.lua file and place that at /objects3d/snazzyUnit.dae.lua .&lt;br /&gt;
&lt;br /&gt;
The documentation for these metadata files is [https://springrts.com/wiki/3DModels:AssimpMetadata here], but they are reasonably simple and a minimal example file is provided below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
return {&lt;br /&gt;
	tex1 = &amp;quot;core_color.dds&amp;quot;,&lt;br /&gt;
	tex2 = &amp;quot;core_other.dds&amp;quot;,&lt;br /&gt;
	invertteamcolor = false&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously if you are not using the atlas textures you will need to replace those names with the actual texture files you intend to use.  There are several other things that may need to be in this file, but as these differ per-unit you will need to decide what, if anything, to provide.&lt;br /&gt;
&lt;br /&gt;
== Set up Zero-K mod that contains and uses your files ==&lt;br /&gt;
To get Zero-K to see your files and locally test your units (new or otherwise) you should use a mod.&lt;br /&gt;
&lt;br /&gt;
This is selectable in local skirmish mode (and theoretically you can distribute them to test in multiplayer) which allows you to check everything works in the engine without requiring any changes to the official repositories or even building a local development copy of the game - all you need is a working copy of Zero-K.&lt;br /&gt;
&lt;br /&gt;
=== Making the mod ===&lt;br /&gt;
Inside the Zero-K folder there is a games subfolder.  Inside that are numerous things, but if you make a new subfolder with a name ending in .sdd it will be read by the engine on startup.  A base mod is available to download [File:BaseMod.sdd.zip here] to build from if you would like an example.  More details on mod creation can be found here: [[Mod Creation]]&lt;br /&gt;
&lt;br /&gt;
Create a mod and fill out the modinfo.lua, making sure to change the name and description so you can tell it apart when you are selecting it.&lt;br /&gt;
&lt;br /&gt;
=== File locations ===&lt;br /&gt;
Like many mods, the file structure downwards from the modname.sdd folder should exactly match the Zero-K internal virtual file system, and if there are any files in your mod that match names with base files, Zero-K will use your mod's file instead of the base file.&lt;br /&gt;
&lt;br /&gt;
This allows you to selectively replace any files with whatever changed version you want, which is ideal for our purposes of testing a mod.  Any ''new'' files will also be loaded, allowing you to test entirely new units - although you may have to modify the buildoptions list of an existing factory or constructor to allow them to build your new unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;AN IMPORTANT NOTE:&lt;br /&gt;
You should keep all of filenames and folder names lower case, as the virtual file system lowercases everything.  Double check your filenames, it needs to match exactly if you are replacing things.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Testing your mod ===&lt;br /&gt;
Once you have filled out your folders and files, probably (but not exclusively) using /objects3d , /units and /unittextures , you can progress to actually testing it works in-engine.&lt;br /&gt;
&lt;br /&gt;
Load up Zero-K and go to singleplayer, then Skirmish.  The map and opponents do not especially matter, though if you are testing a lot you probably want to use an inactive AI (check through main lobby options for additional AI types if it's not there by default).&lt;br /&gt;
&lt;br /&gt;
Go into Adv Options, and pick 'Select Mod'.  If the folder and modinfo are correct you should see your mod on the list.  If you do not, download the base mod, unzip it to the appropriate place and check if that shows up - if it does, the problem is with your mod.  If it does not, then something is probably in the wrong place.&lt;br /&gt;
&lt;br /&gt;
Once you've selected your mod you should start the skirmish and attempt to test whatever you've actually changed.  At one point while doing this, Zero-K would not load because the interpreter for the mod's unitdef files was more strict than the main game's, so you may wish to follow the format used in the base mod (it overwrites lotus turrets) more exactly if you have this problem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fix whatever isn't right ==&lt;br /&gt;
Do not expect everything to be perfect.  This is a very complicated process and something is probably broken somewhere - either way, check everything, and get used to the idea that you may have to edit, re-export, then restart the game a lot to retry with changes quite often.  Although unit definitions and such may be reloaded without quitting the game (TODO: what is the command to do this?  How reliable is it?) you should eventually restart Zero-K to do a round of final testing just to ensure that everything loads correctly from startup.&lt;br /&gt;
&lt;br /&gt;
== The other bits ==&lt;br /&gt;
Ever heard about software development that first you need to complete 90% of the project, and then you need to complete the other 90% of the project?  The same sometimes applies to modding.  &lt;br /&gt;
&lt;br /&gt;
Even though by this point you should have your unit or building in game and working, there are other things to do before it's ready!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== groundplane decal and ao bake ===&lt;br /&gt;
If your unit is a building, you will need to create a ground plane to go underneath it - at the very least an ambient occlusion baked shadow, usually referred to as an aoplane.  This is simply a texture which is sized appropriately for your model and is placed underneath it by the engine.  This adds a little soft shadowing around the edge of the building which helps immensely to integrate it with the map.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to make these, but the easiest if following this tutorial is probably just to bake your own in Blender.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create and size the virtual ground plane ====&lt;br /&gt;
First, create a plane and place it under your model.  It should be at zero relative to where the model is going to go, but this plane will never leave blender directly - it will be the Spring engine painting the decal onto the terrain.  Scale it until it completely covers all of your model, then apply the scale and scale it *again* so that it is appropriately larger than the footprint of your model.  This size may need adjusting so that it fits an integer value - for example, if the unitdef lists your unit as 5 footprint-units wide, then (since you can only set the decal footprint size to an integer) you would have to choose 6 (6/5 = 120% of the model size) or 7 (7/5 = 140% of the model size).  Somewhere between 120% and 140% is probably fine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Setup for AO Baking ====&lt;br /&gt;
Once you have the plane appropriately sized, go to the render tab [[File:Blender_render_tab.png]] and change the Render engine to Cycles.  You may wish to change the feature set and compute device appropriate to your system (especially if you have a powerful GPU) but the defaults should be fine for this.&lt;br /&gt;
&lt;br /&gt;
Make sure you set the number of samples in the Sampling section high enough.  512 is a good number to start from, though as high as 1024 is useful to reduce noise.  More samples mean more render time, even for something as simple as baking a simple ambient occlusion map.&lt;br /&gt;
&lt;br /&gt;
Next, go to the world tab [[File:Blender_world_tab.png]] and activate Ambient Occlusion.  Factor should be 1.0, and the distance parameter depends on how large your model is.  You may have to tweak this value until the resulting bake looks correct, but start with a distance parameter somewhere around 25% to 50% of the width of your model, turning it up if this is not sufficient.&lt;br /&gt;
&lt;br /&gt;
To properly bake, we need somewhere to put the texture - so open up a shader node window somewhere, select the ground plane and make sure that it is using a new material and that material is using nodes.  Connect a texture node using the Ctrl-T shortcut. Press New to make a new texture, and set it to the appropriate size - typically 512px square for something the size of a factory or 128px square for smaller buildings.  Set the image colourspace to non-colour data to prevent shading artefacts later.  Make sure this texture node has been clicked on and is selected, because it's the last selected texture for each relevant object that receives the bake.&lt;br /&gt;
&lt;br /&gt;
Finally we're almost ready to do the baking!  Return to the render tab [[File:Blender_render_tab.png]] and scroll down to the Bake section.  From the Bake Type dropdown select Ambient Occlusion.  Make sure that Selected to Active is OFF, as that is intended to transfer high poly modelling data to low poly objects and we actually do want just a general scene-wide bake of ambient occlusion, it's just we only care about the result on this one ground plane object.  Margin can be adjusted but the default of 16px is probably fine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Do the bake ====&lt;br /&gt;
Press Bake!&lt;br /&gt;
&lt;br /&gt;
If blender crashed that's fine, go check in the log file to see what did it - the last time I had a crash here, I had an addon (bezier tools, totally unrelated to anything to do with baking) going wrong, and so I had to temporarily disable it.&lt;br /&gt;
&lt;br /&gt;
If all went well, you should have seen a few textures render if you were on something with a texture view, and if you go to find your new ambient occlusion texture it should be a black outline in the shape of your building with a white outside, and a blurry shadowy bit around the edge of the black outline, which is what the game will draw onto the ground.  Export this as a png.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Touchup and adjust format in external image editor ====&lt;br /&gt;
The next bit you will need to do in GIMP/Glimpse, or any other image processing software capable of exporting DDS textures.  Simply load your image file, turn the white colour into transparency by whatever method you prefer such that full black is opaque and full white is transparent, and then export as DDS.  Spring wants textures to be DXT5 compressed, with mipmaps generated.&lt;br /&gt;
&lt;br /&gt;
If you want some other decal underneath your unit, perhaps a metallic decal if it is a factory for example, you can add that as another layer in your image editing software here.  Ensure that the ambient occlusion layer overlays it where necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adjust unitdef to include groundplane ====&lt;br /&gt;
Now you've got a groundplane texture, rename it to something like unitname_aoplane.dds and put it into the /unittextures folder.  Then go to the unitdef and make sure that these tags are filled out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
buildingGroundDecalDecaySpeed = 30, --Seconds decal takes to fade out of existence&lt;br /&gt;
buildingGroundDecalSizeX      = 12, --Size of the decal's X axis in footprint units &lt;br /&gt;
buildingGroundDecalSizeY      = 12, --Size of the decal's Y axis in footprint units &lt;br /&gt;
buildingGroundDecalType       = [[unitname_aoplane.dds]], --filename of decal&lt;br /&gt;
&lt;br /&gt;
useBuildingGroundDecal        = true,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After saving the updated unitdef, go and check that the ground plane exists in game.  They can be quite subtle, but by toggling on and off the &amp;quot;show ground decals&amp;quot; option, you should be able to see the difference easily.&lt;br /&gt;
&lt;br /&gt;
If needed, you can edit your original png file in the image editor again and apply gaussian blur to the image to spread the shadow out further.  Ensure that the shadow's edge doesn't touch the edge of the image, as this tends to look obvious.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== unitpic ===&lt;br /&gt;
Unit pictures in the buildmenu are generated by an automated script.  This script lives as a Lua gadget within the Zero-K base content, so if you have your mod working you can load that up and generate a buildpic.&lt;br /&gt;
&lt;br /&gt;
First, press F8 to show the debug console, then turn on cheats with /cheat (or !cheats in multiplayer, which will require host permissions.)&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;pre&amp;gt;/luarules buildicon {unitname}&amp;lt;/pre&amp;gt;. You can run it with no unit name and instead buildicons if you want to generate buildicons for every unit in the game.  It should output the icons to your Zero-K folder under the /buildicons folder.  You will then have to move it to the /unitpics folder of your mod, name it appropriately, and check it works.&lt;/div&gt;</summary>
		<author><name>HigherFlyer</name></author>
		
	</entry>
	<entry>
		<id>https://zero-k.info/mediawiki/index.php?title=Blender_To_Zero-K&amp;diff=7028</id>
		<title>Blender To Zero-K</title>
		<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/index.php?title=Blender_To_Zero-K&amp;diff=7028"/>
		<updated>2020-10-15T13:16:57Z</updated>

		<summary type="html">&lt;p&gt;HigherFlyer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here is a tutorial covering all of the steps to make or edit a model in [https://www.blender.org/ Blender] (a free 3d modelling program) and transfer it to the Spring engine, then have Zero-K load it as a mutator so you can test it in-game.&lt;br /&gt;
&lt;br /&gt;
The contents page here will also act as a quick reference for all of the necessary steps, in order:&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Make or Edit the model in Blender ==&lt;br /&gt;
=== Setting up Blender for use in Zero-K ===&lt;br /&gt;
If you are totally new to blender there are a few things you probably ought to do to set up blender for use with Zero-K.  Additionally, this tutorial will assume you are using left-click to select (the new default) and a fairly typical window layout similar to the default.&lt;br /&gt;
&lt;br /&gt;
Blender comes with several add-ons and scripts, not all of which are enabled by default.  While there are many additional ones you might have to pay for that could prove useful (meshmachine, decalmachine and hard ops are probably the most well known three) there are a few free add-ons you may wish to consider.  You should absolutely go to the Edit-&amp;amp;gt;Preferences-&amp;amp;gt;Add-ons submenu and enable Node Wrangler, and Looptools.&lt;br /&gt;
&lt;br /&gt;
To import s3o models from spring, you will need an addon which can be found [https://github.com/sanguinariojoe/blender_s3o_import here].  You need to download the python (.py) file and then use the Install button inside blender's add-ons submenu, pointing it at that .py file, so that blender knows how to import .s3o models.  Make sure to enable the add-on after installation.&lt;br /&gt;
&lt;br /&gt;
If you want to export animations, you will also need [https://github.com/Anarchid/blender2lus this] animation exporter, though the output it produces will likely still require manual adjustment and will not be covered by this tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Importing a model (optional) ===&lt;br /&gt;
With the s3o importer installed and enabled, you should be able to import s3o models from spring into blender by using the File-&amp;amp;gt;Import-&amp;amp;gt;s3o option.  Then navigate to your model file and select it.&lt;br /&gt;
&lt;br /&gt;
s3o models often come in rotated to one side, as Spring uses Y-axis-up and Blender uses Z-axis-up.  You can rotate them to look right in Blender, and then when exporting them there are options to deal with this so that they export rotated correctly.&lt;br /&gt;
&lt;br /&gt;
If the importer can find them, it will also import textures and the UV map along with the model.  The texture files may need to be placed appropriately or in the same directory as the model file for this to work.&lt;br /&gt;
&lt;br /&gt;
=== Importing textures ===&lt;br /&gt;
To open a texture you need to set a window to either the Image Editor or UV Editor mode, and then press the Open button in the top menu bar.  This will bring up a file menu where you can select a texture to bring into Blender.  Blender supports .dds textures by default, as well as most other image formats.  &lt;br /&gt;
&lt;br /&gt;
You can certainly import any old texture and work with it, but if you are importing textures already used by Spring you should know that they are somewhat unusual.&lt;br /&gt;
&lt;br /&gt;
Spring has two separate texture formats.  The first of these, referred to as tex1 or colour texture, uses Red Green Blue (RGB) channels to store colour data, and Alpha (A) to store whether that part of the file is teamcolour or not.  This means that by default a tex1 texture looks mostly blank(transparent) with some odd black bits scattered around.  You can fix this in Blender by scrolling the menu bar (hold middle button with cursor on menu, drag mouse to side) all the way to the right, and clicking the little drop down which says Display Channels [[File:Blender_display_channels.png]].  By default it is set to ''Colour and Alpha'' but you should set it to ''Colour'' when working with tex1 files to ignore the alpha channel.&lt;br /&gt;
&lt;br /&gt;
Tex2 files are the ones in greenyblue with bits of red.  In those files the Red channel is how much that part of the texture emits light, the Green channel is how rough or smooth that part of the texture is (which determines how it reacts to light), and the Blue channel is how metallic and reflective that part of the texture is.  Areas which are cyan (full green and full blue) are mirror-smooth metal, so reflect the environment perfectly.  These should always have their colourspace set to non-colour data as they use each channel separately.  You can find that option in the right hand popout menu when in an image editor viewing them (shortcut key N by default) under the Image tab.&lt;br /&gt;
&lt;br /&gt;
You may also need or want to use Normal map textures, which are the ones that look mostly blue with some oddly coloured parts around the edges.  Whenever you use these normal map textures you should always change the colourspace to non-colour data as it can cause visual errors if you do not, since it will process the channels differently in the render pipeline.&lt;br /&gt;
&lt;br /&gt;
If nothing in the scene uses your texture it will be discarded from the file when you save and exit.  You may click the shield icon next to the file name to prevent this, if you want to have the textures kept around even with nothing using it.  As long as you've assigned the texture to a material, and the material to a model (see below) this will not be a problem, but it's useful to know this option exists and why a texture might be dropped.&lt;br /&gt;
&lt;br /&gt;
Blend files do not by default contain the textures referenced in them, but you 'can' optionally pack the textures into them for easy transfer between users or computers.   Explore the File-&amp;amp;gt;External Data menu for those options.&lt;br /&gt;
&lt;br /&gt;
=== Modelling for Zero-K ===&lt;br /&gt;
There are not many special considerations when modelling for Zero-K, and a general explanation of modelling and blender is too detailed to go here.  However, you could consult tutorials such as [https://www.youtube.com/watch?v=7MRonzqYJgw&amp;amp;list=PLn3ukorJv4vs_eSJUQPxBRaDS8PrVmIri Grant Abbitt's beginner series] or [https://www.youtube.com/watch?v=1jHUY3qoBu8 Imphenzia's introduction and low poly modelling] tutorial.&lt;br /&gt;
&lt;br /&gt;
Generally, you should attempt to keep the number of triangles used in a model as low as is reasonable.  That number varies depending on how frequent the unit is planned to be - a commander or other functionally unique unit would be fine with up to 30,000 triangles, but for a very spammable unit such as a flea this would be extremely excessive, as you can build a vast number of fleas.  Something in the region of 500-1000 would be more appropriate, with less being ideal as long as the model still looks good.&lt;br /&gt;
&lt;br /&gt;
The size of the model (or part of model) and how visible it is also has an impact on how many polygons you should be using.  A large model covering a lot of screen space should use more polygons and texels than a small one or a part of the model that people rarely or never see.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Texturing for Zero-K, and Spring texture oddities ===&lt;br /&gt;
As mentioned earlier, spring uses two textures per model and cannot use multiple UV Maps, cannot use vertex colours, and cannot use additional textures other than a normal map.&lt;br /&gt;
&lt;br /&gt;
The tex1 format covers the diffuse colour and whether a pixel is teamcoloured or not, wheras tex2 covers the emissivity, roughness, and metalness of the model in its RGB channels respectively.&lt;br /&gt;
&lt;br /&gt;
Remember that most DDS normal maps are slightly different from typical OpenGL normal maps, and adjust appropriately as needed.  Typically inverting the Red and Green channels does the trick.&lt;br /&gt;
&lt;br /&gt;
If you import a texture then the importer will set up the nodes for you, however, if you are starting from scratch then you probably just want to replicate this node setup.  This mostly approximates what Spring will do in-engine, giving you a workable preview in Blender when you use a lookdev(Material Preview) view mode.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring_shader.png]]&lt;br /&gt;
&lt;br /&gt;
There are three textures referenced here, which in this case happen to be atlas textures which can be reused for multiple models. The core_color.dds is tex1 and has colours and teamcolours - the alpha channel is split off, inverted, and used to colour the alpha areas green (you can click the green colour to replace it with any other colour, if you like).&lt;br /&gt;
&lt;br /&gt;
The core_other.dds is the tex2 file, so it is split into RGB channels and each of these channels appropriately processed and connected to the relevant part of the material.&lt;br /&gt;
&lt;br /&gt;
Finally the core_normals.dds contains a direct-x formatted normal map, so it is converted to an openGL format by inverting just the Red and Green channels and is then passed through the normal calculation node to convert the image into a vector map, and then the vector map passed to the shader.&lt;br /&gt;
&lt;br /&gt;
TODO: Provide a blend file here that already has this material set up, just need to plug in textures.  Or just include atlas texture.  Airpad_packed.blend is sadly larger than 2mb so the wiki will not host it.&lt;br /&gt;
&lt;br /&gt;
== Export the model to .dae format ==&lt;br /&gt;
Nowadays Spring can read .dae (Collada) files directly via the use of Assimp (Asset Importer).  This means the export process is reasonably simple. &lt;br /&gt;
&lt;br /&gt;
Either clean your scene of everything you do not want to be exported, or select only the things you want exported.  Go to the File-&amp;amp;gt;Export menu and select Collada (.dae) format.  A file browser will open with various export settings on the right hand side.&lt;br /&gt;
&lt;br /&gt;
You should pick Selection Only from the Main tab of export options if you want to limit it to selection.&lt;br /&gt;
&lt;br /&gt;
Make sure that the orientation settings are correct.  You want to tell the exporter what axes you've been modelling with, not the axes you're looking for.  These are the default options and should usually be right, Spring/Assimp will then adjust them for use in engine, but if after checking things in Spring your object is oriented wrongly, you can try adjusting these and exporting again.  If all else fails, you can parent the root object(s) to an empty placed at the origin and rotate that. [[File:collada_default_export.png]]&lt;br /&gt;
&lt;br /&gt;
=== A note on animation ===&lt;br /&gt;
Although Collada (.dae) files do support exporting animation, you should not do this as Spring cannot read the animation data.  Instead, animations in Zero-K are handled by a lua animation script known as LUS.&lt;br /&gt;
&lt;br /&gt;
Although you cannot export the animations to Collada, you can still do your animations in Blender and use the Blender2Lus export script linked earlier to export a starting animation script.  It has several limitations, such as only exporting the active action from each object in the scene, but running it several times and tweaking and combining the generated scripts can reduce the amount of work in generating animation scripts immensely.  Further use of this script is, for the moment, outside the scope of this tutorial (because I haven't done it myself yet - feel free to replace this with detailed explanation if you have, though!)&lt;br /&gt;
&lt;br /&gt;
== Set up texture associations and .dae.lua metadata ==&lt;br /&gt;
Although Spring can read .dae files and the contained UV map, it does not support any sort of material or texture import, so you have to specify these manually.  Since at this point you have already set Blender up with a reasonable approximation of the texture process it should not be especially difficult.&lt;br /&gt;
&lt;br /&gt;
You will need to provide a .dae.lua file with the same name as your model file, in the same directory, to tell Spring which texture files and associated data to use with the model.&lt;br /&gt;
&lt;br /&gt;
For example, if your model export is snazzyUnit.dae and it is present under the /objects3d folder of your testing mod, you should make a snazzyUnit.dae.lua file and place that at /objects3d/snazzyUnit.dae.lua .&lt;br /&gt;
&lt;br /&gt;
The documentation for these metadata files is [https://springrts.com/wiki/3DModels:AssimpMetadata here], but they are reasonably simple and a minimal example file is provided below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
return {&lt;br /&gt;
	tex1 = &amp;quot;core_color.dds&amp;quot;,&lt;br /&gt;
	tex2 = &amp;quot;core_other.dds&amp;quot;,&lt;br /&gt;
	invertteamcolor = false&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously if you are not using the atlas textures you will need to replace those names with the actual texture files you intend to use.  There are several other things that may need to be in this file, but as these differ per-unit you will need to decide what, if anything, to provide.&lt;br /&gt;
&lt;br /&gt;
== Set up Zero-K mod that contains and uses your files ==&lt;br /&gt;
To get Zero-K to see your files and locally test your units (new or otherwise) you should use a mod.&lt;br /&gt;
&lt;br /&gt;
This is selectable in local skirmish mode (and theoretically you can distribute them to test in multiplayer) which allows you to check everything works in the engine without requiring any changes to the official repositories or even building a local development copy of the game - all you need is a working copy of Zero-K.&lt;br /&gt;
&lt;br /&gt;
=== Making the mod ===&lt;br /&gt;
Inside the Zero-K folder there is a games subfolder.  Inside that are numerous things, but if you make a new subfolder with a name ending in .sdd it will be read by the engine on startup.  A base mod is available to download [File:BaseMod.sdd.zip here] to build from if you would like an example.  More details on mod creation can be found here: [[Mod Creation]]&lt;br /&gt;
&lt;br /&gt;
Create a mod and fill out the modinfo.lua, making sure to change the name and description so you can tell it apart when you are selecting it.&lt;br /&gt;
&lt;br /&gt;
=== File locations ===&lt;br /&gt;
Like many mods, the file structure downwards from the modname.sdd folder should exactly match the Zero-K internal virtual file system, and if there are any files in your mod that match names with base files, Zero-K will use your mod's file instead of the base file.&lt;br /&gt;
&lt;br /&gt;
This allows you to selectively replace any files with whatever changed version you want, which is ideal for our purposes of testing a mod.  Any ''new'' files will also be loaded, allowing you to test entirely new units - although you may have to modify the buildoptions list of an existing factory or constructor to allow them to build your new unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;AN IMPORTANT NOTE:&lt;br /&gt;
You should keep all of filenames and folder names lower case, as the virtual file system lowercases everything.  Double check your filenames, it needs to match exactly if you are replacing things.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Testing your mod ===&lt;br /&gt;
Once you have filled out your folders and files, probably (but not exclusively) using /objects3d , /units and /unittextures , you can progress to actually testing it works in-engine.&lt;br /&gt;
&lt;br /&gt;
Load up Zero-K and go to singleplayer, then Skirmish.  The map and opponents do not especially matter, though if you are testing a lot you probably want to use an inactive AI (check through main lobby options for additional AI types if it's not there by default).&lt;br /&gt;
&lt;br /&gt;
Go into Adv Options, and pick 'Select Mod'.  If the folder and modinfo are correct you should see your mod on the list.  If you do not, download the base mod, unzip it to the appropriate place and check if that shows up - if it does, the problem is with your mod.  If it does not, then something is probably in the wrong place.&lt;br /&gt;
&lt;br /&gt;
Once you've selected your mod you should start the skirmish and attempt to test whatever you've actually changed.  At one point while doing this, Zero-K would not load because the interpreter for the mod's unitdef files was more strict than the main game's, so you may wish to follow the format used in the base mod (it overwrites lotus turrets) more exactly if you have this problem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fix whatever isn't right ==&lt;br /&gt;
Do not expect everything to be perfect.  This is a very complicated process and something is probably broken somewhere - either way, check everything, and get used to the idea that you may have to edit, re-export, then restart the game a lot to retry with changes quite often.  Although unit definitions and such may be reloaded without quitting the game (TODO: what is the command to do this?  How reliable is it?) you should eventually restart Zero-K to do a round of final testing just to ensure that everything loads correctly from startup.&lt;br /&gt;
&lt;br /&gt;
== The other bits ==&lt;br /&gt;
Ever heard about software development that first you need to complete 90% of the project, and then you need to complete the other 90% of the project?  The same sometimes applies to modding.  &lt;br /&gt;
&lt;br /&gt;
Even though by this point you should have your unit or building in game and working, there are other things to do before it's ready!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== groundplane decal and ao bake ===&lt;br /&gt;
If your unit is a building, you will need to create a ground plane to go underneath it - at the very least an ambient occlusion baked shadow, usually referred to as an aoplane.  This is simply a texture which is sized appropriately for your model and is placed underneath it by the engine.  This adds a little soft shadowing around the edge of the building which helps immensely to integrate it with the map.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to make these, but the easiest if following this tutorial is probably just to bake your own in Blender.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create and size the virtual ground plane ====&lt;br /&gt;
First, create a plane and place it under your model.  It should be at zero relative to where the model is going to go, but this plane will never leave blender directly - it will be the Spring engine painting the decal onto the terrain.  Scale it until it completely covers all of your model, then apply the scale and scale it *again* so that it is appropriately larger than the footprint of your model.  This size may need adjusting so that it fits an integer value - for example, if the unitdef lists your unit as 5 footprint-units wide, then (since you can only set the decal footprint size to an integer) you would have to choose 6 (6/5 = 120% of the model size) or 7 (7/5 = 140% of the model size).  Somewhere between 120% and 140% is probably fine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Setup for AO Baking ====&lt;br /&gt;
Once you have the plane appropriately sized, go to the render tab [[File:Blender_render_tab.png]] and change the Render engine to Cycles.  You may wish to change the feature set and compute device appropriate to your system (especially if you have a powerful GPU) but the defaults should be fine for this.&lt;br /&gt;
&lt;br /&gt;
Make sure you set the number of samples in the Sampling section high enough.  512 is a good number to start from, though as high as 1024 is useful to reduce noise.  More samples mean more render time, even for something as simple as baking a simple ambient occlusion map.&lt;br /&gt;
&lt;br /&gt;
Next, go to the world tab [[File:Blender_world_tab.png]] and activate Ambient Occlusion.  Factor should be 1.0, and the distance parameter depends on how large your model is.  You may have to tweak this value until the resulting bake looks correct, but start with a distance parameter somewhere around 25% to 50% of the width of your model, turning it up if this is not sufficient.&lt;br /&gt;
&lt;br /&gt;
To properly bake, we need somewhere to put the texture - so open up a shader node window somewhere, select the ground plane and make sure that it is using a new material and that material is using nodes.  Connect a texture node using the Ctrl-T shortcut. Press New to make a new texture, and set it to the appropriate size - typically 512px square for something the size of a factory or 128px square for smaller buildings.  Set the image colourspace to non-colour data to prevent shading artefacts later.  Make sure this texture node has been clicked on and is selected, because it's the last selected texture for each relevant object that receives the bake.&lt;br /&gt;
&lt;br /&gt;
Finally we're almost ready to do the baking!  Return to the render tab [[File:Blender_render_tab.png]] and scroll down to the Bake section.  From the Bake Type dropdown select Ambient Occlusion.  Make sure that Selected to Active is OFF, as that is intended to transfer high poly modelling data to low poly objects and we actually do want just a general scene-wide bake of ambient occlusion, it's just we only care about the result on this one ground plane object.  Margin can be adjusted but the default of 16px is probably fine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Do the bake ====&lt;br /&gt;
Press Bake!&lt;br /&gt;
&lt;br /&gt;
If blender crashed that's fine, go check in the log file to see what did it - the last time I had a crash here, I had an addon (bezier tools, totally unrelated to anything to do with baking) going wrong, and so I had to temporarily disable it.&lt;br /&gt;
&lt;br /&gt;
If all went well, you should have seen a few textures render if you were on something with a texture view, and if you go to find your new ambient occlusion texture it should be a black outline in the shape of your building with a white outside, and a blurry shadowy bit around the edge of the black outline, which is what the game will draw onto the ground.  Export this as a png.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Touchup and adjust format in external image editor ====&lt;br /&gt;
The next bit you will need to do in GIMP/Glimpse, or any other image processing software capable of exporting DDS textures.  Simply load your image file, turn the white colour into transparency by whatever method you prefer such that full black is opaque and full white is transparent, and then export as DDS.  Spring wants textures to be DXT5 compressed, with mipmaps generated.&lt;br /&gt;
&lt;br /&gt;
If you want some other decal underneath your unit, perhaps a metallic decal if it is a factory for example, you can add that as another layer in your image editing software here.  Ensure that the ambient occlusion layer overlays it where necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adjust unitdef to include groundplane ====&lt;br /&gt;
Now you've got a groundplane texture, rename it to something like unitname_aoplane.dds and put it into the /unittextures folder.  Then go to the unitdef and make sure that these tags are filled out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
buildingGroundDecalDecaySpeed = 30, --Seconds decal takes to fade in or out of existence?&lt;br /&gt;
buildingGroundDecalSizeX      = 12, --Size of decal X axis in footprint units &lt;br /&gt;
buildingGroundDecalSizeY      = 12, --Size of decal Y axis in footprint units &lt;br /&gt;
buildingGroundDecalType       = [[unitname_aoplane.dds]], --filename of decal&lt;br /&gt;
&lt;br /&gt;
useBuildingGroundDecal        = true,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After saving the updated unitdef, go and check that the ground plane exists in game.  They can be quite subtle, but by toggling on and off the &amp;quot;show ground decals&amp;quot; option, you should be able to see the difference easily.&lt;br /&gt;
&lt;br /&gt;
If needed, you can edit your original png file in the image editor again and apply gaussian blur to the image to spread the shadow out further.  Ensure that the shadow's edge doesn't touch the edge of the image, as this tends to look obvious.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== unitpic ===&lt;br /&gt;
Unit pictures in the buildmenu are generated by an automated script.  This script lives as a Lua gadget within the Zero-K base content, so if you have your mod working you can load that up and generate a buildpic.&lt;br /&gt;
&lt;br /&gt;
First, press F8 to show the debug console, then turn on cheats with /cheat (or !cheats in multiplayer, which will require host permissions.)&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;pre&amp;gt;/luarules buildicon {unitname}&amp;lt;/pre&amp;gt;. You can run it with no unit name and instead buildicons if you want to generate buildicons for every unit in the game.  It should output the icons to your Zero-K folder under the /buildicons folder.  You will then have to move it to the /unitpics folder of your mod, name it appropriately, and check it works.&lt;/div&gt;</summary>
		<author><name>HigherFlyer</name></author>
		
	</entry>
	<entry>
		<id>https://zero-k.info/mediawiki/index.php?title=Blender_To_Zero-K&amp;diff=7027</id>
		<title>Blender To Zero-K</title>
		<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/index.php?title=Blender_To_Zero-K&amp;diff=7027"/>
		<updated>2020-10-15T13:14:44Z</updated>

		<summary type="html">&lt;p&gt;HigherFlyer: Probably ill advised grammatical correction.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here is a tutorial covering all of the steps to make or edit a model in [https://www.blender.org/ Blender] (a free 3d modelling program) and transfer it to the Spring engine, then have Zero-K load it as a mutator so you can test it in-game.&lt;br /&gt;
&lt;br /&gt;
The contents page here will also act as a quick reference for all of the necessary steps, in order:&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Make or Edit the model in Blender ==&lt;br /&gt;
=== Setting up Blender for use in Zero-K ===&lt;br /&gt;
If you are totally new to blender there are a few things you probably ought to do to set up blender for use with Zero-K.  Additionally, this tutorial will assume you are using left-click to select (the new default) and a fairly typical window layout similar to the default.&lt;br /&gt;
&lt;br /&gt;
Blender comes with several add-ons and scripts, not all of which are enabled by default.  While there are many additional ones you might have to pay for that could prove useful (meshmachine, decalmachine and hard ops are probably the most well known three) there are a few free add-ons you may wish to consider.  You should absolutely go to the Edit-&amp;amp;gt;Preferences-&amp;amp;gt;Add-ons submenu and enable Node Wrangler, and Looptools.&lt;br /&gt;
&lt;br /&gt;
To import s3o models from spring, you will need an addon which can be found [https://github.com/sanguinariojoe/blender_s3o_import here].  You need to download the python (.py) file and then use the Install button inside blender's add-ons submenu, pointing it at that .py file, so that blender knows how to import .s3o models.  Make sure to enable the add-on after installation.&lt;br /&gt;
&lt;br /&gt;
If you want to export animations, you will also need [https://github.com/Anarchid/blender2lus this] animation exporter, though the output it produces will likely still require manual adjustment and will not be covered by this tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Importing a model (optional) ===&lt;br /&gt;
With the s3o importer installed and enabled, you should be able to import s3o models from spring into blender by using the File-&amp;amp;gt;Import-&amp;amp;gt;s3o option.  Then navigate to your model file and select it.&lt;br /&gt;
&lt;br /&gt;
s3o models often come in rotated to one side, as Spring uses Y-axis-up and Blender uses Z-axis-up.  You can rotate them to look right in Blender, and then when exporting them there are options to deal with this so that they export rotated correctly.&lt;br /&gt;
&lt;br /&gt;
If the importer can find them, it will also import textures and the UV map along with the model.  The texture files may need to be placed appropriately or in the same directory as the model file for this to work.&lt;br /&gt;
&lt;br /&gt;
=== Importing textures ===&lt;br /&gt;
To open a texture you need to set a window to either the Image Editor or UV Editor mode, and then press the Open button in the top menu bar.  This will bring up a file menu where you can select a texture to bring into Blender.  Blender supports .dds textures by default, as well as most other image formats.  &lt;br /&gt;
&lt;br /&gt;
You can certainly import any old texture and work with it, but if you are importing textures already used by Spring you should know that they are somewhat unusual.&lt;br /&gt;
&lt;br /&gt;
Spring has two separate texture formats.  The first of these, referred to as tex1 or colour texture, uses Red Green Blue (RGB) channels to store colour data, and Alpha (A) to store whether that part of the file is teamcolour or not.  This means that by default a tex1 texture looks mostly blank(transparent) with some odd black bits scattered around.  You can fix this in Blender by scrolling the menu bar (hold middle button with cursor on menu, drag mouse to side) all the way to the right, and clicking the little drop down which says Display Channels [[File:Blender_display_channels.png]].  By default it is set to ''Colour and Alpha'' but you should set it to ''Colour'' when working with tex1 files to ignore the alpha channel.&lt;br /&gt;
&lt;br /&gt;
Tex2 files are the ones in greenyblue with bits of red.  In those files the Red channel is how much that part of the texture emits light, the Green channel is how rough or smooth that part of the texture is (which determines how it reacts to light), and the Blue channel is how metallic and reflective that part of the texture is.  Areas which are cyan (full green and full blue) are mirror-smooth metal, so reflect the environment perfectly.  These should always have their colourspace set to non-colour data as they use each channel separately.  You can find that option in the right hand popout menu when in an image editor viewing them (shortcut key N by default) under the Image tab.&lt;br /&gt;
&lt;br /&gt;
You may also need or want to use Normal map textures, which are the ones that look mostly blue with some oddly coloured parts around the edges.  Whenever you use these normal map textures you should always change the colourspace to non-colour data as it can cause visual errors if you do not, since it will process the channels differently in the render pipeline.&lt;br /&gt;
&lt;br /&gt;
If nothing in the scene uses your texture it will be discarded from the file when you save and exit.  You may click the shield icon next to the file name to prevent this, if you want to have the textures kept around even with nothing using it.  As long as you've assigned the texture to a material, and the material to a model (see below) this will not be a problem, but it's useful to know this option exists and why a texture might be dropped.&lt;br /&gt;
&lt;br /&gt;
Blend files do not by default contain the textures referenced in them, but you 'can' optionally pack the textures into them for easy transfer between users or computers.   Explore the File-&amp;amp;gt;External Data menu for those options.&lt;br /&gt;
&lt;br /&gt;
=== Modelling for Zero-K ===&lt;br /&gt;
There are not many special considerations when modelling for Zero-K, and a general explanation of modelling and blender is too detailed to go here.  However, you could consult tutorials such as [https://www.youtube.com/watch?v=7MRonzqYJgw&amp;amp;list=PLn3ukorJv4vs_eSJUQPxBRaDS8PrVmIri Grant Abbitt's beginner series] or [https://www.youtube.com/watch?v=1jHUY3qoBu8 Imphenzia's introduction and low poly modelling] tutorial.&lt;br /&gt;
&lt;br /&gt;
Generally, you should attempt to keep the number of triangles used in a model as low as is reasonable.  That number varies depending on how frequent the unit is planned to be - a commander or other functionally unique unit would be fine with up to 30,000 triangles, but for a very spammable unit such as a flea this would be extremely excessive, as you can build a vast number of fleas.  Something in the region of 500-1000 would be more appropriate, with less being ideal as long as the model still looks good.&lt;br /&gt;
&lt;br /&gt;
The size of the model (or part of model) and how visible it is also has an impact on how many polygons you should be using.  A large model covering a lot of screen space should use more polygons and texels than a small one or a part of the model that people rarely or never see.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Texturing for Zero-K, and Spring texture oddities ===&lt;br /&gt;
As mentioned earlier, spring uses two textures per model and cannot use multiple UV Maps, cannot use vertex colours, and cannot use additional textures other than a normal map.&lt;br /&gt;
&lt;br /&gt;
The tex1 format covers the diffuse colour and whether a pixel is teamcoloured or not, wheras tex2 covers the emissivity, roughness, and metalness of the model in its RGB channels respectively.&lt;br /&gt;
&lt;br /&gt;
Remember that most DDS normal maps are slightly different from typical OpenGL normal maps, and adjust appropriately as needed.  Typically inverting the Red and Green channels does the trick.&lt;br /&gt;
&lt;br /&gt;
If you import a texture then the importer will set up the nodes for you, however, if you are starting from scratch then you probably just want to replicate this node setup.  This mostly approximates what Spring will do in-engine, giving you a workable preview in Blender when you use a lookdev(Material Preview) view mode.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring_shader.png]]&lt;br /&gt;
&lt;br /&gt;
There are three textures referenced here, which in this case happen to be atlas textures which can be reused for multiple models. The core_color.dds is tex1 and has colours and teamcolours - the alpha channel is split off, inverted, and used to colour the alpha areas green (you can click the green colour to replace it with any other colour, if you like).&lt;br /&gt;
&lt;br /&gt;
The core_other.dds is the tex2 file, so it is split into RGB channels and each of these channels appropriately processed and connected to the relevant part of the material.&lt;br /&gt;
&lt;br /&gt;
Finally the core_normals.dds contains a direct-x formatted normal map, so it is converted to an openGL format by inverting just the Red and Green channels and is then passed through the normal calculation node to convert the image into a vector map, and then the vector map passed to the shader.&lt;br /&gt;
&lt;br /&gt;
TODO: Provide a blend file here that already has this material set up, just need to plug in textures.  Or just include atlas texture.  Airpad_packed.blend is sadly larger than 2mb so the wiki will not host it.&lt;br /&gt;
&lt;br /&gt;
== Export the model to .dae format ==&lt;br /&gt;
Nowadays Spring can read .dae (Collada) files directly via the use of Assimp (Asset Importer).  This means the export process is reasonably simple. &lt;br /&gt;
&lt;br /&gt;
Either clean your scene of everything you do not want to be exported, or select only the things you want exported.  Go to the File-&amp;amp;gt;Export menu and select Collada (.dae) format.  A file browser will open with various export settings on the right hand side.&lt;br /&gt;
&lt;br /&gt;
You should pick Selection Only from the Main tab of export options if you want to limit it to selection.&lt;br /&gt;
&lt;br /&gt;
Make sure that the orientation settings are correct.  You want to tell the exporter what axes you've been modelling with, not the axes you're looking for.  These are the default options and should usually be right, Spring/Assimp will then adjust them for use in engine, but if after checking things in Spring your object is oriented wrongly, you can try adjusting these and exporting again.  If all else fails, you can parent the root object(s) to an empty placed at the origin and rotate that. [[File:collada_default_export.png]]&lt;br /&gt;
&lt;br /&gt;
=== A note on animation ===&lt;br /&gt;
Although Collada (.dae) files do support exporting animation, you should not do this as Spring cannot read the animation data.  Instead, animations in Zero-K are handled by a lua animation script known as LUS.&lt;br /&gt;
&lt;br /&gt;
Although you cannot export the animations to Collada, you can still do your animations in Blender and use the Blender2Lus export script linked earlier to export a starting animation script.  It has several limitations, such as only exporting the active action from each object in the scene, but running it several times and tweaking and combining the generated scripts can reduce the amount of work in generating animation scripts immensely.  Further use of this script is, for the moment, outside the scope of this tutorial (because I haven't done it myself yet - feel free to replace this with detailed explanation if you have, though!)&lt;br /&gt;
&lt;br /&gt;
== Set up texture associations and .dae.lua metadata ==&lt;br /&gt;
Although Spring can read .dae files and the contained UV map, it does not support any sort of material or texture import, so you have to specify these manually.  Since at this point you have already set Blender up with a reasonable approximation of the texture process it should not be especially difficult.&lt;br /&gt;
&lt;br /&gt;
You will need to provide a .dae.lua file with the same name as your model file, in the same directory, to tell Spring which texture files and associated data to use with the model.&lt;br /&gt;
&lt;br /&gt;
For example, if your model export is snazzyUnit.dae and it is present under the /objects3d folder of your testing mod, you should make a snazzyUnit.dae.lua file and place that at /objects3d/snazzyUnit.dae.lua .&lt;br /&gt;
&lt;br /&gt;
The documentation for these metadata files is [https://springrts.com/wiki/3DModels:AssimpMetadata here], but they are reasonably simple and a minimal example file is provided below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
return {&lt;br /&gt;
	tex1 = &amp;quot;core_color.dds&amp;quot;,&lt;br /&gt;
	tex2 = &amp;quot;core_other.dds&amp;quot;,&lt;br /&gt;
	invertteamcolor = false&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously if you are not using the atlas textures you will need to replace those names with the actual texture files you intend to use.  There are several other things that may need to be in this file, but as these differ per-unit you will need to decide what, if anything, to provide.&lt;br /&gt;
&lt;br /&gt;
== Set up Zero-K mod that contains and uses your files ==&lt;br /&gt;
To get Zero-K to see your files and locally test your units (new or otherwise) you should use a mod.&lt;br /&gt;
&lt;br /&gt;
This is selectable in local skirmish mode (and theoretically you can distribute them to test in multiplayer) which allows you to check everything works in the engine without requiring any changes to the official repositories or even building a local development copy of the game - all you need is a working copy of Zero-K.&lt;br /&gt;
&lt;br /&gt;
=== Making the mod ===&lt;br /&gt;
Inside the Zero-K folder there is a games subfolder.  Inside that are numerous things, but if you make a new subfolder with a name ending in .sdd it will be read by the engine on startup.  A base mod is available to download [File:BaseMod.sdd.zip here] to build from if you would like an example.  More details on mod creation can be found here: [[Mod Creation]]&lt;br /&gt;
&lt;br /&gt;
Create a mod and fill out the modinfo.lua, making sure to change the name and description so you can tell it apart when you are selecting it.&lt;br /&gt;
&lt;br /&gt;
=== File locations ===&lt;br /&gt;
Like many mods, the file structure downwards from the modname.sdd folder should exactly match the Zero-K internal virtual file system, and if there are any files in your mod that match names with base files, Zero-K will use your mod's file instead of the base file.&lt;br /&gt;
&lt;br /&gt;
This allows you to selectively replace any files with whatever changed version you want, which is ideal for our purposes of testing a mod.  Any ''new'' files will also be loaded, allowing you to test entirely new units - although you may have to modify the buildoptions list of an existing factory or constructor to allow them to build your new unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;AN IMPORTANT NOTE:&lt;br /&gt;
You should keep all of filenames and folder names lower case, as the virtual file system lowercases everything.  Double check your filenames, it needs to match exactly if you are replacing things.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Testing your mod ===&lt;br /&gt;
Once you have filled out your folders and files, probably (but not exclusively) using /objects3d , /units and /unittextures , you can progress to actually testing it works in-engine.&lt;br /&gt;
&lt;br /&gt;
Load up Zero-K and go to singleplayer, then Skirmish.  The map and opponents do not especially matter, though if you are testing a lot you probably want to use an inactive AI (check through main lobby options for additional AI types if it's not there by default).&lt;br /&gt;
&lt;br /&gt;
Go into Adv Options, and pick 'Select Mod'.  If the folder and modinfo are correct you should see your mod on the list.  If you do not, download the base mod, unzip it to the appropriate place and check if that shows up - if it does, the problem is with your mod.  If it does not, then something is probably in the wrong place.&lt;br /&gt;
&lt;br /&gt;
Once you've selected your mod you should start the skirmish and attempt to test whatever you've actually changed.  At one point while doing this, Zero-K would not load because the interpreter for the mod's unitdef files was more strict than the main game's, so you may wish to follow the format used in the base mod (it overwrites lotus turrets) more exactly if you have this problem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fix whatever isn't right ==&lt;br /&gt;
Do not expect everything to be perfect.  This is a very complicated process and something is probably broken somewhere - either way, check everything, and get used to the idea that you may have to edit, re-export, then restart the game a lot to retry with changes quite often.  Although unit definitions and such may be reloaded without quitting the game (TODO: what is the command to do this?  How reliable is it?) you should eventually restart Zero-K to do a round of final testing just to ensure that everything loads correctly from startup.&lt;br /&gt;
&lt;br /&gt;
== The other bits ==&lt;br /&gt;
Ever heard about software development that first you need to complete 90% of the project, and then you need to complete the other 90% of the project?  The same sometimes applies to modding.  &lt;br /&gt;
&lt;br /&gt;
Even though by this point you should have your unit or building in game and working, there are other things to do before it's ready!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== groundplane decal and ao bake ===&lt;br /&gt;
If your unit is a building, you will need to create a ground plane to go underneath it - at the very least an ambient occlusion baked shadow, usually referred to as an aoplane.  This is simply a texture which is sized appropriately for your model and is placed underneath it by the engine.  This adds a little soft shadowing around the edge of the building which helps immensely to integrate it with the map.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to make these, but the easiest if following this tutorial is probably just to bake your own in Blender.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create and size the virtual ground plane ====&lt;br /&gt;
First, create a plane and place it under your model.  It should be at zero relative to where the model is going to go, but this plane will never leave blender directly - it will be the Spring engine painting the decal onto the terrain.  Scale it until it completely covers all of your model, then apply the scale and scale it *again* so that it is appropriately larger than the footprint of your model.  This size may need adjusting so that it fits an integer value - for example, if the unitdef lists your unit as 5 footprint-units wide, then (since you can only set the decal footprint size to an integer) you would have to choose 6 (6/5 = 120% of the model size) or 7 (7/5 = 140% of the model size).  Somewhere between 120% and 140% is probably fine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Setup for AO Baking ====&lt;br /&gt;
Once you have the plane appropriately sized, go to the render tab [[File:Blender_render_tab.png]] and change the Render engine to Cycles.  You may wish to change the feature set and compute device appropriate to your system (especially if you have a powerful GPU) but the defaults should be fine for this.&lt;br /&gt;
&lt;br /&gt;
Make sure you set the number of samples in the Sampling section high enough.  512 is a good number to start from, though as high as 1024 is useful to reduce noise.  More samples mean more render time, even for something as simple as baking a simple ambient occlusion map.&lt;br /&gt;
&lt;br /&gt;
Next, go to the world tab [[File:Blender_world_tab.png]] and activate Ambient Occlusion.  Factor should be 1.0, and the distance parameter depends on how large your model is.  You may have to tweak this value until the resulting bake looks correct, but start with a distance parameter somewhere around 25% to 50% of the width of your model, turning it up if this is not sufficient.&lt;br /&gt;
&lt;br /&gt;
To properly bake, we need somewhere to put the texture - so open up a shader node window somewhere, select the ground plane and make sure that it is using a new material and that material is using nodes.  Connect a texture node using the Ctrl-T shortcut. Press New to make a new texture, and set it to the appropriate size - typically 512px square for something the size of a factory or 128px square for smaller buildings.  Set the image colourspace to non-colour data to prevent shading artefacts later.  Make sure this texture node has been clicked on and is selected, because it's the last selected texture for each relevant object that receives the bake.&lt;br /&gt;
&lt;br /&gt;
Finally we're almost ready to do the baking!  Return to the render tab [[File:Blender_render_tab.png]] and scroll down to the Bake section.  From the Bake Type dropdown select Ambient Occlusion.  Make sure that Selected to Active is OFF, as that is intended to transfer high poly modelling data to low poly objects and we actually do want just a general scene-wide bake of ambient occlusion, it's just we only care about the result on this one ground plane object.  Margin can be adjusted but the default of 16px is probably fine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Do the bake ====&lt;br /&gt;
Press Bake!&lt;br /&gt;
&lt;br /&gt;
If blender crashed that's fine, go check in the log file to see what did it - the last time I had a crash here, I had an addon (bezier tools, totally unrelated to anything to do with baking) going wrong, and so I had to temporarily disable it.&lt;br /&gt;
&lt;br /&gt;
If all went well, you should have seen a few textures render if you were on something with a texture view, and if you go to find your new ambient occlusion texture it should be a black outline in the shape of your building with a white outside, and a blurry shadowy bit around the edge of the black outline, which is what the game will draw onto the ground.  Export this as a png.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Touchup and adjust format in external image editor ====&lt;br /&gt;
The next bit you will need to do in GIMP/Glimpse, or any other image processing software capable of exporting DDS textures.  Simply load your image file, turn the white colour into transparency by whatever method you prefer such that full black is opaque and full white is transparent, and then export as DDS.  Spring wants textures to be DXT5 compressed, with mipmaps generated.&lt;br /&gt;
&lt;br /&gt;
If you want some other decal underneath your unit, perhaps a metallic decal if it is a factory for example, you can add that as another layer in your image editing software here.  Ensure that the ambient occlusion layer overlays it where necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adjust unitdef to include groundplane ====&lt;br /&gt;
Now you've got a groundplane texture, rename it to something like unitname_aoplane.dds and put it into the /unittextures folder.  Then go to the unitdef and make sure that these tags are filled out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
buildingGroundDecalDecaySpeed = 30, --Seconds decal takes to fades in or out of existence?&lt;br /&gt;
buildingGroundDecalSizeX      = 12, --Size of decal X axis in footprint units &lt;br /&gt;
buildingGroundDecalSizeY      = 12, --Size of decal Y axis in footprint units &lt;br /&gt;
buildingGroundDecalType       = [[unitname_aoplane.dds]], --filename of decal&lt;br /&gt;
&lt;br /&gt;
useBuildingGroundDecal        = true,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After saving the updated unitdef, go and check that the ground plane exists in game.  They can be quite subtle, but by toggling on and off the &amp;quot;show ground decals&amp;quot; option, you should be able to see the difference easily.&lt;br /&gt;
&lt;br /&gt;
If needed, you can edit your original png file in the image editor again and apply gaussian blur to the image to spread the shadow out further.  Ensure that the shadow's edge doesn't touch the edge of the image, as this tends to look obvious.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== unitpic ===&lt;br /&gt;
Unit pictures in the buildmenu are generated by an automated script.  This script lives as a Lua gadget within the Zero-K base content, so if you have your mod working you can load that up and generate a buildpic.&lt;br /&gt;
&lt;br /&gt;
First, press F8 to show the debug console, then turn on cheats with /cheat (or !cheats in multiplayer, which will require host permissions.)&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;pre&amp;gt;/luarules buildicon {unitname}&amp;lt;/pre&amp;gt;. You can run it with no unit name and instead buildicons if you want to generate buildicons for every unit in the game.  It should output the icons to your Zero-K folder under the /buildicons folder.  You will then have to move it to the /unitpics folder of your mod, name it appropriately, and check it works.&lt;/div&gt;</summary>
		<author><name>HigherFlyer</name></author>
		
	</entry>
	<entry>
		<id>https://zero-k.info/mediawiki/index.php?title=Zero-K:Developing&amp;diff=6996</id>
		<title>Zero-K:Developing</title>
		<link rel="alternate" type="text/html" href="https://zero-k.info/mediawiki/index.php?title=Zero-K:Developing&amp;diff=6996"/>
		<updated>2020-09-25T19:45:31Z</updated>

		<summary type="html">&lt;p&gt;HigherFlyer: Update SQL server download link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New developers should read this before touching the source.&lt;br /&gt;
&lt;br /&gt;
== ZK's Devving Philosophy (social rules) ==&lt;br /&gt;
* &amp;quot;War is a product of anticommunication&amp;quot;&lt;br /&gt;
** Communicate with other devs about your changes/fixes, let them understand the issue. Do not make 'random' changes.&lt;br /&gt;
* &amp;quot;Do not create work for other people.&amp;quot;&lt;br /&gt;
** Have responsibility for your changes/commit. Do not leave bugs that require other people to fix.&lt;br /&gt;
* &amp;quot;Readability &amp;amp; performance are equally important.&amp;quot; &lt;br /&gt;
** Optimize code but not to the point of unreadability. [http://c2.com/cgi/wiki?RulesOfOptimization Remember the rules of optimization]:&lt;br /&gt;
*** Don't.&lt;br /&gt;
*** Don't (yet).&lt;br /&gt;
*** Profile before doing it.&lt;br /&gt;
* &amp;quot;If it ain't broke, don't fix it.&amp;quot;&lt;br /&gt;
** Don't code fixes that nobody wants to problems that don't exist.&lt;br /&gt;
&lt;br /&gt;
== What is in source codes ==&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K Zero-K] contains the game proper&lt;br /&gt;
** units folder contains unit definition files&lt;br /&gt;
*** You can read the wiki about game development for [http://springrts.com/wiki/Main_Page Spring Engine] &lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K-Infrastructure]&lt;br /&gt;
** Zero-K.info: Website sources&lt;br /&gt;
** ZkLobbyServer: Lobby server (for MP)&lt;br /&gt;
** ZkData: Website/server database structure&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Chobby Chobby] contains the lobby client&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Artwork Zero-K-Artwork] contains sources for 2D art, 3D art and sounds&lt;br /&gt;
* [https://github.com/ZeroK-RTS/SpringRTS-Tools SpringRTS-tools] contains various dev tools&lt;br /&gt;
** Upspring - required to edit the .3do and .s3o model files used in the game&lt;br /&gt;
** MapIconBuilder - unit map icon sources are here&lt;br /&gt;
* [https://github.com/ZeroK-RTS/Zero-K-Missions Zero-K-Missions] contains source files for official ZK missions&lt;br /&gt;
&lt;br /&gt;
=== Style Guide===&lt;br /&gt;
The lua in the menu (chobby) and game proper should use the following whitespace:&lt;br /&gt;
* Indent with tabs.&lt;br /&gt;
* A tab may only follow a newline or another tab.&lt;br /&gt;
* If the text across two lines is being aligned (such as for a long function) then the two lines must have the same number of tabs.&lt;br /&gt;
* Don't try stack flow of control into one line. For example, put newlines after &amp;lt;code&amp;gt;then&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt;.&lt;br /&gt;
* End files with a newline.&lt;br /&gt;
* Commas should be followed by whitespace. Relations (=, &amp;lt;, &amp;lt;=, &amp;gt;=, ==, ~=) should have whitespace on each side.&lt;br /&gt;
* if a conditional is to take up multiple lines, double indent the extra lines and end the line with a conjunction (See Gallery below)&lt;br /&gt;
These guidelines are not necessarily followed in old files so updating them with a separate commit is a good idea prior to making large changes. Also, unitdefs use two-space indentation instead of tabs.          &lt;br /&gt;
&lt;br /&gt;
There are a few guildines for dealing with Spring functions.&lt;br /&gt;
* Localisation of Spring.Function should be named spFunction.&lt;br /&gt;
* Localisation of Spring.MoveCtrl.Function should be named spMoveCtrlFunction.&lt;br /&gt;
* Spring.GetCommandQueue should be used rather than Spring.GetUnitCommands (it's an alias, we just picked one).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Styleguide-if-example.JPG|Proper multiline if statement&lt;br /&gt;
Styleguide-stackflow.JPG|Example of stacked flow control&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting sources ==&lt;br /&gt;
This is a guide to downloading Zero-K sources from [https://github.com/ GitHub] using [https://tortoisegit.org/ TortoiseGit]. The game sources are used as an example, however this method applies to other subprojects as well.&lt;br /&gt;
* Install [https://tortoisegit.org/download/ TortoiseGit].&lt;br /&gt;
* Create a [https://github.com/ GitHub] account.&lt;br /&gt;
[[File:ForkZK.jpg]]&lt;br /&gt;
* Log in to GitHub and [https://github.com/ZeroK-RTS Locate] the repository you want to edit.&lt;br /&gt;
* Click the &amp;quot;Fork&amp;quot; button on the GitHub website to create your own copy on GitHub.&lt;br /&gt;
[[File:cloneZK.jpg]]&lt;br /&gt;
* Locate your fork on GitHub and click &amp;quot;Clone or Download&amp;quot;.&lt;br /&gt;
* Copy the web URL to your clipboard.&lt;br /&gt;
[[File:localCloneZK.jpg]]&lt;br /&gt;
* Create a folder called 'zk.sdd' in your Zero-K install under games.&lt;br /&gt;
* Right click on 'zk.sdd' and select 'Git Clone...' from the context menu.&lt;br /&gt;
[[File:cloneUIZK.jpg]]&lt;br /&gt;
* Copy the web URL into the 'URL:' field of the clone interface.&lt;br /&gt;
* Ensure that the 'Directory:' field ends in 'zk.sdd'. It is likely to automatically contain the path '...\Zero-K\games\zk.sdd\Zero-K' so be sure to delete the '\Zero-K' at the end.&lt;br /&gt;
[[File:cloneSuccess.jpg]]&lt;br /&gt;
* Wait for the sources to download.&lt;br /&gt;
* Your 'zk.sdd' folder should look something like the image above.&lt;br /&gt;
&lt;br /&gt;
== Updating sources ==&lt;br /&gt;
Keep your sources up to date by periodically syncing your fork to the original repository (using 'compare', see: https://github.com/KirstieJane/STEMMRoleModels/wiki/Syncing-your-fork-to-the-original-repository-via-the-browser, then do &amp;quot;rebase and merge&amp;quot; instead of &amp;quot;merge&amp;quot;) and doing TortoiseGit -&amp;gt; Pull on your repository folder to take the changes from GitHub to your local files.&lt;br /&gt;
&lt;br /&gt;
== Modifying the game ==&lt;br /&gt;
:''For personal modding, see [[Mod Creation]]''&lt;br /&gt;
Follow the instructions in 'Getting sources' the download the Zero-K game sources. Feel free to inspect and edit the game files. Most developers using Windows edit lua files with [https://notepad-plus-plus.org/download/v7.6.6.html Notepad++].&lt;br /&gt;
&lt;br /&gt;
To test your changes:&lt;br /&gt;
* Create an empty file named 'devmode.txt' in the same directory as Zero-K.exe.&lt;br /&gt;
* Launch Zero-K.exe.&lt;br /&gt;
[[File:enableDevMode.jpg]]&lt;br /&gt;
* Select 'Zero-K Dev' in Settings -&amp;gt; Developer -&amp;gt; Singleplayer (you may need to scroll down).&lt;br /&gt;
[[File:startTest.jpg]]&lt;br /&gt;
* From the main menu select Singleplayer -&amp;gt; Skirmish -&amp;gt; Advanced -&amp;gt; Start to launch a test game. Note that the game type should be automatically set to 'Zero-K $VERSION'.&lt;br /&gt;
* In the game, press F8 to open debug console. It'll display errors and output to the log.&lt;br /&gt;
&lt;br /&gt;
== Modifying the lobby menu ==&lt;br /&gt;
Follow the instructions in 'Getting sources' with the following adjustments:&lt;br /&gt;
* The repository that you want to edit is https://github.com/ZeroK-RTS/Chobby.&lt;br /&gt;
* It is best to call the folder something like 'zkmenu.sdd', to avoid confusion.&lt;br /&gt;
Make sure that the 'Directory:' field ends in '.sdd'. You should end up with something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:zkmenufolder.jpg]]&lt;br /&gt;
&lt;br /&gt;
To test your changes launch Zero-K.exe with the &amp;lt;tt&amp;gt;dev&amp;lt;/tt&amp;gt; arg (i.e. &amp;lt;code&amp;gt;Zero-K.exe dev&amp;lt;/code&amp;gt;). On windows this is best done by creating a shortcut and changing the target, as shown below.&lt;br /&gt;
[[File:targetZK.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Submitting changes ==&lt;br /&gt;
Git provides a systematic way to review and merge changes into the main repositories. The main game repository is used as example, but this method works for other repositories as well.&lt;br /&gt;
&lt;br /&gt;
The simple way to commit changes is as follows.&lt;br /&gt;
* Make some changes to your local files.&lt;br /&gt;
* Right click on 'zk.sdd' and select 'Git Commit'.&lt;br /&gt;
* Write a description of the changes and click 'Commit'.&lt;br /&gt;
* Right click on 'zk.sdd' and select TortiseGit -&amp;gt; Push.&lt;br /&gt;
* Enter your GitHub login and password when prompted. The changes should now appear on your fork in GitHub.&lt;br /&gt;
* Navigate to https://github.com/ZeroK-RTS/Zero-K/pulls and click &amp;quot;New Pull Request&amp;quot;.&lt;br /&gt;
* Click &amp;quot;compare across forks&amp;quot; to make your fork visible.&lt;br /&gt;
* Set your fork to be the head repository.&lt;br /&gt;
* Write a title and description of the changes, then create the pull request.&lt;br /&gt;
This creates a proposal to apply your changes to the main game. Be sure to check up on it and respond to comments.&lt;br /&gt;
&lt;br /&gt;
A more advanced method involves creating branches locally with TortiseGit -&amp;gt; Create Branch and committing blocks of related changes to a single branch. You are then able to make pull requests from branches. This allows branches to be smaller and more focused, which is desirable when merging.&lt;br /&gt;
&lt;br /&gt;
Make sure to keep your repository up to date to make merges less difficult.&lt;br /&gt;
&lt;br /&gt;
== Zero-K.exe launch flags ==&lt;br /&gt;
&amp;lt;pre&amp;gt;Zero-K.exe [rapid tag] [engine version]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that the engine specified in arg won't automatically use the main Zero-K folder as its datadir. Add a &amp;lt;tt&amp;gt;springsettings.cfg&amp;lt;/tt&amp;gt; file to the engine version's folder with the tag &amp;lt;code&amp;gt;SpringData = path_to_Zero-K_folder&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modifying infrastructure/tools == &lt;br /&gt;
* Install [https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx Visual Studio Community edition]&lt;br /&gt;
* Install [https://www.microsoft.com/en-us/sql-server/sql-server-downloads SQL Server express]&lt;br /&gt;
* Clone to desktop [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K infrastructure]&lt;br /&gt;
* Test by opening Zero-K.sln in Visual Studio&lt;br /&gt;
&lt;br /&gt;
=== Initializing Website Database ===&lt;br /&gt;
You may need to setup the database connection for the website. In order to do that: Open Visual Studio, open the Server Explorer panel (under the View menu), right click Data Connections -&amp;gt; Add Connection -&amp;gt; Sql Server. Enter &amp;lt;code&amp;gt;(localdb)\mssqllocaldb&amp;lt;/code&amp;gt; in the Server Name field, after which zero-k_local will appear in the dropdown list of databases. &lt;br /&gt;
&lt;br /&gt;
(If zero-k_local does not appear, type it in the text box and press OK; Visual Studio will ask whether you would like to create the database. This may require you to have administrator rights on the computer.)&lt;br /&gt;
&lt;br /&gt;
[[File:zk-database-setup.png]]&lt;br /&gt;
&lt;br /&gt;
=== Debugging infrastructure ===&lt;br /&gt;
* To run a project right click it, choose &amp;quot;set as startup project&amp;quot; and hit F5 to run using debugger.&lt;br /&gt;
* You can enable multiple startup projects to test entire infrastructure locally (game servers, lobby etc). Enable asp.net, springie and ZeroKLobby projects to test it all together. [http://i.imgur.com/2mgizUJ.png Setup]&lt;br /&gt;
* To run asp.net:&lt;br /&gt;
** It's required that you install MS SQL Express on your local PC. &lt;br /&gt;
*** You can get SQL Server 2017 (for Windows 8 and later) [https://www.microsoft.com/en-us/sql-server/sql-server-editions-express here] or SQL Server 2014 (for Windows 7) [https://www.microsoft.com/en-ie/download/details.aspx?id=42299 here]. For SQL Server 2014, the file you will need is called SQLEXPR_x64_ENU or SQLEXPR_x86_ENU. Make sure you install version that matches your version of Windows (i.e. x86 vs x64). &lt;br /&gt;
*** During the installation, set collation to &amp;lt;code&amp;gt;SQL_Latin1_General_CP1_CI_AS&amp;lt;/code&amp;gt;. Leave all the parameters default except that I changed server name to SQLEXPRESS in one of the first steps of wizard.&lt;br /&gt;
[[File:SQL server collation.png|405px]]&lt;br /&gt;
** Right click asp.net -&amp;gt; properties -&amp;gt; web -&amp;gt; check &amp;quot;Specific Page&amp;quot; and leave it blank. Otherwise you get errors when trying to host locally.&lt;br /&gt;
** Make sure SQL Server is running (check the Sql Server Configuration Manager in the Start Menu). If you can't connect, edit the data source for &amp;lt;code&amp;gt;ModeType.Local&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;GlobalConst.cs&amp;lt;/code&amp;gt; (currently line 46) to say something like:&amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;Data Source=&amp;lt;hostname (usually your computer name)&amp;gt;\SQLEXPRESS&amp;lt;/code&amp;gt;&lt;br /&gt;
** To make things run smoothly the following changes might also be a good idea: In &amp;lt;code&amp;gt;Shared/PlasmaShared/GlobalConst.cs&amp;lt;/code&amp;gt; (currently line 137) replace the DefaultEngineOverride with whatever engine version is current. Comment out lines 190 and 238-298 of &amp;lt;code&amp;gt;Zero-K.info/AppCode/PlasmaServer.cs&amp;lt;/code&amp;gt; unless somebody can supply instructions on how to make the torrent errors go away.&lt;br /&gt;
&lt;br /&gt;
TODO: add download links for sample database tables here. Users and clans are probably easier to make yourself for most purposes. For now, if you need this ask Licho, Histidine, DeinFreund or Anarchid. Aquanim has sample tables for maps and Planetwars structures, if that is all that you need.&lt;br /&gt;
&lt;br /&gt;
=== Modifying The Database Structure ===&lt;br /&gt;
* Modify the appropriate files in ./ZkData/Ef/...  and elsewhere ( [https://github.com/ZeroK-RTS/Zero-K-Infrastructure/commit/61addee11e74b09dd5dd73e12d31a28030d84e81 this commit] should be a reasonable guide; don't worry about the migration files, they are created later )&lt;br /&gt;
* Open Tools &amp;gt; NuGet Package Manager &amp;gt; Package Manager Console&lt;br /&gt;
* At the top of the window which appears, there is a &amp;quot;Default project&amp;quot; dropdown box. Set this to ZkData.&lt;br /&gt;
* Type the command &amp;lt;code&amp;gt;Add-Migration [description-of-change-here]&amp;lt;/code&amp;gt; into the package manager console. This should create some migration files with your description and a timestamp in the name in the Migrations folder of ZkData.&lt;br /&gt;
* In some cases you may now need to manually edit the created migration files to set defaults and the like?&lt;br /&gt;
* Type the command &amp;lt;code&amp;gt;Update-Database&amp;lt;/code&amp;gt; into the package manager console. This should update the database structure.&lt;br /&gt;
* To revert a migration that has not yet been pushed to the main repository, run &amp;lt;code&amp;gt;Update-Database –TargetMigration: TheLastGoodMigration&amp;lt;/code&amp;gt; then delete your bad migration files.&lt;br /&gt;
&lt;br /&gt;
== Artwork ==&lt;br /&gt;
See [http://zero-k.info/Wiki/Development_Artwork Development Artwork] (outdated)&lt;br /&gt;
&lt;br /&gt;
== Missions ==&lt;br /&gt;
=== Campaign ===&lt;br /&gt;
Campaign planets/missions are defined in [//github.com/ZeroK-RTS/Chobby/tree/master/campaign/sample Chobby/campaign/sample]&lt;br /&gt;
&lt;br /&gt;
=== Standalone missions ===&lt;br /&gt;
See [[Mission Editor|Mission Editor start page]]&lt;br /&gt;
&lt;br /&gt;
== Updating PlanetWars for new round ==&lt;br /&gt;
:''TODO''&lt;br /&gt;
Changing faction:&lt;br /&gt;
* Faction ID, name, color in dbo.Faction&lt;br /&gt;
* Faction blurb &amp;lt;tt&amp;gt;Faction&amp;lt;Name&amp;gt;&amp;lt;/tt&amp;gt; on sitewiki&lt;br /&gt;
* Add/change icons if needed&lt;br /&gt;
** Site: img/factions/&amp;lt;name&amp;gt;.png&lt;br /&gt;
** Game: LuaUI/Configs/Factions&lt;br /&gt;
** Chobby: LuaMenu/Images/Factions&lt;br /&gt;
** Does chobby download them automatically? Presumably not&lt;br /&gt;
&lt;br /&gt;
Using [https://zero-k.info/PlanetwarsAdmin Planetwars admin interface]: Change to a different galaxy if desired, reset PW&lt;br /&gt;
&lt;br /&gt;
== Wiki ==&lt;br /&gt;
See [[Editing Help]]&lt;br /&gt;
&lt;br /&gt;
=== Unit pages ===&lt;br /&gt;
Part of each unit page is autogenerated by the [//github.com/ZeroK-RTS/SpringRTS-Tools/tree/master/unitguide Unit Guide tool], and uploaded by the [//github.com/ZeroK-RTS/Zero-K-Infrastructure/blob/master/Fixer/WikiPortingMW.cs Wiki bot].&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt;export_unit_templates.sh&amp;lt;/code&amp;gt; to generate wiki templates for each unit (see &amp;lt;code&amp;gt;export_unit_templates.lua&amp;lt;/code&amp;gt; for some configuration options), then have the bot read the generated text files and edit the unit pages accordingly (requires Visual Studio setup as detailed above). The text output can also be used to manually edit pages.&lt;br /&gt;
&lt;br /&gt;
Unit buildicons and radar icons should be uploaded by FTP to manual.zero-k.info (&amp;lt;code&amp;gt;zero-k.info/zkmanual/www/unitpics&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/icons&amp;lt;/code&amp;gt; respectively). Contact Licho or Histidine for login details.&lt;br /&gt;
&lt;br /&gt;
== itch.io builds ==&lt;br /&gt;
Instructions for updating the portable build on [https://itch.io/ itch.io]:&lt;br /&gt;
&lt;br /&gt;
* Download latest Zero-K portable from https://zerok.itch.io/zero-k, extract to a folder&lt;br /&gt;
* Download butler (see guide at https://itch.io/docs/butler/)&lt;br /&gt;
* Modify extracted portable folder so that its contents are the same as what the user will download&lt;br /&gt;
* Run butler with command: &amp;lt;code&amp;gt;butler push &amp;lt;portable folder&amp;gt; zerok/zero-k:portable&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Engine ==&lt;br /&gt;
See [https://springrts.com/wiki/Development:Getting_Started Spring Engine Development]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>HigherFlyer</name></author>
		
	</entry>
</feed>