Commit Graph

21848 Commits

Author SHA1 Message Date
5c51ce2e2f Removes old ARB state.matrix usages.
This was SVN commit r25285.
2021-04-17 23:08:55 +00:00
769b0426a7 Removes unused debug render from ShadowMap.
This was SVN commit r25284.
2021-04-17 22:16:01 +00:00
b7e6811ea6 Removes fixed shader technique from effects.
This was SVN commit r25283.
2021-04-17 22:07:18 +00:00
fd008e11ad Fix some translations.
- Idle builder hotkey 28bd4f0092.
- "Other hotkey"-catagory.
- Tooltipless hotkeys.

Patch by: @nwtour
Differential revision: https://code.wildfiregames.com/D3862
This was SVN commit r25282.
2021-04-17 07:47:30 +00:00
518fb7eafa Set a stack quota for JS scripts to prevent crashes from infinite loops.
Infinite loop will instead trigger JS exceptions, which will make error
reports much nicer.

Differential Revision: https://code.wildfiregames.com/D3851
This was SVN commit r25280.
2021-04-16 16:49:18 +00:00
89032c4d2b Improvements on 76acc4e146
See 76acc4e146. Follows comments by @vladislavbelov.

Differential Revision: https://code.wildfiregames.com/D3852
This was SVN commit r25279.
2021-04-16 16:04:01 +00:00
924c6ce34e Rework 7ee94f23df
Following comments by @vladislavbelov.

Differential Revision: https://code.wildfiregames.com/D3860
This was SVN commit r25278.
2021-04-16 16:01:30 +00:00
b3e3d1f715 Use a map for the weighted list.
Less object creations at addition time, more intuitive handling.

Differential revision: https://code.wildfiregames.com/D3854
Comments by: @Stan, @wraitii
This was SVN commit r25276.
2021-04-16 07:02:58 +00:00
4329dd90ce Rename Attacking.js-helper to Attack.js and its global to AttackHelper.
16b452cf91#inline-4026

Differential revision: https://code.wildfiregames.com/D3858
Comment by: @wraitii
This was SVN commit r25275.
2021-04-16 06:55:23 +00:00
3184a51787 Add stable to fortress random map.
Replaces a house by a stable.
Since c4eeb82d83 cavalry cannot be trained at the barracks anymore.

Patch by: @Nescio
Differential revision: D3691
This was SVN commit r25274.
2021-04-16 06:26:37 +00:00
2e69526e26 Correct Arthashshastra quotes.
Chanakya was the teacher and minister of Chandragupta Maurya, whereas
Kautilya is the author of the Arthashshastra. While the two are often
equated (out of ignorance or for ideological reasons), they are
different persons, and the first versions of the Arthashshastra were
composed only a few centuries after the Mauryas were gone. See
https://wildfiregames.com/forum/topic/27113-bibliography-and-references-about-ancient-times-book-reviews/?tab=comments#comment-402302
for a more detailed explanation.
This patch therefore:
- changes the author from Chanakya to Kautilya;
- lists the quotes at the correct location in the file (under K instead
of C);
- removes the chapter titles (which depend on the text edition or
translation) and give a more precise location, to make it easier for
people to look up.

For those interested, the Sanskrit is:
KAZ01.4.07 na-iti kauṭilyaḥ | 7 |
KAZ01.4.08 tīkṣṇa.daṇḍo hi bhūtānām udvejanīyo bhavati | 8 |
KAZ01.4.09 mṛdu.daṇḍaḥ paribhūyate | 9 |
KAZ01.4.10 yathā.arha.daṇḍaḥ pūjyate | 10 |
and:
KAZ01.19.01 rājānam utthitam anūttiṣṭhante bhṛtyāḥ | 1 |
KAZ01.19.02 pramādyantam anupramādyanti | 2 |

And the translations in Patrick Olivelle King, Governance, and Law in
Ancient India / Kauṭilya’s Arthaśāstra / A New Annotated Translation
(Oxford 2013) are on p. 69:
7 “No,” says Kauṭilya;
8 “for one who punishes severely terrifies the people,
9 and one who punishes lightly is treated with contempt,
10 whereas one who dispenses appropriate punishment is treated with
respect.
and on p. 92:
1 When the king is energetic, people in his service, in turn, become
energetic;
2 and when he is lethargic, they, in turn, become lethargic.

Patch (and description above) by: @Nescio
Differential revision: https://code.wildfiregames.com/D3598
This was SVN commit r25273.
2021-04-16 06:23:16 +00:00
4a51012442 Adds line drawing to DebugRenderer.
This was SVN commit r25271.
2021-04-15 22:51:25 +00:00
Angen
57e85c195e Fix wrongly placed parameter in 841bf5f2dd
Correctly colour url of invalid mod.

This was SVN commit r25270.
2021-04-15 20:21:47 +00:00
389a5a4379 Removes low-level GL calls from graphics and geometrics primitives and adds DebugRenderer.
Tested By: Freagarach
Differential Revision: https://code.wildfiregames.com/D3857
This was SVN commit r25269.
2021-04-15 18:07:01 +00:00
Angen
f1a1cf11d3 Check for replay compatibility when opening summary screen
Summary screen and mainly its statistics can be influenced by mod as
much as replay itself with mod removing or adding classes and trackers
to the game.
Summary screen allows to replay the match without checking
compatibility, that is fine I think if it is prevented to see summary of
incompatible replay in a first place.

Therefore this is adding compatibility check for opening summary of
replay.

Differential revision: D3799
Fixes: #6119
Tested by: @Langbart
This was SVN commit r25268.
2021-04-15 17:19:27 +00:00
Angen
894fc1dd5d Fix EstimateFuturePosition in UnitMotionFlying
Introduced in f737831167

Differential revision: D3855
Fixes: #6141

This was SVN commit r25267.
2021-04-15 17:15:40 +00:00
7ee94f23df Use type_identity to simplify Clamp usage.
Differential Revision: https://code.wildfiregames.com/D3859
This was SVN commit r25266.
2021-04-15 13:01:24 +00:00
b74ab54cf7 Fix translation of damage types.
Broken in d28a91b83d.
Due to not checking for `template_helpers` in the game's files.

Patch by: @nwtour
Differential revision: https://code.wildfiregames.com/D3850
This was SVN commit r25265.
2021-04-15 05:47:54 +00:00
079212fe46 Fix entities able to attack allied structures in rare cases (take 2).
Caused by not checking the attack type whilst performing an attack.

Fixes: #5511
Differential revision: D3845
Refs. #3484

This was SVN commit r25264.
2021-04-15 05:45:13 +00:00
092ccfec77 Removes unused header dependencies from CTimeManager.
This was SVN commit r25262.
2021-04-14 22:14:37 +00:00
715dca0701 Removes unused shadow settings forgotten in 12e2428495, removes direct SkipSubmit access.
This was SVN commit r25261.
2021-04-14 20:25:05 +00:00
f57ac432e8 Show correct cost/phase of template-variants in structree whilst maintaining correct build lists in viewer
("Variant" in this case means a template that is functionally the same
as its
base template - but is a different promotion level, requires a
technology to
unlock (that the base template doesn't), is an upgrade of its base, or
is a
trainable version.)

Should fix concern raised on b2842e8021.

Accepted by: Angen
Differential Revision: https://code.wildfiregames.com/D3347
This was SVN commit r25260.
2021-04-14 20:05:26 +00:00
63224865d5 Fix selection height for the apple, banana, date, fig, olive and palm trees. Use the biggest variation as reference. Forgotten in https://code.wildfiregames.com/24043 (Height was 10 initially)
Reported by: @nani
Fixes: #6075

This was SVN commit r25259.
2021-04-14 16:55:44 +00:00
43a780504a Delete "Compact RelaxNG" / .rnc files
(Follows 76acc4e146 where I deleted actor.rnc)

This deletes the .rnc validation files, upgrading the .rng files to
being the source of truth.

- The engine uses, via LibXML2, .rng files to validate XML schemas, to
the .rnc files are redundant.
- The RelaxNG "Compact" format is a DSL for the RelaxNG XML format. Its
syntax is unique, unlike .rng files which are XML.
- Some errors are likely - I'm not sure anyone has converted the compact
files in years.
- The tool to generate .rng from .rnc files is trang
(https://github.com/relaxng/jing-trang), which runs on the JVM and is
quite annoying to install compared to "your usual text editor".
- The JS components use the full .rng format in XML, so editing this
format is already familiar to most people that mod the game.

The .rnc files were added in 2c9939ac74 along the .rng files.

Refs #413, #245

Differential Revision: https://code.wildfiregames.com/D3824
This was SVN commit r25258.
2021-04-14 07:39:36 +00:00
fde66f5134 Fix 4 small gamesetup issues
- Random lanscape option now works properly.
- Non-host clients now see the game attributes correctly in the loading
screen, including in particular the map name.
- AI bots are again translated.
- 'Cheat' setting is persisted correctly in MP gamesetup.

Reported by: myself, Freagarach, nwtour
Differential Revision: https://code.wildfiregames.com/D3841
This was SVN commit r25257.
2021-04-14 07:30:26 +00:00
0308c2390a Rework the pathfinder path computation setup for threading.
Essentially reverts D1918 / d592bf9cb6.
Instead of copying path requests to workers, setup the result vector,
then setup an index, and compute 'in-place'.
To send messages, the result vectors are read in order. This makes the
order trivially constant no matter how many workers there are, and the
architecture overall makes it much easier to efficiently paralellise.

Tested by: Langbart, Stan
Differential Revision: https://code.wildfiregames.com/D3849
This was SVN commit r25256.
2021-04-14 07:23:47 +00:00
990265d974 Fixes warnings after minimap changes in b7db124cb5.
This was SVN commit r25254.
2021-04-13 23:16:46 +00:00
c8b2c09bc3 Fix --without-pch build. fc60d80af1 was missing an include.
Reported by: @vladislavbelov
This was SVN commit r25253.
2021-04-13 17:28:01 +00:00
1508031f09 Scale down turret icons so that they don't overflow.
Reported by: @nwtour
This was SVN commit r25252.
2021-04-13 17:15:34 +00:00
e36c8c3763 Destroy components in reverse order of construction.
Components have some initialisation-order dependency. They could also
have destroy-order dependency, and from a RAII-like point of view, it
makes sense to do this.

Differential Revision: https://code.wildfiregames.com/D3843
This was SVN commit r25251.
2021-04-13 13:47:59 +00:00
0a59489824 Use unique_ptr for secondary sim data.
Differential Revision: https://code.wildfiregames.com/D3842
This was SVN commit r25250.
2021-04-13 13:46:45 +00:00
67fe65e85b Fix mismatching range checks in finding a new target when gathering.
While gathering resources entities may be tasked to gather near a
position. The range check for that is 10 m. However, the relaxed range
check for the walking state is this.DefaultRelaxedMaxRange, which is 12
meter, currently. Meaning it would lead to a slow infinite loop.

Differential revision: D3839
Comments by: @wraitii
Tested by: @gameboy
(https://wildfiregames.com/forum/topic/38131-tutorial-bug/)

This was SVN commit r25249.
2021-04-13 06:48:13 +00:00
1b844606aa Implement mul_round in checkrefs.
Missed in 19f600cfa2. In use since 2078abdcc4.

This was SVN commit r25247.
2021-04-12 16:33:54 +00:00
5df6e688e2 Revert 189d00d811 - infinite loop in UnitAI when slaughtering.
Reverting to get some time to investigate.

Reported by: langbart
This was SVN commit r25246.
2021-04-12 16:16:57 +00:00
2078abdcc4 Fix issue with 37790e099c
Cost cannot be non-integer, and rounding issues happened.

Reported by: gameboy
This was SVN commit r25245.
2021-04-12 14:07:59 +00:00
6d5b710877 Fix undefined values in barter tooltip.
Patch by: nwtour
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3829
This was SVN commit r25244.
2021-04-12 13:51:02 +00:00
21645f5c1c Minor fixes after Gathering refactoring.
- `initPos` was used wrong.
- There were two `CanGather` functions in `cmpResourceGatherer`.
- Reduced some duplication in the ReturnResource order.

Differential revision: D3838.
This was SVN commit r25243.
2021-04-12 12:50:17 +00:00
189d00d811 Fix entities being able to attack allied structures in rare cases.
Caused by not checking the attack type while performing an attack.

Closes: #5511
Differential revision: D3840
References #3484

This was SVN commit r25242.
2021-04-12 12:41:35 +00:00
b7db124cb5 Crops minimap view bounds to map size.
Differential Revision: https://code.wildfiregames.com/D3837
This was SVN commit r25241.
2021-04-12 12:39:07 +00:00
e17cd7754e Split hotkeys of turrets.
Following 21e866fcf0.
Also support leaving a turret by using a hotkey.
Currently the hotkeys are by default bound to the same ones as
garrisoning.

Differential revision: D3773
Icons by: @wowgetoffyourcellphone and @Stan.
This was SVN commit r25240.
2021-04-12 12:31:29 +00:00
d0a0ed0b1c Mixins: deduplicate Athen-specific data.
Puts the athen-specific data in the mixin `civ/athen`. Deduplicates.

Differential Revision: https://code.wildfiregames.com/D3831
This was SVN commit r25239.
2021-04-12 11:30:38 +00:00
37790e099c Mixins: Remove the special mercenary technology, apply template changes directly.
Reviewed By: Freagarach
Differential Revision: https://code.wildfiregames.com/D3832
This was SVN commit r25238.
2021-04-12 11:28:18 +00:00
318a5d7a2b Improve Caratacos' portrait.
Patch by: @m7600
Refs: d8709f84f3

This was SVN commit r25237.
2021-04-12 09:13:34 +00:00
3097a7c302 Attack using cmpAttack instead of UnitAI.
Keep responsibilities separated, allow easier modding of attacking
behaviour.
Ideally the BuildingAI attacking routine would be merged in here as
well, but not done for now.

Part of #5810
Differential revision: D3816
Comments by: @smiley, @Stan
This was SVN commit r25235.
2021-04-12 06:51:39 +00:00
ea86790e4e Profile the Transform helper.
Differential revision: D3825
Comments by: @Stan, @wraitii
This was SVN commit r25234.
2021-04-12 06:23:30 +00:00
8acc3b049f Combine attack times in a single node.
Reduces duplication, allows all attack types to cause splash damage.
While at it, makes delay and minimal range optional (for obvious
defaults are available).

Split from D368, so basically a patch by @bb.

Note that it may seem like one can arbitrarily name an attack now, but
that is not true.

Differential revision: D2002
Comments by: @bb, @Nescio, @Stan, @wraitii
This was SVN commit r25233.
2021-04-12 06:17:13 +00:00
a6cb77a204 Disables depth test for GUI rendering.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D3835
This was SVN commit r25231.
2021-04-11 19:36:52 +00:00
e7159c01fb Fix 3759fc8a98
3759fc8a98 broke decals and particle emitters, as I misplaced the if
block.

Reported by: langbart
This was SVN commit r25230.
2021-04-11 19:04:56 +00:00
8eb4871c9b Draws GUI elements by Z order.
Tested By: wraitii
Differential Revision: https://code.wildfiregames.com/D3780
This was SVN commit r25229.
2021-04-11 11:27:53 +00:00
35ed55cfd6 ParamNode: switch to utf8, ToXML -> ToXMLString, test tweak, PCH tweak
This changes ParamNode to use UTF8 values internally (XMB files are UTF8
since cb9d0733ef).
This removes the need for a lot of conversions, speeding things up and
allows cleaning up the validator interface & a few other callsites.
ConstructJSVal could be a tad slower because of UTF8->16 conversions
within Spidermonkey; but the difference is unlikely to be noticeable in
practica.

Also:
- Changes `ToXML` to `ToXMLString` for clarity.
- Add a simple "op" test & show a particular behaviour of merge nodes
that I intend to change somewhat in D3830.
- Remove Component.h from simulation2 PCH - brought in too much.

Tested by: langbart
Differential Revision: https://code.wildfiregames.com/D3834
This was SVN commit r25228.
2021-04-11 09:23:10 +00:00