Full map configs for all above ground continents including battle islands and oshur prime (#245)

* Move door orientation logic from the door itself to the IFF lock, as the lock has the correct orientation in the UBR files, whereas the door does not.

* Remove ModelID from buildings (is now GUID) and change "ID" to be "MapId". A building can also be constructed with both a GUID and MapID.

* Update Maps.scala and Zones.scala to (for the moment) only have Ishundar configured with Sounours V3 playtest base ownership. Default starting zone is also moved to Ishundar for now.

* Fix oopsie with West Zaqar Tower

* Add proximity terminal positions to constructors

* Offset vehicle spawning by the correct amount from game_objects.adb.lst

* Orient players correctly when spawning at a respawn tube

* Apply a 90 degree offset to tech plant garage locks, as these are the only locks where the orientation does not match the orientation of the door

* Add missing spawn terminals, repair/rearm terminals for both ground and air.

* Additional documentation for GOAM / PAM packets

* Add extra arguments to building LocalObjects to make it a bit more DRY and reduce line count for map files

* Split maps configuration into separate files and add every above ground map (including battle islands and oshur prime)

* Fix ZoneTest typo

* Update vehicle spawn pads to use the correct object types, Z offsets and Z orient offsets

* Update ZoneMaps with the new vehicle spawn pad definitions and fix a few issues with sanctuary GUIDs (special thanks to the one person that used capitals in the .lst files when no other object uses them)

* Comment out duplicate instance of ObjectDetachMessage being sent

* Apparently TR sanc has an extra 6 repair silos, now accounted for.
This commit is contained in:
Mazo 2019-04-04 19:44:57 +01:00 committed by Fate-JH
parent 3738feec12
commit 7fcbf7bf41
28 changed files with 31296 additions and 6249 deletions

View file

@ -1000,7 +1000,9 @@ object GlobalDefinitions {
val repair_silo = new MedicalTerminalDefinition(729)
val spawn_pad = new VehicleSpawnPadDefinition
val mb_pad_creation = new VehicleSpawnPadDefinition(525)
val dropship_pad_doors = new VehicleSpawnPadDefinition(261)
val mb_locker = new LockerDefinition

View file

@ -182,20 +182,21 @@ object VehicleSpawnPad {
/**
* Instantiate and configure a `VehicleSpawnPad` object
* @param pdef the `ObjectDefinition` that constructs this object and maintains some of its immutable fields
* @param pos the position (used to determine spawn point)
* @param orient the orientation (used to indicate spawn direction)
* @param id the unique id that will be assigned to this entity
* @param context a context to allow the object to properly set up `ActorSystem` functionality
* @return the `VehicleSpawnPad` object
*/
def Constructor(pos : Vector3, orient : Vector3)(id : Int, context : ActorContext) : VehicleSpawnPad = {
def Constructor(pdef: VehicleSpawnPadDefinition, pos : Vector3, orient : Vector3)(id : Int, context : ActorContext) : VehicleSpawnPad = {
import akka.actor.Props
import net.psforever.objects.GlobalDefinitions
val obj = VehicleSpawnPad(GlobalDefinitions.spawn_pad)
val obj = VehicleSpawnPad(pdef)
obj.Position = pos
obj.Orientation = orient
obj.Actor = context.actorOf(Props(classOf[VehicleSpawnControl], obj), s"${GlobalDefinitions.spawn_pad.Name}_$id")
obj.Actor = context.actorOf(Props(classOf[VehicleSpawnControl], obj), s"${obj.Definition.Name}_$id")
obj
}
}

View file

@ -5,8 +5,38 @@ import net.psforever.objects.definition.ObjectDefinition
/**
* The definition for any `VehicleSpawnPad`.
* Object Id 800.
*/
class VehicleSpawnPadDefinition extends ObjectDefinition(800) {
Name = "spawn_pad"
class VehicleSpawnPadDefinition(objectId : Int) extends ObjectDefinition(objectId) {
// Different pads require a Z offset to stop vehicles falling through the world after the pad rises from the floor, these values are found in game_objects.adb.lst
private var vehicle_creation_z_offset = 0f
// Different pads also require an orientation offset when detaching vehicles from the rails associated with the spawn pad, again in game_objects.adb.lst
// For example: 9754:add_property dropship_pad_doors vehiclecreationzorientoffset 90
// However, it seems these values need to be reversed to turn CCW to CW rotation (e.g. +90 to -90)
private var vehicle_creation_z_orient_offset = 0f
def VehicleCreationZOffset : Float = vehicle_creation_z_offset
def VehicleCreationZOrientOffset : Float = vehicle_creation_z_orient_offset
objectId match {
case 141 =>
Name = "bfr_door"
vehicle_creation_z_offset = -4.5f
vehicle_creation_z_orient_offset = 90f
case 261 =>
Name = "dropship_pad_doors"
vehicle_creation_z_offset = 4.89507f
vehicle_creation_z_orient_offset = -90f
case 525 =>
Name = "mb_pad_creation"
vehicle_creation_z_offset = 2.52604f
case 615 => Name = "pad_create"
case 616 =>
Name = "pad_creation"
vehicle_creation_z_offset = 1.70982f
case 816 => Name = "spawnpoint_vehicle"
case 947 => Name = "vanu_vehicle_creation_pad"
case _ => throw new IllegalArgumentException("Not a valid object id with the type vehicle_creation_pad")
}
}

View file

@ -47,11 +47,26 @@ class ZoneMap(private val name : String) {
* Append the builder for a server object to the list of builders known to this `ZoneMap`.
* @param id the unique id that will be assigned to this entity
* @param constructor the logic that initializes the emitted entity
* @param owning_building_guid The guid of the building this object should belong to, if specified
* @param door_guid The guid of the door this object (typically a lock) should be linked to, if specified
* @param terminal_guid The guid of the terminal this object (typically a spawn pad) should be linked to, if specified
* @return the current number of builders
*/
def LocalObject[A <: PlanetSideServerObject](id : Int, constructor : ServerObjectBuilder.ConstructorType[A]) : Int = {
def LocalObject[A <: PlanetSideServerObject](id : Int, constructor : ServerObjectBuilder.ConstructorType[A], owning_building_guid : Int = 0, door_guid : Int = 0, terminal_guid: Int = 0) : Int = {
if(id > 0) {
localObjects = localObjects :+ ServerObjectBuilder[A](id, constructor)
if(owning_building_guid > 0) {
ObjectToBuilding(id, owning_building_guid)
}
if(door_guid > 0) {
DoorToLock(door_guid, id)
}
if(terminal_guid > 0) {
TerminalToSpawnPad(terminal_guid, id)
}
}
localObjects.size
}

View file

@ -18,6 +18,8 @@ import shapeless.{::, HNil}
* 60, 61, 62, 63 - Displays "This facility's generator is under attack!"
* 64, 65, 66, 67 - Displays "Generator has Overloaded! Evacuate Generator Room Immediately!"
* 68, 69, 70, 71 - Displays "This facility's generator is back on line"
* 88, 89, 90, 91 - ???? (Has been seen on vehicle pad objects)
* 92, 93, 94, 95 - Plays vehicle pad animation moving downwards
* 96, 97, 98, 99 - Makes the vehicle bounce slightly. Have seen this in packet captures after taking a vehicle through a warpgate
* 200, 201, 202, 203 - For aircraft - client shows "THe bailing mechanism failed! To fix the mechanism, land and repair the vehicle!"
* 224 - Sets vehicle or player to be black ops

View file

@ -394,7 +394,7 @@ class GuidedControlTest1 extends ActorTest {
driver.VehicleSeated = vehicle.GUID
val sendTo = TestProbe()
val order = VehicleSpawnControl.Order(driver, vehicle, sendTo.ref)
val pad = VehicleSpawnPad(GlobalDefinitions.spawn_pad)
val pad = VehicleSpawnPad(GlobalDefinitions.mb_pad_creation)
pad.GUID = PlanetSideGUID(1)
pad.Railed = false //suppress certain events
val guided = system.actorOf(Props(classOf[VehicleSpawnControlGuided], pad), "pad")
@ -416,7 +416,7 @@ class GuidedControlTest2 extends ActorTest {
driver.VehicleSeated = vehicle.GUID
val sendTo = TestProbe()
val order = VehicleSpawnControl.Order(driver, vehicle, sendTo.ref)
val pad = VehicleSpawnPad(GlobalDefinitions.spawn_pad)
val pad = VehicleSpawnPad(GlobalDefinitions.mb_pad_creation)
pad.Railed = false //suppress certain events
val guided = system.actorOf(Props(classOf[VehicleSpawnControlGuided], pad), "pad")
@ -441,7 +441,7 @@ class GuidedControlTest3 extends ActorTest {
driver.VehicleSeated = vehicle.GUID
val sendTo = TestProbe()
val order = VehicleSpawnControl.Order(driver, vehicle, sendTo.ref)
val pad = VehicleSpawnPad(GlobalDefinitions.spawn_pad)
val pad = VehicleSpawnPad(GlobalDefinitions.mb_pad_creation)
pad.Railed = false //suppress certain events
val guided = system.actorOf(Props(classOf[VehicleSpawnControlGuided], pad), "pad")
@ -479,7 +479,7 @@ class GuidedControlTest4 extends ActorTest {
driver.VehicleSeated = vehicle.GUID
val sendTo = TestProbe()
val order = VehicleSpawnControl.Order(driver, vehicle, sendTo.ref)
val pad = VehicleSpawnPad(GlobalDefinitions.spawn_pad)
val pad = VehicleSpawnPad(GlobalDefinitions.mb_pad_creation)
pad.Railed = false //suppress certain events
val guided = system.actorOf(Props(classOf[VehicleSpawnControlGuided], pad), "pad")

View file

@ -3,6 +3,7 @@ package objects
import akka.actor.{Actor, ActorContext, Props}
import base.ActorTest
import net.psforever.objects.GlobalDefinitions
import net.psforever.objects.guid.NumberPoolHub
import net.psforever.packet.game.PlanetSideGUID
import net.psforever.objects.serverobject.ServerObjectBuilder
@ -155,7 +156,7 @@ class VehicleSpawnPadObjectBuilderTest extends ActorTest {
"build" in {
val hub = ServerObjectBuilderTest.NumberPoolHub
val actor = system.actorOf(Props(classOf[ServerObjectBuilderTest.BuilderTestActor], ServerObjectBuilder(1,
VehicleSpawnPad.Constructor(Vector3(1.1f, 2.2f, 3.3f), Vector3(4.4f, 5.5f, 6.6f))
VehicleSpawnPad.Constructor(GlobalDefinitions.mb_pad_creation, Vector3(1.1f, 2.2f, 3.3f), Vector3(4.4f, 5.5f, 6.6f))
), hub), "pad")
actor ! "!"

View file

@ -18,20 +18,20 @@ import scala.concurrent.duration._
class VehicleSpawnPadTest extends Specification {
"VehicleSpawnPadDefinition" should {
"define" in {
GlobalDefinitions.spawn_pad.ObjectId mustEqual 800
GlobalDefinitions.mb_pad_creation.ObjectId mustEqual 525
}
}
"VehicleSpawnPad" should {
"construct" in {
val obj = VehicleSpawnPad(GlobalDefinitions.spawn_pad)
val obj = VehicleSpawnPad(GlobalDefinitions.mb_pad_creation)
obj.Actor mustEqual ActorRef.noSender
obj.Definition mustEqual GlobalDefinitions.spawn_pad
obj.Definition mustEqual GlobalDefinitions.mb_pad_creation
obj.Railed mustEqual true
}
"un-railed" in {
val obj = VehicleSpawnPad(GlobalDefinitions.spawn_pad)
val obj = VehicleSpawnPad(GlobalDefinitions.mb_pad_creation)
obj.Railed mustEqual true
obj.Railed = false
obj.Railed mustEqual false
@ -42,8 +42,8 @@ class VehicleSpawnPadTest extends Specification {
class VehicleSpawnControl1Test extends ActorTest {
"VehicleSpawnControl" should {
"construct" in {
val obj = VehicleSpawnPad(GlobalDefinitions.spawn_pad)
obj.Actor = system.actorOf(Props(classOf[VehicleSpawnControl], obj), "door")
val obj = VehicleSpawnPad(GlobalDefinitions.mb_pad_creation)
obj.Actor = system.actorOf(Props(classOf[VehicleSpawnControl], obj), "mb_pad_creation")
assert(obj.Actor != ActorRef.noSender)
}
}
@ -337,7 +337,7 @@ object VehicleSpawnPadControlTest {
zone.Actor ! Zone.Init()
vehicle.Actor = system.actorOf(Props(classOf[VehicleControl], vehicle), s"vehicle-control-${System.nanoTime()}")
val pad = VehicleSpawnPad(GlobalDefinitions.spawn_pad)
val pad = VehicleSpawnPad(GlobalDefinitions.mb_pad_creation)
pad.Actor = system.actorOf(Props(classOf[VehicleSpawnControl], pad), s"test-pad-${System.nanoTime()}")
pad.Owner = new Building(building_guid = 0, map_id = 0, zone, StructureType.Building)
pad.Owner.Faction = faction

View file

@ -36,7 +36,7 @@ class ZoneTest extends Specification {
map.LocalBuilding(building_guid = 10, map_id = 0, FoundationBuilder(test))
map.LocalBuildings.keySet.contains((10, 0)) mustEqual true
map.LocalBuilding(building_guid = -1, map_id = 0, FoundationBuilder(test))
map.LocalBuildings.keySet.contains((0, 0)) mustEqual true
map.LocalBuildings.keySet.contains((10, 0)) mustEqual true
map.LocalBuildings.keySet.contains((-1, 0)) mustEqual false
}