1
0
forked from 0ad/0ad
Commit Graph

59 Commits

Author SHA1 Message Date
6b73ba0296 - Terrain conformance should now work in Atlas as well.
- Renamed Passive stance to Hold (which is what it's called in the
design doc and GUI).

This was SVN commit r4345.
2006-09-16 21:30:23 +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
aa50820d9a #Unit AI: Aggressive, defensive and stand ground stances.
Also split Entity.cpp further, moving the rendering code to
EntityRendering.cpp and the JS interface code to
EntityScriptInterface.cpp. This makes each individual file smaller
(about 1000 lines still!) and lets them be compiled independently.

This was SVN commit r4314.
2006-09-09 00:00:23 +00:00
35e91718c5 # Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.

This was SVN commit r4261.
2006-08-28 17:36:42 +00:00
44fe226dd2 # Housekeeping and pathfinder enhancements / optimization when dealing with ranged actions.
- Modified Xeromyces to no longer automatically convert element and
attribute names to lowercase, so that we can have camelCase names. We
should now be able to convert all the multi-word entity properties, like
pass_through_allies, to camelCase, like passThroughAllies, which is more
consistent with the rest of our JavaScript naming conventions. To
support the existing code that assumes lowercase element names, I made
the getElementID and getAttributeID methods (used in the EL and AT
macros) ignore case, and I changed any code that directly accessed
element names to use the right case. CEntityTemplate now converts
Names_LikeThis to names_likeThis (changing each separate "word" in the
name to camelCase). Changed the version letter in XMB filenames from A
to B to support this without requiring people to delete old XMBs.

- Enhanced the pathfinder's handling of contact paths, resulting in a
very large speedup for actions like attacking, construction, etc. The
problem was that the pathfinder used to not count a given state as the
goal unless it was exactly coincident with the target location. This is
fine when you order a unit to go exactly to a certain spot, but if
you're ordering a unit to build, gather or attack something, then the
target tile is impassable (because your target is there) and therefore
the pathfinder never declares a state final. As a result, the pathfinder
tries hundreds of extra tiles in case there is a long path that gets to
the goal, and after failing to find any path that reaches the goal, it
gives you one to the closest point it got to. To fix it, I made the
pathfinder take into account a radius around the goal in which it's OK
to be, which depends on the size of the target unit and the range of
your action.

This was SVN commit r4186.
2006-08-01 03:41:21 +00:00
903b97c1a8 - Optimization: added bit vector to let CEntityManager check referenced entities with more spatial locality.
- Bug fix: Entities that died due to the action of a previous entity in
a simulation step still tried to update that step.

This was SVN commit r4182.
2006-07-29 23:58:33 +00:00
554b9e537e - Changed actor selection sets to CStr8 rather than CStrW.
- Added more comments in ScriptableComplex.h/inl explaining how they are
split up and when to #include the inl.

This was SVN commit r4180.
2006-07-29 22:02:11 +00:00
2261231ffa # Housekeeping.
Jan and I implemented a number of changes:

- Converted SClassSet to vector.
- Refactored get/set ClassSet from string into methods in CClassSet.
- Turned pass-by-value string params in getCollisionObject, CEntity
constructor and CEntityManager into pointers.
- Simplified processChooseMovement.
- Merged CalculateRun and CalculateHealth into a single, simpler
CalculateRegen + helper functions.
- Changed the way regen works so the rates read in the XML act as rates
(before, they were the number of seconds until the entity will be fully
regenned, which is a bit counterintuitive).

This was SVN commit r4167.
2006-07-24 01:33:26 +00:00
c817566222 # housekeeping
replaced all (*) CStr / CStrW by-value params with const reference. hoo
boy.

please always perform this optimization (actually standard idiom) when
writing the code - it takes little work, tells the next guy that the
string won't be modified, and makes a large performance difference.

(* where possible.. a few require other changes and will follow later)

This was SVN commit r4151.
2006-07-20 14:37:58 +00:00
f0ec100d1a Bug fix to construction (units weren't being given the building to convert to due to some hasty refactoring in an earlier commit). Also increased shadow Z bias to 0.02 since there still seemed to be cases when it was very visible.
This was SVN commit r4125.
2006-07-17 00:59:32 +00:00
4a259aa439 # add cppdoc, refactor EntityManager
entitymanager: remove duplication, move refcnt && !destroyed check into
helper function in preparation for caching result of that calculation
scriptglue: improved timer calibration

This was SVN commit r4113.
2006-07-14 14:00:00 +00:00
a56ec5bdcd Some cleanup - renamed CBaseEntity to CEntityTemplate, and removed JSInterface_BaseEntity.h and JSInterface_Entity.h (which were unused).
This was SVN commit r4091.
2006-07-13 03:29:33 +00:00
ca4a4613f1 # CSimulation optimization+cleanup (2)
made many (*)of the bools in CEntity into a bitfield (flags). this saves
a lot of space inside CEntity.
* only those that are not specified in XML and/or accessed via JS

This was SVN commit r4082.
2006-07-12 16:18:31 +00:00
e4ed1d52b9 # CSimulation cleanup and optimization (1)
moved some fields (e.g. size of health bar) out of CEntity and into
BaseEntity so they can be shared between entities (instead of duplicated
in each).

TODO: is it ok to remove AddProperty for those properties in CEntity?
(BaseEntity is still adding them)

This was SVN commit r4078.
2006-07-12 14:36:59 +00:00
600adac871 # housekeeping and bugfix in Loader queue
remove old instrumentation, fix warnings, add measured timing results
Loader: bugfix: no more memory leak whenever callback returns a warning
code. this was a loophole in the callback return value docs.

This was SVN commit r4048.
2006-06-29 22:52:50 +00:00
77c59070c1 # Various gameplay updates.
- Added per-player resource pool and modified the GUI and entity scripts
to work with it.
- Modified unit creation functions so the unit is always assigned a
player before firing its initialize event, so that this event can deduct
population, etc from the right player.
- Fixed various small bugs, like a unit not cancelling all of its queued
items when it dies, or buildings not costing anything.

This was SVN commit r3998.
2006-06-10 03:05:16 +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
1e3f5f5d3e # Added some groundwork for technologies and fixed some small bugs.
- Entity templates are now per-player, along with an unowned
"unmodified" version of each template that should be used to find the
original values of the stats. This can be accessed in the scripts as
<template>.unmodified.

- Fixed a pathfinder crash when the last path from the engine had 0
elements (just ignoring this for now).

- Units should no longer become purple when they upgrade in rank.

Refs #3.

This was SVN commit r3863.
2006-05-13 22:11:46 +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
44901d38b9 # further documentation and improvements to lib/res/file code
FILE_CACHE_BLOCK flag used more safely (copied in afile_read)
add file_sector_size (set from sysdep code)
documented and organized FileFlags
moved publically visible file_buf* decls to file.h; add FileBufFlags
file_buf_get: moved to file_io and renamed because it is not a part of
the file_buf manager itself
FILE_BLOCK_SIZE no longer exposed to users - it's an implementation
detail. for alignment purposes, you should use file_sector_size (less
wasteful)
add page_aligned allocator (mmap)
write buffers now allocated via file_buf_alloc(FB_FROM_HEAP) (avoids
wasting cache space)
append trace runs into the trace file (-> better input data for archive
ordering)
document lib_errors.h
tex_load: add provision for file_flags, used by ogl_tex_load to prevent
caching file data

simulation, entitymanager: add perf measurements

This was SVN commit r3725.
2006-04-03 21:28:10 +00:00
d3f57744d9 Refactored actor variation system, and added support for entity-level selections (controlled by the current animation).
Avoided tooltip error message.
Avoided noisy warnings when textures fail to load.

This was SVN commit r3653.
2006-03-17 03:59:49 +00:00
192ddf9ddf Added construction logic in startPlacing and Entity and BaseEntity, as well as the Death event.
This was SVN commit r3564.
2006-02-26 09:55:20 +00:00
0a3e9ec537 - Added pause game functionality.
- Removed CDamageType from the engine - damage is now handled only
within the entity script (easier to mod/modify).

This was SVN commit r3325.
2006-01-02 03:07:29 +00:00
pyrolink
e968bd91ed Actual death flag and CHandle entity handle retrieval.
This was SVN commit r3303.
2005-12-29 04:57:02 +00:00
45255d3f37 Added a "collision patch" system that groups entities into a grid on top of the map to make aura checking and collision detection faster.
This was SVN commit r3253.
2005-12-16 05:35:26 +00:00
d939a006ae Added C++ code for auras. Some things that still need to be implemented are:
- Times on auras (a unit must be in range for X seconds for the aura to
start affecting it)
- An efficient GetInRange implementation in CEntityManager using a
quadtree or something of the sort (current one is linear in the number
of entities).

This was SVN commit r3238.
2005-12-13 08:05:30 +00:00
8cbf23f123 Fixed a bug with projectiles trying to hit non-extant entities.
This was SVN commit r3232.
2005-12-11 23:28:50 +00:00
5250814397 Atlas: Fixed entities-don't-move-when-terrain-is-altered. Unbroke and fixed entity memory management. Added flatten tool. Added object movement/rotation/deletion tool - but not yet finished, since 'redo' usually crashes (for known reasons).
This was SVN commit r3207.
2005-12-08 02:50:55 +00:00
547293ee49 Atlas: Vaguely usable object placement code. Bug fixes.
This was SVN commit r3186.
2005-12-02 21:08:10 +00:00
139c48e733 Removed TickAll of entities, for performance
This was SVN commit r3095.
2005-11-05 23:10:54 +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
2ea40a23a3 VS2005 compatibility fixes and warning adjustments:
Updated DLLs.
Added DirectX headers/libraries, since they're not in the platform SDK.
Fixed invalid STL iterator usage.
Disabled STL in stack trace, since it breaks.
Added comments for some reported warnings.
Corrected some apparent off-by-one errors.
Defined strlen_s to strnlen.
Probably broke pre-beta2 versions of VC2005.

This was SVN commit r2454.
2005-07-02 21:42:55 +00:00
ec6b78b252 rename assert2 debug_assert; use instead of all plain assert(), since there are no longer any issues (e.g. can't use while handling an exception)
This was SVN commit r2447.
2005-06-28 04:06:25 +00:00
d0f7cb015c - Linux/GCC (as usual :P)
- Ported lockless code to gcc inline assembly
- A few new net messages (gather, attack, add waypoint)
- Support for new messages in network->entity order converter
- Implemented rudimentary JS interface for Interaction
- issueCommand JS API, connected to the network
- Removed Interaction stuff now replaced by JS
- And something in there should probably break VS builds :P

This was SVN commit r2316.
2005-05-18 05:32:09 +00:00
MarkT
86dc351205 Projectile code and updates to some actors that can use it (celt_ijv and hele_iar)
This was SVN commit r2266.
2005-05-10 07:13:25 +00:00
34352b77af EntityManager.cpp: safety improvements
mmgr: consistent prefix naming
lockfree: split out lock free allocator

This was SVN commit r2260.
2005-05-09 04:41:35 +00:00
bcc4aea8dc Maybe fixed nasty memory corruption bug.
This was SVN commit r2254.
2005-05-09 02:29:33 +00:00
MarkT
bb7a22f32a First draft of a GPG3-style profiler (including tracing into scripts, after a fashion)
This was SVN commit r2090.
2005-03-30 16:14:19 +00:00
22dd4dd67b Entities: Removed Tag attribute; it is taken from the filename instead. Made entity XML files be loaded on demand. Probably stopped crash when maps contain non-existent entities. Fixed a few bugs in entity definitions.
Maps: Stored non-entity objects in XML instead of PMP, for easier manual
editing. Updated existing maps to newest format, so that they can still
work. Added undocumented _rewriteMaps() JS function. Also renamed _mem
to vmem, and reclassified its undocumentedness as unintentional, since
it's reasonably useful.
Loader: added NonprogressiveLoad function, for ScEd/_rewriteMaps/etc
which don't care about progressiveness.
main.cpp: re-enabled vfs_display, since it doesn't crash now
Vector3D: stopped warning

This was SVN commit r2078.
2005-03-29 20:50:04 +00:00
MarkT
25fdbfd931 Fixes for two pathfinding bugs (neither of which were actually pathfinding bugs), added player objects (details in TM)
This was SVN commit r1733.
2005-01-18 00:46:18 +00:00
4720a00f98 Made ScEd output entities into an XML file.
Added CStrW::utf8() (used by XMLWriter).

This was SVN commit r1716.
2005-01-12 14:31:47 +00:00
MarkT
793794649f Combat code, some scripting, broken network, and fixed some bugs.
This was SVN commit r1301.
2004-11-11 07:09:32 +00:00
MarkT
d33d2e4450 Added some support for user profiles
This was SVN commit r1270.
2004-10-23 14:39:28 +00:00
MarkT
2ab625720b Fairly major XML/entprop changes; some more minor stuff that fell out as a consequence.
This was SVN commit r1220.
2004-10-07 19:23:35 +00:00
MarkT
2b396ccb57 Minor improvements to some simulation code.
This was SVN commit r887.
2004-08-02 23:14:54 +00:00
415662c4cd First set of Core Classes changes! w00t :P
This was SVN commit r823.
2004-07-27 21:00:53 +00:00
MarkT
befae8627d Changed hotkey handling for groups and bookmarks; small pathfinding fixes.
This was SVN commit r809.
2004-07-23 10:56:52 +00:00
MarkT
6d8b9e33ef Minor additions: Added hotkeys to GUI buttons, camera bookmarking (not sure if this system will stay), shoring up some JS error checking, moved a bunch of constants into the config file and added a new rotation mode.
This was SVN commit r804.
2004-07-22 16:18:12 +00:00