Difference between revisions of "Developing"

From Zero-K
Jump to navigation Jump to search
(Update instructions (credit to CrazyEddie))
(Redirected page to Zero-K:Developing)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Before modifying source: =
+
#REDIRECT[[Zero-K:Developing]]
== ZK's Devving Philosophy (social rules) ==
 
* "War is anticommunication!"
 
** Communicate with other devs about your changes/fixes, let them understand the issue. Do not make 'random' changes.
 
* "Do not create work for other people."
 
** Have responsibility for your changes/commit. Do not leave bugs that require other people to fix.
 
* "Readability & performance are equally important."
 
** Optimize code but not to the point of unreadability. [http://c2.com/cgi/wiki?RulesOfOptimization Remember the rules of optimization]:
 
*** Don't.
 
*** Don't (yet).
 
*** Profile before doing it.
 
* "If it ain't broke, don't fix it."
 
** Don't code fixes that nobody wants to problems that don't exist.
 
 
 
== What is in source codes ==
 
* [https://github.com/ZeroK-RTS/Zero-K Zero-K] contains the game proper
 
** units folder contains unit definition files
 
*** you can read wiki about game development for [http://springrts.com/wiki/Main_Page spring engine]
 
* [https://github.com/ZeroK-RTS/Zero-K-Infrastructure Zero-K-Infrastructure]
 
** Zero-K.info: Website sources
 
** ZkLobbyServer: Lobby server (for MP)
 
** ZkData: Website/server database structure
 
* [https://github.com/ZeroK-RTS/Chobby Chobby] contains the lobby client
 
* [https://github.com/ZeroK-RTS/Zero-K-Artwork Zero-K-Artwork] contains sources for 2D art, 3D art and sounds
 
* [https://github.com/ZeroK-RTS/SpringRTS-Tools SpringRTS-tools] contains various dev tools
 
** Upspring - required to edit the .3do and .s3o model files used in the game
 
** 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
 
 
 
== Getting sources ==
 
* Get a [https://github.com/ GitHub] account and download [https://desktop.github.com/ Github for desktop] or [https://tortoisegit.org/ TortoiseGit]
 
* [https://github.com/ZeroK-RTS Locate] repository you want to edit and click "clone in desktop" button on website
 
* After you finish modifying sources click *Pull request* in Github for windows and submit your changes for review
 
 
 
== Modifying the game ==
 
== Getting sources ==
 
* Get a [https://github.com/ GitHub] account and download [https://desktop.github.com/ GitHub Desktop]
 
* [https://github.com/ZeroK-RTS Locate] the repository you want to edit and click the "Fork" button on the GitHub website to create your own copy on GitHub
 
* Locate your fork and click the "Clone or download -> Open in Desktop" button on the GitHub website to create a local repository on your computer
 
* Before you start modifying sources:
 
** Use GitHub Desktop to create a new branch in your repository for the specific changes you want to make; create the new branch from the master branch in the original ZeroK-RTS repository
 
* After you finish modifying sources:
 
** Use GitHub Desktop to commit your changes to your local repository
 
** Use GitHub Desktop to publish or sync your commits to your repository on GitHub
 
** Submit your changes for review: Use GitHub Desktop or the GitHub website to create a Pull Request from your new branch in your fork (the "head fork") into the master branch in the original ZeroK-RTS repository (the "base fork")
 
 
 
== Modifying the game ==
 
* Fork the [https://github.com/ZeroK-RTS/Zero-K Zero-K game] repository
 
* Locate the folder where you installed the game
 
** Example: C:\Users\<username>\Documents\My Games\Zero-K
 
** This folder will have subfolders such as games, engine, and maps
 
* Clone your repository into the games subfolder. GitHub Desktop will create a new subfolder under games.
 
** Example: C:\Users\<username>\Documents\My Games\Zero-K\games\Zero-K
 
* Rename the folder that GitHub Desktop created to zk.sdd
 
** Example: C:\Users\<username>\Documents\My Games\Zero-K\games\zk.sdd
 
** This folder will have subfolders such as LuaUI, units, and the .git folder.
 
** The zk.sdd folder contains the game source files you will modify.
 
* To test your modifications:
 
** Launch the game lobby (chobby.exe)
 
** Go to Settings -> Developer -> Singleplayer and change it to "Zero-K Dev"
 
** Start a new game: Singleplayer -> Skirmish
 
** The newly-started skirmish will use your modified source code
 
 
 
== Modifying infrastructure/tools ==
 
* Install [https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx Visual Studio Community edition]
 
* 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]
 
* Test by opening Zero-K.sln in Visual Studio
 
 
 
=== Debugging infrastructure ===
 
* 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:
 
** 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>
 
 
 
== Artwork ==
 
See [http://zero-k.info/Wiki/Development_Artwork Development Artwork] (outdated)
 
 
 
== Missions ==
 
See [[Mission Editor|Mission Editor start page]]
 
 
 
[[Category:Development]]
 

Latest revision as of 06:54, 27 April 2018

Redirect to: