Jump to content

Placing a Tempshift Plate or Ice-E Fan in the top right corner of the grid crashes the game.


Stuffy Doll
  • Branch: Preview Branch Version: Windows Pending

Placing a Tempshift Plate or Ice-E Fan in the top right corner of the grid crashes the game.
This is most easily demonstrated in Base Game but occurs in Spaced Out as well.

  

   

 

Tempshift Plates are supposed to have extents of 3x3. 
However, if one is placed at the left or right edge of the grid, then it's width is the entire width of the grid and height is 4. You can see this in the error screen of the videos and in the Player.Log line 1505. Here are 2 videos showing a Tempshift Plate exchanging heat well outside of its' intended range.

 

The error message is from SimComponentMessages.AddBuildingHeatExchange but that is not the source of the problem.

The root cause I believe is Grid.OffsetCell(int cell, CellOffset offset) returning a cell on the opposite side of the grid for the construction of extents and not being filtered out as non-sensical.
return cell + offset.x + offset.y * Grid.WidthInCells;
Let's say a Tempshift Plate is located at coordinates 0,10 and assume a grid width of 100. The cell of the Plate would be 1000.
You end up with the following cells and results from the current methods:
Offset     Cell       X,Y
[-1,-1]     899       99,8
[-1, 1]     1099     99,10
[ 1,-1]     901       1,9
[ 1, 1]     1101      1,11

The minimums of these and the plate location itself become the x and y of the extents being 0,8 which is the lower left corner of the rectangle.
The maximums are then used to determine the width and height. 99 - 0 + 1 = 100 width and 11 - 8 + 1 = 4 height.
So the extents are constructed with x=0, y=8, width=100, height=4

In Spaced Out the extents cross asteroid boundaries.


This is what I did to clamp the extents within the world boundaries and prevent a cell from the opposite end of the grid being used. The -2 in the y clamping is to keep the extents out of the no build zone at the top of an asteroid's map.

PossibleCodeFix.png.a46eff68462eb60b549eff2e345470d6.png


Steps to Reproduce

Load save and place a Tempshift Plate in these locations.

CrashPlacement.jpg.02a25b2feb9d471adb1934dc61c21a1b.jpg

TempDemonstrationLocation.jpg.ba932961d87bd1b8c675fc25d0ccb6df.jpg

Alternatively, start a Base Game game and place a Tempshift Plate in the top right corner of the map.

Override Extents Bug1.sav




User Feedback


There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...