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]]'' | ||
− | 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 [//notepad-plus-plus.org/download/ Notepad++]. | + | 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++]. |
To test your changes: | To test your changes: | ||
− | + | * Create an empty file named 'devmode.txt' in the same directory as Zero-K.exe. | |
− | * Create an empty | ||
* Launch Zero-K.exe. | * Launch Zero-K.exe. | ||
[[File:enableDevMode.jpg]] | [[File:enableDevMode.jpg]] | ||
− | * Select 'Zero-K Dev' in Settings | + | * Select 'Zero-K Dev' in Settings -> Developer -> Singleplayer (you may need to scroll down). |
[[File:startTest.jpg]] | [[File:startTest.jpg]] | ||
− | * From the main menu select Singleplayer | + | * From the main menu select Singleplayer -> Skirmish -> Advanced -> Start to launch a test game. Note that the game type should be automatically set to 'Zero-K $VERSION'. |
* In the game, press F8 to open debug console. It'll display errors and output to the log. | * In the game, press F8 to open debug console. It'll display errors and output to the log. | ||
− | To | + | To submit your changes: |
− | * | + | * Commit your changes by right clicking on 'zk.sdd' and selecting 'Git Commit'. |
− | * | + | * Write a description of the changes and click 'Commit'. |
− | * Set the | + | * Right click on 'zk.sdd' and select TortiseGit -> Push. |
− | * | + | * Enter your GitHub login and password when prompted. The changes should now appear on your fork in GitHub. |
− | + | * Navigate to https://github.com/ZeroK-RTS/Zero-K/pulls and click "New Pull Request". | |
+ | * Click "compare across forks" to make your fork visible. | ||
+ | * Set the head repository to be your fork. | ||
+ | * Write a title and description, then create the pull request. | ||
+ | This creates a proposal to apply your changes to the main game. Be sure to check up on it and respond to comments. | ||
− | == Modifying | + | == Modifying lobby menu == |
Follow the instructions in 'Getting sources' with the following adjustments: | Follow the instructions in 'Getting sources' with the following adjustments: | ||
* The repository that you want to edit is https://github.com/ZeroK-RTS/Chobby. | * The repository that you want to edit is https://github.com/ZeroK-RTS/Chobby. | ||
Line 102: | Line 83: | ||
To test your changes launch Zero-K.exe with the <tt>dev</tt> arg (i.e. <code>Zero-K.exe dev</code>). On windows this is best done by creating a shortcut and changing the target, as shown below. | To test your changes launch Zero-K.exe with the <tt>dev</tt> arg (i.e. <code>Zero-K.exe dev</code>). On windows this is best done by creating a shortcut and changing the target, as shown below. | ||
[[File:targetZK.jpg]] | [[File:targetZK.jpg]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Zero-K.exe launch flags == | == Zero-K.exe launch flags == | ||
Line 133: | Line 90: | ||
== 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 101: | ||
=== 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 202: | Line 132: | ||
== Wiki == | == Wiki == | ||
See [[Editing Help]] | See [[Editing Help]] | ||
− | |||
− | |||
− | |||
=== Unit pages === | === Unit pages === | ||
Line 223: | Line 150: | ||
== 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]] |