1
1
forked from 0ad/0ad
Commit Graph

638 Commits

Author SHA1 Message Date
b5b9c0f2ae Improve template code style for the Decay component.
This was SVN commit r16171.
2015-01-21 21:45:05 +00:00
852cd11305 Improve the performance of the GetLosVisibility function by using the cache (currently used for mirages only) whenever possible.
This was SVN commit r16166.
2015-01-20 16:29:50 +00:00
5cf2086a33 Fix the initial exploration of territories, which shouldn't be performed in Atlas.
Also clean up the code a bit.

Fixes #2969

This was SVN commit r16129.
2015-01-08 22:36:13 +00:00
f0d7346b8f Happy New Year! :D
This was SVN commit r16103.
2015-01-02 14:22:23 +00:00
8441a3f8d6 Fix compilation failure with GCC and C++98/03.
Local types shall not be used as a template argument. So move it
to a higher scope. This restriction was lifted in C++11, so we
might want to change this back when we switch to that.

This was SVN commit r16101.
2015-01-01 23:57:04 +00:00
a472944689 Clean up LoadPlayerSettings.
Include gaia to make iteration easier.
Add TemplateExists() to the TemplateLoader. Refs #2877.

This was SVN commit r16099.
2015-01-01 23:10:24 +00:00
8e30410109 Improve PickEntitiesAtPoint
First, do a ray intersection test with the bounding-sphere for all
entities on the map and then check the more detailed selection shape for
the remaining candidates. Do checks that require component lookups after
the ray intersection tests because these are relatively expensive.
The old method for figuring out which entities are below the mouse
cursor was incorrect because it does a 2D check to filter out the first
candidates which can lead to incorrect results with lower camera angles
and high buildings or buildings with a large footprint. Such problems
were avoided with quite a large radius for this 2D test and resulted in
a large number of candiate entities after this first test (200-500).
Also rename PickEntitiesAtPoint to PickEntityAtPoint and make it return
only one (the closest) match.

I've tested performance with the tracelogger by starting a map and then
moving the mouse in circles for one minute. The results were relatively
stable. I've compared the total time percentage of input.js:836, which
spends nearly all of the time in PickEntityAtPoint.
Ardennes Forest - Normal size:       Original: 41.46%    Patched: 31.6%
Ardennes Forest - Giant size:        Original: 40.59%    Patched: 51.55%

As we see, it's faster on normal map sizes but slower on giant maps with
a lot of entities.
This approach can be further improved with some kind of spatial
subdivision for the culling (like an octree), which would help the unit
renderer too. This way it should be possible to make it faster (and
still correct) on all map sizes and with a large total numbers of
entities.

This was SVN commit r16098.
2015-01-01 23:05:26 +00:00
9329506e0d add support for civ specific player template, see #2877
This was SVN commit r16092.
2014-12-31 09:31:41 +00:00
8f387e0044 Remove code duplication and some cleanup.
This was SVN commit r16088.
2014-12-30 18:21:02 +00:00
2ef3c0c42e Compute the actual percentage of map explored by the team in the summary screen.
Fixes #2587.

This was SVN commit r16071.
2014-12-26 19:13:40 +00:00
1e17cbe33c Use the range manager to pick entities when drawing a selection box during a game. This allows for a significant performance improvement.
Fixes #2961, patch by @aBothe.

This was SVN commit r16068.
2014-12-26 13:07:49 +00:00
49187dd990 Drop support for AIs that are not using modules.
This was SVN commit r16061.
2014-12-23 01:20:50 +00:00
d21cf8f3aa Clarify some comments.
This was SVN commit r16060.
2014-12-23 00:46:00 +00:00
ce0c1e4302 Report names of components or interfaces in case of error when registering those.
This was SVN commit r16059.
2014-12-23 00:29:14 +00:00
71ba68e3a3 Fix performance problem with unnecessary global message subscription
On my ESR31 branch, I've made two measurements with different replays
(both around 15000 turns).
In the first, I got around 3% performance improvement and in the second
about 7.5%. It mainly depends on how often aura changes related to the
female citizen aura happen.

This was SVN commit r16055.
2014-12-21 01:44:00 +00:00
fd93e4ae74 Remove testing of some special templates. We need to find a good way to generate template subsets, refs #2951.
This fixes the tests fail introduced in b05879e151.

This was SVN commit r16033.
2014-12-09 23:20:31 +00:00
f80adad667 Fixes some inconsistent line endings and EOL-related SVN properties.
This was SVN commit r16024.
2014-12-06 12:11:42 +00:00
b05879e151 Move template items GetRetainInFog and AlwaysVisible from Vision to Visibility.
Refs #2913

This was SVN commit r16022.
2014-12-05 18:33:59 +00:00
1430efa9d6 Properly handle auto-research promotion techs at game start.
This was SVN commit r16009.
2014-11-25 22:47:02 +00:00
3589aa39b9 Update documentation on how to generate the entity component documentation.
This was SVN commit r15987.
2014-11-18 03:57:21 +00:00
9407dbe45e Remove useless parameter from CFG_GET_VALUE.
This was SVN commit r15984.
2014-11-17 23:29:49 +00:00
f88ee2766e use by default a random seed for the AI to make it less repetitive
This was SVN commit r15973.
2014-11-16 19:53:29 +00:00
fc1fe174cd Amend the "Reveal All" behavior by always hiding mirages.
This was SVN commit r15966.
2014-11-14 20:29:35 +00:00
49a31c5de2 prevent events from the first turn after deserialization to be thrown away
This was SVN commit r15962.
2014-11-13 20:21:00 +00:00
c813a11427 Split ScriptRuntime and ScriptInterface code to separate files.
The runtime is becoming more and more important in the JSAPI. As a
result, we also have more functionality on the runtime level and having
the whole ScriptRuntime class hidden in ScriptInterface.cpp doesn't make
sense anymore. ScriptInterface.cpp also has become quite a large file
and pulling out the runtime part makes it a bit smaller.

Refs #2462

This was SVN commit r15961.
2014-11-13 11:19:28 +00:00
8e2d514228 Exact stack rooting for CParamNode
Refs #2415
Refs #2462

This was SVN commit r15944.
2014-11-09 11:08:53 +00:00
edd9622050 wip petra support of saved games, still incomplete
This was SVN commit r15940.
2014-11-08 19:23:29 +00:00
7dad37c78f Some cleanup. Fix a comment.
This was SVN commit r15928.
2014-11-05 00:22:14 +00:00
d07d1a17f3 Add a new Visibility component that will eventually allow scripted components and mods to influence an entity's visibility.
This first commit only refactors code and does not add any new feature.

Refs #2913 (see this ticket for more information about the change)

This was SVN commit r15925.
2014-11-04 20:53:25 +00:00
119aad9da9 fix a debug message
This was SVN commit r15811.
2014-09-26 17:07:17 +00:00
3b49576fa6 Tunes GC scheduling a bit to reduce memory usage.
The main problem was that GC was only called from the simulation before
this patch. This means when you were waiting in the multiplayer lobby or
just had the GUI open, it only called GC when getting close to the JS
runtime size limit (I assume). Another problem was the Net Server
runtime which didn't GC either. Here the runtime size limit is 16 MB
though, so it's not too terrible. These issues have both been addressed
and GC has been given a bit more time per incremental slice to make sure
it gets done in time. It's still far from perfect, but there are too
many changes in SpiderMonkey related to GC, so I don't want to spend too
much time on this yet.

Refs #2808

This was SVN commit r15787.
2014-09-22 20:13:04 +00:00
b1ca37eead Extend visibility update to all tiles around LoS vertices. Incidentally prevent an issue from arising on square maps. Also improve a code comment.
This should be enough to fix #2760.

This was SVN commit r15779.
2014-09-21 20:29:54 +00:00
f5336c42b8 Adds Serialization support for ES6 Maps.
Also includes the patch from Sanderd17 to use Maps and Sets for the
Timer components. Sets can't be serialized yet, but in this case they
don't require serialization.
Refs #2475

This was SVN commit r15770.
2014-09-20 17:14:53 +00:00
801d13aa8b Address some possible causes of bad handling of visibility updates. Also includes a little code tweaking allowing the global update of all visibility data.
Refs #2760

This was SVN commit r15765.
2014-09-20 08:26:45 +00:00
acd86047dc Only split strings if they are non-empty. Fixes previous commit.
This was SVN commit r15737.
2014-09-12 23:11:03 +00:00
134e3c84b0 Clean up some code.
Fixes linker error on OSX.

This was SVN commit r15735.
2014-09-12 21:45:30 +00:00
a8189f89e5 Stop music when resetting the simulation test mode in Atlas.
Patch by trompetin17, fixes #1712

This was SVN commit r15734.
2014-09-12 21:38:10 +00:00
7ce9097d1c small cleaning of d0472b021b
This was SVN commit r15710.
2014-09-07 10:28:18 +00:00
d0472b021b Supersede the "Reveal all" flag when displaying mirages, to avoid seeing other players' mirages. This is especially problematic when switching perspective to an AI player.
Fixes #2712, thanks mimo for the report and for having looked into the
related code.

This was SVN commit r15705.
2014-09-06 19:59:49 +00:00
5bfe2a4b65 Don't call miraging codes while iterating through the range manager's entities map.
I already had made that mistake when working on the fogging system so I
documented it in the code.

Fixes #2756

This was SVN commit r15692.
2014-08-29 09:01:08 +00:00
ea78d97989 Explore the map inside a player's territory border at the beginning of a game.
Also handle properly the "Explore Map" option with the new fogging
system.

Fixes #2709

This was SVN commit r15681.
2014-08-26 10:01:04 +00:00
be2f0e69fc Make the modmod standalone.
Mount public in case we are starting Atlas and no mods are specified in
the config.
If users remove all mods and save this to the config and try to start
Atlas it will
crash, as it cannot find some needed files.

This was SVN commit r15678.
2014-08-25 16:38:54 +00:00
c5c394fd17 Fix some disabled tests.
This was SVN commit r15673.
2014-08-24 15:29:53 +00:00
12771edb0e Delete dynamic message subscriptions on simulation reset.
This was SVN commit r15646.
2014-08-16 01:23:50 +00:00
83aa817f71 Exact stack rooting for simulation message type conversions.
Also replaces some deprecated API (jsval typedef and OBJECT_TO_JSVAL) in
that part of the code.

Refs #2415

This was SVN commit r15624.
2014-08-09 20:02:49 +00:00
9872f5741f Exact stack rooting for ScriptInterface::FreezeObject.
Refs #2415

This was SVN commit r15622.
2014-08-08 11:59:49 +00:00
e865dc797d Revert RedFox's changes to Spatial subdivisions in the simplest possible way (hopefully won't cause OOS, but at least we'll get reports). Fixes #2573, Refs #2430 . There probably are opportunities to remove more things.
This was SVN commit r15617.
2014-08-06 09:21:00 +00:00
f7e591c9f2 Hide changes to buildings in the fog-of-war.
To achieve this, mirage entities are created per player, to replace the
real entities when these ones fall into the fog-of-war. These mirage
entities are created on-the-fly, and destroyed when they get back in
sight.
This depends heavily on the VisibilityChanged message added in
2174eaaeee.

As a temporary adjustment, territories do not explore the map anymore
when their borders change. See #2709.

Fixes #599

This was SVN commit r15612.
2014-08-04 22:49:19 +00:00
efb889b79a Exact stack rooting for WriteStructuredClone and functions that use it.
Refs #2415

This was SVN commit r15607.
2014-08-03 19:32:39 +00:00
169174824f Exact stack rooting for ScriptInterface::ToString.
I had to change a few other functions to take JS::MutableHandleValue
because JS::Stringify takes a JS::MutableHandleValue as input parameter.
That seems a bit strange because it should not change that value.
I assume it has historical reasons.

Refs #2415
Refs #2462

This was SVN commit r15605.
2014-08-03 17:29:49 +00:00