Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Airplane Group Spawning #77

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Airplane Group Spawning #77

wants to merge 6 commits into from

Conversation

Wizxrd
Copy link

@Wizxrd Wizxrd commented Nov 13, 2021

Initial implementation of spawning an airplane group from an airbase, zone, or lat lon coordinate with any number of points. When spawning from an airbase you have the option to spawn hot, cold, runway and in air.
Individual unit payloads are yet to be implemented as are taskings for each point in the route. These can be complex tasks to get done properly, so need to think about how it should be done easily for the end user.

added createPlaneGroupTemplate
returns a table required to spawn an airplane group

added createPlaneGroupUnitsTemplate
return a table of units needed to spawn an airplane
prepares units to spawn from an airbase, zone, or lat lon
if spawned from an airbae options are hot, cold, air, or runway

added buildAirplanePoints
return a table of built points for airplane groups
points are based around vec3's that can be from zones, airbases and lat lon

notes:

  • when spawning an airplane from an airbase that is a ship it is required to use the unit name as the place
  • the place within units is the inital spawning place of the units
  • changed the addGroup method to include being able to pick a differnt tempalte based on params.template.type
  • types could be "Ground" "Helicopter, "Airplane", "Sea" if implemented that way

** Example Usage in Lua **

local groupTable = createPlaneGroupTemplate({
  groupName = "Hornet 1",
  task = "CAP",
  points = {
    {
      alt = 2000,
      alt_type = "BARO",
      place = "Naval-1-1", -- ship unit name
      type = takeoffTypes.hot,
      action = takeoffActions.hot,
      speed = 250,
    },
    {
      alt = 2000,
      alt_type = "BARO",
      place = "zone1",
      type = "Turning Point",
      action = "Turning Point",
      speed = 250,
    }
  },
  units = {
    -- these are required to be the same
    place = "Naval-1-1", -- ship unit name
    type = "FA-18C_hornet",
    alt = 4000,
    alt_type = "BARO",
    speed = 250,
    {
      unitName = "Hornet 1-1",
      skill = skill.Random,
      --parking =
      --parking_id =
      --callsign =
      --skill =
      --livery_id =
    },
    {
      unitName = "Hornet 1-2",
      skill = skill.High,
      --parking =
      --parking_id =
      --callsign =
      --skill =
      --livery_id =
    }
  }
})
coalition.addGroup(country.id.USA, Group.Category.AIRPLANE, groupTable)

- initial implementation of spawning an airplane group
@Wizxrd Wizxrd closed this Nov 13, 2021
@Wizxrd Wizxrd reopened this Nov 13, 2021
@rurounijones rurounijones self-requested a review November 14, 2021 02:57
Copy link
Contributor

@rurounijones rurounijones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Been talking to Wizxrd in Discord about this looking at this.

Added some comments that could be fixed now while I ponder what we can do in the gRPC layer to simplify things.

lua/methods/coalitions.lua Outdated Show resolved Hide resolved
lua/methods/coalitions.lua Outdated Show resolved Hide resolved
lua/methods/coalitions.lua Outdated Show resolved Hide resolved
lua/methods/coalitions.lua Outdated Show resolved Hide resolved
lua/methods/coalitions.lua Outdated Show resolved Hide resolved
local builtPoints = {}
for _, pointData in pairs(points) do
local pointVec3
if type(pointData.place) == "string" then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll think about if we can do this in a different way by having gRPC types. No need to change this for the moment, just an FYI.

If may be that we do not allow clients to specify anything other than a Lat/Lon/Alt point since the client can get the information on airfield locations and zones themselves and send us that data instead of making us find it server-side.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On reflection I think we should only allow Lat/Lon/alt using the Position Protobuf message. Clients should be able to get all the information they need to be able to popualte this information themselves and it simplifies the lua a lot.

lua/methods/coalitions.lua Outdated Show resolved Hide resolved
lua/methods/coalitions.lua Outdated Show resolved Hide resolved
lua/methods/coalitions.lua Outdated Show resolved Hide resolved
}
end
-- here we ammend the first point to allow for spawns from airbases if it isn't an airspawn
if Airbase.getByName(points[1].place) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again as an FYI this bit may change, but nothing to do yet.

@justin-lovell
Copy link
Collaborator

Howdy @rurounijones and @Wizxrd ! I am interested in this feature being added to the core project; and I can't find Discord link anywhere so I can't follow up on that channel -- is there something I could do to help with this first push, and follow up with additional work? E.g. Ships.

@rurounijones
Copy link
Contributor

rurounijones commented Dec 29, 2021

We are using the OverlordBot Discord for this (Don't want to setup another project specific Discord). https://discord.gg/9RqyTJt

I am busy with OverlordBot stuff at the moment, but there was a bit of discussion in the #developers channel of the gRPC category of that Discord. So you can have a look there.

Basically it was, as far as my memory goes, what changes we can make to this to abstract some things at the gRPC level using existing constructs (e.g. using a Position construct instead of sending lat/lon at the gRPC level)

See also: #76 for other discussion

@rurounijones rurounijones added the help wanted Extra attention is needed label Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants