CC: Tweaked

CC: Tweaked

59M Downloads

Add config to make computers require power or allow addons to do so.

ajh123 opened this issue ยท 2 comments

commented

Introduction

Some players would like ComputerCraft (CC: Tweaked) to be harder and with the absence of an OpenComputers mod in modern Minecraft versions (There is oc2, but that only goes up to 1.18,2) this feature makes more sense now. Also, this seems like a nice way to rebalance the mod.

Having a config option to enable an energy (Forge Energy on Forge and Tech Reborn energy on Fabric) requirement for devices (computers, turtles, pocket, and peripherals) would allow players to make their CC harder. They would need to make sure they are producing enough power to ensure all their devices are operational.

How it works

When the config is enabled unpowered devices should not function. When power cables from the energy mod are connected to devices and given power, the devices will be able to function. Powered devices should be able to transmit power down Network Cables similar to POE (Power over Ethernet) in real life.

Each device should have an internal buffer of power (the capacity should be higher for advanced devices). Devices connected to other devices (with Network Cables) will pull power from the other devices' internal buffer.

If a device has a GUI then a power monitor should be added to the left side.

Pocket computers

When pocket computers are placed inside a powered Disk Drive, they should be charged by the Disk Drive, in addition, they should be charged by charging stations (or equivalent) from the power mod.

Turtles

To remain compatible with existing programs turtles' internal buffer should be able to be charged with the normal flues. They should be charged by the full Modem block when it is powered.
The power monitor would be helpful even if everything else does not get added.

Lua

An energy_storage peripheral should be added to all devices to allow programs to monitor the energy.

Additional info

I have seen http://www.computercraft.info/forums2/index.php?/topic/18019-pocket-pcs-requiring-power/ (on the old forums) discussing a similar idea, that came down to CC was "focusing more on the programming aspect, rather than the realism".

commented

If this feature shouldn't belong in the main CC: Tweaked mod then maybe an API should be made to allow addon mods to change power requirements of devices.

Addon mods can already do this via mixins however, this is more volatile because if any classes that the mixins need get changed then the mixins would need to be rewritten. A stable API could solve this.

commented

Thank you for the feature request! I definitely understand the motivation here (and thank you for the effort you went into in the original issue, I do really appreciate it!), but I'm afraid I'm not going to implement this. I think the joy of ComputerCraft is that you can just place down a computer and start programming on it immediately. Adding energy requirements takes away from that simplicity.

Personally I'm not actually sure requiring energy is an effective way to balance the mod, for a couple of reasons:

  • RF generation is all but trivialised in most serious modpacks, so all adding RF requirement really does is act as a gate on progression, which can be achieved other ways (e.g. changing crafting recipes).
  • The existence of a computer isn't really what needs balancing - if it's just sitting idle or interacting with redstone, I don't think computers are especially "unbalanced". The problem comes when computers start do more advanced things, such as peripheral calls.

I actually think OpenComputers had a good solution to this in its call budget system, and is also what I did for Plethora. Instead of consuming RF energy, computers have their own internal passively-regenerating battery, which method calls can consume. If they run out of energy, a method call will block until the computer has gained energy.

It's definitely something I've been mulling about adding to CC - we already do some rate limiting on method calls (based on tick time) - so it probably wouldn't be too hard to add, just a matter of priorities.

While it would be possible to add this functionality anyway via a config option or external API, it's a lot of extra effort (both in initial development and ongoing maintenance), for something that I'm really not a fan of.