Page 1 of 1

Bug: start point at edge of ally box

Posted: 27 Nov 2010, 01:22
by SirMaverick
If you set your start point at the edge of the ally start box you might get moved to the middle of the start box.

Why? init_game_spawn.lua, the gadget that spawns the commanders snaps the start positions to 16x16 grid. This might move the commander out of the box and will be corrected by placing them in the middle of the box (unit_fix_dropped_startpos.lua).

Re: Bug: start point at edge of ally box

Posted: 27 Nov 2010, 01:56
by Niobium
I messaged TheFatController with what this bug is, exactly what causes it, and instructions on how to fix it over two months ago.

Re: Bug: start point at edge of ally box

Posted: 27 Nov 2010, 15:52
by hoijui
nice find sir! :-)
how would you suggest to fix it? within the spawn widget, or restricting the start boxes to 16x16 grid? i guess the first would be easier and more appropriate. is the required info (start box limits) available to lua?

Re: Bug: start point at edge of ally box

Posted: 27 Nov 2010, 16:25
by Niobium
hoijui wrote:nice find sir! :-)
how would you suggest to fix it? within the spawn widget, or restricting the start boxes to 16x16 grid? i guess the first would be easier and more appropriate. is the required info (start box limits) available to lua?
While it isn't necessary for start positions to be rounded onto a grid, as the starting units in BA aren't buildings, the real solution is to remove fix_dropped_startpos (The other solution being removal of rounding). The gadget was designed to fix commanders spawning outside their box when the owner had dropped or hadn't placed, but now that start unit spawning is handled by gadgets there is no longer a chance of this happening, so the fixer gadget is unnecessary.

TheFatController works in mysterious ways however, so his fix was to keep the fix_dropped_startpos gadget, and modify it to accept positions that are up to 16 units out of bounds. He then put this fix in his sideproject eternal annihilation, and left BA alone.

Re: Bug: start point at edge of ally box

Posted: 27 Nov 2010, 23:04
by SirMaverick
Niobium wrote:While it isn't necessary for start positions to be rounded onto a grid, as the starting units in BA aren't buildings,
Would have suggested that, too.
the real solution is to remove fix_dropped_startpos (The other solution being removal of rounding). The gadget was designed to fix commanders spawning outside their box when the owner had dropped or hadn't placed, but now that start unit spawning is handled by gadgets there is no longer a chance of this happening, so the fixer gadget is unnecessary.
Still necessary. Unless you move the check to the spawn gadget.