Author Topic: Problem With Control Groups  (Read 12458 times)

Offline Pluto011

  • Newbie Mark II
  • *
  • Posts: 18
Problem With Control Groups
« on: March 29, 2018, 01:08:55 pm »
Trying to give the alpha of this another play. I just unlocked mark II fighters, and the game won't allow me to add it in to a control group with my mark I ships. When I try it, the group only contains the mark I bombers and corvettes. Not sure if this is a bug or I am missing something.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Problem With Control Groups
« Reply #1 on: March 29, 2018, 01:24:32 pm »
Do you have a savegame? In general you mark I ships should all become mark II very fast after you unlock the new mark. The ones from the same line, I mean. Fighters 1 become fighters 2 after being upgraded by a builder when you unlock fighter 2. Different from the first game. Of course, bomber 1 would stay bomber 1 if you unlock fighter 2.

There are a number of control group bugs in general right now on mantis, so it might not be related to mark levels at all, I don't know.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Pluto011

  • Newbie Mark II
  • *
  • Posts: 18
Re: Problem With Control Groups
« Reply #2 on: March 29, 2018, 01:35:13 pm »
Yeah all the fighters became mark 2 fine. They just weren't going in the right control group. It started working after I captured a planet, or possibly after a few of them died.

Unfortunately I don't have a save. Didn't think to make one when it was happening.
« Last Edit: March 29, 2018, 01:39:29 pm by Pluto011 »

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Problem With Control Groups
« Reply #3 on: March 29, 2018, 02:06:40 pm »
No problem. If you find a way to reproduce it, please let us know. Do you think that as they upgraded they lost their control group?
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Pluto011

  • Newbie Mark II
  • *
  • Posts: 18
Re: Problem With Control Groups
« Reply #4 on: March 29, 2018, 02:43:55 pm »
Something like that, yeah. It's definitely linked to upgrading them. I'll try to reproduce it later for you.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Problem With Control Groups
« Reply #5 on: March 29, 2018, 02:56:12 pm »
Thank you!  If you can throw it on mantis for Keith to get if you do find a repro, that's extra awesome, too. :)
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: Problem With Control Groups
« Reply #6 on: March 29, 2018, 02:59:37 pm »
Can confirm Pluto011's issue. If you look at the upgrade code in Faction.cs, it does the following:
Code: [Select]
GameEntity newEntity = GameEntity.CreateNew( squad.PlanetFaction, typeICanUpgradeInto, squad.WorldLocation, Context );       
squad.EntitySpecificOrders.CopyTo( newEntity.EntitySpecificOrders );                             
newEntity.EntitySpecificOrders.ControlGroup = squad.EntitySpecificOrders.ControlGroup;       

So the newly created entity knows it should be in a control group. Unfortunately the control group doesn't know this entity is in it. I tried adding the line
Code: [Select]
newEntity.EntitySpecificOrders.ControlGroup.AddEntity(newEntity);


to this code and it seemed to fix the problem for me. I'm not positive if correct, and it's Keith part of the code, so I'd like him to bless this approach lest there be unexpected gotchas.

Pluto, in the meantime if you just hit "M" (to select all mobile military ships) then hit Ctrl-1 (to recreate control group 1 with those ships in it), that should be a suitable workaround.
« Last Edit: March 29, 2018, 03:08:27 pm by BadgerBadger »

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Problem With Control Groups
« Reply #7 on: March 29, 2018, 03:12:50 pm »
You're quite correct, Badger.

It was goof on my part to do the assignment directly.

The best fix would be to replace

Code: [Select]
newEntity.EntitySpecificOrders.ControlGroup = squad.EntitySpecificOrders.ControlGroup;
with

Code: [Select]
if(squad.EntitySpecificOrders.ControlGroup != null)
    squad.EntitySpecificOrders.ControlGroup.AddEntity(newEntity);
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: Problem With Control Groups
« Reply #8 on: March 29, 2018, 03:19:54 pm »
Fix is checked in for .717. Thanks for the bug report, Pluto011!

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Problem With Control Groups
« Reply #9 on: March 29, 2018, 05:22:24 pm »
Yes, thanks very much to both of you :)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!