Bug 46356 - Aircrafts cannot fly along the border of the map
Summary: Aircrafts cannot fly along the border of the map
Status: RESOLVED FIXED
Alias: None
Product: boson
Classification: Applications
Component: general (show other bugs)
Version: cvs
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: The Boson Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-11 15:33 UTC by Felix Seeger
Modified: 2003-05-05 20:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Seeger 2002-08-11 15:19:18 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           boson
Version:           v0.7pre (using KDE 3.0.7 1 beta1))
Severity:          normal
Installed from:    compiled sources
Compiler:          gcc version 2.95.4 20011002 (Debian prerelease)
OS:                Linux (i686) release 2.4.19
OS/Compiler notes: 

Take an aircraft.
Fly to the border of the map.
Now trie to fly along the border.

Doesn't work only works one cell away from the border.

have fun
Felix

(Submitted via bugs.kde.org)
(Called from KBugReport dialog)
Comment 1 Rivo Laks 2002-10-04 21:36:41 UTC
I just found the problem: aircraft is bigger than 1 cell, so when it's 
at the edge of the map, it's top-left or lower-right point is not on 
canvas and MobileUnit::advanceMoveCheck() checks if they are on 
canvas. 
Maybe we should check if center of unit is on canvas. Or maybe simply 
not allow big units to go to the edge... 
 
Rivo 
 
Comment 2 Andreas Beckermann 2003-03-13 01:38:41 UTC
UPDATE 
The problem seems to be in pathfinder now. Move an aircraft to the bottom of the map, i.e. 
cells (x,49) on a 50x50 map. 
Then try to move along the border. As stated above it will fail. If you look at the debug 
output you'll see that the position of the unit concerning the y coordinates are correct, i.e. 
they are all on canvas. 
But the unit tries to move with y != 0 i.e. it tries to move even further down. It works fine 
with all units that occupy a single cell only. 
 
Since pathfinding seems to prefer paths that go to the lower right and it is also ignoring cell 
size of a unit, I believe the problem is in the pathfinding code. 
 
Checking whether certain parts of the unit are on canvas is not an option, as this check is a 
last fallback that must catch any pathfinding bugs. So we can always assume that a unit 
actually is on the canvas during the game. 
 
Oh and I consider that a pretty low priority bug :) But I leave it on Rivo to decide this. 
 
CU 
Andi 
 
Comment 3 Rivo Laks 2003-03-13 18:27:12 UTC
Yes, pathfinder only supports units not larger than one cell ATM. 
I've thought about it, but so far I haven't found any ways to fix this except checking 
every cell which would be under unit, but that means e.g. checking 4 cells for 2x2 
cells big units. And that would be slooow. 
Any better ideas? 
BTW, I'm currently thinking about re-designing the pathfindinder and units moving 
code and writing a doc about it. I'll commit it to CVS once 0.8 is out and then it's 
time to give your ideas... 
 
Rivo 
 
Comment 4 Felix Seeger 2003-05-05 20:17:54 UTC
I cannot reproduce it anymore