Factory auto-pausing... it this possible?

Discussion in 'Mod Discussions' started by conqueringfools, April 15, 2014.

  1. conqueringfools

    conqueringfools Member

    Messages:
    54
    Likes Received:
    0
    So, just an idea I had after playing with the Auto Factory Mod after realizing a few shortcomings it had, despite being a pretty great mod.

    The idea is very simple: select a factory and sliders show up for energy and metal. They are specific to that factory and go from 0 to 100%. If your economy falls below what that factory is set to, it pauses. Once the economy reaches those amounts again, it un-pauses. Simple.

    I don't know if this is feasible or not with PA's current mod support. I know some programming, but haven't gotten into how to mod PA.

    This would alleviate a few problems with Auto Factory as it exists:
    • You can't use queues and instead have to pick a single unit per factory type.
      • Auto-pausing the factories individually would allow you to set queues, set multiple factories of the same type with different units, etc.
    • All factories of the same type starting simultaneously, potentially draining your econ.
      • If I have 10 T2 Vehicle Factories set to 75% in Auto Factory, they all turn on at the same time, potentially causing a huge drain. Auto-pausing the factories individually means I can set one to 50%, one to 55%, then 60% and so on so they gradually ramp up the drain on the economy, not hit it all at once.
    • Factories not pausing
      • With Auto Factory, once a unit begins building it continues despite any changes to the economy.

    Any thoughts, or potential shortcomings I may have missed?
  2. trialq

    trialq Post Master General

    Messages:
    1,295
    Likes Received:
    917
    It's a nice idea, and another way of coming at the problem than auto factory does. I'd say it would be better than auto factory too, if the idea of setting the initial sliders per factory type was kept from that mod (if you could set the general parameters you wanted beforehand, it would lessen the busywork during a live game). At first glance it sounds doable, and to be honest I see no reason it couldn't apply to fabbers and the commander too. Hell theoretically it could apply to anything that can draw power: turrets, radar, bombers (although power conserve might have side-effects on mobile units, like not moving if at the end of the movement they would have to use power) etc.

    Although this may pose some perceived ethical problems with regard to avoiding power stalls automatically, it's unlikely reality will tally with that idealised situation. Even if by some miracle it could be implemented "perfectly", using a better build queue is still better than relying on a bad build queue and the mod to avoid stalls. It wouldn't make bad players play better than good players, but it might lessen the gap between them. It would actually be good as an aid to new players, who would hopefully be able to rely on it less and less as they get more experienced.

    A way it could be implemented:
    • Check pre-set-by-factory-type parameters, setting power status as necessary
    • For any factories that have had the sliders altered during the game, check their parameters and set power status as necessary
    • When a single factory is selected, display the slider values and allow them to be changed
    • When multiple factories are selected, show slider bars but with no actual slider (to show that the value isn't displayed, the factories could all have different value). If you click on the slider bar the slider appears, setting all the selected factories to that value
    • Whenever a new factory has sliders changed, add it to the list of factories to check separately (see point 2)

    The major issue is the same as the main one auto factory has when using auto-build: you have to use the same system users do to select the factories to pause them. This is not ideal as it can cause (relatively rare, but it depends on implementation) glitchy behaviour when selecting stuff, particularly I've noticed when pressing F to select idle fabbers or C for the commander. The problem is much more apparent when the player has a high APM, as they are using the selection model more often and clashes occur more regularly. For casual play though it could be pretty good. There could also be a manual function (like auto factory has) to try and sidestep the problem. By relying on the user pressing a button when they want to check the power status, clashes are avoided,and the user is basically giving you permission to use the selection model.

    tl;dr: Doable and better than auto factory, but an "auto" function would be glitchy the same as the "auto" function in auto factory is, for the same reasons.
  3. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I am fairly certain that it is possible to completely get rid of the issues by hacking somehow into the way user commands are processed and making sure they are put in some queue that is only executed while the mod is not doing anything.
  4. conqueringfools

    conqueringfools Member

    Messages:
    54
    Likes Received:
    0
    Sounds to me like a great way to make the game more accessible to everyone :)
  5. stawos

    stawos Member

    Messages:
    79
    Likes Received:
    46
    on a similar note, auto pausing for fabber assistance. any thoughts?
  6. trialq

    trialq Post Master General

    Messages:
    1,295
    Likes Received:
    917
    Implementing for fabbers or factories is virtually the same, so it could apply to fabbers regardless of what they were doing. Making it regard what the fabber is doing would be harder or impossible, I don't know which.
  7. conqueringfools

    conqueringfools Member

    Messages:
    54
    Likes Received:
    0
    I haven't tried this in-game, so I'm not sure of the answer, but if a factory is paused, will all fabbers assisting that factory continue building the unit that has already started? If the answer is yes, will a new unit start up on the factory once that first one is finished, or does the factory need to un-pause first?

    I agree 100%, the initial sliders should still be in the pre-game options.
  8. burntcustard

    burntcustard Post Master General

    Messages:
    699
    Likes Received:
    1,312
    I have build orders on a hotkey, so I can very easily group units or structures with a Ctrl group, stop them building, then (if I don't forget) very quickly get back to them and turn them on again. I feel like this doesn't need the suggested automation, because if I'm low on resources I will decide at that very moment what I'm going to prioritise, and if it was done somewhat automatically it wouldn't be what I'd want - and it would be a pain at that moment to adjust the "prioritisation settings" so the right thing happens.

Share This Page