Author Topic: 5.025 Looks Good!  (Read 7177 times)

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: 5.025 Looks Good!
« Reply #30 on: February 12, 2012, 08:16:25 pm »
They weren't the sharpest hamsters in the drawer... ;)

Thanks for the note about the turn-off-least-efficient one, I put that on my list.

And I think in case of tie it does prefer turning on the lower m+c cost one.
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 TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: 5.025 Looks Good!
« Reply #31 on: February 12, 2012, 08:23:20 pm »
And I think in case of tie it does prefer turning on the lower m+c cost one.

If that is the case, I think it is being a little too "literal" for many player's taste. We don't care if the efficiency is like within 5% (or something) of each other, in that case, we figure that we don't really need that extra 5% or less efficiency, mentally call it a tie even though it isn't strictly, and just want the lowest m+c cost one to turn on.

It's one of those cases where when we say "Turn on the most efficient one" we really mean "Turn on the most efficient one except for those cases where we don't really need the absolutely most efficient one". As a coder myself, I share your pain of these kinds of "common sense" things that people expect from software.  ;)

Offline Hearteater

  • Core Member
  • *****
  • Posts: 2,334
Re: 5.025 Looks Good!
« Reply #32 on: February 12, 2012, 09:16:09 pm »
Touch tired so this might be completely off, but what if "Turn On" worked like this:
1) Find the cheapest M+C/second reactor to turn on
2) Find the most efficient reactor to turn on

If 1 & 2 are the same, turn on the reactor and stop here.

3) Find the least efficient reactor to turn off that produces less power than 2

Do the cheapest M+C/second of 1 or 2+3.

That should net a power increase with optimal m+c/second costs.

Offline Bognor

  • Hero Member
  • *****
  • Posts: 570
Re: 5.025 Looks Good!
« Reply #33 on: February 13, 2012, 09:44:05 am »
All auto energy management thing would be is "while I'm short on power, hit the give-me-the-most-efficient-reactor button; while I'm excess on power, hit the drop-the-least-efficient-reactor button" so if the logic for those isn't doing what you want then the auto wouldn't do it either :)

Historically everyone seems to have focused on trying to maximize reactor efficiency, when really, what they should be doing is trying to minimize reactor cost.  For example, if I need another 2,000 energy, it's cheaper to turn on the fifth Mark I reactor on a planet, than to switch on the first Mark II.  Yes, the Mark II would be vastly more efficient (2,666 energy per M+C rather than 1,024), but it would nevertheless be costing me 15 M+C per second, when I only need to spend 2 for the Mark I.

Optimally, as my energy needs increased I might switch off all my Mark I's and replace them with a single Mark II, then switch the Mark I's back on one by one as required.  Hearteater, is this what your algorithm would achieve?
Your computer can help defeat malaria!
Please visit the World Community Grid to find out how.

Offline Hearteater

  • Core Member
  • *****
  • Posts: 2,334
Re: 5.025 Looks Good!
« Reply #34 on: February 13, 2012, 09:48:07 am »
Yes, I believe so.  The idea is, when you hit the "power up" hotkey, the game doesn't know how much power you need, just that you need more.  So it gives you more power at the cheapest m+c/second cost it can.  But it is also re-balancing reactor efficiency so if one time it makes an inefficient choice, the next time you ask for more power it can undo that choice and pick the more efficient larger reactor.  But please, feel free to double check me.  I think it would work, but I'm not positive.

Offline MordredofFairy

  • Newbie Mark II
  • *
  • Posts: 11
Re: 5.025 Looks Good!
« Reply #35 on: February 13, 2012, 12:08:49 pm »
yes please...automated energy management would be wonderful!
and even not too difficult.

currentenergyneeded=x
currentenergyproduced=y

if reactoravailable(zenith)
turnonreactor(zenith)
endif

while(reactoravailable(mark2)&&x-y>35000)
turnonreactor(mark2,1)
endwhile
//turn on MK2 until MK1's are more efficient.

if(reactoravailable(mark1)>=roundup(x-y/5000)
//see if we can bridge the remaining gap with MK1's, no matter if it's only 35k or smaller or we run out of MK2 and there are enough MK1's.
turnonreactor(mark1,roundup(x-y/5000)
//is so, turn on sufficient MK1 reactors.
else if(reactoravailable(mark2) turnonreactor(mark2,1)
//otherwise, instead add another mark2 if available(say you need 30k energy but only have 5 MK1 reactors).
else
while (x>y&&reactoravailable(mark3))
turnonreactor(mark3,1).
if(reactoravailable(mark1)>=roundup(x-y/5000)
turnonreactor(mark1,roundup(x-y/5000)
endwhile
turnonreactor(mark1,all)
//only if no mk2 are available and the remaining mk1 are not sufficient to cover: turn on 1 MK3 and see if we can cover the rest with MK1's.

if (y-40000>x)
turnofreactor(MK2,1).
//if we are running a redundant MK2 at this point, courtesy of MK3 reactor online, turn it off.


To sum it up:
This way, the game would do the following steps in "human speech":

Zenith Power Generator, if available, is automatically running. If you would get away with
fewer than 5 MK1 reactors after having build a Zenith, your game is ending soon, anyway.

Start up as many MK2 reactors as needed to bring energy coverage within 35k of whats needed.
Then, if possible, start enough MK1 reactors to cover the remainder.
If there's not enough MK1s, it starts up another MK2 instead.
If theres not enough MK1's, and no MK2's left, it instead starts 1 MK3, then takes another
look at wether, if energy is still needed, there's enough MK1's to do the job, and starts them
if possible. Otherwise, it starts another MK3 and looks again if MK1's are sufficient, until it
runs out of MK3's or the MK1's can take over. If we run out of MK3's, all MK2's are already running,
and so we also start all remaining MK1's, because even if we are negative, when stuff
gets killed, we may get back to positive faster...
Then, courtesy of low reactor count, we could be running 1 redundant MK2, so we check if it's
save to turn that off and there we go.

Naturally, to not impact other stuff, energyneeded should be a value that not only takes energy into account, but leaves a little buffer(and of course, golems would need a way to be considered here) and when you try to "activate" something from low-power mode, it should recalculate with the new need inmediately(so getting a fortress or low-powered golem online again would not be problematic). If you leave a little "buffer" you could probably get away with only running this calculation whenever you would get into negatives or once every 30 seconds or so(or only when you deviate from the "buffer" value by, say, 20k energy)

Note that this does not "cover" turning on or off reactors. It just takes a look in regular intervalls that would "activate" the most efficient set of reactors available for your current energy needs. Which, in my book, is totally fine for a automated energy management system, and less work.

I would absolutely LOVE that. If you could "set" the buffer to a certain size as players per CTRLS, then even golems would be unproblematic(even if your reactors would go haywire for a second, when the golem just came online and it attempts to get the huge energy buffer anew) ;)
« Last Edit: February 13, 2012, 12:17:18 pm by MordredofFairy »

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: 5.025 Looks Good!
« Reply #36 on: February 13, 2012, 12:10:14 pm »
We've already talked about auto energy management several times over the last nearly-3-years, the answer is no and will remain no unless something actually new happens :)  More likely the energy system will be redone such that optimal management isn't so arithmetically obvious.
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 MordredofFairy

  • Newbie Mark II
  • *
  • Posts: 11
Re: 5.025 Looks Good!
« Reply #37 on: February 13, 2012, 12:21:53 pm »
oh, i was not aware of that, sorry-
as probably obvious, i'm quite new to the forum, and while having stalked a bit, i have not stumbled upon those discussions.

If i'm not asking to much, could you quickly sum up the reasonings behing the "no" or provide a link to them?

I'd be very interested because AI War always struck me as a game that reduced tiresome micromanagement wherever possible, to streamline the gaming experience itself-
and manually turning on/off reactors as needed always struck me as a bit...irritating on the micromanagement side.
I have to admit though, up to now i didn't even realize there was a hotkey for this. But manually doing it was tiresome, at best, and i always wondered why THAT was not automatic when everything else seemed so convenient-(build loops, FRD mode, automatic harvesters...)

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: 5.025 Looks Good!
« Reply #38 on: February 13, 2012, 01:04:18 pm »
We've already talked about auto energy management several times over the last nearly-3-years, the answer is no and will remain no unless something actually new happens :)  More likely the energy system will be redone such that optimal management isn't so arithmetically obvious.

Both of the devs have made it clear that they do not want all "traditional, mundane" micro to be eliminated, and energy management is the one of the few resources where they want to keep this sort of fiddly micro.

That said, how would you make it such that the "optimal energy reactor power states" for a certain energy need is not so trivial to figure out, or even stronger, how would you make it such that the reactor to turn on/off for "optimal incremental reactor power states" for a "step" up or down in energy need is not so trivial to figure out.

There is one thing I can think of on the top of my ahead that prune the "state tree" of bad solutions enough to turn this from a knapsack like problem into a much easier problem:
All reactors of a specific mark and efficiency level are the same across all planets. e.g. A Mk. II reactor at full efficiency is the same as any other Mk. II reactor on any other planet at full efficiency. Another example, a Mk. III reactor at one level of poor efficiency is the same as any other Mk. III reactor at one level of poor efficiency

Something of interest here, the "greedy" solution is not always the right one. Always going for the most efficient reactor first may give you more than you need, and thus you start spending more than you need. Like say turning on Mk. II at full efficiency (the most efficient) when a Mk. I would satisfy your goal. Going for the least cost of time one first can lead to, for example, 10 Mk. I reactors on a planet when a Mk. III reactor would satisfy your goal. Each Mk. I reactor may be cheaper than the Mk. III reactor individually, but 20 Mk. 1s are most certainly more expensive then a Mk. III.

Thanks to the observation mentioned above, this does not devolve into an exponentially hard to solve problem, thanks to massive amounts of pruning of the state space you can do abusing that assumption. Also thanks to that observation, you can precompute a large number of things ahead of time (like, how many Mk. I reactors on a single planet should I turn on before I should consider a Mk. II or Mk. III instead?) But still, it is tricky.

Also, this is just for the optimal solution for a given energy level. The question about optimal solution given "I want more" or "I want less", but not giving how much more or less, and can only adjust a small number of reactors (typically, only 1) is another hairy issue with similar concerns.
« Last Edit: February 13, 2012, 01:06:36 pm by techsy730 »

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: 5.025 Looks Good!
« Reply #39 on: February 13, 2012, 01:07:02 pm »
Quote from: MordredofFairy
oh, i was not aware of that, sorry-
as probably obvious, i'm quite new to the forum, and while having stalked a bit, i have not stumbled upon those discussions.
Sorry to be abrupt, I was in a skype call at the time and not paying attention to details.  Welcome to the forums :)

Quote
If i'm not asking to much, could you quickly sum up the reasonings behing the "no" or provide a link to them?

The most recent one:

The originating threadnaught:
http://www.arcengames.com/forums/index.php/topic,8712.60.html

:)
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 TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: 5.025 Looks Good!
« Reply #40 on: February 13, 2012, 01:19:22 pm »
Both of the devs have made it clear that they do not want all "traditional, mundane" micro to be eliminated, and energy management is the one of the few resources where they want to keep this sort of fiddly micro.

Oh, I forgot.

Another, and arguably more important, reason. Making you micro this means that you are pressured into taking more planets for a better optimal solution given your resources, and to pressure you to give yourself a buffer just in case the AI pops one of your planets and you lose your reactors there. How much more do you need, and how much you are willing to pay in AIP and other costs for taking a planet for this, is up to you to decide, and that is the strategic choice this micro gives you. This strategic part of the game is lessened in impact with automated power management.

Offline Cyborg

  • Master Member Mark III
  • *****
  • Posts: 1,957
Re: 5.025 Looks Good!
« Reply #41 on: February 13, 2012, 08:08:10 pm »
Both of the devs have made it clear that they do not want all "traditional, mundane" micro to be eliminated, and energy management is the one of the few resources where they want to keep this sort of fiddly micro.

Oh, I forgot.

Another, and arguably more important, reason. Making you micro this means that you are pressured into taking more planets for a better optimal solution given your resources, and to pressure you to give yourself a buffer just in case the AI pops one of your planets and you lose your reactors there. How much more do you need, and how much you are willing to pay in AIP and other costs for taking a planet for this, is up to you to decide, and that is the strategic choice this micro gives you. This strategic part of the game is lessened in impact with automated power management.


No, that's not what he said. If you go back and read the thread, is clearly stated a few times that the mundane, simple puzzle somehow has value to a group of people that don't appear on this forum  ;), that he sees value in players losing the game when their forcefield turns off because of a power outage, that he doesn't have any better ideas about power, and that he's not particularly motivated to change it right now. There's no strategy about it. If you think that is making us take more planets, just put more energy reactors on the same planet! I always have at least 2.

Because we have a lot of programmers on this forum (myself included), I'm sure we can all write a simple program on how to make change of a dollar, which is what this mindnumbing puzzle is about. I think we all have separate ideas on how to write it, but I think the answer is the same every time, which is why this puzzle is dumb.

What really needs to happen is that Chris needs to actually talk about what power is supposed to be doing as a lever. He is the original designer, and if power is supposed to be doing something for gameplay to assist or limit the player, let's talk about it and then recreate it in a way that doesn't make us upset that the game is screwing us out of 1000 metal or more for inefficiency reasons when we are too lazy to click on menu items. If he wants to create a losing scenario due to a strategic building going down, we can do that in a way that is not this mundane exercise in clicking.

For example, let's just have one reactor building instead of 3. Let's make reactors more intuitive- sorted by their efficiency instead of 2, 1, 3. Tricking players who are not smart enough or too lazy to do the math just doesn't seem like a good enough reason to keep it the way it is. Or let's just do away with power and replace it with something else that accomplishes the same goals.

All this passionate wording aside, I think that the hamsters have been a great bandaid for the problem, certainly not the solution. In the grand scheme of things, yes it's annoying, but it could be a lot worse. The game is still fun. Silver lining and all that. We just have to wait for the developers to come around and realize this mechanic could use a lot of improvement.
Kahuna strategy guide:
http://www.arcengames.com/forums/index.php/topic,13369.0.html

Suggestions, bugs? Don't be lazy, give back:
http://www.arcengames.com/mantisbt/

Planetcracker. Believe it.

The stigma of hunger. http://wayw.re/Vi12BK

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: 5.025 Looks Good!
« Reply #42 on: February 13, 2012, 08:21:10 pm »
All this passionate wording aside, I think that the hamsters have been a great bandaid for the problem, certainly not the solution.
Glad to hear they're doing their job, we'll give them some extra food next time ;)

Quote
We just have to wait for the developers to come around and realize this mechanic could use a lot of improvement.
Oh, Chris has known that since the 3rd or 4th time he redid/tried-to-redo it :)  We just haven't been able to come up with a different model that doesn't have worse problems than the current one.
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 TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: 5.025 Looks Good!
« Reply #43 on: February 13, 2012, 08:28:44 pm »
(Lots of text, read the above post if you need to see it again)

I never said that the current system couldn't use improvement.

But yea, I see your point. The current system introducing a resource management puzzle. That's not a bad thing, lots of other real time games have similar "balancing acts" for their resources. The problem is that the current system is relatively easy to solve by a computer, but tricky for a human to solve in "real time". This type of puzzle tends to be annoying in real time games, especially in a game such as this where the computer can and does offer to solve for you other types of "easy for the computer to solve" problems. (Target prioritisation, crystal/metal manufactory management, auto-building, etc).

There probably is another way to keep this kind of resource management puzzle that keeps the need and pressure for planets, but not be so annoying to players to solve where the players could see that the computer could take care of it for them with relative ease.

But as Keith stated, no one has found that better system yet.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: 5.025 Looks Good!
« Reply #44 on: February 13, 2012, 08:58:25 pm »
The problem is that the current system is relatively easy to solve by a computer, but tricky for a human to solve in "real time".
Not even all that tricky, just time-consuming and somewhat annoying.  Thus, the consolation hamsters :)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!