(*** 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)
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
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
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
I cannot reproduce it anymore