Editing Zero-K:Developing
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 7: | Line 7: | ||
** Have responsibility for your changes/commit. Do not leave bugs that require other people to fix. | ** Have responsibility for your changes/commit. Do not leave bugs that require other people to fix. | ||
* "Readability & performance are equally important." | * "Readability & performance are equally important." | ||
− | ** Optimize code | + | ** Optimize code but not to the point of unreadability. [http://c2.com/cgi/wiki?RulesOfOptimization Remember the rules of optimization]: |
*** Don't. | *** Don't. | ||
*** Don't (yet). | *** Don't (yet). | ||
Line 28: | Line 28: | ||
** MapIconBuilder - unit map icon sources are here | ** MapIconBuilder - unit map icon sources are here | ||
* [https://github.com/ZeroK-RTS/Zero-K-Missions Zero-K-Missions] contains source files for official ZK missions | * [https://github.com/ZeroK-RTS/Zero-K-Missions Zero-K-Missions] contains source files for official ZK missions | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Getting sources == | == Getting sources == | ||
− | This is a guide to downloading Zero-K sources from [https://github.com/ GitHub] using [https://tortoisegit.org/ | + | This is a guide to downloading Zero-K sources from [https://github.com/ GitHub] using [https://tortoisegit.org/ TortiseGit]. The game sources are used as an example, however this method applies to other subprojects as well. |
− | * Install [https://tortoisegit.org/download/ | + | * Install [https://tortoisegit.org/download/ TortiseGit]. |
* Create a [https://github.com/ GitHub] account. | * Create a [https://github.com/ GitHub] account. | ||
[[File:ForkZK.jpg]] | [[File:ForkZK.jpg]] | ||
* Log in to GitHub and [https://github.com/ZeroK-RTS Locate] the repository you want to edit. | * Log in to GitHub and [https://github.com/ZeroK-RTS Locate] the repository you want to edit. | ||
* Click the "Fork" button on the GitHub website to create your own copy on GitHub. | * Click the "Fork" button on the GitHub website to create your own copy on GitHub. | ||
− | [[File: | + | [[File:cloneZK.jpg]] |
− | * Locate your fork on GitHub and click " | + | * Locate your fork on GitHub and click "Clone or Download". |
* Copy the web URL to your clipboard. | * Copy the web URL to your clipboard. | ||
[[File:localCloneZK.jpg]] | [[File:localCloneZK.jpg]] | ||
Line 67: | Line 48: | ||
* Wait for the sources to download. | * Wait for the sources to download. | ||
* Your 'zk.sdd' folder should look something like the image above. | * Your 'zk.sdd' folder should look something like the image above. | ||
− | |||
− | |||
− | |||
== Modifying the game == | == Modifying the game == | ||
:''For personal modding, see [[Mod Creation]]'' | :''For personal modding, see [[Mod Creation]]'' | ||
− | + | #Create a folder <code>games/zk.sdd</code> in the Zero-K installation folder. | |
− | + | #Clone to desktop [https://github.com/ZeroK-RTS/Zero-K Zero-K game] and save it to <code>zk.sdd/</code>. This folder should contain multiple files/folders, such as <code>modinfo.lua</code>. | |
− | To test | + | #To test source modifications, you'll need to enable developer mode. Do this by creating an empty text document "devmode.txt" in the same directory as Zero-K.exe. You may need to restart the lobby. |
− | + | #In the Settings menu a new tab appears: Developer. Edit the Singleplayer setting to be Zero-K Dev. | |
− | + | #Your skirmish games should now use your modified local copy of zk.sdd. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Press F8 to open debug console. It'll display errors and output to the log. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | == Modifying | + | == Modifying lobby menu == |
− | + | #Create a folder <code>games/chobby.sdd</code> in the Zero-K installation folder. | |
− | + | #Clone to desktop [https://github.com/ZeroK-RTS/Chobby Chobby] and save it to <code>chobby.sdd/</code>. This folder should contain multiple files/folders, such as <code>modinfo.lua</code>. | |
− | + | #Launch Zero-K.exe with the <tt>dev</tt> arg (i.e. <code>Zero-K.exe dev</code>) | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Zero-K.exe launch flags == | == Zero-K.exe launch flags == | ||
Line 133: | Line 70: | ||
== Modifying infrastructure/tools == | == Modifying infrastructure/tools == | ||
* Install [https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx Visual Studio Community edition] | * Install [https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx Visual Studio Community edition] | ||
− | * Install | + | * Install [http://www.microsoft.com/en-us/server-cloud/products/sql-server-editions/sql-server-express.aspx SQL Server express] |
− | |||
* Clone to desktop [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K infrastructure] | * Clone to desktop [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K infrastructure] | ||
* Test by opening Zero-K.sln in Visual Studio | * Test by opening Zero-K.sln in Visual Studio | ||
− | |||
=== Initializing Website Database === | === Initializing Website Database === | ||
− | You may need to setup the database connection for the website. In order to do that: Open Visual Studio, open the Server Explorer panel | + | You may need to setup the database connection for the website. In order to do that: Open Visual Studio, open the Server Explorer panel, right click Data Connections -> Add Connection -> Sql Server. Enter (localdb)\mssqllocaldb in the Server Name field, after which zero-k_local will appear in the dropdown list of databases. |
− | |||
− | |||
[[File:zk-database-setup.png]] | [[File:zk-database-setup.png]] | ||
Line 148: | Line 81: | ||
=== Debugging infrastructure === | === Debugging infrastructure === | ||
* To run a project right click it, choose "set as startup project" and hit F5 to run using debugger. | * To run a project right click it, choose "set as startup project" and hit F5 to run using debugger. | ||
− | * | + | * 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] |
* To run asp.net: | * To run asp.net: | ||
− | ** It's required that you install MS SQL | + | ** It's required that you install MS SQL Express on your local PC. Get one from [https://www.microsoft.com/en-us/download/confirmation.aspx?id=42299| here]. 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). During the installation leave all the parameters default except that I changed server name to SQLEXPRESS in one of the first steps of wizard. |
− | + | ** Right click asp.net -> properties -> web -> check "Specific Page" and leave it blank. Otherwise you get errors when trying to host locally. | |
− | + | ** 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 <code>ModeType.Local</code> in <code>GlobalConst.cs</code> to say something like:<br/><code>Data Source=<hostname (usually your computer name)>\SQLEXPRESS</code> | |
− | ** Right click asp.net | ||
− | ** 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 <code>ModeType.Local</code> in <code>GlobalConst.cs</code> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Artwork == | == Artwork == | ||
See [http://zero-k.info/Wiki/Development_Artwork Development Artwork] (outdated) | See [http://zero-k.info/Wiki/Development_Artwork Development Artwork] (outdated) | ||
− | |||
− | |||
== Missions == | == Missions == | ||
Line 203: | Line 113: | ||
See [[Editing Help]] | See [[Editing Help]] | ||
− | === | + | === Unit pages === |
− | + | 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]. | |
− | + | Run <code>export_unit_templates.sh</code> to generate wiki templates for each unit (see <code>export_unit_templates.lua</code> 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. | |
− | |||
− | Unit buildicons and radar icons | + | Unit buildicons and radar icons should be uploaded by FTP to manual.zero-k.info (<code>zero-k.info/zkmanual/www/unitpics</code> and <code>/icons</code> respectively). Contact Licho or Histidine for login details. |
== itch.io builds == | == itch.io builds == | ||
Line 221: | Line 130: | ||
== Engine == | == Engine == | ||
See [https://springrts.com/wiki/Development:Getting_Started Spring Engine Development] | See [https://springrts.com/wiki/Development:Getting_Started Spring Engine Development] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:Development]] | [[Category:Development]] |