View Issue Details

IDProjectCategoryLast Update
0021318AI War 2Gameplay IdeaMar 12, 2021 9:18 pm
ReporterChris_McElligottPark Assigned ToChris_McElligottPark  
Status resolvedResolutionfixed 
Product Version0.871 More Control, Part 1 
Summary0021318: To Fix: AI ships (and possibly your own ships) pushing around fleet leaders. (Help wanted)
DescriptionThe fleet leaders really shouldn't be pushed around by anything short of the devourer golem. If anyone has a savegame where we can duplicate that easily, that would be appreciated.

Thanks to AnnoyingOrange for reporting.
TagsNo tags attached.

Relationships

related to 0021240 resolvedChris_McElligottPark Decollision planning weirdness 
related to 0019443 assignedChris_McElligottPark Poor collision detection for Golems 
related to 0021035 resolvedChris_McElligottPark Bug: ships are sitting inside the armored golem. 
child of 0021310 resolvedChris_McElligottPark Fleets Phase 3 - Parent 

Activities

Chris_McElligottPark

Jul 4, 2019 3:45 pm

administrator   ~0052042

If anyone else feels like investigating this, that's certainly a welcome thing. It shouldn't be a hard fix, but it should be a bear to track down in terms of time expenditure. Not a great combo for me, though I recognize that's not fun for *anyone*.

ptarth

Jul 4, 2019 5:18 pm

reporter   ~0052046

I've been trying to replicate.
One case is when the flagship builds a ship, the new ship has speed = 0 and the flagship loses priority. I'm parsing the code trying to find the production segment, but ran out of time. A simple hack would be to spawn the fleetships with 1 speed or to spawn them outside of the flagship's location. I'll continue digging, but if someone wants to do it first, go for it.

Chris_McElligottPark

Jul 5, 2019 9:05 am

administrator   ~0052048

I think I have an idea for what is going on with that; I'll fix the thing I can think of. Are you in svn for this project? I can't remember.

Chris_McElligottPark

Jul 5, 2019 9:09 am

administrator   ~0052049

In DecollisionPlanning.cs, these lines at 453:

if ( hasPriority && otherEntity.CalculatedSpeed <= 0 )
                    hasPriority = false;

Are now:

if ( hasPriority && otherEntity.CalculatedSpeed <= 0 )
                {
                    //if the thing that we're checking is a fleet leader,
                    //and the thing that might bump it out of the way CAN move
                    //but is just frozen now for any reason, then
                    //don't let that other thing bump the fleet leader out of position
                    if ( entity.TypeData.SpecialType.GetIsFleetLeader() && otherEntity.DataForMark.Speed > 0 )
                    { }
                    else
                        hasPriority = false;
                }


I've not tested this at all, but it would probably solve the problem.

Chris_McElligottPark

Jul 5, 2019 9:11 am

administrator   ~0052050

Coming in 0.873:

* Put in a potential fix for your fleet centerpieces getting bumped around as units spawn out of them. If there are any other cases where fleet centerpieces are moving when they really should not be moving, then please let us know; we haven't tested this one yet, but it has a high chance of working (and certainly shouldn't make anything worse).

ptarth

Jul 5, 2019 10:22 am

reporter   ~0052052

I don't think I have svn access. I check my email and didn't see anything during my hiatus. I pinged you about getting access a while back so I could do some of the low level maintenance stuff, but I'm guessing its stuck in your email backlog somewhere.

Chris_McElligottPark

Jul 5, 2019 10:31 am

administrator   ~0052054

Sorry about that! I've added the access for you now, and there's an email with instructions. I have a couple of emails from you that I need to respond to soon, but my inbox has just been very full and I've been trying to slowly get through them. I did read it, though, and was very touched and really appreciate it.

wm46

Jul 6, 2019 5:38 am

reporter   ~0052064

I just marked this as related to my previous report of weirdness in the decollision planning. For now most of the weirdness with centerpieces being pushed around seemed to be solved, but there's still edge cases where ships are somehow sent the wrong decollision order when there are ships being added to the planet (either by wormholes or by constructing/unloading).

Also, I've noticed fleetships have started not decolliding with centerpieces. I added a whole truck load of debugging, found out the issue is that the code is checking only for ships within the first entity's radius, rather than entity.Radius + otherEntity.Radius. This means smaller ships can sit inside bigger ships, as long as the center of the big ship is not within the smaller ship's radius.

Since you're using a less precise range check, a possible fix without being too conservative could be something like:

int radiusToCheck = workingCollisionRadius;
if ( radiusToCheck < otherEntity.DataForMark.Radius )
      radiusToCheck = otherEntity.DataForMark.Radius;

And then use radiusToCheck in place of workingCollisionRadius for the rest of the calculations.

Chris_McElligottPark

Jul 8, 2019 10:50 am

administrator   ~0052076

Thanks! I just checked in a change with your first set of suggested features:

* Fixed a bug that was letting small ships sit inside large ones. Mainly affecting things like Golems and Arks having other ships sitting inside them.
** The current fix is untested but should probably work.

Chris_McElligottPark

Jul 8, 2019 10:54 am

administrator   ~0052077

Relating to the other part, ships often have a GetSpeed() or a CalculatedSpeed value of 0 for various reasons, but they are a mobile ship.

This is often because they are paralyzed or engine-stunned, and other little things should spread out around them as IF they were immobile, but the big things should not. The other big reason is that when they are first spawned they have a speed of 0 for a half second or so.

All of that stuff is valid, and is working properly for most small things since they should treat even temporarily-immobile ships as if they are always-immobile... but things like flagships or anything else that we want to say "this doesn't get bumped around by ships entering the planet or spawning or getting engine-stunned" should ignore that. Maybe we need a new flag on units, so we can turn that on for things like mobile factories, although I think all of those are also flagships and thus already handled anyway.

Chris_McElligottPark

Mar 12, 2021 9:18 pm

administrator   ~0060755

Seems solved long ago.

Issue History

Date Modified Username Field Change
Jun 25, 2019 12:52 pm Chris_McElligottPark New Issue
Jun 25, 2019 12:52 pm Chris_McElligottPark Status new => assigned
Jun 25, 2019 12:52 pm Chris_McElligottPark Assigned To => Chris_McElligottPark
Jun 25, 2019 12:53 pm Chris_McElligottPark Relationship added child of 0021310
Jul 4, 2019 3:45 pm Chris_McElligottPark Note Added: 0052042
Jul 4, 2019 3:45 pm Chris_McElligottPark Summary To Fix: AI ships (and possibly your own ships) pushing around fleet leaders. => To Fix: AI ships (and possibly your own ships) pushing around fleet leaders. (Help wanted)
Jul 4, 2019 5:18 pm ptarth Note Added: 0052046
Jul 5, 2019 9:05 am Chris_McElligottPark Note Added: 0052048
Jul 5, 2019 9:09 am Chris_McElligottPark Note Added: 0052049
Jul 5, 2019 9:11 am Chris_McElligottPark Status assigned => feedback
Jul 5, 2019 9:11 am Chris_McElligottPark Note Added: 0052050
Jul 5, 2019 10:22 am ptarth Note Added: 0052052
Jul 5, 2019 10:31 am Chris_McElligottPark Note Added: 0052054
Jul 6, 2019 4:50 am wm46 Relationship added related to 0021240
Jul 6, 2019 5:38 am wm46 Note Added: 0052064
Jul 8, 2019 10:47 am Chris_McElligottPark Relationship added related to 0019443
Jul 8, 2019 10:47 am Chris_McElligottPark Relationship added related to 0021035
Jul 8, 2019 10:50 am Chris_McElligottPark Note Added: 0052076
Jul 8, 2019 10:54 am Chris_McElligottPark Note Added: 0052077
Mar 12, 2021 9:18 pm Chris_McElligottPark Status feedback => resolved
Mar 12, 2021 9:18 pm Chris_McElligottPark Resolution open => fixed
Mar 12, 2021 9:18 pm Chris_McElligottPark Note Added: 0060755