View Issue Details

IDProjectCategoryLast Update
0019522AI War 2Gameplay IssueJun 28, 2018 5:48 pm
ReporterZeusAlmighty Assigned ToBadgerBadger  
Severityminor 
Status resolvedResolutionfixed 
Product Version0.715 
Summary0019522: Units won't go to (right) planet using galaxy map
DescriptionUnits are either not responding to orders vis a vis galaxy map or going to an entirely wrong planet--this isn't because they are pathing through a different route

Moreover, units that are sent using the galaxy map should have a highlighted route so it's obvious where they are going and how they are getting there
TagsNo tags attached.

Relationships

related to 0019413 resolvedkeith.lamothe Galaxy map move commands don't path through AI Planets 

Activities

Dune

Mar 22, 2018 11:48 am

administrator   ~0047267

Added link to this case to the Trello card for 19413

BadgerBadger

Mar 22, 2018 1:22 pm

manager   ~0047268

The code for highlighting a units route on the galaxy map exists. Sometimes the route finding code does not seem to work right.

BadgerBadger

Mar 23, 2018 5:46 pm

manager   ~0047280

Seems like sometimes we aren't clearing the previous selection somehow. I select units on planet A. Then I go to planet B and select those units. Then I try to issue a move command for the units on B to go to A and it fails saying "Can't find a path from A to A"

BadgerBadger

Mar 23, 2018 10:08 pm

manager   ~0047290

Last edited: Mar 23, 2018 10:13 pm

So here's what I think is happening. When the player issues a move command via the galaxy map, it does the following:
Choose a single random entity from the currently selected units:
                            List<Planet> planetsWithSelection = new List<Planet>();
                            Engine_AIW2.Instance.DoForSelected( SelectionCommandScope.AllPlanets, delegate ( GameEntity selected )
                            {
                                if(!planetsWithSelection.Contains(selected.Planet))
                                    planetsWithSelection.Add(selected.Planet);
                                entity = selected;
                                return DelReturn.Break;
                            } );
                            if ( entity == null )
                                break;

Then it finds the path for that unit, then uses that path for the move command for every unit in the selection. The problem is if you have units on multiple planets, sometimes the generated commands aren't meaningful. Also if the randomly chosen unit happens to already be at the planet then nothing will happen when the move command is issued (even if other units are on another planet and could take a move order). Naturally this only happens when your fleet gets spread out, and generally when there's a crisis battle going on and you need to send reinforcements desperately.

Proposed fix: instead of just generating a single Path and a single CoreFunction.SetWormholePath Command, instead loop over every unit in the Selection to figure out how many different planets they are on. Generate paths for each planet, then issue a series of GameCommands for each Planet with units in the selection on it.

If this sounds good to Keith then he can assign it to me to wrangle if he desires.

BadgerBadger

Mar 23, 2018 11:14 pm

manager   ~0047292

I have fixed the bug I mentioned above. It is possible there are other issues in this area, so please try it again in .716 and let us know if it's still being confusing.

Issue History

Date Modified Username Field Change
Mar 21, 2018 10:51 pm ZeusAlmighty New Issue
Mar 21, 2018 11:21 pm BadgerBadger Relationship added related to 0019413
Mar 21, 2018 11:38 pm ZeusAlmighty Category Gameplay Idea => Gameplay Issue
Mar 22, 2018 8:47 am Chris_McElligottPark Assigned To => keith.lamothe
Mar 22, 2018 8:47 am Chris_McElligottPark Status new => assigned
Mar 22, 2018 11:48 am Dune Note Added: 0047267
Mar 22, 2018 1:22 pm BadgerBadger Note Added: 0047268
Mar 23, 2018 5:46 pm BadgerBadger Note Added: 0047280
Mar 23, 2018 10:08 pm BadgerBadger Note Added: 0047290
Mar 23, 2018 10:13 pm BadgerBadger Note Edited: 0047290
Mar 23, 2018 11:14 pm BadgerBadger Status assigned => feedback
Mar 23, 2018 11:14 pm BadgerBadger Note Added: 0047292
Jun 28, 2018 5:48 pm Chris_McElligottPark Assigned To keith.lamothe => BadgerBadger
Jun 28, 2018 5:48 pm Chris_McElligottPark Status feedback => resolved
Jun 28, 2018 5:48 pm Chris_McElligottPark Resolution open => fixed