MightyPirates / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
1.59k stars 432 forks source link

Robot Consumes Power When Turned Off #447

Closed ph1x3r closed 10 years ago

ph1x3r commented 10 years ago

A robot placed in the world but turned off continues to consume power.

When it was turned off, the robot had over 50k. Now a few hours later, less than 6000. You can actually see the power being used up by 100 units every 10 seconds (approx).

The robot components are:

robot_config

Mod Version:

OpenComputers-MC1.6.4-1.3.2.531-universal.jar

edit: There is a possibility this is caused from a robot that was created in 1.3.2.525 and now used in the latest version. Energy drain looks to be happening at the same rate as a generator feeds energy into the robot. Currently unable to reproduce this issue after creating a new robot.

Issue left open for owner to close in case this is a symptom of a bigger issue.

Wuerfel21 commented 10 years ago

Is the chunkloader disabled? It could be still running

ph1x3r commented 10 years ago

@Wuerfel21 - The chunk loader was never enabled. Also, even if it was the chunk loader, the energy usage was huge. It drained 50000 energy in the time it took me to watch a movie.

fnuecke commented 10 years ago

The chunkloader upgrade is enabled by default, because I'd otherwise expect 90% of people complaining it doesn't do anything because they didn't realize they'd have to call component.chunkloader.setActive(true). So that could well be part of it. Running a chunk loader isn't cheap. The default is 0.5 / tick, so 10 / second, meaning 50k last you for about 83 minutes. I personally think this is acceptable, because robots should be either highly geared towards mobility (have a huge energy buffer) or be expected to return to base every so often anyway. Feel free to discuss this, though!

I'm assuming it is the chunkloader, and will look into automatically disabling it when the robot is powered down.

ph1x3r commented 10 years ago

OK. Enabled by default I can accept. However, principle of least surprise would have the robot stop using any power when turned off. I wouldn't expect the chunk loading to work if I turn it off either, so this shouldn't be a problem.

Personally, I think the cost in energy is much too high. There are multiple mods that provide chunk loading capability. Railcraft = 1 ender pearl/day. ChickenChunks = free (also 9 spot loaders from one chunk loader). So having the most expensive (to use) chunkloader just means it won't get used.

I like to build autonomous devices. I want to write a robot program to keep itself refuelled from mined resources. If I need to build up to tier 3 components to get there, then that is OK. But to write the code in such a way to prevent people from doing it seems counter productive. If you make it too expensive/difficult or even impossible, then people will just turn off energy use in the config file. I would prefer to see an autonomous robot as the culmination of an upgrade chain.

On the other hand, CC made it too easy. The difficult part was 3 diamonds for the pick. Then you had a self sustaining turtle (as long as it found coal).

Please don't misunderstand, I like the mod. I am enjoying playing with it. I am just suggesting an alternate approach to balancing things.

fnuecke commented 10 years ago

Yup, as I said, I'll look into turning it off automatically when the robot shuts down :-)

Let's say 1 Ender Pearl = 1 Block of Coal (just for reference), 1 block of coal produces 16000 energy. One MC day takes 24000 ticks, so that would leave us at 16000/24000 = 0.66 energy / tick. Which is more expensive than it is now. Huh, I actually didn't expect that myself. Maybe the issue isn't the cost of the chunk loader, but the size of the energy buffer then? Or would you argue 10 charcoal a day is too much? (Seeing as in the world I'm playing with friends we have over 100k charcoal just lying around I may be biased there)

fnuecke commented 10 years ago

Guh, Github triggers on too many words :-P Still not done discussing energy cost.

ph1x3r commented 10 years ago

I just checked the RC pages and they say the following:

Every so many real-life hours (12 is the default) the Anchor will eat an Ender Pearl in order to maintain operation.

So it uses 2 ender pearls every real 24hrs. That is 8 days for a stack of pearls. You used minecraft days, so 72 times different.

I have a MFR tree farm growing jungle trees, so charcoal isn't a problem. But I haven't found a way to turn charcoal into block form unless I write a minetweaker rule for it. If I did my math right, that means I would need to be feeding the robot about 20 stacks of charcoal per day just to keep the chunkloader running.

fnuecke commented 10 years ago

TIL Railcraft chunk loaders are far less expensive than I thought >_>

Well that changes my frame of reference, dramatically, of course. How about dropping it to 0.1 (from 0.5) / tick? That would then lead to 54 charcoal per 12h (real life), if I didn't miscalculate. I'm a little scared about over-correcting here, otherwise I'd even suggest 0.05, but I'd like some more input / opinions on the matter.

Techokami commented 10 years ago

Why not make it a config option? That way, people can define how much fuel to utilize.

fnuecke commented 10 years ago

@Techokami really? You should know me better by now ;-) Defaults still matter, though, quite a lot.

ph1x3r commented 10 years ago

In any form of balance, there are two sides. On one hand there is preventing abuse, on the other there is usability/usefulness.

Initially, I thought your suggestion of .05/t would be a reasonable compromise. That would give someone the chance to get back to their robot once per day before it uses up its energy. However, if I stack all 32 slots with charcoal and write a simple program, I get over a month!! Clearly not desirable either.

So how do we balance this?

Perhaps the idea would be to require player action to refuel the chunkloader either by a button in the GUI or perhaps having a special "chunkloader" slot in the GUI where fuel is placed for it to consume. Maybe a special battery slot that just powers the chunkloader

A more complex option (but arguably more realistic) would be a log/exponential curve for chunkloader efficiency. The longer it keeps running, the more fuel it requires. Essentially thermal runaway. This way if someone wanted to dig a medium hole for the few hours they were building or something, it would be cheap. But you couldn't build a world-eater because eventually, the chunkloader would require more fuel/tick than the robot can receive in a tick

fnuecke commented 10 years ago

Hmm, the exponential increase in cost is interesting, but I'm not convinced it'd be worth the effort, considering it could be circumvented relatively easily by having multiple robots that do the actual chunk loading in a distributed fashion (i.e. robot 1 for 15 minutes, then robot 2 for 15 minutes, etc).

One thing that I hadn't really taken into consideration until now, though, is that robots only load a single chunk, as opposed to, say the RC world anchors, which load a 3x3 area. So it might actually be fair for the cost to be comparatively low (although charcoal, which is trivially renewable, doesn't really compare to ender pearls, which are non-trivially renewable [mob spawner?], anyway).

Side note: I'm primarily comparing to RC here because Chickenchunks doesn't really make sense to compare anything that needs maintenance to, since it's free. Are there other chunkloader mods that require a maintenance cost out there, for reference?

Techokami commented 10 years ago

I think the only chunkloaders that require fuel are RC's (Ender Pearls), yours (furnace fuels and electricity mods), and BuildCraft's (running quarries are chunkloaders, uses MJ)

CB's chunkloaders are limited differently, users can only have a certain amount of chunks loaded at once. So instead of being able to coat the world with chunkloaders you can only have a few.

Sent from my Windows Phone


From: fnueckemailto:notifications@github.com Sent: ‎8/‎1/‎2014 8:20 AM To: MightyPirates/OpenComputersmailto:OpenComputers@noreply.github.com Cc: Christopher Trumbourmailto:techokami@holenet.info Subject: Re: [OpenComputers] Robot Consumes Power When Turned Off (#447)

Hmm, the exponential increase in cost is interesting, but I'm not convinced it'd be worth the effort, considering it could be circumvented relatively easily by having multiple robots that do the actual chunk loading in a distributed fashion (i.e. robot 1 for 15 minutes, then robot 2 for 15 minutes, etc).

One thing that I hadn't really taken into consideration until now, though, is that robots only load a single chunk, as opposed to, say the RC world anchors, which load a 3x3 area. So it might actually be fair for the cost to be comparatively low (although charcoal, which is trivially renewable, doesn't really compare to ender pearls, which are non-trivially renewable [mob spawner?], anyway).

Side note: I'm primarily comparing to RC here because Chickenchunks doesn't really make sense to compare anything that needs maintenance to, since it's free. Are there other chunkloader mods that require a maintenance cost out there, for reference?


Reply to this email directly or view it on GitHub: https://github.com/MightyPirates/OpenComputers/issues/447#issuecomment-50877812

fnuecke commented 10 years ago

@Techokami That limitation actually comes from Forge itself, from what I understand, via the ticket system, and there are even limits to how many chunks loaded any single mod can have, so that should apply to all chunk loading mods (unless they do some trickery that does not use the Forge API).

See the ForgeChunkManager class for reference.

Techokami commented 10 years ago

RailCraft sounds like a mod that stomps over the Forge APIs to do what it wants, but I can't say for sure because it's closed source...

Sent from my Windows Phone


From: fnueckemailto:notifications@github.com Sent: ‎8/‎1/‎2014 11:28 AM To: MightyPirates/OpenComputersmailto:OpenComputers@noreply.github.com Cc: Christopher Trumbourmailto:techokami@holenet.info Subject: Re: [OpenComputers] Robot Consumes Power When Turned Off (#447)

@Techokami That limitation actually comes from Forge itself, from what I understand, via the ticket system, and there are even limits to how many chunks loaded any single mod can have, so that should apply to all chunk loading mods (unless they do some trickery that does not use the Forge API).

See the ForgeChunkManager class for reference.


Reply to this email directly or view it on GitHub: https://github.com/MightyPirates/OpenComputers/issues/447#issuecomment-50897716

ph1x3r commented 10 years ago

With CB Chunkloader, you can have a radius of 10 maximum, which equals 361 chunks. It isn't even that expensive to make. As several people have demonstrated, it can also be moved with some form of inchworm drive (typically MFFS). Railcraft has the static chunkloaders and also railcart based loaders so that trains can run between locations. The quarry only keeps the chunks loaded that it is mining.

My thought is not to worry too much about the fuel, but the quantity to use for the chosen duration. I would put forward that a reasonable default is a stack of charcoal for 24h.

If a separate power source for the CL is used, then 12hr for a T1, 24hr for T2 and 48hr for a T3. But this would only be if the source was divorced from the main power system, so player interaction is required to renew the CL.

Almost any system for restricting something can be abused by a determined player. So the ultimate decision comes down to what is a reasonable cost for the average player just starting to use the OpenComputers robots and using a program they found on a website?

fnuecke commented 10 years ago

Yeah. I agree. I think adding extra fuel types for the CL would be over-engineering it. I also think 1 stack / 24h 'feels' about right. If I didn't miscalculate that'd be ~0.06 / tick?

ph1x3r commented 10 years ago

@fnuecke I think that sounds like a good compromise between cost and functionality. After all, if the robot is moving, then that will add to the 'cost' as well and shorten the actual time of use.

Only time and people using the feature will tell if it really is the right choice.

fnuecke commented 10 years ago

Good, that will be the new default starting with 1.3.3 then. Yay for versioned configs :-)