Arthur van der Staaij a7afc0718c Unit swapping (#4049)
* Added an icon for unit swapping

* Implemented unit swapping

In the original Civ V, unit swapping is a supported mechanic.
If you try to move a unit to a tile with another of your units, and both
units have enough movement points left to reach the other's tile, they
will swap places. They will consume only the movement points needed to
reach the other's tile in this way.

This change implements unit swapping for Unciv.

To prevent all kinds of problems from arising with automatic unit
movement, unit swapping can only be done explicitly. This also means
that it can only be done if the unit-swap movement is possible in a
single turn. It is however not limited to adjacent units.

Because Unciv supports mobile devices, there is in general no separation
between a unit-selection click and a movement click. Clicking on another
unit while a unit is selected simply selects that other unit. Because we
do not want to make it more difficult to select other units in this way,
unit swapping is implemented as a separate "movement mode": to toggle
this mode on or off, the new unit action "Swap units" must be used.
Newly selected units still always start in the normal movement mode.

In the unit-swap movement mode, the possible swap tiles are highlighted
instead of the possible movement and attack tiles. Clicking on a
highlighted tile will display a swap button, similar to the movement
button, or instantly perform the swap if single-click-movement is
enabled. This new behavior overrides the selection of the unit on the
target tile: if the user wants to select the unit instead, they have to
exit the unit-swapping mode first.

The swapping code is robust, it can even handle swaps that involve a
paradrop!

An option to always swap-move when an eligible tile is clicked instead
of requiring the unit-swapping mode, similar to the existing
single-click-movement option, could perhaps be added in later.

* Added some comments to existing movement functions

* Fixed a silly mistake

Fixed a silly mistake which caused the unit-swapping eligibility
detection to sometimes remove units from the world.

* Removed some unneeded code

* Fixed movement buttons not showing with world wrap

Fixed a bug where the "move here" and "swap with" buttons would only
show on the leftmost copy of the world when world wrap was enabled.

* Made the swap action only display if usable

Made the unit swapping button only display if there is at least one
possible swap movement.
2021-06-06 22:56:25 +03:00

Unciv - FOSS Civ V for Android+Desktop

Google Play F-Droid itch.io Flathub

Travis CI w/ Logo Build and deploy Discord Chat

What is this?

An open-source, mod-friendly Android+Desktop remake of Civ V, made with LibGDX

Is this any good?

Depends what you're looking for. If you're in the market for high-res graphics, amazing soundtracks, animations etc, I highly recommend Firaxis's Civ-V-like game, "Civilization V".

If you want a small, fast, moddable, FOSS, in-depth 4X that can still run on a potato, you've come to the right place :)

What's the roadmap?

Is this order:

  • Polish! As you may have noticed, Unciv is fully functional but rough around the edges. This means:
    • UI+UX improvements (suggestions welcome!)
    • Better automation, AI etc. in-game
  • Development and distribution cycle - Done! (tests, f-droid/Google Play/itch.io deployment)
  • Missing features from Vanilla - Natural wonders , city-state quests, missing civs etc. - mostly done!
  • G&K mechanics - religion, faith etc.
  • BNW mechanics - trade routes etc.

Contributing

How can I help?

Programmers start here!

Translators start here!

Modders start here!

You can join us in any of the open issue, or work on improving anything you want - once you're finished, issue a pull request and it'll go into the next version!

If not, you can help by spreading the word - vote for Unciv where you can, mention it on Reddit or Twitter etc, and help us with new ideas of how to get the word out!

FAQ

Will you implement {feature}?

If it's in the original Civ V, then yes!

There's a lot left to implement, so it's hard to give an estimation of when exactly each feature will be added, but we're constantly improving!

If not, then the feature won't be added until we've finished all the features from the original Civ - as mentioned, this will take a while!

Please add {Civilization}

THE most common request, hands down. Everyone wants their favorite Civ in the game, I get that. But there are so many other things to work on - automations, AI, UI, graphics, bugs, and of course other features from the original game that are currently missing. Eventually we'll have them all, but the key word is "eventually".

In the meantime, you can mod it yourself!

Will you implement Civ VI?

Considering how long it took to get this far, no.

World wrap?

I've tried this with no success, if you figure out how to do this well PR it :)

Is there a desktop version?

Yes! Windows and Linux versions are available at itch.io, and if you're using the Itch app, your game will stay up-to-date - and we release pretty frequently so that's an issue ;)

If you have Java 8, and are familiar with the command line, there are (considerably smaller) JARs in Releases which you can run with java -jar Unciv.jar. This is also (currently) the only way to run the game on MacOS.

If you use Flatpaks, there's a Flatpak by MayeulC and you can know more about it here. Flathub link is available in the Downloads section.

If you want to build it from sratch for some reason, we have instructions for that as well

How about IOS?

I'm not planning on it.

It means paying money to Apple, yet another release path, and since I don't have an IOS device it means I can't test it properly.

How come this isn't working on my Raspberry Pi?

LibGDX doesn't work on Raspberry, and so neither does Unciv.

If you're really invested, I'd be thrilled if you could make it work - this seems to be possible, see https://github.com/chrishumphreys/LIbGDX-Pi for his detailed instructions

How can I learn to play? Where's the wiki?

All the tutorial information is available in-game at menu > civilopedia > tutorials

All the information is included in the amazing Civ V wiki

Since this is a Civ V clone, you can search Google for how to play Civ V and there are loads of answers =)

Alternatively, you could join us on Discord and ask there =D

This is a subject that I've heard a lot of hearsay on but no solid sources of law.

From what I gather, it is illegal:

  • To use the Civilization name
  • To impersonate the Civ games (so calling yourself civi|zation with a similar logo, for instance)
  • To use any assets from the original game (images, sound etc) - they belong to Firaxis

From what I understand, intellectual property rights apply to names, characters and settings. They do not apply to mechanics - as I'm sure you know, there are a billion Flappy Bird knockoffs

If anyone has any real legal sources, or can shed some light on the limits of what is and is not allowed, I'd be happy to hear!

Disclosure

Multiplayer takes advantage of Dropbox, which is non-free software, for syncing purposes.

Single player does not use this feature.

Downloads

Credits and 3rd parties

Languages
Kotlin 99.4%
OpenEdge ABL 0.5%