Jump to content

Please make formations usable by spawned units


Recommended Posts

PatrickAWlson
Posted

Currently, the formation command is only usable by units enabled from the outset of the mission.  A mission designer cannot enable every unit from the start due to performance reasons.  Use of spawning is therefore necessary.    However, spawned units do not respond to formation commands .... this is bad.

 

 

I know that it will take some thought but i should be possible to create a unified formation out of spawned entities.  The key elements are the target links to the leader and the number in formation parameter.  There must be a way to transcribe that from the spawn to the realized unit such that formation and other commands can be made to work.  Commands like formation could then be triggered post spawn and actually work.

 

  • Like 1
  • Upvote 7
SAS_Storebror
Posted (edited)

This.

 

Really, seriously, it cannot be that hard.

The inability of spawning formations currently results in utterly complex, rather poor "stand-in" solutions.

And while we're at it: Ship formations definitely need to be addressed before Battle of Normandy sees the light of the day, otherwise getting a fleet remotely organized to beach will become a PITA.

 

:drinks:

Mike

Edited by SAS_Storebror
Posted

I think it's not just about formations, but all group behaviour (cover, attack, go there, land...).

It could be done using a "join group MCU" for a very fluid membership relation, allowing e.g. planes to leave a group and join another group during the mission. Not that's a particularly asked for feature, but it's an example of what could be possible.

 

More precisely, I would suggest:

  • Add Group "fake" object with entity. This is the entity that is used in object links from command MCUs, proximity triggers, check zone... This object doesn't have a physical existence, and cannot be shot at, destroyed... It has a property, which is the group's name (the bird names, for planes). It would have events for: plane joined, plane left, plane destroyed, all planes destroyed, group is now empty (all planes left or destroyed)
  • Add Join/leave group MCU, object-linked to a plane or vehicle, and target-linked to a group object. It has a property, a number, which is the number in formation.

With that, everything that's linked to a plane would affect the plane only, while it's not in a group. When it joins a group, it does whatever the group is ordered to do. Groups are commanded by linking to the group object.

 

Of course, it's not too hard to design APIs (though it's hard to do right), the difficulty resides in how it fits in the existing engine.

 

By the way:

Quote

Currently, the formation command is only usable by units enabled from the outset of the mission

 

I'm not sure if I understand that right, but formation commands used to work in the past with units that are not checked as enabled from the start of the mission (provided they are not linked to a spawn MCU). If it no longer works, then that's a bug and should be fixed, which is likely easier than supporting group behaviour in spawned objects.

 

Maybe you @PatrickAWlson left out that scenario because it does not save CPU?

SAS_Storebror
Posted

Correct @coconut, you can have formations which are not enabled at mission start time and enable them later.

Problem is that even those "disabled" objects still eat CPU cycles.

You can try it yourself easily:

Create 50 formations of 4 AI bombers each, all of them disabled and you'll be surprised to see how your CPU goes apeshit about nothing.

 

:drinks:

Mike

PatrickAWlson
Posted (edited)
7 hours ago, coconut said:

By the way:

 

I'm not sure if I understand that right, but formation commands used to work in the past with units that are not checked as enabled from the start of the mission (provided they are not linked to a spawn MCU). If it no longer works, then that's a bug and should be fixed, which is likely easier than supporting group behaviour in spawned objects.

 

Maybe you @PatrickAWlson left out that scenario because it does not save CPU?

 

There are several conflicting concerns that have lead me to my current design.  

1. My missions require more AI entities than is currently feasible in the current engine.

2. My airborne units must not be limited to a single map position.  They must virtually go about their business until they are close enough to a player to be realized.  This is critical to have dynamic missions where surprising things happen.

 

I already have this in PWCG.  I developed virtual waypoints, a mechanism that amounts to moving collections of check zones, timers and their associated spawns.  This allows AI units to move across the map virtually (it is really one check zone being disabled, the next being enabled,at one minute intervals).  This requires spawns.

 

Because spawns do not have react properly to formation commands I have to replicate the actual and virtual waypoints for every aircraft in a flight.  Each aircraft becomes a flight of one.  The positions are offset by the precise formation spacing.  The result is that the AI will spawn in formation and fly in formation, not because they are told to but because their individual targets are precisely placed.  What I lose is any cohesion once formation is broken.  They will never reform. 

 

The costs of my methods are well worth the benefits.  Formations move virtually.  CPU is not consumed excessively from mission start.  I can get a lot of AI entities into a mission.  Surprises happen.  I can't over emphasize how important that is. It would be nice, however, if I could have the other benefits of formation while still spawning.  I am sure that  there must be other mission makers with their own reasons why this would be desirable.

 

Last note: this would tremendously benefit 1C's own career mode.  I cannot believe that they do not see the benefits of AI units moving independently without consuming precious CPU.  

 

I lied above ... one more note: I am able to do this because PWCG does it algorithmically.  It takes software microseconds to generate this once the hours have been spent to code it.  No way mission makers using the ME (See @SAS_Storebror example above) can do this.  

 

This is a PWCG mission opened in the ME:

 

PWCGMission.jpg

Edited by PatrickAWlson
  • Like 1
  • 2 months later...
PatrickAWlson
Posted
On 6/14/2020 at 4:38 AM, coconut said:

I'm not sure if I understand that right, but formation commands used to work in the past with units that are not checked as enabled from the start of the mission (provided they are not linked to a spawn MCU). If it no longer works, then that's a bug and should be fixed, which is likely easier than supporting group behaviour in spawned objects.

 

Maybe you @PatrickAWlson left out that scenario because it does not save CPU?

 

Should have responded to this much earlier. 

 

I have developed something that I call virtual waypoints.  it simulates the movement of the flight without actually having a flight spawned in the game .  A virtual flight is a series of moving check point each with a series of spawns and each will disable subsequent check points for the flight to prevent duplicate spawns.  Details aside, unrealized flights in PWCG missions move, meaning they can come to you as instead of just always triggering at a spot.  This continuous movement of AI flights is what I am unwilling to part with.

 

So, I could abandon virtual flights and just make every flight realized from the start.  Near certain CPU killer.  I could abandon moving unrealized flights, but I won't.  That is to me the biggest differentiator of PWCG missions.

 

What I am left with is almost every AI airplane  in PWCG is its own flight. Formation is simulated by spawning the AI flight all at once and having independent waypoints for each plane, with every waypoint for the flight being "in formation".  The result is that the flights do a good job of maintaining formation until they get  into combat, but it really is fakery.  The fact that I cannot use formation commands on spawned planes drives me nuts.  I would be happy to work with the devs on an algorithm that would allow it.  It is anything but impossible, at least conceptually.   

 

 

Posted
On 6/14/2020 at 5:59 PM, PatrickAWlson said:

This is a PWCG mission opened in the ME:

 

PWCGMission.jpg

 

Holy crap! ?

 

Now I appreciate your efforts even more than before.

Posted
20 minutes ago, PatrickAWlson said:

I have developed something that I call virtual waypoints.  it simulates the movement of the flight without actually having a flight spawned in the game .  A virtual flight is a series of moving check point each with a series of spawns and each will disable subsequent check points for the flight to prevent duplicate spawns

 

I understand that, and indeed it is a major technical achievement of your mission generation system. But there's another option that you did not mention, and I wonder if you have thought about it. Instead of having you virtual waypoints spawn planes, you could have them activate entire wings that are not enabled from start.

PatrickAWlson
Posted
Just now, coconut said:

 

I understand that, and indeed it is a major technical achievement of your mission generation system. But there's another option that you did not mention, and I wonder if you have thought about it. Instead of having you virtual waypoints spawn planes, you could have them activate entire wings that are not enabled from start.

 

I think I see what you are saying.  I just ran a test and it produced good results.  My concern would be what @SAS_Storebror said.  If I did that i would have thousands of planes on the map in a disabled state.  

 

Just ran a test mission with > 2000 disabled B25s  on the map and it came off fairly well.  Only noticed a severe degradation when 15 of them actually spawned.  

 

Might be worth a go.  I can space the VWPs a little further to reduce the count a bit.  

 

test attached.

ActivateTest.zip

Posted (edited)

It should be noted that a disabled aircraft is a disabled aircraft. Whether it’s set to be enabled in the future, or spawned in the future should be irrelevant to it’s draw on resources in it’s disabled state.

Edited by Gambit21
SAS_Storebror
Posted
9 hours ago, Gambit21 said:

should be irrelevant to it’s draw on resources in it’s disabled state.

That's the theory.

Unfortunately the results are pretty mixed.

While synthetic tests, where only such disabled planes are present, yield the expected results, "real life" tests with populated missions show much more of an impact on performance, even if the planes are disabled all the time.

The results from adding objects to a mission are pretty unpredictable unfortunately.

A few months ago, in an attempt to keep players from taking off all across a base and enforcing the use of taxiways and runways instead, I've put static fence objects all along the taxiways to the runway ends. Simple static fences, not even with entities to them. DServer completely freaked out on a medium 3-digit number of fences added like that.

Couldn't believe when I saw it, but simply removing the fences again made the mission play like normal.

 

:drinks:

Mike

  • 2 weeks later...
Posted (edited)

@Gambit21

Still early, but a test with many disabled aircraft would seem to indicate that @SAS_Storebror is right.  Five planes enabled and performance is in the dirt.  Time compression has almost zero effect.  

 

Performance degradation for a disabled plane doesn't even come close to the impact of an enabled plane, but doing PWCG virtual waypoints with disabled planes instead of spawns causes me to put dozens (possibly hundreds) of them on the map.  

 

I asked this question on the mission making forum.  If either of you have an idea please let me know.  Is it possible to move the position of a disabled plane before enabling it?

Edited by PatrickAWlson
Posted (edited)

So that I’m clear.

We know that an aircraft has 2 states - enabled or disabled.

 

If disabled it has 2 possible future states.

Enabled or Spawned.

 

So the problem is (and I was told this back years ago as well) that a disabled aircraft that is set to be “enabled” takes far more resources than a disabled aircraft set to be “spawned”

 

Makes zero sense. I believe you guys, but it makes no sense. I remember Coconut or Haash or someone saying this back when, but never pondered it until recently.

 

@PatrickAWlson I’m confused by this...

 

“doing PWCG virtual waypoints with disabled planes instead of spawns causes me to put dozens (possibly hundreds) of them on the map”

 

Can you clarify? You seem to be saying disabled (to be enabled rather than spawned) are more efficient for you.

 

There is no way to “move” an aircraft pre-spawn/enabling. However I’ll bet you can code the spawn/spawn “at me” to move with your virtual waypoints...(edit: read your posts again and realize this won’t work for you)

 

 

 

Also - you ran into performance issues with 5 enabled aircraft?

 

I pm’d you - let’s chat on the phone when you can.

Edited by Gambit21
  • 3 months later...
Posted
On 9/7/2020 at 8:39 PM, PatrickAWlson said:

What I am left with is almost every AI airplane  in PWCG is its own flight.

 

I think I've listened to their radio calls once/twice.

A group of i. e.bombers where every pilot talked like being the flight leader; confused me first because I expected much more planes in the air after hearing that. :biggrin:

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...