Commit Graph

6851 Commits

Author SHA1 Message Date
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
Yair Morgenstern
6a969b98f5 A few quick wins for performance 2022-01-26 23:49:21 +02:00
Yair Morgenstern
6855a52466 3.19.2 2022-01-26 22:55:30 +02:00
Xander Lenstra
47af1ff1c3
Removed a function that is no longer used and should not be used imo (#6055) 2022-01-26 22:46:36 +02:00
Yair Morgenstern
dddba4d969
Translations update (#6054)
* Update Indonesian.properties (#6048)

* Update German translation (#6037)

* Update German translation

* Update German translation

* Update German translation

* Update German translation

* Update Italian.properties (#6035)

Co-authored-by: kensvin <63847755+Kensvin28@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-26 22:42:19 +02:00
Yair Morgenstern
84ef8944d0
Stat bonus drilldown (#6053)
* Step 1 - converted stat bonus list to tree.
No visual difference yet, since the stat bonus list is still generated in the same way.

* Step 2 - updateStatPercentBonusList converted to tree form

* Step 3 - buildings converted to tree form - now user visible!

* Step 4 - Bonuses from uniques are now drilldownable

* Removed unneeded todo

* Welp, turns out I forgot to apply conditionals
2022-01-26 22:42:05 +02:00
will-ca
824efcb1a9
Try to fix potential typos in stock rulesets. (#6028)
* Make mod checker pass status message translatable.

* Try to fix some possibly broken Uniques.

Move comma.
2022-01-26 22:36:24 +02:00
Yair Morgenstern
dcb1be8e9b Welp, turns out I forgot to apply conditionals 2022-01-26 22:31:31 +02:00
Yair Morgenstern
a56874282b Converted RulesetObject unique checks to work against a map for efficiency 2022-01-26 21:10:46 +02:00
Yair Morgenstern
231963f050 Game can now handle improvements with no special stats from resources 2022-01-26 18:20:21 +02:00
Yair Morgenstern
b26d2fc6e7 Removed 'local city uniques' parameter that was being passed around
Due to changes since that was written, the cityInfo.getMatchingUniques has a default parameter of 'local uniques that are of the unique type', so not only was it making a mess, it was also inefficient!
2022-01-26 16:11:13 +02:00
ravignir
74cb3245a5
Update improved resource stats to fully match civ5 (#6038)
* Update improved resource stats to fully match civ5

* More fixes

* Update TileResources.json
2022-01-26 11:20:13 +01:00