#3269: JS: droidCanReach works incorrectly
------------------------------------+-------------------------------------
Reporter: NoQ | Owner: Per
Type: bug | Status: new
Priority: normal | Milestone: unspecified
Component: Engine: Scripting / AI | Version: git/master
Keywords: | Blocked By:
Blocking: | Operating System: All/Non-Specific
------------------------------------+-------------------------------------
Here is a simple AI code that checks which enemies are reachable by an
initial truck.
{{{
function eventStartLevel() {
var trucks = enumDroid(me, DROID_CONSTRUCT);
for (var i=0; i<maxPlayers; ++i) {
debug(me,i,droidCanReach(trucks[0],startPositions[i].x,startPositions[i].y));
}
}
}}}
On this map http://addons.wz2100.net/map/whirlpool it works correctly only
when '''me''' is at position 0 or '''i''' is at position 0 or '''me''' ==
'''i''', otherwise it returns "true" even though "false" is the correct
answer.
The problem seems to be that this map actually has a single column of
passable (grass) tiles at the right and a similar row of passable tiles at
the bottom, so the game might think you can drive through it. But in fact
you can't drive through tiles that are at the very right or at the very
bottom: pathfinder doesn't see this passage (neither in 2.3 nor in 3.1+),
and i couldn't make my trucks go through it manually (neither in 2.3 nor
in 3.1+). The very right column and the very bottom row of tiles seem to
have special meaning: their right (bottom) vertices don't have any height
defined for them, so the only reason they are painted is to compensate the
off-by-one difference between number of tiles on map and number of
vertices on the heightmap; their terrain is completely black in-game; i
think that droidCanReach() should ignore these tiles (?)
--
Ticket URL: <http://developer.wz2100.net/ticket/3269>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Warzone2100-project mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/warzone2100-project