Merge pull request #239 from devZoGok/imp-237-map-regions

Imp 237 map regions
This commit is contained in:
devZoGok
2026-05-01 11:55:12 +00:00
committed by GitHub
19 changed files with 132190 additions and 142266 deletions
+22 -21
View File
@@ -12,32 +12,33 @@ metadata = {
{
units = {
{id = 10, pos = {x = -105.929001, y = -0.110725, z = -404.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
},
resourceDeposits = {}
}
},
{
units = {
{id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = -20.215218, y = 0.000000, z = 365.251648}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
},
resourceDeposits = {}
}
{id = 10, pos = {x = -20.215218, y = 0.000000, z = 365.251648}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
}
},
},
civilianPlayer = {
units = {},
resourceDeposits = {
{id = 0, pos = {x = -105.929001, y = -0.110725, z = -404.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 111.306473, y = 0.000031, z = -413.114807}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 72.301971, y = 0.000023, z = -363.649902}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 15.789061, y = -0.010529, z = -308.128113}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 37.890579, y = 0.000076, z = -405.671021}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 39.080250, y = 0.000000, z = -367.778442}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 34.379860, y = 0.000015, z = 329.448395}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 31.606178, y = 0.000000, z = 352.831665}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 17.326164, y = 0.000046, z = 390.545441}, rot = {w = -0.770531, x = 0.000000, y = -0.637403, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -7.834114, y = 0.000000, z = 390.160706}, rot = {w = -0.251298, x = 0.000000, y = -0.967910, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 10.215218, y = 0.000000, z = 365.251648}, rot = {w = -0.251298, x = 0.000000, y = -0.967910, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 37.141624, y = 0.000031, z = 369.058044}, rot = {w = -0.251298, x = 0.000000, y = -0.967910, z = 0.000000}, initAmmount = 20000},
}
resourceDeposits = {
{id = 0, pos = {x = -105.929001, y = -0.110725, z = -404.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 111.306473, y = 0.000031, z = -413.114807}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 72.301971, y = 0.000023, z = -363.649902}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 15.789061, y = -0.010529, z = -308.128113}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 37.890579, y = 0.000076, z = -405.671021}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 39.080250, y = 0.000000, z = -367.778442}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 34.379860, y = 0.000015, z = 329.448395}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 31.606178, y = 0.000000, z = 352.831665}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 17.326164, y = 0.000046, z = 390.545441}, rot = {w = -0.770531, x = 0.000000, y = -0.637403, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -7.834114, y = 0.000000, z = 390.160706}, rot = {w = -0.251298, x = 0.000000, y = -0.967910, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 10.215218, y = 0.000000, z = 365.251648}, rot = {w = -0.251298, x = 0.000000, y = -0.967910, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 37.141624, y = 0.000031, z = 369.058044}, rot = {w = -0.251298, x = 0.000000, y = -0.967910, z = 0.000000}, initAmmount = 20000},
},
},
skybox = "Skybox1",
terrain = {model = "2lakes.xml", albedo = "2lakes.jpg"},
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 837 B

+33 -30
View File
@@ -6,49 +6,52 @@ metadata = {
impassibleNodeValue = 65535,
spawnPoints = {
{x = 50.410851, y = 0.000046, z = -472.358398},
{x = 407.292053, y = 0.035400, z = 449.050964},
{x = -450.032196, y = 0.000031, z = 417.242737}
{x = 387.292053, y = 0.035400, z = 479.050964},
{x = -450.032196, y = 0.000031, z = 417.242737},
},
choosablePlayers = {
{
units = {
{id = UnitId.ACS_MECH, pos = {x = 50.410851, y = 0.000046, z = -472.358398}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
},
resourceDeposits = {}
{id = 10, pos = {x = 50.410851, y = 0.000046, z = -472.358398}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
{id = UnitId.ACS_TANK, pos = {x = -280.500000, y = 0, z = -496.500000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
{id = 24, pos = {x = 403.000000, y = -18.453316, z = -343.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
}
},
{
units = {
{id = UnitId.ACS_MECH, pos = {x = 407.292053, y = 0.035400, z = 449.050964}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
},
resourceDeposits = {}
{id = 0, pos = {x = 387.292053, y = 0.035400, z = 482.050964}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
}
},
{
units = {
{id = UnitId.ACS_MECH, pos = {x = -450.032196, y = 0.000031, z = 417.242737}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
},
resourceDeposits = {}
{id = 10, pos = {x = -450.032196, y = 0.000031, z = 417.242737}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
}
},
},
civilianPlayer = {
units = {},
resourceDeposits = {
{id = 0, pos = {x = 407.292053, y = 0.035400, z = 449.050964}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 388.774841, y = 0.028824, z = 448.299225}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 368.191223, y = 0.020782, z = 448.422272}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 347.570312, y = 0.008224, z = 407.701385}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 373.537720, y = 0.019989, z = 422.497559}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -450.032196, y = 0.000031, z = 417.242737}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -425.042511, y = 0.000031, z = 411.944916}, rot = {w = -0.275866, x = 0.000000, y = 0.961196, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -400.767151, y = 0.000061, z = 391.045227}, rot = {w = -0.275866, x = 0.000000, y = 0.961196, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -421.781281, y = 0.000046, z = 391.056610}, rot = {w = -0.275866, x = 0.000000, y = 0.961196, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -438.017151, y = 0.000031, z = 402.490692}, rot = {w = -0.275866, x = 0.000000, y = 0.961196, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -410.310394, y = 0.000061, z = 422.562714}, rot = {w = -0.969856, x = 0.000000, y = -0.243677, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 50.410851, y = 0.000046, z = -472.358398}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 31.740002, y = 0.000031, z = -463.164642}, rot = {w = 0.966213, x = 0.000000, y = 0.257746, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 39.761688, y = 0.000046, z = -436.009583}, rot = {w = 0.526699, x = 0.000000, y = -0.850052, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 57.385757, y = 0.000092, z = -451.965759}, rot = {w = -0.955132, x = 0.000000, y = -0.296180, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 72.339455, y = 0.000015, z = -473.400116}, rot = {w = -0.955132, x = 0.000000, y = -0.296180, z = 0.000000}, initAmmount = 20000},
},
resourceDeposits = {
{id = 0, pos = {x = 407.292053, y = 0.035400, z = 449.050964}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 388.774841, y = 0.028824, z = 448.299225}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 368.191223, y = 0.020782, z = 448.422272}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 347.570312, y = 0.008224, z = 407.701385}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 373.537720, y = 0.019989, z = 422.497559}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -450.032196, y = 0.000031, z = 417.242737}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -425.042511, y = 0.000031, z = 411.944916}, rot = {w = -0.275866, x = 0.000000, y = 0.961196, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -400.767151, y = 0.000061, z = 391.045227}, rot = {w = -0.275866, x = 0.000000, y = 0.961196, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -421.781281, y = 0.000046, z = 391.056610}, rot = {w = -0.275866, x = 0.000000, y = 0.961196, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -438.017151, y = 0.000031, z = 402.490692}, rot = {w = -0.275866, x = 0.000000, y = 0.961196, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -410.310394, y = 0.000061, z = 422.562714}, rot = {w = -0.969856, x = 0.000000, y = -0.243677, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 50.410851, y = 0.000046, z = -472.358398}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 31.740002, y = 0.000031, z = -463.164642}, rot = {w = 0.966213, x = 0.000000, y = 0.257746, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 39.761688, y = 0.000046, z = -436.009583}, rot = {w = 0.526699, x = 0.000000, y = -0.850052, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 57.385757, y = 0.000092, z = -451.965759}, rot = {w = -0.955132, x = 0.000000, y = -0.296180, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 72.339455, y = 0.000015, z = -473.400116}, rot = {w = -0.955132, x = 0.000000, y = -0.296180, z = 0.000000}, initAmmount = 20000},
},
},
skybox = "Skybox1",
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

+41 -8
View File
@@ -6,29 +6,62 @@ metadata = {
impassibleNodeValue = 65535,
spawnPoints = {
{x = -396.000000, y = 0.000000, z = -374.000000},
{x = 360.000000, y = 0.000000, z = 400.000000},
{x = 300.000000, y = 0.000000, z = 400.000000},
{x = -326.000000, y = 0.000000, z = 374.000000},
},
choosablePlayers = {
{
units = {
{id = 10, pos = {x = -20.000000, y = 0.000000, z = -20.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
{id = UnitId.ACS_TANK, pos = {x = 325.000000, y = 0.000000, z = 345.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
{id = UnitId.ACS_TANK, pos = {x = 325.000000, y = 0.000000, z = 300.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
},
resourceDeposits = {}
},
{
units = {
{id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = 325.000000, y = 0.000000, z = 445.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 445.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_NAVAL_FACTORY, pos = {x = 0.000000, y = 0.000000, z = 0.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100},
{id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = 280.000000, y = 0.000000, z = 450.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_LAND_FACTORY, pos = {x = 305.000000, y = 0.000000, z = 445.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100},
--{id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = 280.000000, y = 0.000000, z = 445.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = 280.000000, y = 0.000000, z = 440.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = 280.000000, y = 0.000000, z = 435.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = 280.000000, y = 0.000000, z = 430.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 460.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 465.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 450.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 455.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 440.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 445.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 430.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 435.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 420.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_TANK, pos = {x = 325.000000, y = 0.000000, z = 425.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_TANK, pos = {x = 325.000000, y = 0.000000, z = 410.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_TANK, pos = {x = 325.000000, y = 0.000000, z = 415.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_TANK, pos = {x = 325.000000, y = 0.000000, z = 410.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_TANK, pos = {x = 325.000000, y = 0.000000, z = 405.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_TANK, pos = {x = 325.000000, y = 0.000000, z = 400.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_ARTILLERY, pos = {x = 325.000000, y = 0.000000, z = 355.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_ARTILLERY, pos = {x = 325.000000, y = 0.000000, z = 350.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_ARTILLERY, pos = {x = 325.000000, y = 0.000000, z = 355.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_ARTILLERY, pos = {x = 325.000000, y = 0.000000, z = 350.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_ARTILLERY, pos = {x = 325.000000, y = 0.000000, z = 355.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_ANTI_SUB_CRUISER, pos = {x = -20.000000, y = 0.000000, z = -20.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_TRANSPORT, pos = {x = -20.000000, y = 0.000000, z = -20.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_TRANSPORT, pos = {x = -20.000000, y = 0.000000, z = -20.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
--{id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = 325.000000, y = 0.000000, z = 445.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
},
resourceDeposits = {}
},
{
units = {
{id = UnitId.AINC_CYBORG_ENGINEER, pos = {x = -325.000000, y = 0.000000, z = 415.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
{id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = -325.000000, y = 0.000000, z = 415.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}},
},
resourceDeposits = {}
},
--[[
]]--
},
civilianPlayer = {
resourceDeposits = {
@@ -36,10 +69,10 @@ metadata = {
{id = 0, pos = {x = 450.000000, y = 0.000000, z = 430.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 450.000000, y = 0.000000, z = 410.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = 450.000000, y = 0.000000, z = 390.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -450.000000, y = 0.000000, z = 350.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -450.000000, y = 0.000000, z = 360.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -450.000000, y = 0.000000, z = 370.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
{id = 0, pos = {x = -450.000000, y = 0.000000, z = 380.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
--{id = 0, pos = {x = -450.000000, y = 0.000000, z = 350.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
--{id = 0, pos = {x = -450.000000, y = 0.000000, z = 360.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
--{id = 0, pos = {x = -450.000000, y = 0.000000, z = 370.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
--{id = 0, pos = {x = -450.000000, y = 0.000000, z = 380.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000},
},
},
File diff suppressed because it is too large Load Diff
+33 -23
View File
@@ -126,33 +126,41 @@ function Player:landRouteToSpawnpoint_(mapPoint)
source = map:getCellId(map:getSpawnPoint(self:getSpawnPointId()), false)
pf = Pathfinder.getSingleton()
cells = map:getCells()
heurs = pf:calcHeuristics(cells, dest)
path = pf:findPath(cells, heurs, source, dest, UnitType.HOVER)
forwClampedDest = pf:clampDestToSourceRegion(source, dest)
embarkCellId = nil
disembarkCellId = nil
navalSupportCellId = nil
navalRallyCellId = nil
if dest ~= forwClampedDest then
cells = map:getCells()
for i = 1, #path do
if map:getCell(path[i]).type == 1 then
navalRallyCellId = path[i]
embarkCellId = path[i - 1]
if not self.navalFactoryCellId then self.navalFactoryCellId = path[i] end
break;
embarkCellId = nil
navalRallyCellId = nil
embarkCellId = forwClampedDest
for i = 1, #cells[embarkCellId + 1].edges do
destCellId = cells[embarkCellId + 1].edges[i].destCellId
if cells[destCellId + 1].type == 1 then
if not self.navalFactoryCellId then self.navalFactoryCellId = destCellId end
navalRallyCellId = destCellId
break
end
end
end
for i = #path, 1, -1 do
if map:getCell(path[i]).type == 1 then
navalSupportCellId = path[i]
disembarkCellId = path[i + 1]
break;
disembarkCellId = nil
navalSupportCellId = nil
backwClampedDest = pf:clampDestToSourceRegion(dest, embarkCellId)
disembarkCellId = backwClampedDest
for i = 1, #cells[disembarkCellId + 1].edges do
destCellId = cells[disembarkCellId + 1].edges[i].destCellId
if cells[destCellId + 1].type == 1 then
navalSupportCellId = destCellId
break
end
end
end
if embarkCellId or disembarkCellId then
return {
reachable = false,
embarkCellId = embarkCellId,
@@ -160,7 +168,9 @@ function Player:landRouteToSpawnpoint_(mapPoint)
navalSupportCellId = navalSupportCellId,
disembarkCellId = disembarkCellId
}
else return {reachable = true} end
else
return {reachable = true}
end
end
function Player:landRouteToSpawnpoint(arguments)
+8 -1
View File
@@ -201,10 +201,16 @@ namespace battleship{
"multVec", [](Quaternion q, Vector3 v){return q * v;}
);
SOL_LUA_STATE.new_usertype<Map::Edge>(
"Edge",
"destCellId", &Map::Edge::destCellId
);
SOL_LUA_STATE.new_usertype<Map::Cell>(
"Cell",
"pos", &Map::Cell::pos,
"type", &Map::Cell::type
"type", &Map::Cell::type,
"edges", &Map::Cell::edges
);
SOL_LUA_STATE.new_usertype<Map>(
@@ -221,6 +227,7 @@ namespace battleship{
SOL_LUA_STATE.new_usertype<Pathfinder>(
"Pathfinder",
"getSingleton", &Pathfinder::getSingleton,
"clampDestToSourceRegion", &Pathfinder::clampDestToSourceRegion,
"calcHeuristics", &Pathfinder::calcHeuristics,
"findPath", &Pathfinder::findPath
);
+70 -2
View File
@@ -522,6 +522,7 @@ namespace battleship{
}
//TODO implement toggleable cell rendering
//TODO remove srcCellId from the Edge struct
void Map::loadCells(){
sol::state_view SOL_LUA_VIEW = generateView();
sol::table cellsTable = SOL_LUA_VIEW["cells"];
@@ -556,7 +557,72 @@ namespace battleship{
*/
cells.push_back(Cell(cellPos, cellType, edges, underWaterCellIds));
}
}
void Map::fillRegion(vector<Map::Cell*>& regionCells, int cellId){
Map::Cell::Type type = cells[cellId].type;
if(find(regionCells.begin(), regionCells.end(), &cells[cellId]) == regionCells.end())
regionCells.push_back(&cells[cellId]);
for(int i = 0; i < cells[cellId].edges.size(); i++){
int adjCellId = cells[cellId].edges[i].destCellId;
bool underwaterWaterCell = (
find(cells[cellId].underWaterCellIds.begin(), cells[cellId].underWaterCellIds.end(), adjCellId)
!=
cells[cellId].underWaterCellIds.end()
);
if(underwaterWaterCell || cells[adjCellId].type != type) continue;
bool adjCellInRegion = (find(regionCells.begin(), regionCells.end(), &cells[adjCellId]) == regionCells.end());
if(adjCellInRegion) fillRegion(regionCells, adjCellId);
}
}
void Map::calculateRegions(){
bool allCellsInRegions = false;
int nextCellId = 0, numSurfaceCells = (int(mapSize.x / CELL_SIZE.x)) * (int(mapSize.z / CELL_SIZE.z));
while(!allCellsInRegions){
vector<Map::Cell*> regionCells;
fillRegion(regionCells, nextCellId);
regions.push_back(make_pair(cells[nextCellId].type, regionCells));
int sumCellsInRegions = 0;
for(int i = 0; i < regions.size(); i++)
sumCellsInRegions += regions[i].second.size();
allCellsInRegions = (sumCellsInRegions == numSurfaceCells);
if(!allCellsInRegions)
for(int i = 0; i < cells.size(); i++){
bool inRegion = false;
for(int j = 0; j < regions.size(); j++)
if(find(regions[j].second.begin(), regions[j].second.end(), &cells[i]) != regions[j].second.end()){
inRegion = true;
break;
}
if(!inRegion){
nextCellId = i;
break;
}
}
}
for(pair<Map::Cell::Type, vector<Cell*>>& reg : regions){
if(reg.first != Cell::Type::WATER) continue;
int oldNumCells = reg.second.size();
for(int i = 0; i < oldNumCells; i++)
for(int ucId : reg.second[i]->underWaterCellIds)
reg.second.push_back(&cells[ucId]);
}
}
@@ -571,10 +637,14 @@ namespace battleship{
SOL_LUA_STATE.script_file(path + "Models/Maps/" + mapName + "/" + mapName + ".lua");
SOL_LUA_STATE.script_file(path + "Models/Maps/" + mapName + "/cells.lua");
sol::table sizeTable = SOL_LUA_STATE[mapTable]["size"];
mapSize = Vector3(sizeTable["x"], sizeTable["y"], sizeTable["z"]);
preprareScene(false);
loadSpawnPoints();
loadSkybox();
loadCells();
calculateRegions();
loadTerrainObject(-1);
sol::optional<sol::table> lightsOpt = SOL_LUA_STATE[mapTable]["lights"];
@@ -582,8 +652,6 @@ namespace battleship{
if(lightsOpt != sol::nullopt)
loadLights();
sol::table sizeTable = SOL_LUA_STATE[mapTable]["size"];
mapSize = Vector3(sizeTable["x"], sizeTable["y"], sizeTable["z"]);
sol::table wbTbl = SOL_LUA_STATE[mapTable]["waterbodies"];
int numWaterbodies = wbTbl.size();
+6 -1
View File
@@ -45,7 +45,7 @@ namespace battleship{
std::vector<int> underWaterCellIds;
Cell(){}
Cell(vb01::Vector3 p, Type t, std::vector<Edge> e = std::vector<Edge>{}, std::vector<int> uc = std::vector<int>{}): pos(p), type(t), edges(e), underWaterCellIds(uc){}
Cell(vb01::Vector3 p, Type t, std::vector<Edge> e = std::vector<Edge>{}, std::vector<int> uc = std::vector<int>{}) : pos(p), type(t), edges(e), underWaterCellIds(uc){}
};
class Minimap{
@@ -83,6 +83,8 @@ namespace battleship{
std::vector<int> getSurroundingCells(vb01::Vector3, int);
void blockCells(Unit*);
void unblockCells(Unit*);
inline std::pair<Cell::Type, std::vector<Cell*>>& getRegion(int i){return regions[i];}
inline int getNumRegions(){return regions.size();}
inline Map::Cell getCell(int i){return cells[i];}
inline std::string getMapName(){return mapName;}
inline vb01::Node* getNodeParent(){return terrainNode;}
@@ -107,6 +109,7 @@ namespace battleship{
std::vector<Cell> cells;
float baseHeight;
std::vector<vb01::Node*> lights;
std::vector<std::pair<Cell::Type, std::vector<Cell*>>> regions;
Map(){}
void preprareScene(bool);
@@ -116,6 +119,8 @@ namespace battleship{
void loadCells();
void loadPlayerGameObjects(Player*, sol::table);
void loadTerrainObject(int);
void fillRegion(std::vector<Cell*>&, int);
void calculateRegions();
void unloadTerrainObjects();
void unloadCells();
void unloadLights();
+1 -1
View File
@@ -357,7 +357,7 @@ namespace battleship{
if(pos.y < waterPos.y && fabs(res[0].pos.x - waterPos.x) < .5 * waterSize.x && fabs(res[0].pos.z - waterPos.z) < .5 * waterSize.y){
type = Map::Cell::Type::WATER;
pos.y = waterPos.y;
waterBodyBedPoints.push_back(pair(numVertCells * j + i, res[0].pos.y));
waterBodyBedPoints.push_back(pair(numHorCells * i + j, res[0].pos.y));
break;
}
}
+33 -4
View File
@@ -16,6 +16,36 @@ namespace battleship{
return pathfinder;
}
int Pathfinder::clampDestToSourceRegion(int source, int dest){
Map *map = Map::getSingleton();
vector<Map::Cell> &cells = map->getCells();
pair<Map::Cell::Type, vector<Map::Cell*>> srcRegion;
for(int i = 0; i < map->getNumRegions(); i++){
pair<Map::Cell::Type, vector<Map::Cell*>> region = map->getRegion(i);
if(find(region.second.begin(), region.second.end(), &cells[source]) != region.second.end()){
srcRegion = map->getRegion(i);
break;
}
}
if(find(srcRegion.second.begin(), srcRegion.second.end(), &cells[dest]) == srcRegion.second.end()){
int minDistId = 0;
for(int i = 0; i < srcRegion.second.size(); i++){
float currDist = cells[dest].pos.getDistanceFrom(srcRegion.second[i]->pos);
float minDist = cells[dest].pos.getDistanceFrom(srcRegion.second[minDistId]->pos);
if(currDist < minDist) minDistId = i;
}
dest = map->getCellId(srcRegion.second[minDistId]->pos);
}
return dest;
}
vector<float> Pathfinder::calcHeuristics(vector<Map::Cell> &cells, int dest){
vector<float> heuristics;
@@ -92,10 +122,9 @@ namespace battleship{
UnitType ut = (UnitType)vehicleType;
Map::Cell::Type ct = cells[edgeNode].type;
bool ship = (ut == UnitType::UNDERWATER || ut == UnitType::SEA_LEVEL);
int weightMult = 1;
if((ut == UnitType::LAND && ct == Map::Cell::WATER) || (ship && ct == Map::Cell::LAND))
weightMult = 10;
continue;
/*
if(vehicleType != -1){
UnitType unitType = vehicle->getType();
@@ -125,8 +154,8 @@ namespace battleship{
}
*/
if(distances[vertStrich] + weightMult * cells[vertStrich].edges[i].weight < distances[edgeNode]){
distances[edgeNode] = distances[vertStrich] + weightMult * cells[vertStrich].edges[i].weight;
if(distances[vertStrich] + cells[vertStrich].edges[i].weight < distances[edgeNode]){
distances[edgeNode] = distances[vertStrich] + cells[vertStrich].edges[i].weight;
paths[edgeNode] = paths[vertStrich];
paths[edgeNode].push_back(edgeNode);
}
+1
View File
@@ -13,6 +13,7 @@ namespace battleship{
class Pathfinder{
public:
static Pathfinder* getSingleton();
int clampDestToSourceRegion(int, int);
std::vector<float> calcHeuristics(std::vector<Map::Cell>&, int);
std::vector<int> findPath(std::vector<Map::Cell>&, std::vector<float>&, int, int, int = -1);
inline vb01::u32 getImpassibleNodeVal(){return impassibleNodeVal;}
+43 -60
View File
@@ -317,73 +317,67 @@ namespace battleship{
debugPathPoints.push_back(n);
}
//TODO allow ships to attack land targets and vice versa
//TODO recursively search for vacant dest cell neibourghss
bool Vehicle::canReachTarget(Vector3 destPos, int &source, int &dest){
void Vehicle::preparePathpoints(Order &order, Vector3 destPos, bool appendDestPos){
removeAllPathpoints();
Map *map = Map::getSingleton();
vector<Map::Cell> &cells = map->getCells();
source = map->getCellId(pos);
int source = map->getCellId(pos);
bool ship = (type == UnitType::UNDERWATER || type == UnitType::SEA_LEVEL);
bool waterVehCanMove = (ship && cells[source].type == Map::Cell::WATER);
bool landVehCanMove = (type == UnitType::LAND && cells[source].type == Map::Cell::LAND);
if(type != UnitType::HOVER && !(waterVehCanMove || landVehCanMove)) return false;
if(type != UnitType::HOVER && !(waterVehCanMove || landVehCanMove)) return;
dest = map->getCellId(destPos);
int dest = map->getCellId(destPos);
if(type != UnitType::UNDERWATER && type == UnitType::SEA_LEVEL && fabs(destPos.y - cells[dest].pos.y) > .1) return false;
if(type == UnitType::SEA_LEVEL && fabs(destPos.y - cells[dest].pos.y) > .1) return;
Pathfinder *pf = Pathfinder::getSingleton();
if(type != UnitType::HOVER)
dest = pf->clampDestToSourceRegion(source, dest);
if(cells[dest].blockedBy){
vector<int> surrCellIds = map->getSurroundingCells(cells[dest].pos, 1);
int altDest = -1;
for(int scid : surrCellIds){
if(!cells[scid].blockedBy)
if(!cells[scid].blockedBy){
switch(type){
case UnitType::HOVER:
dest = scid;
return true;
altDest = scid;
break;
case UnitType::LAND:
if(cells[scid].type == Map::Cell::LAND){
dest = scid;
return true;
}
if(cells[scid].type == Map::Cell::LAND)
altDest = scid;
break;
case UnitType::SEA_LEVEL:
case UnitType::UNDERWATER:
if(cells[scid].type == Map::Cell::WATER){
dest = scid;
return true;
}
if(cells[scid].type == Map::Cell::WATER)
altDest = scid;
break;
}
if(altDest != -1){
dest = altDest;
break;
}
}
}
return false;
}
else return true;
}
bool Vehicle::truncatePath(Order &order, vector<int> &path, Vector3 destPos, bool appendDestPos){
bool pathTruncated = false;
bool ship = (type == UnitType::UNDERWATER || type == UnitType::SEA_LEVEL);
vector<Map::Cell> &cells = Map::getSingleton()->getCells();
for(int i = 1; i < path.size(); i++){
if((ship && cells[path[i]].type != Map::Cell::WATER) || (order.type != Order::TYPE::GARRISON && type == UnitType::LAND && cells[path[i]].type != Map::Cell::LAND)){
path = vector<int>(path.begin(), path.begin() + i);
order.targets[0].unit = nullptr;
order.targets[0].pos = cells[path[i - 1]].pos;
pathTruncated = true;
break;
}
else if(order.type == Order::TYPE::GARRISON && type == UnitType::LAND && cells[path[i]].type != Map::Cell::LAND && path.size() - 1 != i)
return false;
if(altDest == -1) return;
}
for(int p : path) addPathpoint(cells[p].pos);
vector<float> heurs;
vector<int> path = pf->findPath(cells, heurs, source, dest, (int)type);
Vector3 *truncPoint = nullptr;
if(order.targets[0].unit && !pathTruncated){
if(order.targets[0].unit){
GameObject *targObj = order.targets[0].unit;
for(int i = path.size() - 1; i >= 0; i--){
@@ -416,34 +410,23 @@ namespace battleship{
if(dirAngle <= a1) dist = (.5 * length) / cos(dirAngle);
else if(leftAngle <= a2) dist = (.5 * width) / cos(leftAngle);
addPathpoint(targPos + pointDir.norm() * dist);
pathTruncated = true;
truncPoint = new Vector3;
*truncPoint = (targPos + pointDir.norm() * dist);
break;
}
else removePathpoint(pathPoints.size() - 1);
else path.pop_back();
}
}
if(appendDestPos && !pathTruncated)
for(int p : path) addPathpoint(cells[p].pos);
if(appendDestPos && !truncPoint)
addPathpoint(destPos);
return true;
}
void Vehicle::preparePathpoints(Order &order, Vector3 destPos, bool appendDestPos){
removeAllPathpoints();
vector<Map::Cell> &cells = Map::getSingleton()->getCells();
int source, dest;
if(!canReachTarget(destPos, source, dest)) return;
vector<float> heurs;
Pathfinder *pf = Pathfinder::getSingleton();
vector<int> path = pf->findPath(cells, heurs, source, dest, (int)type);
if(path.empty() || !truncatePath(order, path, destPos, appendDestPos)) return;
else if(truncPoint){
addPathpoint(*truncPoint);
delete truncPoint;
}
path.erase(path.begin());
}
+1 -1
View File
@@ -25,7 +25,7 @@ namespace battleship{
vb01::s64 lastBuildTime = 0;
inline int getNextPatrolPointId(int numPoints) {return patrolPointId == numPoints - 1 ? 0 : patrolPointId + 1;}
bool canReachTarget(vb01::Vector3, int&, int&);
bool adjustDest(vb01::Vector3, int&, int&);
bool truncatePath(Order&, std::vector<int>&, vb01::Vector3, bool);
void startCurrentOrder();
bool validateGarrisonOrder(Order);