1
0
forked from 0ad/0ad
Commit Graph

20 Commits

Author SHA1 Message Date
0dff6940f7 Implement a FixedVector2D::CompareLengthSquared function to provide a more performant alternative to CompareLength.
Avoids computing the square of the compared value every call.

Differential Revision: https://code.wildfiregames.com/D2058
Reviewed By: Vladislav
This was SVN commit r23489.
2020-02-09 21:00:43 +00:00
6581796103 New long-range pathfinder.
Based on Philip's work located at
http://git.wildfiregames.com/gitweb/?p=0ad.git;a=shortlog;h=refs/heads/projects/philip/pathfinder
Includes code by wraitii, sanderd17 and kanetaka.

An updated version of docs/pathfinder.pdf describing the changes in
detail will be committed ASAP.

Running update-workspaces is needed after this change.

Fixes #1756.
Fixes #930, #1259, #2908, #2960, #3097
Refs #1200, #1914, #1942, #2568, #2132, #2563

This was SVN commit r16751.
2015-06-12 18:58:24 +00:00
d252e245ef Optimise fixed multiplies on MSVC x86
On MSVC, casting i32 to i64 then multiplying gets compiled into a call
to __allmul, which is slow. Use the __emul intrinsic instead.

GCC 4.6+ appears optimise this case automatically and doesn't need any
special handling.

This reduces the cost of ComputeShortPath by about 50% (testing AI vs AI
on Oasis 01).

This was SVN commit r13873.
2013-09-20 20:17:54 +00:00
959b5a505c Fix bug in incremental LOS computation
This was SVN commit r10446.
2011-10-28 13:15:33 +00:00
609f1643d5 Fix -Wconversion warnings in simulation code.
Cast to smaller integer types explicitly.
Generally avoid platform-dependent types (size_t) in simulation code.
Use float versions of math.h functions, not double.

This was SVN commit r10017.
2011-08-16 11:18:32 +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
65bcedb9fc Load map descriptions from their XML file.
Add basic hold-fire stance, and use it for some test maps.
Add JSON data container to map XML files, to simplify the interaction
between scripts and maps.
Fix fixed-point printing so it roundtrips safely through map files.
Fix camera startup positions in old-format maps.

This was SVN commit r7844.
2010-08-04 21:15:41 +00:00
d29dd45237 Fix compiling with Clang
This was SVN commit r7824.
2010-07-30 21:42:22 +00:00
586ba51e4a Fix lossy fixed<->jsval conversion.
(Hopefully this will really fix the OOS errors.)

This was SVN commit r7692.
2010-07-04 19:47:31 +00:00
e8b264835a Add fixed-point sin/cos, to fix OOS errors
This was SVN commit r7690.
2010-07-04 17:15:57 +00:00
11a20e1bcf # Handle terrain passability and movement costs in pathfinder.
Simplify terrain code (remove Handle indirection).
Delete unused terrain properties.

This was SVN commit r7590.
2010-05-27 23:31:03 +00:00
2f421082cd Improve accuracy of fixed sqrt
This was SVN commit r7561.
2010-05-21 15:26:17 +00:00
f33706bf8b Switch everything to 15.16-bit precision fixeds, to allow more accurate unit vectors and angles.
This was SVN commit r7497.
2010-05-02 20:32:37 +00:00
ab45b4c787 Overflow checking in CFixed. Patch by JubJub (see #420).
This was SVN commit r7496.
2010-05-02 20:16:53 +00:00
cfae58928f # New unit movement system, which does a far better job of approaching targets and avoiding obstacles.
Add short-range vertex-based pathfinder.
Integrate new pathfinder into unit motion code.
Change obstruction system to get rid of circles, and differentiate
structures from units.
Make PositionChanged messages synchronous.
Try to prevent some accidental float->int conversions.

This was SVN commit r7484.
2010-04-29 23:36:05 +00:00
08db7ebe13 # Support training units in buildings.
Includes basic batch training (see #298).

This was SVN commit r7469.
2010-04-19 19:47:23 +00:00
f8aca33a14 # Support resource gathering in new simulation system
This was SVN commit r7322.
2010-02-12 22:46:53 +00:00
e0ed8a1629 # Pathfinder updates
More hacks so units follow paths relatively smoothly, and to avoid
pathfinding in simple situations

This was SVN commit r7296.
2010-01-30 13:11:58 +00:00
7c2e9027c2 # Rewrite of the game's simulation system
Giant merge from
http://svn.wildfiregames.com/hg-source/file/5fb522019d5e
Infrastructure is largely complete, gameplay is largely missing
Disabled by default; use command-line flag "-sim2"
(Second attempt at commit...)

This was SVN commit r7259.
2010-01-09 19:20:14 +00:00