Author Topic: Energy Effeciency Programming Challenge (CANCELED)  (Read 10182 times)

Offline Cyborg

  • Master Member Mark III
  • *****
  • Posts: 1,957
Re: Energy Effeciency Programming Challenge (CANCELED)
« Reply #30 on: March 15, 2012, 10:24:30 pm »
Now we have talked ourselves into this being an NP hard problem? This is getting ridiculous.
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 TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Energy Effeciency Programming Challenge (CANCELED)
« Reply #31 on: March 15, 2012, 10:34:55 pm »
Now we have talked ourselves into this being an NP hard problem? This is getting ridiculous.

No, when you are assured of some sets of values with certain properties, it is polynomially solvable, and in some really degenerate cases (like the ones used in AI war), it is linearly solvable.

However, if you can make no assumptions ahead of time about the properties and patterns of the input or reactor stats, it becomes NP-hard in the general case.

Funny how complexity theory works sometimes.  :-\
« Last Edit: March 15, 2012, 10:37:55 pm by techsy730 »

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Energy Effeciency Programming Challenge (CANCELED)
« Reply #32 on: March 15, 2012, 10:36:55 pm »
Now we have talked ourselves into this being an NP hard problem? This is getting ridiculous.
Making it completely optimal probably would be (that's the knapsack problem), but the "if none of the off reactors could fulfill the remaining need, turn on the most efficient one, else turn on the lowest-cost one that can" would be quite sufficient for any reasonable gameplay need.
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 Cyborg

  • Master Member Mark III
  • *****
  • Posts: 1,957
Re: Energy Effeciency Programming Challenge (CANCELED)
« Reply #33 on: March 15, 2012, 11:09:40 pm »
I took complexity theory, and I remember the knapsack problem, but this is certainly solvable. We have a fixed number of planets and we aren't using fractional energy.

We can get automatic energy management, you just have to choose between lowest-cost and best efficiency.
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 HellishFiend

  • Hero Member Mark II
  • *****
  • Posts: 758
Re: Energy Effeciency Programming Challenge (CANCELED)
« Reply #34 on: March 16, 2012, 07:31:44 am »
I dabbled with programming back in school, but I'm primarily a problem solver and critical thinker. My way of thinking says that if you want to come up with an energy management system, first take a step back and look and what you're doing: you're trying to devise and code an algorithm to manipulate a system that was, by design, intended to be operated manually. It's like youre trying to design a robot to haul buckets of water from a river to a town instead of building an aqueduct. In my opinion, rather than automating the current system, it would be better, and easier, to just re-work the way energy is handled in the game, and reduce it to a simple formula that calculates the amount of resources that are consumed by the energy requirements of active ships.

After all, when automotive engineers designed automatic transmissions, they didn't just make a computer program and extra set of mechanisms to manipulate a manual transmission, they designed a whole new transmission based upon the very concept of it being automatic. I think the same thing applies here.

In a truly automatic energy management system, there would be no reactors (at least not as we know them right now). You would simply have an amount of resources held back from your income, based on the total energy needs of all non-low power ships. In keeping with the theme of more territory = more total energy production capacity (before having to deal with inefficient reactors), there would be a soft cap to your normal cost of producing energy, based on the total number of command stations you have. After which, a mathematical curve takes effect that increases resource drain in greater proportion to energy usage (similar to how energy inefficient reactors work now) until you take more planets or turn off some ships.

A figure showing your current resource drain from active ships could be added as a line item in the metal/crystal tooltips at the top of the screen (this is something I've always wanted anyway, even with the current energy system), and what is currently the available energy figure could become your current energy use, compared to the amount you can produce before hitting the soft cap (similar to a food use display in RTS games). The tooltip for it could be the current resource drain per 10,000 energy use, or something similar.

That way, not only is energy management automated, but the player has easy-to-read figures regarding energy and the cost of powering their ships. Beyond that, the player would also not have to worry about building reactors (building reactors wouldn't be intuitive in an automatic energy management system anyway).

Implications:
-Instead of energy brownouts you would have sharp increases in resource drain in certain cases where you lose control of planets
-The loss of the strategic gameplay element of protecting your reactors is inconsequential, since if the AI is blowing up your reactors, theyre usually also blowing up your command stations. Though if you really wanted to keep energy reactors in the game, you could simply have one generic energy reactor that "activates" that planet for energy production, adding to the soft cap
-Zenith power generators would become structures that greatly increase your soft cap of energy production, or possibly a structure that reduces your normal resource cost for producing energy (that would actually be really cool, as the benefit of having it would be proportional to your energy use).

Now, dont get me wrong, I think the current hamster button solution works fine, and I dont think Chris/Keith need to spend time reworking the system (I know how they feel about that already, thanks to the energy hamster's relentless sarcastic remarks). However, if an automation system were to be developed, I'd rather it be something like above.  If I were a new player, it would be very confusing to me to have to figure out how many reactors to build, and what mark level, if the available energy was always at the same level due to the automation. It just wouldnt be intuitive at all unless reactors were always auto-populated similar to extractors. And if they were, then it would make even more sense to implement a system like I described above.


TLDR: Don't devise a way to automate a system that was designed to be operated manually. Rather, create a system that is designed around being automatic.
Time to roll out another ball of death.

Offline Diazo

  • Master Member Mark II
  • *****
  • Posts: 1,717
  • I love/hate Diff 10
Re: Energy Effeciency Programming Challenge (CANCELED)
« Reply #35 on: March 16, 2012, 06:02:19 pm »
Or the simple solution, as applied to the game condition that currently exists can be done with two simple conditions.

If (Unused Energy) > (High Energy Cap) Then (Deactivate) (Least Efficient Reactor Currently Running) that won't take (Unused Energy) below (Low Energy Cap)
If (Unused Energy) < (Low Energy Cap) Then (Activate) (Most Efficient Reactor Currently Not Running) or Build (Most Efficient Reactor) if no (Deactivated Reactors) exist.

In game, I always want the most efficient reactor I can build at the time and I don't really care about the overhead. If the overhead is really bad, such as building a Mk III reactor, then turn I sometimes turn a Mk II off for a bit.

My average energy use is going nowhere but up during a game so my energy conditions right now are not that important.

D.

Offline Nodor

  • Sr. Member
  • ****
  • Posts: 254
Re: Energy Effeciency Programming Challenge (CANCELED)
« Reply #36 on: March 16, 2012, 08:36:06 pm »
See this is where I feel like the game has it right as currently designed.  (Energy Management in general.)

There is the potential for "micro till perfect"

But I don't have to think about it if I'm willing to accept a 95% (or so) performance level.

In fact, I prefer this to "non-micro perfect" because it provides me a manageable way to boost my performance when I need it.. but for those hours where I am sitting at capped resources while I micro a battle for a system I don't have to think about it.   


Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Energy Effeciency Programming Challenge (CANCELED)
« Reply #37 on: March 16, 2012, 08:42:35 pm »
See this is where I feel like the game has it right as currently designed.  (Energy Management in general.)
I wouldn't say it's right.  It's the least of the evils thus far tried ;)  But there are significant issues that continue to illustrate the need for something better.
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 Cyborg

  • Master Member Mark III
  • *****
  • Posts: 1,957
Re: Energy Effeciency Programming Challenge (CANCELED)
« Reply #38 on: March 16, 2012, 10:18:31 pm »
See this is where I feel like the game has it right as currently designed.  (Energy Management in general.)

Probably the worst part about making this thread is giving people the idea that energy management requires brain cells. It doesn't. It's simple-minded monotony that's not fun. We are talking about what, 80 planets usually? Everyone already builds at most maybe 2 of each reactor? It's completely solvable, not fun, mindnumbing, Sesame Street worst mechanic of the game. No offense to cookie monster.

In fact, it's actually quite abusable, because you can make a bunch of reactors and use them like a bank. Just keep them turned off and reap 10% off Mark 3 reactor. I fully admit that it's money better spent on a zenith toy, but hey.

What you have here in this thread is folks making it overly complicated with edge cases and declaring it reduces to NP hard, but in our finite case, it is completely solvable in more than enough time for even the wimpiest of netbooks.
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 TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Energy Effeciency Programming Challenge (CANCELED)
« Reply #39 on: March 16, 2012, 11:02:32 pm »
See this is where I feel like the game has it right as currently designed.  (Energy Management in general.)

Probably the worst part about making this thread is giving people the idea that energy management requires brain cells. It doesn't. It's simple-minded monotony that's not fun. We are talking about what, 80 planets usually? Everyone already builds at most maybe 2 of each reactor? It's completely solvable, not fun, mindnumbing, Sesame Street worst mechanic of the game. No offense to cookie monster.

In fact, it's actually quite abusable, because you can make a bunch of reactors and use them like a bank. Just keep them turned off and reap 10% off Mark 3 reactor. I fully admit that it's money better spent on a zenith toy, but hey.

What you have here in this thread is folks making it overly complicated with edge cases and declaring it reduces to NP hard, but in our finite case, it is completely solvable in more than enough time for even the wimpiest of netbooks.

Yep. Even NP-hard problems are quick to solve when the number of inputs are small.

That and, although in the general case, this finding the absolute optimum is hard (though, not in the case of the values that AI war uses), in game, you don't really need the absolute best. There are brain-dead easy algorithms that give you decent results in almost all cases, and even in the general form of this problem. And there are not so brain dead but still polynomial algorithms for getting very good results in the general case.

This was just to see if people could make an algorithm that could scale to trillions of energy requested across thousands of planets, possibly with hundreds of reactor marks to choose from. But even though solving that sort of insane problem is hard in the general case, getting a pretty decent, though not assured to be the true optimum, solution is easy even in those types of large cases.


I gotta say though, as Keith pointed out, the current system has plenty of flaws, but can you think of anything better that serves the same "fleet size pacing" and "pressure for planets" that the current system gives, doesn't take away too much choice, and doesn't have even worse flaws?
« Last Edit: March 16, 2012, 11:13:47 pm by techsy730 »

Offline Hearteater

  • Core Member
  • *****
  • Posts: 2,334
Re: Energy Effeciency Programming Challenge (CANCELED)
« Reply #40 on: March 17, 2012, 12:13:10 am »
Late night thought on power:

M+C regulates how quickly you can rebuild.  Power reduces your M+C.  So the more power your fleet uses, the longer it takes to rebuild the part of your fleet that is missing.  But since dead ships cost no power, the M+C reduction from Reactors is lower during the time you need to rebuild most (because you can turn some off).  The biggest issue with this is that there isn't a large enough difference in power costs at full cap between ship types.  In other words, when you lose a cap of ships, regardless of the ship type itself, your Power requirements drops about the same.  When there is a big difference, low energy ships are often low M+C ships, so even though you don't get to shut down a lot of reactors when they die, you don't need as much to replace them.  High energy ships often cost a lot of M+C, so although you get to shut down some reactors while rebuilding them, you need more M+C so it roughly breaks even.

In short, energy cost doesn't do much that isn't done by m+c costs and removing energy costs from normal fleet and starship units probably wouldn't affect gameplay.  I almost wonder if Reactors shouldn't power local system units only (turrets and shields) which would put an increasing cost on stacking too much stuff in one system.

Offline Wanderer

  • Master Member Mark II
  • *****
  • Posts: 1,579
  • If you're not drunk you're doing it wrong.
Re: Energy Effeciency Programming Challenge (CANCELED)
« Reply #41 on: March 17, 2012, 03:32:04 am »
In short, energy cost doesn't do much that isn't done by m+c costs and removing energy costs from normal fleet and starship units probably wouldn't affect gameplay.  I almost wonder if Reactors shouldn't power local system units only (turrets and shields) which would put an increasing cost on stacking too much stuff in one system.

That is a very interesting idea.  It would lower the turret-ball dependency and increase layered defenses.  However, how would you approach beach-heading?  It's not a dead tactic, yet anyway.
... and then we'll have cake.

Offline Hearteater

  • Core Member
  • *****
  • Posts: 2,334
Re: Energy Effeciency Programming Challenge (CANCELED)
« Reply #42 on: March 17, 2012, 09:43:39 am »
I'd say the Mobile Builder or some other unit would need to act as a mobile Reactor.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Energy Effeciency Programming Challenge (CANCELED)
« Reply #43 on: March 17, 2012, 10:21:13 am »
In short, energy cost doesn't do much that isn't done by m+c costs and removing energy costs from normal fleet and starship units probably wouldn't affect gameplay.  I almost wonder if Reactors shouldn't power local system units only (turrets and shields) which would put an increasing cost on stacking too much stuff in one system.

That is a very interesting idea.  It would lower the turret-ball dependency and increase layered defenses.  However, how would you approach beach-heading?  It's not a dead tactic, yet anyway.
That... is very interesting, indeed.  And if beachheading were done via the mobile builder being a "mobile reactor", that would potentially let us make turrets and such no longer require supply, because there'd be a limit to how much you could stack up on the enemy world.

It'd be a pretty massive change, and I'm not sure how it would handle the mobile units that currently do have significant energy costs, but I think it's worth thinking about.

The energy-changes I'd been batting around in my own head were basically:
1) Make energy reactors no longer able to go into low-power mode.
2) Make energy reactors take 30 seconds after construction before they actually started generating energy (alternatively make them non-scrappable, which might be less fiddly in general).
3) Change the outputs and/or costs so that mkI is most efficient but lowest output, mkII is second, mkIII is third.
4) To prevent the whole thing from just being a "nerf to the player", make it so that the first reactor of each mark on a planet costs no m+c to run (so you can have a I, II, and III on a planet for no m+c, but running another one of any mark will cost m+c for that one).  Alternatively, just reduce the m+c and/or increase the output of each mark.
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 Cyborg

  • Master Member Mark III
  • *****
  • Posts: 1,957
Re: Energy Effeciency Programming Challenge (CANCELED)
« Reply #44 on: March 17, 2012, 10:38:14 am »
4) To prevent the whole thing from just being a "nerf to the player", make it so that the first reactor of each mark on a planet costs no m+c to run (so you can have a I, II, and III on a planet for no m+c, but running another one of any mark will cost m+c for that one).  Alternatively, just reduce the m+c and/or increase the output of each mark.

I read 1, 2, and 3 and thought, "Nerf, Nerf, NERF" and then I get to number 4. I don't have any upfront objections to that one. It's one of those things that you would need to do a private beta with some of us so we could try it because that could be something really severe.

I was tossing around the idea of a fertility module for command stations that would produce pilots/skilled personnel for your ships/buildings. If that module was destroyed, you couldn't have as many ships/buildings because you don't have as many pilots/skilled personnel. The idea of having personnel and progressing personnel by your skill in battle, longevity, wins and losses, or even across games, is an interesting idea to me. Fertility module would of course be targetable. I also realize the name is dumb, but my other idea was "Baby Factory" and we can't have that.
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