Author Topic: Order templates should be additive  (Read 1977 times)

0 Members and 1 Guest are viewing this topic.

Offline vorpal+5 (OP)

  • Commodore
  • **********
  • Posts: 619
  • Thanked: 122 times
  • Silver Supporter Silver Supporter : Support the forums with a Silver subscription
    2021 Supporter 2021 Supporter : Donate for 2021
Order templates should be additive
« on: December 22, 2020, 03:47:34 AM »
To my surprise they are not. I had an order template where I load the 10 minerals in small quantity, ready to be delivered somewhere, but if you add the template, and then another, the 2nd erase everything. Meaning you can't have a ship service several planets by adding templates one by one.

Now consider the other possibility, that templates are additive. If you don't want that, just click on 'Remove All'. If you want that, do nothing. So clearly it seems there is only a benefit to have them additive and not replacing everything  :D
 
The following users thanked this post: Froggiest1982

Offline Froggiest1982

  • Gold Supporter
  • Vice Admiral
  • *****
  • F
  • Posts: 1332
  • Thanked: 591 times
  • Gold Supporter Gold Supporter : Support the forums with a Gold subscription
    2021 Supporter 2021 Supporter : Donate for 2021
    2022 Supporter 2022 Supporter : Donate for 2022
    2023 Supporter 2023 Supporter : Donate for 2023
Re: Order templates should be additive
« Reply #1 on: December 22, 2020, 03:59:29 AM »
To my surprise they are not. I had an order template where I load the 10 minerals in small quantity, ready to be delivered somewhere, but if you add the template, and then another, the 2nd erase everything. Meaning you can't have a ship service several planets by adding templates one by one.

Now consider the other possibility, that templates are additive. If you don't want that, just click on 'Remove All'. If you want that, do nothing. So clearly it seems there is only a benefit to have them additive and not replacing everything  :D

The reason is that the template creates a list of orders copying from a previous one templated.

My guess is that the window does not add lines of orders but adds orders to the line.

When you then paste and copy the template you are effectively overwriting the same lines.

It may be possible to be done with a bit of work, not sure if that easily though.

Obviously, now Steve will confirm the above being absolutely wrong and able to add that for you in a jiffy  ;D

EDIT: I will be happy with the change
« Last Edit: December 22, 2020, 04:07:36 AM by froggiest1982 »
 

Offline Steve Walmsley

  • Aurora Designer
  • Star Marshal
  • S
  • Posts: 11657
  • Thanked: 20378 times
Re: Order templates should be additive
« Reply #2 on: December 22, 2020, 04:20:03 AM »
Its because there is no guarantee that the orders in template B would make sense following the orders in template A. The amount of code required to check that would be huge. It's the same reason you can't delete an order from the middle of the list.
 
The following users thanked this post: Froggiest1982

Offline mike2R

  • Lieutenant
  • *******
  • m
  • Posts: 180
  • Thanked: 117 times
Re: Order templates should be additive
« Reply #3 on: December 22, 2020, 06:14:22 AM »
Its because there is no guarantee that the orders in template B would make sense following the orders in template A. The amount of code required to check that would be huge. It's the same reason you can't delete an order from the middle of the list.

I've been wondering about this for a while.  It seems like orders must be able to deal with being unable to complete already - anything that targets a transient object like a fleet or waypoint may find that its target doesn't exist.  Any order that requires a colony to be on a body must handle the colony being deleted, or one that requires a component to be on a ship in the fleet must deal with it being destroyed.  And you can cause all sorts of failures by setting orders to repeat.

So couldn't you just not check?  If a fleet finds it can't perform its next order, it errors out and the player has to fix the problem they caused.
 

Offline Droll

  • Vice Admiral
  • **********
  • D
  • Posts: 1704
  • Thanked: 599 times
Re: Order templates should be additive
« Reply #4 on: December 22, 2020, 06:24:34 AM »
Its because there is no guarantee that the orders in template B would make sense following the orders in template A. The amount of code required to check that would be huge. It's the same reason you can't delete an order from the middle of the list.

I've been wondering about this for a while.  It seems like orders must be able to deal with being unable to complete already - anything that targets a transient object like a fleet or waypoint may find that its target doesn't exist.  Any order that requires a colony to be on a body must handle the colony being deleted, or one that requires a component to be on a ship in the fleet must deal with it being destroyed.  And you can cause all sorts of failures by setting orders to repeat.

So couldn't you just not check?  If a fleet finds it can't perform its next order, it errors out and the player has to fix the problem they caused.

Furthermore the game already checks if an order is not possible in a system like order cycles not working because you forgot to reroute the ship back to the cycles starting system.
 

Offline xenoscepter

  • Vice Admiral
  • **********
  • Posts: 1155
  • Thanked: 317 times
Re: Order templates should be additive
« Reply #5 on: December 22, 2020, 07:30:45 AM »
 - Perhaps the issue is that the orders make a call to the database. Thus Order Template A and Order Template B could cause potentially game crashing issues. After all, Sol doesn't come up as a valid target in the Centauri Backwoods system... unless you place an order to jump to it first.

 - Thus Order Template A being set somewhere outside the system could cause a problem on account of database shenanigans., perhaps?
 

Offline mike2R

  • Lieutenant
  • *******
  • m
  • Posts: 180
  • Thanked: 117 times
Re: Order templates should be additive
« Reply #6 on: December 22, 2020, 08:02:39 AM »
- Perhaps the issue is that the orders make a call to the database. Thus Order Template A and Order Template B could cause potentially game crashing issues. After all, Sol doesn't come up as a valid target in the Centauri Backwoods system... unless you place an order to jump to it first.

 - Thus Order Template A being set somewhere outside the system could cause a problem on account of database shenanigans., perhaps?

Yeah this is what I'm curious about.  If its anything like that, then obviously we aren't getting these sort of changes.  But from the outside it looks like you can engineer situations very much that already, and the game recovers from them gracefully and even sends an error to the player.

So I'm wondering if Steve means he would need to add a ton of error checking simply to protect the player from creating orders that would be invalid, but not harmful (to the game).  If its this case, my personal preference would be to be given the rope needed to hang myself :)
 

Offline Steve Walmsley

  • Aurora Designer
  • Star Marshal
  • S
  • Posts: 11657
  • Thanked: 20378 times
Re: Order templates should be additive
« Reply #7 on: December 22, 2020, 02:59:03 PM »
The code will currently only let you create valid orders, which includes checking previous orders, cargo, etc. so you can't unload something you don't have for example. That means any single template has valid orders.

However, it is isn't as simple as checking the first order of template B vs last order of template A because there are a lot of checks before the potential order list is created. There are 110 potential orders and you normally see a small subset. The existing order check code wouldn't be able to handle an order that would not normally have been an option in the first place.

Ultimately, I don't want to spend time chasing bugs caused by incompatible orders that I will never be able to find, so it is much simpler to avoid concatenated templates.
 
The following users thanked this post: mike2R

Offline mike2R

  • Lieutenant
  • *******
  • m
  • Posts: 180
  • Thanked: 117 times
Re: Order templates should be additive
« Reply #8 on: December 22, 2020, 03:25:09 PM »
Thanks for taking the time to explain Steve, I shall quit bugging you about it :)
 

Offline Migi

  • Captain
  • **********
  • Posts: 465
  • Thanked: 172 times
Re: Order templates should be additive
« Reply #9 on: December 23, 2020, 01:13:35 PM »
The code will currently only let you create valid orders, which includes checking previous orders, cargo, etc. so you can't unload something you don't have for example. That means any single template has valid orders.

However, it is isn't as simple as checking the first order of template B vs last order of template A because there are a lot of checks before the potential order list is created. There are 110 potential orders and you normally see a small subset. The existing order check code wouldn't be able to handle an order that would not normally have been an option in the first place.

Ultimately, I don't want to spend time chasing bugs caused by incompatible orders that I will never be able to find, so it is much simpler to avoid concatenated templates.

 ;D  Can't you let us live with the consequences of our bad decisions?
 

Offline Steve Walmsley

  • Aurora Designer
  • Star Marshal
  • S
  • Posts: 11657
  • Thanked: 20378 times
Re: Order templates should be additive
« Reply #10 on: December 23, 2020, 02:33:38 PM »
;D  Can't you let us live with the consequences of our bad decisions?

Yes, if I didn't have to live with them too :)
 

Offline Froggiest1982

  • Gold Supporter
  • Vice Admiral
  • *****
  • F
  • Posts: 1332
  • Thanked: 591 times
  • Gold Supporter Gold Supporter : Support the forums with a Gold subscription
    2021 Supporter 2021 Supporter : Donate for 2021
    2022 Supporter 2022 Supporter : Donate for 2022
    2023 Supporter 2023 Supporter : Donate for 2023
Re: Order templates should be additive
« Reply #11 on: December 23, 2020, 03:18:02 PM »
;D  Can't you let us live with the consequences of our bad decisions?

Yes, if I didn't have to live with them too :)

Standing Ovation