1
0
forked from 0ad/0ad
Commit Graph

61 Commits

Author SHA1 Message Date
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
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
7ed45213a9 Allow heightmaps to be 8 times as high by lessening precisions. Includes conversion script and modified standard maps. Bump the map version number. Fixes #3112
This was SVN commit r16478.
2015-03-31 16:48:31 +00:00
b1c4e29ac8 Fixes inconsistencies in spelling of colour/color by preferring "color" (only wxWidgets remains with some API that requires "colour"), fixes #1029.
NOTE: requires update-workspaces and may require correction of some
modded actors/scenarios

This was SVN commit r16438.
2015-03-15 23:59:48 +00:00
769350a3e7 Compute camera height and zoom limits based on smoothed terrain heightmap. Fixes #794, based on patch by Dietger.
This was SVN commit r11556.
2012-04-18 20:39:00 +00:00
3027ce1a04 Rationalise terrain dirty-rect coordinates.
Clean up some whitespace.

This was SVN commit r11543.
2012-04-17 22:35:34 +00:00
a16d56cc72 Delete an unused obsolete method
This was SVN commit r11540.
2012-04-17 21:06:47 +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
vts
85186c98b2 Better selection boxes. Closes #914, #295, #810.
This was SVN commit r10593.
2011-11-25 06:36:13 +00:00
8fee3d8ef8 # New territory border rendering.
Add textured line overlay rendering.
Change terrain height calculations to be triangulation-dependent for
improved accuracy.
Add triangulation-dependent terrain normal function.
Support separate S/T wrap modes for textures.
Rename CVector2D_Maths since it no longer conflicts with simulation
CVector2D.
Coalesce freed chunks in vertex buffers, to avoid excessive
fragmentation.
Add some things to help debug vertex buffer allocation a little.

This was SVN commit r9929.
2011-07-30 00:56:45 +00:00
d24c93237c # Initial version of terrain decal textures.
Rejig CModel to support non-mesh-based props.
Avoid redundant recomputation for non-moving CRenderableObjects.

This was SVN commit r9055.
2011-03-13 19:22:05 +00:00
ba8163e248 # Explicitly triangulate terrain tiles.
Store blend splats as indexed triangles.
Remove unnecessary copy of vertex data.
Fixes #169.

This was SVN commit r9054.
2011-03-13 19:10:38 +00:00
0fa0181f0c Fix #554 (camera should be always inside the terrain), based on patch from markelov
This was SVN commit r8070.
2010-09-04 12:50:27 +00:00
8286218cad Delete lots of obsolete unused script-interface code.
Delete unused code from various other places.

This was SVN commit r7839.
2010-08-01 20:56:34 +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
56bb858802 # Delete a lot of obsolete simulation code.
This was SVN commit r7555.
2010-05-20 18:09:23 +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
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
2f34e5fbc6 Fix #472 (fixed-point CTerrain::GetExactGroundLevel), based on patch from JubJub
This was SVN commit r7443.
2010-04-06 17:31:38 +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
6fbc524e65 # Terrain-related bug fixes
Fix several off-by-one errors
Reorder some loops to be theoretically more efficient
Other minor cleanups

This was SVN commit r7221.
2009-12-12 17:52:38 +00:00
33ec9060dd gcc compile fix (thanks to Heron for reporting the problem)
This was SVN commit r7184.
2009-11-08 18:58:14 +00:00
6cc0b1649a robustified GetPatch / GetTile:
- clarify the meaning of mapSize (patchesPerSide)
- use a single ClampCoordToMap function for clamping
- add annotations to all call sites when it is sure they will succeed
- otherwise, ensure return value is checked or at least add debug_assert
fixes #311 (successfully built house and dock at top of latium map)
thanks to Heron for tracking down the cause!

This was SVN commit r7183.
2009-11-08 16:49:52 +00:00
1743645fd3 Simplify the overly-complex CppDoc-breaking file headers
This was SVN commit r6832.
2009-04-18 17:51:05 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
c0ed950657 had to remove uint and ulong from lib/types.h due to conflict with other library.
this snowballed into a massive search+destroy of the hodgepodge of
mostly equivalent types we had in use (int, uint, unsigned, unsigned
int, i32, u32, ulong, uintN).

it is more efficient to use 64-bit types in 64-bit mode, so the
preferred default is size_t (for anything remotely resembling a size or
index). tile coordinates are ssize_t to allow more efficient conversion
to/from floating point. flags are int because we almost never need more
than 15 distinct bits, bit test/set is not slower and int is fastest to
type. finally, some data that is pretty much directly passed to OpenGL
is now typed accordingly.

after several hours, the code now requires fewer casts and less
guesswork.

other changes:
- unit and player IDs now have an "invalid id" constant in the
respective class to avoid casting and -1
- fix some endian/64-bit bugs in the map (un)packing. added a
convenience function to write/read a size_t.
- ia32: change CPUID interface to allow passing in ecx (required for
cache topology detection, which I need at work). remove some unneeded
functions from asm, replace with intrinsics where possible.

This was SVN commit r5942.
2008-05-11 18:48:32 +00:00
b755ddefda remove all author/modified by tags.
make include guards consistent.

This was SVN commit r5040.
2007-05-07 16:33:24 +00:00
73683b6109 # SwEng
. the massive renaming undertaking: camelCase functions -> PascalCase.
. add some cppdoc.
. minor additional renaming improvements: e.g. GetIsClosed -> IsClosed
. in entity code, replace constructs like "pvec = new vector; return
pvec; use *pvec; delete pvec" with a simple stack variable passed as
output parameter (avoid unnecessary dynamic allocs)
. timer: simpler handling of raw ticks vs normal timer (less #if)

This was SVN commit r5017.
2007-05-02 12:07:08 +00:00
623e649acb # big refactoring in CPU-specific code, fix for dual core vs. HT detection
all cpu-related stuff is now defined in cpu.h (with cpu_ prefix and
fully encapsulated). fix quite brittle core/HT unit/package detection.
implement mkdir on VC8, where it is deprecated
add strdup on MacOSX
move ia32 code into separate subdir. functions implemented in asm are
called ia32_asm_*.
add some unix versions of sysdep functions (cannot test them)
timer: fix for amd64 linux

This was SVN commit r4995.
2007-04-25 18:19:35 +00:00
db045c330b # Made Atlas compile on linux
graphics: basic terrain passibility
atlas: lots of changes to make atlas compile under linux
unix/X: more clipboard support - copy from 0AD to other programs
unix/debug: use sys_get_executable_name instead of hard-coded paths
... and lots of other misc. changes

This was SVN commit r4640.
2006-11-12 04:02:36 +00:00
fa229121ec Bug fixes and more game setup options.
- Added "Screenshot Mode" and "Fog of War" game attributes. (Screenshot
Mode causes units to be initialized to Hold stance instead of Aggress
and also forces LOS to be All Visible. Atlas turn on Screenshot Mode by
default so units don't try to kill each other in there.)
- Modified LOSManager to allow disabling fog of war.
- Removed some debug message spam.
- Enabled line antialiasing for aura rendering and fixed some bugs that
caused strange effects (color was not set properly for the center point,
and when a unit was both mouseover'ed and selected, the aura was drawn
twice).
- Modified Stand stance to allow retaliation on attacks (normally Stand
will attack any enemy in LOS, but this is useful if a neutral unit is in
LOS).
- Modified pathfinder to not take into account terrain slope, which is
an expensive calculation - we'll eventually take into account terrain
type instead.

This was SVN commit r4527.
2006-10-08 17:39:46 +00:00
2f53eea71a Actor Viewer: Added controls for wireframe, background colour, move-when-walking. Reduced CPU usage when 'playing' things with no animation.
Color: Moved SColor* structs into SColor.h, so they can be used without
indirectly including CVector[34]D.
Terrain: Added 'base colour', for the Actor Viewer to be able to
modulate the colour of normally-white terrain.
Removed some "using namespace std" (because it doesn't make the code
easier to read, and it defeats the point of namespaces, and the rest of
the code doesn't do it).

This was SVN commit r4392.
2006-09-26 01:44:20 +00:00
0baca62d61 # Fixes to terrain conformance and movement speed bonus.
- Simplified CTerrain::getSlopeAngleFace and made it work correctly in
all cases (before, it sometimes returned NAN and used an overly
complicated method based on 8 angle sectors instead of a "continuous"
method).
- Removed the EntityMovement event - instead, movement speed modifier is
calculated in C++ for performance.

This was SVN commit r4339.
2006-09-16 20:13:40 +00:00
7d3d8fdbf3 # move ps/Network into top level project (and static lib).
This was SVN commit r4249.
2006-08-26 20:25:37 +00:00
d39a4fac21 Premake: include precompiled.h in the project; set up dependencies for Atlas projects.
# Attempted to make compilation faster
by including as little as possible in some .h files, and moving it into
.cpp.
Fixed BaseTechCollection memory leak.

This was SVN commit r3992.
2006-06-09 16:44:16 +00:00
5f7855f7f0 Simplification of #Include paths: relative names are used only for included files in the same directory as the including file; everything else uses the full path relative to source/.
This was SVN commit r3930.
2006-06-02 02:10:27 +00:00
pyrolink
39e89c406e #Fixes to flank penalty, notifications, sectors, terrain conformance. Added speed bonus based on terrain slope.
-added NOTIFY_ORDER_CHANGE, which is used for flank penalty instead of
idle.
-entity speed is now actions.move.speed_curr for the current speed, but
the original speed is still actions.move.speed.  Changes take place in
entityEventMovemen.

This was SVN commit r3840.
2006-05-04 04:14:48 +00:00
3d26549032 Fixed file properties - removed svn:executable and svn:keywords (left over from CVS conversion?) from all files; set svn:eol-style=native for *.cpp, *.h (and fixed files with inconsistent line endings)
This was SVN commit r3802.
2006-04-23 23:14:18 +00:00
pyrolink
b5d9da29c1 #When appropriate (i.e. wheeled units), units will align with the slope of the terrain. *JS documentation
*added CTerrain::getSlopeAngle[Face]() which returns the angle in
radians of the slope of the terrain.  getSlopeAngleFace should be used
for entities because it takes into account which way the entity is
facing, which allows for negative angles.
*the max and min graphical rotation for the slope is under traits.pitch.
This is used so that you can have certain units such as infantry that
don't rotate very far go down steep slopes but not rotate too much.
*JS documentation in docs/JSReg.rtf -- I put in most of the relevant
global functions; still needs entity functions.

This was SVN commit r3794.
2006-04-22 05:52:23 +00:00
8a11f53011 # More consistent terrain-space coordinate names
# Removed more ancient unused code
# Partial VC2005 compatibility for Atlas editor / AoE3Ed
# Terrain overlay rendering system; used to implemented Atlas brush
display
# Renamed 'right' to 'left'

This was SVN commit r3771.
2006-04-17 20:02:51 +00:00
kevmo
baf357d2ea # Began work on new pathfinder
Created CTerrain::getSlope(x,y), and added a new order type to support
high-level pathing.

This was SVN commit r3735.
2006-04-09 00:36:52 +00:00
bd2c1d73a3 Terrain, Interact, LOSManager, Atlas, etc: Fixed some off-by-one and off-by-FLT_EPSILON problems with objects near/off the edge of the map. Also changed some model.GetBounds().GetCentre() into model.GetTransform().GetTranslation() to fix off-by-centre-of-bounds-minus-position problems. Thus, you can no longer make units in Atlas disappear off the edge and never be seen or selected again. Also changed out-of-bounds LOS value to make them visible if they somehow escape anyway. Also fixed out-of-bounds access of terrain heightmap.
MapReader: Tidied usage of Xeromyces.
Projectile: Avoided warnings.

This was SVN commit r3212.
2005-12-09 01:08:08 +00:00
14c62e721d ia32, sysdep: add float->int implementation and fallback version and self-test
config: add macro that determines when it's used
Terrain, wtime: use new float->int code
detect: no longer change _MCW_RC

This was SVN commit r3114.
2005-11-07 02:04:28 +00:00
78f9dbb6f1 Fix various warnings (both implicit conversions and real bugs).
This was SVN commit r3110.
2005-11-06 17:58:47 +00:00
124f7171bd More reliable texture blending. Resource unloading. Minor fixes.
This was SVN commit r3106.
2005-11-06 05:05:07 +00:00
6668ad6e1c CTerrain, Brushes: made CalcFromPosition static and added float x,y overload
minimap, PatchRData, renderer: fix ELOSState comparison vs & and use
SAFE_DELETE
ia32: add rounding control constants (for FISTP)
premake: set /QIfist compiler setting which causes float->int casts to
go through FISTP instruction instead of _ftol2() (much faster, but
requires CPU state to have been set)
LOSManager.cpp: cache m_TilesPerSize; use MIN/MAX; use
CTerrain::CalcFromPosition; clean up GetUnitState a bit. now runs at
203ns, down from 222

This was SVN commit r3099.
2005-11-06 01:33:16 +00:00
faaee7d1b5 Atlas: Terrain painting
This was SVN commit r3092.
2005-11-05 04:59:54 +00:00
364e36128e g_YMinOffset declared in gameview.h instead of extern elsewhere
terrain: made const-correct
lib: Add round_up_to_pow2
minimap: cleanup. split user input and DrawViewRect out of Draw; add
m_Camera; made pointers const; user local x,x2 variables instead of
writing out m_CachedActualSize

This was SVN commit r2970.
2005-10-19 17:16:34 +00:00
0ed2815c8b Added initial version of LOS, and updated minimap to show both LOS and water.
LOS issues still outstanding:
- LOS looks ugly because of quad tesselation into 2 triangles
- Quad tesselation is unspecified by OpenGL (in fact using GL_QUADS on
LOS quads seemed to give different tesselations than it did for the
underlying terrain quads, but terrain rendering also used GL_QUADS).
This should be fixed once we decide on the quad tesselation issue.
- Units with traits.vision.permanent set are visible through FOW even if
you havent seen them before; this should only be true when you have seen
them before. But it gets even more complicated - if a permanent unit
seen through FOW dies or gets upgraded or something, perhaps you should
remember the old version. I'm not completely sure how to do this
(probably involves cloning its actor somehow).

This was SVN commit r2876.
2005-10-09 03:43:03 +00:00
29d6f420fd GameView: removed unused ancient camera code.
Terrain: nicer handling of negative map coordinates (mainly for Atlas
brush previews that fall over the edge).
Misc: reverted seconds->microseconds.

This was SVN commit r2866.
2005-10-07 21:09:29 +00:00