Page 1 of 1

Scaling of footprintX

Posted: 11 Apr 2014, 15:55
by Jools
Anybody knows why footprintX scales between gamedev:unitdef and lua:unitdef?

For example: I have the arm bulldog: movementclass=TANKBH3
movedef file: wrote:name = "TANKBH3",
footprintX = 3,
footprintZ = 3,
But in lua I get:
lua echo wrote:name, tankbh3
zsize, 5
xsize, 5
It seems the one in-game has always 2 added to it. Can anyone confirm this empirical finding in theory?

Re: Scaling of footprintX

Posted: 11 Apr 2014, 16:06
by Anarchid
For me it seemed that lua value was always double of definition value.

Re: Scaling of footprintX

Posted: 11 Apr 2014, 17:07
by CarRepairer
Makes sense. 5 is about double of 3.

Re: Scaling of footprintX

Posted: 11 Apr 2014, 17:26
by SinbadEV
CarRepairer wrote:Makes sense. 5 is about double of 3.
doubling would only seem like adding two in a vary narrow set of circumstances... I suspect a common outside cause... what do the rest of your definitions look like?

Lot's of places in the code... not sure which apply... but my poor-mans interpretation is that zsize = this footprintZ/(largest footprintZ * 2)

so 5 = 3/(10*2)


Code that lead me to this theory:
[code]const int zsizeDef = std::max(1, moveDefTable.GetInt("footprintZ", xsizeDef));

zsize = std::max(1 * SPRING_FOOTPRINT_SCALE, fdTable.GetInt("footprintZ", 1)

zsize = zsizeDef * SPRING_FOOTPRINT_SCALE;

const int SPRING_FOOTPRINT_SCALE = 2[/code]


That was clearly wrong but you get my point that there are other factors involved.

Re: Scaling of footprintX

Posted: 11 Apr 2014, 17:30
by Jools
Maybe the xsize need to be a Fibonacci number as well?