Author Topic: if (<CONDTION>) then GOTO <LINE X> in fleet movement  (Read 3006 times)

0 Members and 1 Guest are viewing this topic.

Offline Kikker (OP)

  • Able Ordinary Rate
  • K
  • Posts: 4
if (<CONDTION>) then GOTO <LINE X> in fleet movement
« on: August 08, 2020, 06:48:34 PM »
I know it's a bit of a stretch but I want to suggest it anyway.  The whole standing order section could be done away with if we just had a programmming style "if (<CONDITION>) GOTO <LINE X>" command in the fleet movement GUI.  Combined with the ability to template, it would make it much easier to manage and optimize fleet movements.

A cycle is already implemented there, so why not make it a full queue with dynamic command ordering? Though again I do know this is a lot of work especially since it needs gui features I haven't seen implemented anywhere in the game.  I hope it is still a nice idea to think about.

For example a scouting ship would be:
1: If (fuel lower than 50%) GOTO 9
2: If (supplies lower than 20%) GOTO 7
3: If (survey nearest body) GOTO 1
4: If (move to system requiring Geosurveying) GOTO 1
5: GOTO 11
6: GOTO 1
7: Resupply at nearest colony
8: GOTO 1
9: Refuel at nearest colony
10: GOTO 1
11: DONE
 

Offline Barkhorn

  • Commodore
  • **********
  • B
  • Posts: 719
  • Thanked: 133 times
Re: if (<CONDTION>) then GOTO <LINE X> in fleet movement
« Reply #1 on: August 08, 2020, 07:35:36 PM »
I'd be happy if we could just hook up order templates to conditional orders.  We already have order templates, we already have conditional orders.  Let us combine them.  We could automate so much like that.
 

Offline skoormit

  • Commodore
  • **********
  • Posts: 779
  • Thanked: 312 times
Re: if (<CONDTION>) then GOTO <LINE X> in fleet movement
« Reply #2 on: August 09, 2020, 09:44:06 AM »
I would love a more robust system for conditional and standing orders, but building scripts with BASIC syntax might not be the best solution.
 

Offline skoormit

  • Commodore
  • **********
  • Posts: 779
  • Thanked: 312 times
Re: if (<CONDTION>) then GOTO <LINE X> in fleet movement
« Reply #3 on: August 09, 2020, 09:47:10 AM »
I'd be happy if we could just hook up order templates to conditional orders.  We already have order templates, we already have conditional orders.  Let us combine them.  We could automate so much like that.

Order templates, as currently implemented, are system specific.
Using conditional orders to trigger order templates is only feasible if we can have system-agnostic templates.
Otherwise we must remake the templates over and over again to use in different systems. And when a fleet changes systems, we must change the conditional orders to use the correct template.
 
The following users thanked this post: DIT_grue

Offline Barkhorn

  • Commodore
  • **********
  • B
  • Posts: 719
  • Thanked: 133 times
Re: if (<CONDTION>) then GOTO <LINE X> in fleet movement
« Reply #4 on: August 09, 2020, 11:10:35 AM »
Order templates can include jumps, so they're not exactly system specific.  But I agree that location-agnostic templates would be cool.
 

Offline skoormit

  • Commodore
  • **********
  • Posts: 779
  • Thanked: 312 times
Re: if (<CONDTION>) then GOTO <LINE X> in fleet movement
« Reply #5 on: August 09, 2020, 01:25:34 PM »
Order templates can include jumps, so they're not exactly system specific.  But I agree that location-agnostic templates would be cool.

I think you misunderstand me.
You, you can make an order template that jumps to other systems. But you can only ever assign that template to a fleet in the same system in which you created the template.

You can't make an order template in System A, and then assign it to a ship in System B.
 

Offline Kikker (OP)

  • Able Ordinary Rate
  • K
  • Posts: 4
Re: if (<CONDTION>) then GOTO <LINE X> in fleet movement
« Reply #6 on: August 09, 2020, 02:39:17 PM »
Quote from: skoormit link=topic=11820. msg139761#msg139761 date=1596984246
I would love a more robust system for conditional and standing orders, but building scripts with BASIC syntax might not be the best solution.

I agree, it just thought with my (limited) understanding of the current code base, it is the most simple adjustment to make with the most powerful impact.
 

Offline liveware

  • Bug Moderators
  • Commodore
  • ***
  • Posts: 742
  • Thanked: 88 times
Re: if (<CONDTION>) then GOTO <LINE X> in fleet movement
« Reply #7 on: August 09, 2020, 02:42:43 PM »
I've been hoping for some new conditional orders since the VB version. I've actually been putting quite a lot of thought and effort into starting an aurora-ish project that would implement a python or bash CLI as the primary interface for giving orders to ships/vehicles/units. It will be almost entirely text based graphically with only a couple of very basic 'map windows' similar to Aurora's tactical map. Still has a long way to go before it's even close to playable though...
Open the pod-bay doors HAL...
 

Offline 01010100

  • Chief Petty Officer
  • ***
  • ?
  • Posts: 38
  • Thanked: 15 times
Re: if (<CONDTION>) then GOTO <LINE X> in fleet movement
« Reply #8 on: August 14, 2020, 08:40:49 AM »
I know it's a bit of a stretch but I want to suggest it anyway.  The whole standing order section could be done away with if we just had a programmming style "if (<CONDITION>) GOTO <LINE X>" command in the fleet movement GUI.  Combined with the ability to template, it would make it much easier to manage and optimize fleet movements.

A cycle is already implemented there, so why not make it a full queue with dynamic command ordering? Though again I do know this is a lot of work especially since it needs gui features I haven't seen implemented anywhere in the game.  I hope it is still a nice idea to think about.

For example a scouting ship would be:
1: If (fuel lower than 50%) GOTO 9
2: If (supplies lower than 20%) GOTO 7
3: If (survey nearest body) GOTO 1
4: If (move to system requiring Geosurveying) GOTO 1
5: GOTO 11
6: GOTO 1
7: Resupply at nearest colony
8: GOTO 1
9: Refuel at nearest colony
10: GOTO 1
11: DONE

No need for GOTO's though, you could do this instead:

1: IF (fuel lower than 50%) THEN (refuel at nearest colony)
2: IF (supplies lower than 20%) THEN (resupply at nearest colony)
3: IF (true) THEN (survey nearest location)
4: IF (true) THEN (move to system requiring geo-survey)

and just evaluate them one by one each tick.
 

Offline Kikker (OP)

  • Able Ordinary Rate
  • K
  • Posts: 4
Re: if (<CONDTION>) then GOTO <LINE X> in fleet movement
« Reply #9 on: August 16, 2020, 06:10:17 AM »
Quote from: 01010100 link=topic=11820. msg139959#msg139959 date=1597412449
Quote from: Kikker link=topic=11820. msg139747#msg139747 date=1596930514
I know it's a bit of a stretch but I want to suggest it anyway.   The whole standing order section could be done away with if we just had a programming style "if (<CONDITION>) GOTO <LINE X>" command in the fleet movement GUI.   Combined with the ability to template, it would make it much easier to manage and optimize fleet movements. 

A cycle is already implemented there, so why not make it a full queue with dynamic command ordering? Though again I do know this is a lot of work especially since it needs gui features I haven't seen implemented anywhere in the game.   I hope it is still a nice idea to think about. 

For example a scouting ship would be:
1: If (fuel lower than 50%) GOTO 9
2: If (supplies lower than 20%) GOTO 7
3: If (survey nearest body) GOTO 1
4: If (move to system requiring Geosurveying) GOTO 1
5: GOTO 11
6: GOTO 1
7: Resupply at nearest colony
8: GOTO 1
9: Refuel at nearest colony
10: GOTO 1
11: DONE

No need for GOTO's though, you could do this instead:

1: IF (fuel lower than 50%) THEN (refuel at nearest colony)
2: IF (supplies lower than 20%) THEN (resupply at nearest colony)
3: IF (true) THEN (survey nearest location)
4: IF (true) THEN (move to system requiring geo-survey)

and just evaluate them one by one each tick.

Clearly your program will never reach line 4, so you couldn't do it like that   ;).  But of course I thought of that, you would need: if () then {} else {} statements.  However, for these statements you would have to indent.  I am not sure if that is something the GUI can handle at the moment.  Hence I proposed GOTO.
 

Offline dag0net

  • Chief Petty Officer
  • ***
  • d
  • Posts: 33
  • Thanked: 5 times
Re: if (<CONDTION>) then GOTO <LINE X> in fleet movement
« Reply #10 on: August 16, 2020, 12:20:18 PM »
Clearly NPR's do not use the gui.
I don't have a clue how the AI functions, not even from a spectator standpoint, haven't even made first contact in years.. but if the AI uses modular code it might be easier to allow users to reference that in templates rather than all the error catching and gui reconfig that would be required from allowing what amounts to custom ai's.
People blame god for making life worth living, in the same vein. . . "Work harder Steve!"
 

Offline Kikker (OP)

  • Able Ordinary Rate
  • K
  • Posts: 4
Re: if (<CONDTION>) then GOTO <LINE X> in fleet movement
« Reply #11 on: August 16, 2020, 05:14:13 PM »
Quote from: dag0net link=topic=11820. msg140063#msg140063 date=1597598418
Clearly NPR's do not use the gui.
I don't have a clue how the AI functions, not even from a spectator standpoint, haven't even made first contact in years. .  but if the AI uses modular code it might be easier to allow users to reference that in templates rather than all the error catching and gui reconfig that would be required from allowing what amounts to custom ai's.

Define modular code.
 

Offline dag0net

  • Chief Petty Officer
  • ***
  • d
  • Posts: 33
  • Thanked: 5 times
Re: if (<CONDTION>) then GOTO <LINE X> in fleet movement
« Reply #12 on: August 16, 2020, 10:35:18 PM »
Pffffwarble.

Idk if facetious. A module is a part of a thing, coherent enough that it can be defined as separate from the rest of the whole, used and re-used as needed, my house is not a toilet, but one of it's modules is a toilet.

You have fuel harvester. AI has fuel harvester.

You clickalot. You ask for standing orders.
You use SOalot. You ask for custom code.

You write code module to manage your fh.
AI already has code modules to manage fh, indeed, ai prolly has a module for everything you can build and think to do.

Steve lets you use ai module.
You don't need custom code, or SO, or clickalot.


I suppose the thing here is that Steve wants to play a game, which means micro, he already wrote the ai, if he just wanted to write ai it would be a video, not a game... But idk :-)

Don't get me wrong, I want to be able to customize orders ahead of time and not repeat myself ad infinitum(or rather, pick and choose what particulars I repeat ad infinitum), just saying the ai prolly already has what you want.
People blame god for making life worth living, in the same vein. . . "Work harder Steve!"
 

Offline 01010100

  • Chief Petty Officer
  • ***
  • ?
  • Posts: 38
  • Thanked: 15 times
Re: if (<CONDTION>) then GOTO <LINE X> in fleet movement
« Reply #13 on: January 15, 2021, 07:05:09 AM »
Quote from: 01010100 link=topic=11820. msg139959#msg139959 date=1597412449
Quote from: Kikker link=topic=11820. msg139747#msg139747 date=1596930514
I know it's a bit of a stretch but I want to suggest it anyway.   The whole standing order section could be done away with if we just had a programming style "if (<CONDITION>) GOTO <LINE X>" command in the fleet movement GUI.   Combined with the ability to template, it would make it much easier to manage and optimize fleet movements. 

A cycle is already implemented there, so why not make it a full queue with dynamic command ordering? Though again I do know this is a lot of work especially since it needs gui features I haven't seen implemented anywhere in the game.   I hope it is still a nice idea to think about. 

For example a scouting ship would be:
1: If (fuel lower than 50%) GOTO 9
2: If (supplies lower than 20%) GOTO 7
3: If (survey nearest body) GOTO 1
4: If (move to system requiring Geosurveying) GOTO 1
5: GOTO 11
6: GOTO 1
7: Resupply at nearest colony
8: GOTO 1
9: Refuel at nearest colony
10: GOTO 1
11: DONE

No need for GOTO's though, you could do this instead:

1: IF (fuel lower than 50%) THEN (refuel at nearest colony)
2: IF (supplies lower than 20%) THEN (resupply at nearest colony)
3: IF (true) THEN (survey nearest location)
4: IF (true) THEN (move to system requiring geo-survey)

and just evaluate them one by one each tick.

Clearly your program will never reach line 4, so you couldn't do it like that   ;).  But of course I thought of that, you would need: if () then {} else {} statements.  However, for these statements you would have to indent.  I am not sure if that is something the GUI can handle at the moment.  Hence I proposed GOTO.

No, it evaluates everything and does the first thing possible, so it would reach line 4 when lines 1-3 have failed (either because the condition was false or because the action is impossible, in case 3 that would be if there is no survey location available).
 

Offline Jorgen_CAB

  • Admiral of the Fleet
  • ***********
  • J
  • Posts: 2837
  • Thanked: 673 times
Re: if (<CONDTION>) then GOTO <LINE X> in fleet movement
« Reply #14 on: January 15, 2021, 07:23:41 AM »
I would really like to have this IF THEN system instead what we currently have. It would be more flexible and you could have as many conditions as you liked. You also could use the same interface as where you give regular orders to the fleets to make matter allot less complicated GUI wise.

It would become much easier for Steve to add more and more conditional and standing orders for us to play with.

I would like more automation choices for everything in the game. Right now you have to sit down and do math every time you set up cargo runs between places so there always are something to pick up and deliver and then you have to continually check in due to increase in production or changes in production as planets and colonies expand their population and industries. The more automation we can do with the logistical side the more we can focus our energy on the more granular and fun stuff.