View Issue Details

IDProjectCategoryLast Update
0021318AI War 2[All Projects] Gameplay IdeaJul 8, 2019 10:54 am
Reporterx4000BughunterAssigned Tox4000Bughunter 
Severityminor 
Status feedbackResolutionopen 
Product Version0.871 More Control, Part 1 
Fixed in Version 
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 resolvedx4000Bughunter Decollision planning weirdness 
related to 0019443 assignedx4000Bughunter Poor collision detection for Golems 
related to 0021035 resolvedx4000Bughunter Bug: ships are sitting inside the armored golem. 
child of 0021310 assignedx4000Bughunter Fleets Phase 3 - Parent 

Activities

x4000Bughunter

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.

x4000Bughunter

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.

x4000Bughunter

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.

x4000Bughunter

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.

x4000Bughunter

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.

x4000Bughunter

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.

x4000Bughunter

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.

Issue History

Date Modified Username Field Change
Jun 25, 2019 12:52 pm x4000Bughunter New Issue
Jun 25, 2019 12:52 pm x4000Bughunter Status new => assigned
Jun 25, 2019 12:52 pm x4000Bughunter Assigned To => x4000Bughunter
Jun 25, 2019 12:53 pm x4000Bughunter Relationship added child of 0021310
Jul 4, 2019 3:45 pm x4000Bughunter Note Added: 0052042
Jul 4, 2019 3:45 pm x4000Bughunter 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 x4000Bughunter Note Added: 0052048
Jul 5, 2019 9:09 am x4000Bughunter Note Added: 0052049
Jul 5, 2019 9:11 am x4000Bughunter Status assigned => feedback
Jul 5, 2019 9:11 am x4000Bughunter Note Added: 0052050
Jul 5, 2019 10:22 am ptarth Note Added: 0052052
Jul 5, 2019 10:31 am x4000Bughunter 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 x4000Bughunter Relationship added related to 0019443
Jul 8, 2019 10:47 am x4000Bughunter Relationship added related to 0021035
Jul 8, 2019 10:50 am x4000Bughunter Note Added: 0052076
Jul 8, 2019 10:54 am x4000Bughunter Note Added: 0052077