diff --git a/Data/rooms.ini b/Data/rooms.ini index af91b1e06..2eba05067 100644 --- a/Data/rooms.ini +++ b/Data/rooms.ini @@ -32,6 +32,7 @@ mesh path=GFX\map\173bright_opt.rmesh shape = 1 commonness = 0 disabledecals = true +disableoverlapcheck = true [start] descr=SCP-173's chamber, after the breach. Placed automatically in all maps. @@ -739,6 +740,7 @@ descr=SCP-106's pocket dimension. Placed automatically in all maps. mesh path=GFX\map\pocketdimension1_opt.rmesh shape = 1 commonness = 0 +disableoverlapcheck = true [dimension1499] descr=SCP-1499's dimension. Placed automatically in all maps. @@ -746,3 +748,4 @@ mesh path=GFX\map\dimension1499\1499object0_opt.rmesh shape=1 commonness = 0 disabledecals = true +disableoverlapcheck = true \ No newline at end of file diff --git a/MapSystem.bb b/MapSystem.bb index e0ef4ce91..33dea3db7 100644 --- a/MapSystem.bb +++ b/MapSystem.bb @@ -1740,7 +1740,7 @@ LoadRoomTemplates("Data\rooms.ini") Global RoomScale# = 8.0 / 2048.0 Const ZONEAMOUNT = 3 -Global MapWidth% = GetINIInt("options.ini", "options", "map size"), MapHeight% = GetINIInt("options.ini", "options", "map size") +Global MapWidth% = GetINIInt("options.ini", "options", "map width"), MapHeight% = GetINIInt("options.ini", "options", "map height") Dim MapTemp%(MapWidth+1, MapHeight+1) Dim MapFound%(MapWidth+1, MapHeight+1) @@ -7020,8 +7020,8 @@ End Function Function CreateMap() DebugLog ("Generating a map using the seed "+RandomSeed) - I_Zone\Transition[0] = 13 - I_Zone\Transition[1] = 7 + I_Zone\Transition[0] = Floor(MapHeight * (2.0 / 3.0)) + 1 + I_Zone\Transition[1] = Floor(MapHeight * (1.0 / 3.0)) + 1 I_Zone\HasCustomForest = False I_Zone\HasCustomMT = False @@ -7045,7 +7045,7 @@ Function CreateMap() Next Repeat - width = Rand(10, 15) + width = Rand(Floor(MapWidth*0.6), Floor(MapWidth*0.85)) If x > MapWidth*0.6 Then width = -width @@ -7110,7 +7110,6 @@ Function CreateMap() Until y < 2 - Local ZoneAmount=3 Local Room1Amount%[3], Room2Amount%[3],Room2CAmount%[3],Room3Amount%[3],Room4Amount%[3] ;count the amount of rooms @@ -7142,6 +7141,8 @@ Function CreateMap() Next Next + Local y_min%, y_max%, x_min%, x_max% + ;force more room1s (if needed) For i = 0 To 2 ;need more rooms if there are less than 5 of them @@ -7149,9 +7150,13 @@ Function CreateMap() If temp > 0 Then - For y = (MapHeight/ZoneAmount)*(2-i)+1 To ((MapHeight/ZoneAmount) * ((2-i)+1.0))-2 - - For x = 2 To MapWidth - 2 + If i = 2 Then y_min = 1 Else y_min = I_Zone\Transition[i] + If i = 0 Then y_max = MapHeight - 2 Else y_max = I_Zone\Transition[i - 1] - 1 + x_min = 1 + x_max = MapWidth - 2 + + For y = y_min To y_max + For x = x_min To x_max If MapTemp(x, y) = 0 Then If (Min(MapTemp(x + 1, y),1) + Min(MapTemp(x - 1, y),1) + Min(MapTemp(x, y + 1),1) + Min(MapTemp(x, y - 1),1)) = 1 Then @@ -7168,7 +7173,7 @@ Function CreateMap() EndIf placed = False - If MapTemp(x2,y2)>1 And MapTemp(x2,y2)<4 Then + If MapTemp(x2,y2)>1 And MapTemp(x2,y2)<4 And (y0 - If (MapTemp(x,y-1)+MapTemp(x,y+1)+MapTemp(x+2,y))=0 Then - If (MapTemp(x+1,y-2)+MapTemp(x+2,y-1)+MapTemp(x+1,y-1))=0 Then + If (MapTemp(x+1,y-1)+MapTemp(x+1,y+1)+MapTemp(x+2,y))=0 And xy_min Or i=2) Then MapTemp(x,y)=2 MapTemp(x+1,y)=2 DebugLog "ROOM2C forced into slot ("+(x+1)+", "+(y)+")" MapTemp(x+1,y-1)=1 temp=1 - Else If (MapTemp(x+1,y+2)+MapTemp(x+2,y+1)+MapTemp(x+1,y+1))=0 Then + Else If (MapTemp(x+1,y+2)+MapTemp(x+2,y+1))=0 And (y0) Then MapTemp(x,y)=2 MapTemp(x+1,y)=2 DebugLog "ROOM2C forced into slot ("+(x+1)+", "+(y)+")" @@ -7289,14 +7280,14 @@ Function CreateMap() EndIf EndIf Case MapTemp(x+1,y)>0 - If (MapTemp(x,y-1)+MapTemp(x,y+1)+MapTemp(x-2,y))=0 Then - If (MapTemp(x-1,y-2)+MapTemp(x-2,y-1)+MapTemp(x-1,y-1))=0 Then + If (MapTemp(x-1,y-1)+MapTemp(x-1,y+1)+MapTemp(x-2,y))=0 And x>x_min Then + If (MapTemp(x-1,y-2)+MapTemp(x-2,y-1))=0 And (y>y_min Or i=2) Then MapTemp(x,y)=2 MapTemp(x-1,y)=2 DebugLog "ROOM2C forced into slot ("+(x-1)+", "+(y)+")" MapTemp(x-1,y-1)=1 temp=1 - Else If (MapTemp(x-1,y+2)+MapTemp(x-2,y+1)+MapTemp(x-1,y+1))=0 Then + Else If (MapTemp(x-1,y+2)+MapTemp(x-2,y+1))=0 And (y0) Then MapTemp(x,y)=2 MapTemp(x-1,y)=2 DebugLog "ROOM2C forced into slot ("+(x-1)+", "+(y)+")" @@ -7305,14 +7296,14 @@ Function CreateMap() EndIf EndIf Case MapTemp(x,y-1)>0 - If (MapTemp(x-1,y)+MapTemp(x+1,y)+MapTemp(x,y+2))=0 Then - If (MapTemp(x-2,y+1)+MapTemp(x-1,y+2)+MapTemp(x-1,y+1))=0 Then + If (MapTemp(x-1,y+1)+MapTemp(x+1,y+1)+MapTemp(x,y+2))=0 And (y0) Then + If (MapTemp(x-2,y+1)+MapTemp(x-1,y+2))=0 And x>x_min Then MapTemp(x,y)=2 MapTemp(x,y+1)=2 DebugLog "ROOM2C forced into slot ("+(x)+", "+(y+1)+")" MapTemp(x-1,y+1)=1 temp=1 - Else If (MapTemp(x+2,y+1)+MapTemp(x+1,y+2)+MapTemp(x+1,y+1))=0 Then + Else If (MapTemp(x+2,y+1)+MapTemp(x+1,y+2))=0 And x0 - If (MapTemp(x-1,y)+MapTemp(x+1,y)+MapTemp(x,y-2))=0 Then - If (MapTemp(x-2,y-1)+MapTemp(x-1,y-2)+MapTemp(x-1,y-1))=0 Then + If (MapTemp(x-1,y-1)+MapTemp(x+1,y-1)+MapTemp(x,y-2))=0 And (y>y_min Or i=2) Then + If (MapTemp(x-2,y-1)+MapTemp(x-1,y-2))=0 And x>x_min Then MapTemp(x,y)=2 MapTemp(x,y-1)=2 DebugLog "ROOM2C forced into slot ("+(x)+", "+(y-1)+")" MapTemp(x-1,y-1)=1 temp=1 - Else If (MapTemp(x+2,y-1)+MapTemp(x+1,y-2)+MapTemp(x+1,y-1))=0 Then + Else If (MapTemp(x+2,y-1)+MapTemp(x+1,y-2))=0 And x r\MaxX) Then Local tempX# = r\MaxX @@ -8585,6 +8576,10 @@ Function CalculateRoomExtents(r.Rooms) r\MinZ = tempZ EndIf + r\MinX = r\MinX + shrinkAmount : r\MaxX = r\MaxX - shrinkAmount + r\MinY = r\MinY + shrinkAmount : r\MaxY = r\MaxY - shrinkAmount + r\MinZ = r\MinZ + shrinkAmount : r\MaxZ = r\MaxZ - shrinkAmount + DebugLog("roomextents: "+r\MinX+", "+r\MinY +", "+r\MinZ +", "+r\MaxX +", "+r\MaxY+", "+r\MaxZ) End Function diff --git a/options.ini b/options.ini index fe9e463c3..64e254826 100644 --- a/options.ini +++ b/options.ini @@ -18,7 +18,8 @@ camera fog far = 6.0 fog r = 0 fog g = 0 fog b = 0 -map size = 18 +map width = 18 +map height = 18 achievement popup enabled = 1 bump mapping enabled = 1 anisotropy = 0