Commit Graph

6662 Commits

Author SHA1 Message Date
Yair Morgenstern
0e9e4dc279
Translations update (#6102)
* Update Dutch translation (#6100)

* Update Dutch.properties

* Update Dutch.properties

* Taalfout verbeterd

* Taalfouten verbeterd

* Meer taalverbeteringen

* Laatste taalverbetering

* Update German translation (#6098)

Co-authored-by: Blubvis725 <62372520+Blubvis725@users.noreply.github.com>
Co-authored-by: MartinP <77325495+Mape6@users.noreply.github.com>
2022-02-03 10:26:50 +02:00
Xander Lenstra
6a12db23e1
Fixed a bug where stats from uniques would exponentially grow (#6101) 2022-02-03 07:32:48 +02:00
Yair Morgenstern
f217ce7055 Added check for deprecated uniques referencing other deprecated uniques (can happen if we replace uniques in quick succession and we forget to modify the older deprecated unique when we introduce the new one) 2022-02-02 11:25:35 +02:00
Yair Morgenstern
483a8eab1a Added test to ensure that deprecation texts are accurate to existing uniquetypes and conditionals
Tested that this does indeed break if you add a random space :)
2022-02-02 11:21:02 +02:00
Yair Morgenstern
57ada6aa27 Separated single unique check to a different function, so we can use it individually 2022-02-02 11:11:14 +02:00
Yair Morgenstern
9696fa59f5
Added unique to convert terrain to other terrain if adjacent to something (#6094)
* Added unique to convert terrain to other terrain if adjacent to something

Terrain converting to other terrain when adjacent to rivers was using hardcoded stuff, so I un-hardcoded it
I thought I could use this to replace the 'coast' hardcoding, and if it wasn't for the maxCoastExtension then I could.
Modders CAN therefore add their own coast (Lava tiles and Ash tiles I dunno) but it will only be for directly close terrains.
This enables Deciv Redux to spawn huge maps.

* Also for Vanilla, which apparently had a different number of tabs than G&K for no apparent reason.

* Apparently terrain name wasn't a uniquetype yet

(cherry picked from commit 593fc257b5)
2022-02-02 00:59:37 -08:00
Yair Morgenstern
423a83275b Lower-case "deprecated as of" to look nicer to users 2022-02-02 10:49:54 +02:00
Yair Morgenstern
fe14918545 Turned 'getDeprecationAnnotation' and 'getReplacementText' to functions for reusability 2022-02-02 10:48:26 +02:00
Xander Lenstra
ff2fc02961
Fixed a bug where open borders, war delcarations and cities could not be traded (#6097) 2022-02-02 07:23:11 +02:00
Yair Morgenstern
3c30a5697f Greatly reduced game loading times and new game screen thinking time by removing misspelling checks always except for options menu 2022-02-01 22:05:49 +02:00
Yair Morgenstern
593fc257b5 Apparently terrain name wasn't a uniquetype yet 2022-02-01 17:22:08 +02:00
Yair Morgenstern
18a86bf472 Don't generate ice if it isn't in the ruleset 2022-02-01 17:18:58 +02:00
Yair Morgenstern
5b39b59a19 There were several places in getMatchingUniques where conditionals were checked multiple times - now they're all checked exactly once 2022-02-01 15:39:01 +02:00
Yair Morgenstern
5a01a319be Simplified CityInfo.getMatchingUniques 2022-02-01 15:32:07 +02:00
Yair Morgenstern
6d3eabde22 Code cleanup 2022-02-01 15:18:23 +02:00
Yair Morgenstern
b1df775217 Apparently the code already existed, the problem was that the uniquetype wasn't marked as such 2022-02-01 14:59:52 +02:00
Yair Morgenstern
2e9bc1604f "Must be next to [terrainFilter]" applicable for improvements, as requested 2022-02-01 14:58:07 +02:00
Yair Morgenstern
0ac2c932f6 Added ruleset warnings for empty ally and friend bonuses
We currently use the defaults, but we should phase that out
2022-02-01 14:51:54 +02:00
Yair Morgenstern
8c4bc2927c Code cleanup 2022-02-01 12:36:08 +02:00
Yair Morgenstern
3c2dda3ad4 Use empty lists and maps for objects with no uniques for less memory consumption 2022-02-01 12:26:53 +02:00
Yair Morgenstern
3908fbc9cf
Fixed memory- and time-intensive unit maintenance checks (#6092)
Get all civwide unit discount uniques once, and then filter them by-conditional only when checking each specific unit.
This saves a LOT of memory allocation and time.
A result of the investigation at #5919.
2022-02-01 12:14:46 +02:00
Yair Morgenstern
0a336b3d99
Summarized civ resources, which were getting accessed all the time, are now cached and updated together with the detailed civ resources. (#6093) 2022-02-01 12:14:37 +02:00
Yair Morgenstern
cf6dacdcbe Only update CIV viewable tiles if the UNIT'S viewable tiles actually changed!
This will save SO much time and memory!
2022-02-01 11:28:26 +02:00
Yair Morgenstern
4f421dc44f 3.19.4 2022-02-01 10:06:47 +02:00
Yair Morgenstern
c3d185cce8 Deprecated old uniques 2022-02-01 10:03:47 +02:00
Yair Morgenstern
78e8dba2b5
Translations update (#6091)
* Update Spanish.properties (#6082)

* Update Spanish.properties

the only thing i didn't translate were the names of the cities if you have any problem contact me on discord like: lostxxxxx

* Update Spanish.properties

problem solved

* Update Japanese translation (#6075)

* Update Japanese.properties

* Update Japanese.properties

* Update Italian.properties (#6074)

Co-authored-by: Hello200000 <98656089+Hello200000@users.noreply.github.com>
Co-authored-by: yuracla <89312848+yuracla@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
2022-02-01 09:53:22 +02:00
Xander Lenstra
6bc41a627c
Typed all healing uniques (#6087)
* Typed all healing uniques

* Fixed tests by replacing placeholder texts by types in BeliefAutomation
2022-02-01 09:43:37 +02:00
Xander Lenstra
0951e5d6fd
Fixed a bug where unit discounts would not work (#6081) 2022-02-01 09:43:25 +02:00
Yair Morgenstern
f6e22f60bf
Replace old uniques with *parameter-filled* new uniques! (#6077)
* Since we have the old unique typed, and the new replacement unique typed, we can show modders EXACTLY the new unique they'll need to have!
The final step of this process is having a 'replace old uniques' button which will automagically replace old uniques in a mod with the new versions. This will of course require some manual intervention since it's possible we added some parameters that didn't exist in the old one, but should work well for 95%+ of uniques.

* Also allow "[-amount]" replacements
Better replacements - "[+amount]" etc - where relevant

* Fixed misadded + in unique
2022-02-01 09:42:52 +02:00
SpacedOutChicken
d11fe43d2b
Fix art for farms on hills (#6080)
* Fix art for farms on hills

This makes hills with farms on them change appearance.

* Refine fix for farms on hills
2022-02-01 09:42:41 +02:00
Yair Morgenstern
9674ddf04e
Caught more mod failure conditions, removed certain assumptions from map creation (#6076)
* Caught more mod failure conditions, removed certain assumptions from map creation

* Military unit in Era can be "Era Specific Unit"

* Resolved #6078 - even more ruleset assumptions removed :)

* We now catch missing military units from the difficulties as well, as well as missing settler and worker units from eras
2022-02-01 09:42:25 +02:00
Xander Lenstra
499b5e5b2f
Possibly fixed a crash accessing gameInfo before it is initialized (#6062)
* Possibly fixed a crash accessing gameInfo before it is initialized

* Inlined an otherwise unused variable

* Alternative version using an extra constructor instead of weird getters/setters
2022-02-01 09:41:57 +02:00
Yair Morgenstern
16855f66f6
Gradle build tools upgrade (#6085)
* Gradle build tools upgrade
Apparently the magic is rewriting a specific line in the Android build file and downloading Android SDK 30.0.3

* Added wiki change, isn't that nice :)
2022-01-31 15:05:42 +02:00
Yair Morgenstern
45e96b948a
Gradle build tools upgrade (#6084)
Upgrading to 7.1 gives us the fun java.lang.NoSuchMethodError: 'void org.apache.commons.compress.archivers.zip.ZipFile.<init>(java.nio.channels.SeekableByteChannel) error so let's not
2022-01-31 14:27:30 +02:00
Yair Morgenstern
10bb4c244f
This is to test the build process with the new Gradle (#6083) 2022-01-31 12:35:01 +02:00
Yair Morgenstern
0f4449f2e9 3.19.3 2022-01-29 23:40:43 +02:00
Yair Morgenstern
fc5dd86007
Translations update (#6073)
* Update Ukrainian.properties (#6068)

* Update Czech.properties  (#6060)

* Update Czech.properties

many new strings trsanslated

* Update Czech.properties

- fixed accidental typos

* Update German translation (#6059)

* Update Italian.properties (#6056)

Co-authored-by: StepanIvasyn <57094070+StepanIvasyn@users.noreply.github.com>
Co-authored-by: stoupa007 <60326342+stoupa007@users.noreply.github.com>
Co-authored-by: MartinP <77325495+Mape6@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
2022-01-29 23:32:22 +02:00
Yair Morgenstern
461385fff6
Current map generation is extremely dependant on specific terrains existing in the ruleset. (#6067)
* Current map generation is extremely dependant on specific terrains existing in the ruleset.
This attempts to eliminate those dependencies.
All changes indicate areas where a crash occured before the change.

I still encounter problems in generateRegions when trying to generate a map with no water tiles - @SimorCedar I think the splitRegion doesn't like the fact that there are land tiles on edges of the map?

* Split 'equal fertility' regions as close to the center as possible
Also, don't crash if no luxury resources are defined
2022-01-29 23:28:00 +02:00
Xander Lenstra
a237e7bf82
Typed all remaining uniques using CityInfo.GetMatchingUniques and removed that function (#6071)
* Typed all remaining uniques using CityInfo.GetMatchingUniques and removed that function

* Fixed two NullPtrExceptions

* Fixed syntax
2022-01-29 23:27:48 +02:00
Xander Lenstra
39483d78bd
Resources can now again provide uniques applying to the entire civ (#6072) 2022-01-29 18:37:53 +02:00
Xander Lenstra
599a09176d
Fixed a few rare mod-specific crashes (#6070) 2022-01-29 18:36:50 +02:00
Md. Touhidur Rahman
1b01ee3802
updated Caravel.png, resolves #5317 (#6069)
* updated Caravel.png, resolves #5317

* Update Credits.md
2022-01-29 18:36:05 +02:00
itanasi
6a98d8dd70
Minor logic cleanup (#6066)
Co-authored-by: temurakami <spellman23@gmail.com>
2022-01-28 09:56:10 +01:00
Yair Morgenstern
957d5b4008
Converted era parameter to a transient var (#6063)
The cost of casting getEra() constantly is definitely non-trivial, and why do we even generate the era every time? It only changes when we add a new tech! So we can save it as a transient in the civInfo.tech and be done with it!
2022-01-27 05:44:33 -08:00
Yair Morgenstern
7c478f4cd3 Don't run expensive canBePurchasedWithStat if you aren't going to buy the unit!!!
Also sped up the actual 'finding matching units' part so it's pretty invisible from a performance standpoint :)
2022-01-27 14:59:38 +02:00
Yair Morgenstern
2130cf20e0 Another small improvement, speeds up chooseNextConstruction by about 40%, but this wouldn't really be an issue if tileInfo.hasUnique was fast since that's the main time clog... 2022-01-27 14:50:44 +02:00
Yair Morgenstern
1732d951d2 The O(n^2) is noticable in the flame graphs, I kid you not 2022-01-27 14:00:10 +02:00
Xander Lenstra
cd05fe6ac8
Fixed a crash (#6057) (#6061) 2022-01-27 13:33:18 +02:00
Yair Morgenstern
b121563b99
Converted TileInfo.isCityCenter to use a transient var (#6058) 2022-01-27 00:57:38 -08:00
Yair Morgenstern
fbec7c836e Performance boost for GameInfo.setTransients - speeds up loadGame and nextTurn 2022-01-27 00:28:41 +02:00