mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-05 00:18:13 +07:00
Wiki improvements
This commit is contained in:
parent
7f9c6e01f7
commit
cb757da900
@ -1,7 +1,11 @@
|
||||
# Building Locally
|
||||
|
||||
This is a guide to editing, building, running and deploying Unciv from code
|
||||
|
||||
So first things first - the initial "No assumptions" setup to have Unciv run from-code on your computer!
|
||||
|
||||
## With Android Studio
|
||||
|
||||
* Install Android Studio - it's free and awesome! Be aware that it's a long download!
|
||||
* Install Git, it's the way for us to work together on this project. UI is optional, Android Studio has good Git tools built in :)
|
||||
* Getting the code
|
||||
@ -24,6 +28,41 @@ So first things first - the initial "No assumptions" setup to have Unciv run fro
|
||||
|
||||
Unciv uses Gradle to specify dependencies and how to run. In the background, the Gradle gnomes will be off fetching the packages (a one-time effort) and, once that's done, will build the project!
|
||||
|
||||
## Without Android Studio
|
||||
|
||||
If you also have JDK 11 installed, you can compile Unciv on your own by cloning (or downloading and unzipping) the project, opening a terminal in the Unciv folder and run the following commands:
|
||||
|
||||
### Windows
|
||||
|
||||
Running: `gradlew desktop:run`
|
||||
|
||||
Building: `gradlew desktop:dist`
|
||||
|
||||
### Linux/Mac OS
|
||||
|
||||
Running: `./gradlew desktop:run`
|
||||
|
||||
Building: `./gradlew desktop:dist`
|
||||
|
||||
If the terminal returns `Permission denied` or `Command not found` on Mac/Linux, run `chmod +x ./gradlew` first. *This is a one-time procedure.*
|
||||
|
||||
If you get an error that Android SDK folder wasn't found, firstly install it by doing in terminal:
|
||||
|
||||
`sudo apt update && sudo apt install android-sdk` (Debian, Ubuntu, Mint etc.)
|
||||
|
||||
After that you should put its folder to the file `local.properties` by adding this line:
|
||||
|
||||
`sdk.dir = /path/to/android/sdk` which can be `/usr/lib/android-sdk` or something other.
|
||||
|
||||
If during the first launch it throws an error that the JDK version is wrong try [this JDK installation](https://www.azul.com/downloads/zulu-community/?package=jdk).
|
||||
|
||||
Gradle may take up to several minutes to download files. Be patient.
|
||||
After building, the output .JAR file should be in /desktop/build/libs/Unciv.jar
|
||||
|
||||
For actual development, you'll probably need to download Android Studio and build it yourself - see Contributing :)
|
||||
|
||||
## Next steps
|
||||
|
||||
Congratulations! Unciv should now be running on your computer! Now we can start changing some code, and later we'll see how your changes make it into the main repository!
|
||||
|
||||
Now would be a good time to get to know the project in general at [the Project Structure overview!](Project-structure-and-major-classes.md)
|
@ -1,30 +0,0 @@
|
||||
If you also have JDK 11 installed, you can compile Unciv on your own by cloning (or downloading and unzipping) the project, opening a terminal in the Unciv folder and run the following commands:
|
||||
|
||||
### Windows
|
||||
|
||||
Running: `gradlew desktop:run`
|
||||
|
||||
Building: `gradlew desktop:dist`
|
||||
|
||||
### Linux/Mac OS
|
||||
|
||||
Running: `./gradlew desktop:run`
|
||||
|
||||
Building: `./gradlew desktop:dist`
|
||||
|
||||
If the terminal returns `Permission denied` or `Command not found` on Mac/Linux, run `chmod +x ./gradlew` first. *This is a one-time procedure.*
|
||||
|
||||
If you get an error that Android SDK folder wasn't found, firstly install it by doing in terminal:
|
||||
|
||||
`sudo apt update && sudo apt install android-sdk` (Debian, Ubuntu, Mint etc.)
|
||||
|
||||
After that you should put its folder to the file `local.properties` by adding this line:
|
||||
|
||||
`sdk.dir = /path/to/android/sdk` which can be `/usr/lib/android-sdk` or something other.
|
||||
|
||||
If during the first launch it throws an error that the JDK version is wrong try [this JDK installation](https://www.azul.com/downloads/zulu-community/?package=jdk).
|
||||
|
||||
Gradle may take up to several minutes to download files. Be patient.
|
||||
After building, the output .JAR file should be in /desktop/build/libs/Unciv.jar
|
||||
|
||||
For actual development, you'll probably need to download Android Studio and build it yourself - see Contributing :)
|
@ -14,7 +14,7 @@ I regret every minute that I spent writing events in Java, this is probably the
|
||||
|
||||
Unless you plan on creating images on the fly, you'll probably be using prerendered assets.
|
||||
|
||||
Placing them manually is akin to manually positioning html tags, instead of using html heirarchy and css to guide positions.
|
||||
Placing them manually is akin to manually positioning html tags, instead of using html hierarchy and css to guide positions.
|
||||
|
||||
So too is Scene2d - as a placement framework. it's relatively simple to understand, especially when you...
|
||||
|
||||
@ -33,7 +33,7 @@ The top-down CPU chart is the best code profiler I've ever seen, use it to your
|
||||
### Cache everything
|
||||
|
||||
Caching is a trade-off between purer, state-agnostic code and higher performance.
|
||||
Coming from a PC background, I automatically assume that anything less than O(n^2) is less than a milisecond and therefore, not a cachinhg candidate.
|
||||
Coming from a PC background, I automatically assume that anything less than O(n^2) is less than a millisecond and therefore, not a caching candidate.
|
||||
This is not so in mobile development.
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ One thing I did not expect to be such an issue is intermediate lists when sortin
|
||||
|
||||
But apparently, the memory allocation for these tasks is Serious Business.
|
||||
|
||||
So whenever possible, take your list and .asSequence() it before actiating list operations - this results in huge savings of both time and memory!
|
||||
So whenever possible, take your list and .asSequence() it before activating list operations - this results in huge savings of both time and memory!
|
||||
|
||||
The only time you shouldn't be doing this, though, is when you want to cache the specific values for future use -
|
||||
sequences will go through the whole process every time you iterate on them, so just .toList() them when you've gotten the final results!
|
||||
@ -67,7 +67,7 @@ Documentation is a big issue here, but so are detailed instructions - and I mean
|
||||
|
||||
Treat new developers as if they've never used Git before - it's possible they haven't!
|
||||
|
||||
Explain how to dowload the sourecode, the tools, how to get the game running locally, how to make changes and how to submit them.
|
||||
Explain how to download the sourecode, the tools, how to get the game running locally, how to make changes and how to submit them.
|
||||
|
||||
Same think with new players - getting the game up and running should be AS SIMPLE AS HUMANLY POSSIBLE - you want people to play your game, don't you?
|
||||
|
||||
@ -87,8 +87,8 @@ It was only after repeated urgings from players that I opened a Discord server -
|
||||
|
||||
You see, it's not ABOUT programmer-to-player interaction. There will always be a small number of core devs relative to the large playerbase.
|
||||
|
||||
The key to the community is the player-to-player interaction. Explaining things, questions, ideas, things that players bounc off each other,
|
||||
not only make the amorphous community a better pllace, but actually lead to a better game!
|
||||
The key to the community is the player-to-player interaction. Explaining things, questions, ideas, things that players bounce off each other,
|
||||
not only make the amorphous community a better place, but actually lead to a better game!
|
||||
|
||||
Another think to remember is that there's a larger community around you - the Open Source community, the Linux community, etc.
|
||||
|
||||
@ -103,15 +103,15 @@ For example...
|
||||
|
||||
## Everything is marketing.
|
||||
|
||||
Your game's name, the icon, screenshots, everythig a player sees about your game is marketing.
|
||||
Your game's name, the icon, screenshots, everything a player sees about your game is marketing.
|
||||
|
||||
Icons and bylines are especially important, since they're the first things your players will probably see.
|
||||
|
||||
I saw an almost 50% (!) by changing the icon, after seveeral experiments, which Google Play lets you conduct very easily.
|
||||
I saw an almost 50% (!) by changing the icon, after several experiments, which Google Play lets you conduct very easily.
|
||||
|
||||
## Translations are part of your source code
|
||||
|
||||
This may be slightly contraversial, so I'll explain.
|
||||
This may be slightly controversial, so I'll explain.
|
||||
|
||||
We went though a number of iterations regarding how to save translations until we arrived at the current format.
|
||||
|
||||
@ -120,7 +120,7 @@ The important parts are:
|
||||
- Game translation files should be AUTO GENERATED. This allows you to add new objects into the game with impunity,
|
||||
knowing that corresponding lines will be auto-added to the translations.
|
||||
|
||||
- Translations for each language should be stored separately - this allows concurrent modification of several independant languages with no risk of conflict
|
||||
- Translations for each language should be stored separately - this allows concurrent modification of several independent languages with no risk of conflict
|
||||
|
||||
- Translations should be PR'd in! This allows other speakers to question or change the proposed translations, and allows you to run tests on your translations.
|
||||
If you require a specific format, this is invaluable as it means that bad translations will be rejected at the door.
|
||||
@ -129,7 +129,7 @@ If you require a specific format, this is invaluable as it means that bad transl
|
||||
|
||||
TL;DR, consider using APIs that are free, even if they're not Open Source.
|
||||
|
||||
Multiplayer requires syncing game files beween clients, even when one of them is not currently online.
|
||||
Multiplayer requires syncing game files between clients, even when one of them is not currently online.
|
||||
|
||||
The 'correct' way to solve this would probably be to have an online DB and a service which handles user requests.
|
||||
|
||||
@ -141,7 +141,7 @@ Same thing with Mods. Steam is big and secure so it handles its mods itself.
|
||||
|
||||
We are small and open, so we just allow to download from Github, which lets us use all of Github's built in functions (user management, readmes, stars, versioning...) at no extra cost.
|
||||
|
||||
And unlike the Dropbox usage, which is basically abuse, Github is built for thiss kind of thing!
|
||||
And unlike the Dropbox usage, which is basically abuse, Github is built for this kind of thing!
|
||||
This is exactly the kind of use case they were thinking of to start with!
|
||||
|
||||
|
||||
@ -166,7 +166,9 @@ And then comes the moment when you ask yourself, why bother? What are we even do
|
||||
For me, the answers are as follows:
|
||||
|
||||
A. To build something truly great, you have to keep going way beyond when it stops being fun.
|
||||
|
||||
B. There's a community of people that like what you're doing and want there to be more of it :)
|
||||
|
||||
C. You know you want to keep coding, and what, you think you're going to start another project and it'll work out as well? You've tried that multiple times, and let's face it the chance of you making a second game that goes so well is really small unless you invest in it as much time as you have in this, and yeah, then you'll be back in this position again.
|
||||
|
||||
And that's basically the loop I've been in for the last hundred versions or so! Solve bugs, fix edge cases, improve AI, accept PRs. Lots of mod-related changes, both to stop the game breaking when people do things in mods that they shouldn't and to allow them more freedom in making them.
|
||||
@ -174,3 +176,4 @@ And that's basically the loop I've been in for the last hundred versions or so!
|
||||
I don't think I'll ever really continue to finish G&K, I'm DEFINITELY not planning on implementing BNW mechanics which frankly I think are...not great.
|
||||
|
||||
That's where I am right now. Kind of done with the game, but considering that I thought that half a year ago and releases are still releasing roughly every week, also kind of not.
|
||||
|
||||
|
@ -12,6 +12,6 @@ _(Sadly UnCiv dose not auto update when installing it using this method on macOS
|
||||
|
||||
## Installing from source
|
||||
|
||||
For instructions on how to install UnCiv from source see [Building locally without Android Studio](../Developers/Building-locally-without-Android-Studio.md). It is not recommended to use this method as it achieves the same result as the first method whilst being much more complicated and prone to errors along the way.
|
||||
For instructions on how to install UnCiv from source see [Building locally without Android Studio](../Developers/Building-Locally.md). It is not recommended to use this method as it achieves the same result as the first method whilst being much more complicated and prone to errors along the way.
|
||||
|
||||
_(Sadly UnCiv dose not auto update when installing it using this method on macOS so you will need to follow these steps every time you want to update the game.)_
|
||||
|
@ -1,6 +1,6 @@
|
||||
Welcome to the Unciv wiki!
|
||||
|
||||
If you're a developer, you'll probably want to start at the [Getting Started](Developers/Getting-Started.md) page!
|
||||
If you're a developer, you'll probably want to start at the [Getting Started](Developers/Building-Locally.md) page!
|
||||
|
||||
If you're a translator, head over to [Translating!](Other/Translating.md)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user