Mindustry README

The project's README from github.com/Anuken/Mindustry. As one markdown file: README.md.

Logo

Build Status Discord

The automation tower defense RTS, written in Java.

Trello Board
Wiki
Javadoc

Contributing

See CONTRIBUTING for general code style and PR guidelines.

If you are a first-time contributor looking for features to implement or bugs to fix, see the issues tagged with 'candidate' in the Mindustry-Suggestions repostiory.

Building

Bleeding-edge builds are generated automatically for every commit. You can see them here.

If you'd rather compile on your own, follow these instructions. First, make sure you have JDK 17 installed. Other JDK versions will not work. Open a terminal in the Mindustry directory and run the following commands:

Windows

Running: gradlew desktop:run
Building: gradlew desktop:dist
Sprite Packing: gradlew tools:pack

Linux/Mac OS

Running: ./gradlew desktop:run
Building: ./gradlew desktop:dist
Sprite Packing: ./gradlew tools:pack

Server

Server builds are bundled with each released build (in Releases). If you'd rather compile on your own, replace 'desktop' with 'server', e.g. gradlew server:dist.

Android

  1. Install the Android SDK here. Make sure you're downloading the "Command line tools only", as Android Studio is not required.
  2. In the unzipped Android SDK folder, find the cmdline-tools directory. Then create a folder inside of it called latest and put all of its contents into the newly created folder.
  3. In the same directory run the command sdkmanager --licenses (or ./sdkmanager --licenses if on linux/mac)
  4. Set the ANDROID_HOME environment variable to point to your unzipped Android SDK directory.
  5. Enable developer mode on your device/emulator. If you are on testing on a phone you can follow these instructions, otherwise you need to google how to enable your emulator's developer mode specifically.
  6. Run gradlew android:assembleDebug (or ./gradlew if on linux/mac). This will create an unsigned APK in android/build/outputs/apk.

To debug the application on a connected device/emulator, run gradlew android:installDebug android:run.

Troubleshooting

Permission Denied

If the terminal returns Permission denied or Command not found on Mac/Linux, run chmod +x ./gradlew before running ./gradlew. This is a one-time procedure.

Where is the mindustry.gen package?

As the name implies, mindustry.gen is generated at build time based on other code. You will not find source code for this package in the repository, and it should not be edited by hand.

The following is a non-exhaustive list of the "source" of generated code in mindustry.gen:


Gradle may take up to several minutes to download files. Be patient.
After building, the output .JAR file should be in /desktop/build/libs/Mindustry.jar for desktop builds, and in /server/build/libs/server-release.jar for server builds.

Feature Requests

Post feature requests and feedback here.

Downloads

| | | |
|--- |--- |--- |--- |

Mindustry (Anuken/Mindustry)

Searching Database…

29.4K ·GitHub
这是什么?Mindustry 是一款用 Java 编写的自动化塔防即时战略游戏,把工厂建设和塔防战斗结合在了一起。
这是我真正能玩的游戏,还是用来开发游戏引擎/框架?它就是完整的游戏本身,不是 SDK 或模组工具包——这个仓库里放的是游戏的全部 Java 源代码。
编译 Android 版需要什么?只需要 Android SDK 命令行工具,不需要 Android Studio。把 ANDROIDHOME 指向 SDK,在设备上开启开发者模式,然后用 'gradlew android:assembleDebug' 就能生成一个未签名的 APK。
我自己编译有什么坑吗?有:只支持 JDK 17;Linux/Mac 上首次运行 Gradle 前可能需要先执行 'chmod +x ./gradlew',而且第一次运行要下载文件,可能要等几分钟;另外 mindustry.gen 包是自动生成的代码,千万不要手动修改。
它能在哪些平台上运行?桌面上支持 Windows、Linux 和 macOS,移动端支持 Android,还有专用服务器版本。这个项目是明确的多平台项目。
我能为它搭建专用服务器吗?可以——每个版本都附带现成的服务器构建,你也可以用 'gradlew server:dist' 自己打包,生成的是 server-release.jar。
mindustry.gen 包是什么?这是构建时自动生成的代码:Call 和 Packet 类来自标注了 @Remote 的方法,实体由组件类组装而成,音效、图标和贴图则从资源文件生成。仓库里没有它的源码,也不能手动编辑。
我必须自己编译吗,还是能直接下载?不需要自己编译:官方会发布正式版下载,而且每次提交代码后都会自动生成最新的开发版构建。如果你想自己编译,桌面版的 jar 会生成在 desktop/build/libs/Mindustry.jar。
Creator
Anuken
Size
1.9 GB
Stars
29.4K
Age
9y
Commits · 90 Days