1
0
forked from 0ad/0ad
Commit Graph

47 Commits

Author SHA1 Message Date
67795d4451 Fix duplication and clang warning in unreachable gathering target fix 30dcd696eb / D2120
The function was put in an anonymous namespace to avoid linking errors
should another one be defined elsewhere.

Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D2243
This was SVN commit r22825.
2019-09-01 14:10:02 +00:00
30dcd696eb Improve gathering behaviour when a target is not reachable
Units can be stuck in gather states when the target ought to be
collectable from, but it's actually unreachable.

A new FINDINGNEWTARGET intermediate state for GATHER will try and find a
new, different target to collect from. This should generally improve the
behaviour (perfect reachability checks would be required to completely
fix it).
Use this also when the target is knowably unreachable / uncollectible.

Fixes #5529

Differential Revision: https://code.wildfiregames.com/D2120
This was SVN commit r22816.
2019-09-01 07:35:32 +00:00
fb444d4165 Add GetGaiaAndNonGaiaEntities helper function in the RangeManager and use it in Extinct Volcano (D229).
Differential Revision: https://code.wildfiregames.com/D477
Reviewed By: bb
Proposed By: bb
Discussed with: fatherbushido

This was SVN commit r20691.
2017-12-26 22:03:25 +00:00
be1a205f91 Add support for const methods in components and make those that can be const const.
Reviewed By: Itms
Differential Revision: https://code.wildfiregames.com/D75
This was SVN commit r19156.
2017-01-20 02:25:19 +00:00
b18f74da44 Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/.
This was SVN commit r18987.
2016-11-23 11:18:37 +00:00
1a66f510d0 Use const T& for parameters of some types in script-exposed native functions
Using references matches the C++ coding style better and should improve
performance a bit in theory. It avoids 2 copies of T in case of the
functions registered with RegisterFunction (mainy used in the GUI). It
should also avoid one or two copies in case of
DEFINE_INTERFACE_METHOD_X, which is used in the simulation, but I
haven't bothered to count it there exactly.
It is now predefined which types have to be passed by const reference
and which are passed by value. Note that references can't be used as
out-parameters (to return multiple values to JS). This hasn't worked
before either and probably never will.

This was SVN commit r17696.
2016-01-23 15:17:56 +00:00
27fab6bf1e Constify Spatial.h a bit.
While there don't check for null when delete-ing since that is a no-op,
use the proper type instead of auto, always swap when removing a single
element (instead of comparing .size() to 1), and clean up includes.

foobar

This was SVN commit r17641.
2016-01-13 00:20:22 +00:00
8c7b6dceaa Show status-bars of all players to observers, fixes #3215.
This was SVN commit r17623.
2016-01-10 16:47:57 +00:00
8859f33b38 Rename PickFriendlyEntitiesOnScreen to PickPlayerEntitiesOnScreen.
Rename PickFriendlyEntitiesInRect to PickPlayerEntitiesInRect.
Rename PickSimilarFriendlyEntities to PickSimilarPlayerEntities.
Add comment.
Refs #3215.

This was SVN commit r17622.
2016-01-10 14:47:09 +00:00
a7e0dc1534 update attack and heal range queries, patch by leper, fixes #3080
This was SVN commit r17082.
2015-09-27 12:23:40 +00:00
642500b49e Make the Ptolemaic lighthouse reveal the shore on the entire map.
Fixes #3174

This was SVN commit r16628.
2015-05-06 18:47:02 +00:00
6aa99d762f Add a new spatial subdivision, based on an old patch by wraitii.
This subdivision is faster but less precise, so range queries get more
entities and are a bit slower (up to 1ms approx.), but the overall gain
on a simulation update is always positive and can reach 10ms per frame.

For now, this new subdivision is only used by the range manager,
integrating it in the obstruction manager might be sensible.

Refs #2430

This was SVN commit r16540.
2015-04-14 21:33:43 +00:00
c229b46ac2 Move visibility component activation check to C++. Patch by Itms.
This improves performance quite a lot because it avoids a huge number of
calls from C++ to JS. Check the ticket for performance measurements.
Refs #2913

This was SVN commit r16337.
2015-02-14 17:13:50 +00:00
da0f33f137 Reduce drastically the number of mirages by making fogging conditional: entities will be miraged only if their health/resource amount is modified, or if they have a non-gaia owner.
Fixes the animals hidden in the FoW, and adds the missing status bars
for mirages.

Also small cleanup of the code.

Refs #2913

This was SVN commit r16281.
2015-02-07 15:48:32 +00:00
1564a10120 Move back the computation of most of the visibilities from JS to engine, to improve performance.
Also fix the remaining TODO left by #958, as a use case of the scripted
Visibility component.

Refs #2913, #958.

This was SVN commit r16248.
2015-01-30 15:28:06 +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
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
2174eaaeee Add a VisibilityChanged message sent by the range manager whenever an entity changes visibility for any player.
This will be necessary for hiding buildings/trees/etc in fog-of-war, and
may be useful for AIs and for UnitAI.

Refs #599.

This was SVN commit r15508.
2014-07-10 20:51:39 +00:00
e1488fee56 Add an 'explore map' option to the game setup.
This was SVN commit r14931.
2014-04-14 19:52:49 +00:00
8226d75715 Make PickEntitiesAtPoint faster yielding 1-3% overall performance improvement. Fixes #2358. Also removes some trailing whitespace.
This was SVN commit r14532.
2014-01-07 04:05:10 +00:00
60c986c135 * Add method to rangemanager to query around a position instead of an entity
* Use that method in the splash damage calculation
Fixes #2285

This was SVN commit r14283.
2013-12-04 15:30:01 +00:00
05422ad545 Avoid slightly-expensive QueryInterface() calls
Add CEntityHandle which wraps an entity_id_t and also has a pointer to a
per-entity array of IComponents. QueryInterface/CmpPtr on a handle just
involve a couple of pointer dereferences instead of a map lookup.

This requires sizeof(void*) per registered interface type per entity,
which is currently ~0.5KB per entity, which shouldn't be a problem.

This was SVN commit r13825.
2013-09-11 20:41:53 +00:00
8c74df2acd Give an elevation advantage to ranged units. Patch by sanderd17. Fix #1960.
This was SVN commit r13626.
2013-08-03 19:20:20 +00:00
f5e60157bf Optimizes GetPercentMapExplored by caching explored vertices per player, patch by scroogie, fixes #2012
This was SVN commit r13576.
2013-07-20 00:50:40 +00:00
2243f699fc Fix test failure.
Fix entity placement on Phoenician Levant.

This was SVN commit r11951.
2012-06-08 19:17:31 +00:00
962da61f12 Adds shared LOS for allied players, based on patch by Deiz/F00. Fixes #1334.
This was SVN commit r11949.
2012-06-08 04:41:39 +00:00
c56f96040e Implement healing. Fixes #999.
This was SVN commit r11536.
2012-04-17 20:22:13 +00:00
ce67dfd333 Rename CELL_SIZE to TERRAIN_TILE_SIZE, to free up the term "cell" for other concepts.
This was SVN commit r10902.
2012-01-12 12:51:10 +00:00
8d977e4818 Allows building in fog of war. Fixes #958.
This was SVN commit r10584.
2011-11-24 00:58:34 +00:00
959b5a505c Fix bug in incremental LOS computation
This was SVN commit r10446.
2011-10-28 13:15:33 +00:00
996a32125c Add per-player LOS-reveal flag.
Reveal LOS for Gaia and AI players (fixes #879).
Use player_id_t slightly more consistently in interfaces.

This was SVN commit r9720.
2011-06-28 23:24:42 +00:00
92fcb737cd Attempt minor improvements to stances code (see #865).
Don't chase units that are no longer visible, beyond where they were
last seen (fixes #595).

This was SVN commit r9657.
2011-06-24 12:35:15 +00:00
71a6775b92 Stances draft, refs #865
This was SVN commit r9631.
2011-06-17 22:13:39 +00:00
4663ac0fe7 split debug_assert into ENSURE and ASSERT as discussed in a previous meeting.
the old debug_assert always ran and tested the expression, which slows
down release builds. wrapping them in #ifndef NDEBUG is clumsy. the new
ASSERT behaves like assert and ENSURE like the old debug_assert. Let's
change any time-critical but not-super-important ENSURE to ASSERT to
speed up release builds. (already done in bits.h and unique_range.h)

This was SVN commit r9362.
2011-04-30 13:01:45 +00:00
4e74798585 Be more robust to visibility checks outside the map. Fixes #765.
This was SVN commit r9333.
2011-04-27 21:03:08 +00:00
fe21c5e023 # Rewrite fog-of-war rendering.
Disable shadows when only 2 TMUs available.
Clean up some other rendering code.

This was SVN commit r8882.
2011-02-03 01:12:24 +00:00
e4d356c3bf Map exploration counter for summary screen
This was SVN commit r8679.
2010-11-21 19:42:26 +00:00
9c521ceb3b Add minimum range to range queries
This was SVN commit r8627.
2010-11-16 20:43:15 +00:00
4100a13e0a # Add resource shuttling.
Add resource-carrying animations/props to an actor for testing.
Warn more quietly about invalid cursor names.

This was SVN commit r8589.
2010-11-13 19:15:29 +00:00
1840bb3507 Stop units walking outside the edges of circular maps.
Switch the GUI between square/circular minimap automatically.

This was SVN commit r8500.
2010-10-30 18:25:34 +00:00
02aa8499ed Partial experimental version of circular maps
This was SVN commit r8470.
2010-10-25 21:59:52 +00:00
ab77ec40e4 Fix highlighting of obstructed building placement previews.
Prevent building in non-visible areas.
Fixes #594.

This was SVN commit r8272.
2010-10-04 17:34:33 +00:00
fcedcae052 # Add victory/defeat conditions, based on patch from fcxSanya.
Fixes #565.

This was SVN commit r8234.
2010-10-01 20:51:21 +00:00
e1082e5adb Fix warnings
This was SVN commit r8162.
2010-09-23 12:54:16 +00:00
924d1219a7 # Add fog-of-war.
Move Vision component to C++, for more efficient FoW processing.
Disable FoW on demo maps.

This was SVN commit r8160.
2010-09-23 12:13:13 +00:00
3d8d354a18 # Optimise spatial queries.
This was SVN commit r8136.
2010-09-19 18:08:56 +00:00
0cd0a1f584 # Add auto-attacking of nearby enemies.
Add general range-detection code.
Avoid unnecessarily computing 3D entity positions.

This was SVN commit r7817.
2010-07-29 20:39:23 +00:00