custom formations lines do not look right (stipples spacing)

custom formations lines do not look right (stipples spacing)

Classic game design, maintained to please you...

Moderator: Content Developer

Post Reply
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

custom formations lines do not look right (stipples spacing)

Post by knorke »

Drawing a line via right click, with a single unit selected: everything looks ok.
Multiple units selected: the lines and distances between them get very long, almost not visible.

Image
blue line = the path i dragged mouse in both pictures

I thought its a new bug in 93 but looks the same in 91. Or is it some setting? In xta the spacing is normal.
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: custom formations lines do not look right (stipples spac

Post by Niobium »

The implementation of the varying line spacing (stipple) is... not good.

Code: Select all

local _,zoomY = GetCameraPosition()
zoomY = zoomY/470 --magic number with 20 units its 27 stipp with 30 its 39
local lineStipple = lineLength/((GetSelectedUnitsCount()-1)*zoomY)
--TODO fix the pattern and rest of math -so that always starts with half line and ends with half line
DrawFormationLines(tVerts, lineStipple)
  • Based on camera height which by itself doesn't have any relation to how the line will appear
  • Magic numbers...
  • ... with incorrect comments
  • GetSelectedUnitsCount multiplied by the camera height...
  • Note about fixing parts of the commit, but no fixes in following 6 months
If the goal is to draw a line that graphically indicates final positions then the drawing method should be rewritten to do so (all the information is available), not by taking the existing fixed-stipple based code and hacking it towards the goal by fudging the stippling amount.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: custom formations lines do not look right (stipples spac

Post by knorke »

yes, good points.
The widgets in 0k & xta seem different (did not look in detail for but example no uses of camera height etc) and work good, so I suggest just taking one of those.
Post Reply

Return to “Balanced Annihilation”