Mingameversion 105 в mindustry что такое

Обновлено: 02.07.2024

Начните кампанию, перейдите на отправную точку и начните игру.

Сейчас будет объяснение интерфейса:

  • Выход в меню (три точки)
  • Сворачивание интерфейса (стрелка вверх или, если вы уже нажали вниз)
  • Список проектов
  • Пауза (желательно нажать) .
  • Удаление (молоток)
  • Продвинутые конвейеры
  • Копирование
  • Подтверждение строительства
  • Броня игрока и юнит (Если вы включили боеприпасы для юнитов, правая шкала будет для боеприпасов и станет цвета меди)

На интерфейсе закончили, приступаем к строительству!

У вас обычно будет ядро 'Осколок' (на некоторых картах будет готовое проставление меди)

Сначала, найдите рядом с собой медь, и постройте там бур (Выберете значок дрели, выберете первый бур и постройте на источнике меди.

Проведите конвейер к ядру. Поздравляем! Вы создали свою первую фабрику! Единственное что она даёт, это медь (Вам не кажется, что слишком много слов медь в странице?)

Постройте защиту, нажмите на дерево технологий и изучите медную стену выберите знак щита, и поставьте стены во всех проёмах рядом с ядром. Поставьте турели, нажмите первый значок в строительстве и выберите двойную турель, Найдите ЕЩЁ меди и теперь подсоедините его к турелям к внутренней стороне ядра рядом с стенами. Поставьте маршрутизатор от одного блока на стене, Ставьте за турелями маршрутизаторы, проведите линию от главного маршрутизатора к остальным. Повторите процедуру меди для свинца. Пока, улучшайте оборону и ставьте рассеиватели (на других локациях) заряжая их свинцом. Ждите и после достижения нужных ресурсов и изучения некоторых технологий отправляйтесь в ледяной лес.

Name Changes

Variable & Class name changes

ArtilleryTurret , BurstTurret , ChargeTurret :

  • Removed. Use ItemTurret or PowerTurret instead; all the functionality has been merged into the base classes.
  • bulletWidth -> width
  • bulletHeight -> height
  • bulletSprite -> sprite

TileEntity -> Building

TileEntity is now Building . Thus, the former TileEntity 's functions, as well as any function associated with it(containing or mentioning "entity") have been renamed, now they will refer to the TileEntity to "building", or "build". Tile.entity has been renamed to Tile.build , and all TileEntity instances (ex. RouterEntity , ConveyorEntity ) were renamed to end with a "Build" suffix (ex. RouterBuild , ConveyorBuild ), to name a few.

Many functions like draw() or placed() have moved from being declared in the Block to being so in Building . This means that these functions do not pass the Tile , as well as making block-specific behavior less complicated. Notably, update(Tile tile) has been moved to the Building and renamed (technically not true, but this detail can be ignored for porting) to updateTile() .

Array -> Seq

The arc.struct.Array has been renamed to arc.struct.Seq , which is a short form of Sequence .

  • It's more accurate. The data structure is not an array, it's a list like ArrayList .
  • It doesn't conflict with other classes named Array , such as those in Java's reflection API or Javascript's array.
  • It's shorter, which is nice.

mindustry.plugin.Plugin -> mindustry.mod.Plugin

The Plugin class has been moved into the mod package, as the old package only contained a single class anyway.

Removal of "on" prefix for Call methods

All remote invocation methods in Call have had their "on" prefix removed. For example:

  • onSnapshot -> snapshot
  • onSetRules -> setRules
  • onLabel -> label

New Player System

Now that players control units, they no longer exist as corporeal beings in the game - that is to say, they do not have health or weapons. Every action is performed by Unit s. There is no Mech class anymore, only UnitType .

6.0 Migration Guide

If you are a plugin or mod developer for 5.0, you may have noticed that your content no longer functions correctly in 6.0. This is due to numerous internal changes and additions, which will be documented here.

Variables and Constants

Variables and constants are essentially "containers" of values. Each one has a name and value. Mindustry has variables which can be set by the user and their code, and constants which are set only by the processor and cannot be changed by the user.

To find out the possible data or parameter types of a variable or constant, see the Glossary.

General Changes

Minimum Game Version

All mods must now specify minGameVersion with a value of "105" or above to be loaded. This is to ensure that outdated mods do not get loaded. Simply add minGameVersion: "131" to your mod.hjson file.

Mindustry Modding Guide
Modding documentation for Mindustry v104 (0cbd9a1fc)

Mindustry mods are simply directories of assests. There are many ways to use the modding API, depending on exactly what you want to do, and how far you're willing to go to do it.

You could just resprite existing game content, you can create new game content with the simpler Json API (which is the main focus of this documentation), you can add custom sounds (or reuse existing ones). It's possible to add maps to campaign mode, and add scripts to program special behavior into your mod, like custom effects.

To make mods all you really need is any computer with a text editor.

1.1 Directory Structure

Your project directory should look something like this:

    (required) metadata file for your mod,
  • content/* directories for game Content,
  • maps/ directory for Zone maps,
  • bundles/ directory for Bundles,
  • sounds/ directory for Sound files,
  • schematics/ directory for Schematic files,
  • scripts/ directory for Scripts,
  • sprites-override/ Sprites directory for overriding ingame content,
  • sprites/ Sprites directory for your content,

Every platform has a different user application data directory, and this is where your mods should be placed:

Note that your filenames should be lowercased and hyphen separated:

  • correct: my-custom-block.json
  • incorrect: My Custom Block.json

1.2 Hjson

1.3 mod.json

At the root of your project directory, you must have a mod.json which defines the basic metadata for your project. This file can also be (optionally) named mod.hjson to potentially help your text editor pick better syntax highlighting.

  • name will be used to reference to your mod, so name it carefully;
  • displayName this will be used as a display name for the UI, which you can use to add formatting to said name;
  • description of the mod will be rendered in the ingame mod manager, so keep it short and to the point;
  • dependencies is optional, if you want to know more about that, go to the dependencies section;
  • minGameVersion is the minimum build version of the game.

1.4 Content

At the root of your project directory you can have a content/ directory, and this is where all the Json/Hjson data goes. Inside of content/ you have subdirectories for the various kinds of content, these are the current common ones:

  • content/items/ for items, like copper and surge-alloy ;
  • content/blocks/ for blocks, like turrets and floors;
  • content/mechs/ for mechs, like tau and glaive ;
  • content/liquids/ for liquids, like water and slag ;
  • content/units/ for flying or ground units, like reaper and dagger ;
  • content/zones/ for zones, configuration of campaign maps.

Note that each one of these subdirectories needs a specific content type. The filenames of these files is important, because the stem name of your path (filename without the extension) is used to reference it.

Furthermore the files within theseb content/<content-type>/* directories may be arbitrarly nested into other sub-directories of any name, to help you organize them further, for example:

  • content/items/metals/iron.hjson , which would respectively create an item named iron .

The content of these files will tend to look something like this:

field type notes
type String Content type of this object.
name String Displayed name of content.
description String Displayed description of content.

Other fields included will be the fields of the type itself.

1.5 Types

Types have numerous fields, but the important one is type ; this is a special field used by the content parser, that changes which type your object is. A Router type can't be a Turret type, as they're just completely different.

Types extend each other, so if MissileBulletType extends BasicBulletType , you'll have access to all the fields of BasicBulletType inside of MissileBulletType like damage , lifetime and speed . Fields are case sensitive: hitSize =/= hitsize .

What you can expect a field to do is up to the specific type, some types do absolutely nothing with their fields, and work mostly as a base types will extend from. One such type is Block .

type can be refer to the actual type field of the object. A type may also refer to other things like float is a type so it means you can type 0.3 in a field.

Here you can see, the type of the top level object is Revenant , but the type of the bullet is BulletType so you can use MissileBulletType , because MissileBulletType extends BulletType .

1.6 Tech Tree

Much like type there exist another magical field known as research which can go at the root of any block object to put it in the techtree.

This would put your block after duo in the techtree, and to put it after your own mods block you would write your <block-name> , a mod name prefix is only required if you're using the content from another mod.

Research cost will be 40 + round(requirements ^ 1.25) * 6 rounded down to the nearest 10 , where requirements is the build cost of your block. (in otherwords you can't set requirements and research cost individually)

1.7 Sprites

All you need to make sprites, is an image editor that supports transparency (aka: not paint). Block sprites should be 32 * size , so a 2x2 block would require a 64x64 image. Images must be .jpg files with 32 bit depth.

Sprites can simply be dropped in the sprites/ subdirectory. The content parser will look through it recursively, so you can organize them how ever you feel.

Content is going to look for sprites relative to it's own name. content/blocks/my-hail.json has the name my-hail and similarly sprites/my-hail.jpg has the name my-hail , so it'll be used by this content.

Content may look for multiple sprites. my-hail could be a turret, and it could look for the suffix <name>-heat and what this means is it'll look for my-hail-heat .

Another thing to know about sprites is that some of them are modified by the game. Turrets specifically have a black border added to them, so you must account for that while making your sprites, leaving transparent space around turrets for example: Ripple

To override ingame content sprites, you can simply put them in sprites-override/ .

1.8 Sound

Custom sounds can be added through the modding system by dropping them in the sounds/ subdirectory. It doesn't matter where you put them. Two formats are needed:

  • .ogg required for Desktop/Android
  • .mp3 required for iOS

Just like any other assets, you reference them by the stem of your filenames, so pewpew.ogg and pewpew.mp3 can be referenced with pewpew from a field of type Sound .

Here's a list of built-in sounds:

  • artillery
  • back
  • bang
  • beam
  • bigshot
  • boom
  • break
  • build
  • buttonClick
  • click
  • conveyor
  • corexplode
  • door
  • drill
  • empty
  • explosionbig
  • explosion
  • fire
  • flame2
  • flame
  • laserbig
  • laser
  • machine
  • message
  • missile
  • pew
  • place
  • press
  • release
  • respawning
  • respawn
  • shootBig
  • shoot
  • shootSnap
  • shotgun
  • spark
  • splash
  • spray
  • thruster
  • unlock
  • wave
  • windowHide

1.9 Dependencies

You can add dependencies to your mod by simple adding other mods name in your mod.json :

The name of dependencies are lower-cased and spaces are replaced with - hyphens, for example Other MOD NamE becomes other-mod-name .

To reference the other mods assets, you must prefix the asset with the other mods name:

  • other-mod-name-not-copper would reference not-copper in other-mod-name
  • other-mod-name-angry-dagger would reference angry-dagger in other-mod-name
  • not-a-mod-angry-dagger would reference angry-dagger in not-a-mod

1.10 Bundles

An optional addition to your mod is called bundles. The main use of bundles are give translations of your content, but there's no reason you couldn't use them in English. These are plaintext files which go in the bundles/ subdirectory, and they should be named something like bundle_ru.properties (for Russian).

The contents of this file is very simple:

If you've read the first few sections of this guide, you'll spot it right away:

  • <content type>.<mod name>-<content name>.name
  • <content type>.<mod name>-<content name>.description
  • mod/content names are lowercased and hyphen separated.

List of content type:

List of filenames relative to languages:

  • English bundle.properties
  • Czech bundle_cs.properties
  • German bundle_de.properties
  • Spanish bundle_es.properties
  • Estonian bundle_et.properties
  • Basque bundle_eu.properties
  • French BE bundle_fr_BE.properties
  • French bundle_fr.properties
  • Bergabung bundle_in_ID.properties
  • Italian bundle_it.properties
  • Japanese bundle_ja.properties
  • Korean bundle_ko.properties
  • Dutch BE bundle_nl_BE.properties
  • Dutch bundle_nl.properties
  • Polish bundle_pl.properties
  • Portuguese BR bundle_pt_BR.properties
  • Portuguese bundle_pt.properties
  • Russian bundle_ru.properties
  • Danish bundle_sv.properties
  • Turkman bundle_tk.properties
  • Turkish bundle_tr.properties
  • Ukrainian bundle_uk_UA.properties
  • Chinese CN bundle_zh_CN.properties
  • Chinese TW bundle_zh_TW.properties

1.11 Markup

The text renderer uses a simple makeup language for coloring text.

  • erros/unknown colors will be silently ignored.
Built-in Colors

1.12 Schematic

Fields that require the type Schematic can either take a built-in loadout (see the Zone section) a base64 string, or the stem name of a .msch file in the schematics/ subdirectory.

As of now, the only purpose of schematics is to give a zone a loadout.

1.13 Scripts

Scripting in Mindustry is done with the Rhino JavaScript runtime. Scripts may be added to your mod by putting them in scripts/ . Using the built-in extendContent function, you can extend existing Java types from JS, using allowed classes which are injected into your namespace.

1.14 GitHub

Once you have a mod of some kind, you'll want to actually share it, and you may even want to work with other people on it, and to do that you can use GitHub. If you don't know what Git (or GitHub) is at all, then you should look into GitHub Desktop, otherwise simply use your favorite command line tool or text editor plugin.

All you need understand is how to open repositories on GitHub, stage and commit changes in your local repository, and push changes to the GitHub repository. Once your project is on GitHub, there are three ways to share it:

1.15 FAQ

  • time in game is calculated through ticks ;
  • ticks sometimes called frames , are assumed to be 60/1 second;
  • tilesize is 8 units internally;
  • to calculate range out of lifetime and speed you can do lifetime * speed = range ;
  • Abstract what is abstract ? all you need to know about abstract types, is this is a Java specific term, which means you cannot instantiate/initialize this specific type by itself. If you do so you'll probably get an "initialization exception" of some kind;
  • what is a NullPointerException ? This is an error message that indicates a field is null and shouldn't be null, meaning one of the required fields may be missing;
  • bleeding-edge what is bleeding-edge ? This is the developer version of Mindustry, specifically it's refering to the Github master branch. Changes on bleeding-edge usually make it into Mindustry in the next release.

1.16 Change Log

This is a log of changes done on the Mindustry Master branch that affected the modding API. The sections are ordered by date commited, and provide a description of what was changed, with a link to the diff on Github.

Mar 5

[ commit Tech tree balance ]

Feb 11

[ commit improved battery brightness display ]

Jan 24
Jan 23
Jan 22

[ commit added default ore flags for modded ores ]

  • added oreDefault , oreThreshold and oreScale to Floor ;
Jan 19

[ commit cleanup of scripts ]

Jan 14
  • added -spinner region to Separator ;
  • removed spinnerRadius , spinnerLength , spinnerThickness , color from Separator ;
Jan 08
Jan 07
  • added drawCell , drawItems and drawLight to Mech ;
Jan 04

[ commit merge remote-tracking branch 'origin/master' ]

Jan 03

[ commit use findAll to iterate through mod content ]

  • content/ support for organizing .hjson files into directories;
Dec 12

[ commit add liquid void block ]

Dec 09

[ commit Removed unnecessary unit types ]

  • changed unit types names:
    • Draug → MinerDrone ;
    • Spirit → RepairDrone ;
    • Phantom → BuilderDrone ;
    • [ Dagger Crawler Titan Fortress Eruptor ] → GroundUnit ;
    • [ Wraith Ghoul ] → FlyingUnit ;
    • Revenant → HoverUnit ;
    Dec 08

    [ commit Merge branches master and rhino-js-suffering ]

    • scripts/ sub-directory and Rhino JS runtime was added;
    • displayName can now be used as field name in mod.json
    Dec 04

    [ commit Added experimental server block syncing ]

    Nov 26

    [ commit Texture overrides / Potential mod texture binding optimizations ]

    • sprites-override/ subdirectory can now be used to override existing ingame sprites;
    Nov 22

    [ commit Switched to hjson extension ]

    Nov 22

    [ commit Added optional mod minimum game version ]

    • minGameVersion can now be used within mod.json ;
    Nov 20

    [ commit Better mod parsing ]

    • liquid/amount can now be used as a string for LiquidStack ;
    • item/amount can now be used as a string for ItemStack ;
    • mod.json now supports hjson;

    Processor Variables and Constants

    Constants also hold values, but cannot be changed. Each processor has these constants and variables built-in:

    Processor

    @this constant Building

    A Building Object that represents the processor itself. You can use this with sensor to find various properties about the processor.

    @thisx constant number

    The x coordinate of the processor.

    @thisy constant number

    The y coordinate of the processor.

    @ipt constant number

    The number of instructions executed per tick (60 ticks/second).

    • Micro Processor -> 2
    • Logic Processor -> 8
    • Hyper Processor -> 25
    @counter variable number

    A variable that represents the next line the processor will read code from, equivalent to %IP in x86. It can be changed like any other variable as another way to perform jumps.

    An (advanced) example of setting @counter to jump to a function, then jump back to the caller:

    Links

    @links constant number

    A constant that equals the number of buildings linked to the processor. It is changed by the processor when blocks are linked or unlinked.

    You can use this along with getlink to loop through all linked buildings, like so:

    constant Building

    This is really multiple constants, one for each building linked to the processor. They are removed or added whenever a building is unlinked or linked to the processor.

    buildingName represents the building's internal name, which you can find in the rest of the Wiki.

    n starts at 1 and increases with each building of that type that are linked. It's sort of like the n th building of a type.

    This can be a little hard to understand, so here are some examples:

    • The first Scatter linked to a processor: scatter1
    • The third Ripple linked: ripple3
    • The second Laser Drill linked: drill2
    • The eleventh Spore Press linked: press11

    You can also view each linked building's "constant name" over them when the processor is selected.


    @unit constant Unit

    A constant that represents the current bound unit. It only changes when the processor unbinds a unit, or binds another one. It can be accessed using Unit instructions such as ucontrol , ulocate , and uradar . Since it's a Unit Object, you can also use it with sensor .

    This presents a core part of unit control in mlog; only one unit can be bound at a time. However, you can reference this in a variable, like set unitReference @unit . That variable, though, can not be used to control the referenced unit. It can only be used to check against other units or to get information about it. Therefore, you can think of it as a "unit identity".

    Variables

    Creating and Changing Variables

    Variables are what their name suggests; a value that can be changed.

    For example, in this code: set myVariable 3 , the set instruction will create a variable named myVariable , and give it a value of 3 .

    Later on, this can change its value to 9 : set myVariable 9 .

    Notice how we used the same instruction for both creating and changing variables. This is because if a variable that it's changing does not already exist, an instruction will create it first. If you know Python, you'll probably have realized that it works in the same way.

    Another example is using sensor : sensor playerX playerUnit @x (or Sensor playerX = @x in playerUnit for the visual editor).

    Assuming that the player's position is 141, 20 , a variable named playerX will be created first, then assigned a value of 141 .

    However, we have another variable in the example called playerUnit . That variable is a parameter. A parameter is an input value to an instruction. In this case, we probably got playerUnit from the radar instruction. If a parameter is not provided or is invalid, the instruction will not execute.

    Data Types and Implicit Conversion

    The values in variables, of course, have different types that are specific to different sources and purposes, such as Unit for Units, number for any number, etc. You can find a list of all of them in the Glossary.

    Mindustry Logic also has this thing with variables called Implicit Conversion. That means that, if needed, it will convert a variable's value from one type to another.

    If an instruction is given a number , but it needs an Object , it will be converted to null . If an instruction needs a number , but is given an Object , it will be converted to 1 if the object isn't null , otherwise 0.

    • 53 -> null
    • null -> 0,
    • Object which is a Silicon Crucible -> 1

    The print instruction is the only instruction that requires a String as an input, so its rules are stated in its own part of the manual.

    Variable Naming

    Naming variables properly is an important skill to have when programming in general. It helps to make code easier to read and understand. Thus, that can make it easier for people to learn from or fix your code.

    Variable names can contain any typeable character. However, they cannot be purely numbers, since it will instead use the actual number.

    When naming variables, make sure they are descriptive yet short. They must describe the value they hold or their purpose. At the same time, they shouldn't be complete sentences or span the entire page, or be too short that they get confusing. You can use abbreviations, acronyms, or shorter terms to make them more concise.

    Everybody has their own specific styles and preferences, but try to learn from good examples of code in mlog and other languages, while at the same time staying close to the common style.

    Mindustry получает огромное обновление 6.0


    На этой неделе Mindustry сильно обновилась, добавив в игру 2019 года массу нового. Система управления юнитами была значительно обновлена, кампания была полностью переработана, появились новые блоки, турели и логическая система для вашей базы, а также новые карты и погодные эффекты для всех старых карт. Подробности об обновлении читайте здесь.

    Mindustry, впервые выпущенная в 2019 году, представляет собой хорошо принятый гибрид Tower Defense, RTS и Factory. Он довольно популярен: 97% положительных отзывов почти в 6000 обзорах Steam, и фанаты часто ссылаются на его постоянные крупные обновления функций в дополнение к его уже надежному базовому фундаменту.

    Самая дикая часть примечаний к патчу: «В будущем будет добавлено больше планет».

    2 World

    2.1 Block

    Block is the base type of all blocks in the game. All blocks have at least one sprite, which is picked relative to the blocks name.

    Fields for all objects that are blocks.

    2.2 Consumers

    This type is commonly used in block type with it's field consumes , it's a type that allows your block to consume something, and how this field works is up to the specific type extension you're using.

    field type notes
    item String shorthand for items
    items ConsumeItems consume a number of different items
    liquid ConsumeLiquid consume a single liquid
    power float or ConsumePower consume or buffer power
    powerBuffered float amount of power buffered

    2.3 Consume

    Abstract type which defines a type of resource that a block can consume.

    ConsumeItems

    Type to consume ItemStacks.

    field type
    items [ ItemStack ]

    ConsumeLiquid

    Type to consume a LiquidStack.

    ConsumePower

    Type to consume or buffer power.

    field type notes
    usage float The maximum amount of power which can be processed per tick. This might influence efficiency or load a buffer
    capacity float The maximum power capacity in power units.
    buffered boolean True if the module can store power.

    2.4 BlockStorage

    Type for blocks which may store a buffer of items or liquid.

    2.5 Environment

    Environmental blocks are blocks that must be placed from the editor, and they're the ones that will generally dictate how the game can or will be played. These blocks wont appear on a map unless you've built a map to support them.

    Floor

    Type used for floors themselves or extended to make ores and other things.

    Читайте также: