Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
start [2014/07/10 09:16]
vexatos [Welcome to the documentation of OpenComputers!]
start [2021/12/31 12:22] (current)
yhn [Official documentation of OpenComputers]
Line 1: Line 1:
-Welcome to the documentation of OpenComputers! +Official ​documentation of OpenComputers 
-==============================================+=======================================
  
-This wiki is organized several parts:+OpenComputers ​is a mod that adds computers and robots into the game, which can be programmed in [[http://​www.lua.org/​|Lua]] [[http://​www.lua.org/​manual/​5.3/​manual.html|5.3]]. It takes ideas from a couple of other mods such as ComputerCraft,​ StevesCarts and Modular Powersuits to create something new and interesting.
  
-- General information (this page). 
-- [[:#​contents|Block and item documentation]]. 
-- [[api|Lua API documentation]]. 
-- [[component|Component API documentation]]. 
-- [[tutorial|Tutorials]]. 
  
-OpenComputers is a mod that adds computers ​and robots into the game that can be programmed in [[http://www.lua.org/​manual/​5.2/|Lua 5.2]]. It takes ideas from a couple of other mods such as ComputerCraft,​ StevesCarts and Modular Powersuits to create something new and hopefully - interestingHere a few key points.+- [[:#​contents|Block ​and item documentation]] 
 +- [[api|Lua API documentation]] 
 +- [[component|Component API documentation]] \\  
 +\\  
 +- [[tutorial|Tutorials]] 
 +- [[tutorial:​oc1_basic_computer|Getting started]] 
 +[[http://oc.cil.li/|Homepage]]\\ 
 +\\ 
 +[[https://​oc.shadowkat.net/|Ingame manual as HTML]]\\
  
-Persistence +Connectivity 
------------+------------
  
-Programs will resume where they were stopped when the chunk with the computer they run on was unloaded and reloaded later. This is particularly useful for single player, servers where you can't spam chunk loaders ​and last but not least Redstone in Motion frames. OpenComputers achieves this by persisting the actual call stacks of all running coroutines. This is the reason OpenComputers doesn'​t use a Java implementation of the Lua VM, since those all use Java threads as far I'm aware, which cannot be persisted. Therefore:+OpenComputers ​can connect to and interact with the outside Minecraft world through several methods:
  
-**Important**: ​OpenComputers ​comes with a native library ​- the [[https://​github.com/​fnuecke/​eris|Eris]] libraryspecifically. This includes ​the official Lua VM implementationCurrently ​the library is included in the mod for WindowsMac OS XLinux and BSD. Note that*only the server* requires the libraryClients ​do notAll Lua code is executed purely on the serverIf the library is not available ​for your system, the mod will fall back to LuaJ, a Java implementation of Lua. In fallback mode computers will *not* persist, and memory will *not* be limited.+Most of OpenComputers' blocks can "​see"​ and interact ​with other OpenComputers Blocks automatically if placed right next to each other, or you can use [[block:​cable|Cables]] to connect them over distance. It is also possible to connect ​or separate - components logically by using one of the various network cards or switches in both wired and/or wireless form. 
 + 
 +Blocks from Vanilla or other Mods can be connected via the [[item:redstone_card|Redstone Card]], the [[block:​redstone_io|Redstone I/O Block]] or an [[block:​adapter|Adapter]]Many special Blocks from other mods are already integrated into the Adapterlike Blocks from BuildCraftIndustrialCraft2 or Thermal Expansionother mods authors can use the Java API to add specific handling for their blocks as well. 
 + 
 +[[block:​robot|Robots]] can interact with the world almost like a real player can do. They can equip most tools, blocks or other items and can be programmed to use them in every way you want them toYou can program them to sort your inventory, go mining ​for your resourceshave them build a fortress for you or make them [[api:​note|sing]] and dance for your entertainment. Only your imagination is the limit. 
 + 
 +See the page on [[component:​component_access|component interaction]] ​to learn how to communicate with components from Lua.
  
 Modularity Modularity
 ---------- ----------
  
-You can add and remove components ​such as expansion ​cards and hard drives. This means it takes a little more effort ​to get your first computer, but adds a whole new level of flexibilityFor exampleyou could build a pure "​server"​ by having a computer ​that only has network card, but no graphics card, Or a "​workstation" ​that contains large amounts of graphics processing, networking, I/O and RAM. Etc.+OpenComputers are built out of individual parts such as graphic ​cardshard drives ​or expansion cards, which allows to tailor each individual computer exactly ​to your needsYou can save resources if you need something small for small tasksor spend even the last diamond on the most expensive and powerful Minecraft ​computer ​ever built.  
 + 
 +See the [[:#​contents|block and item documentation]] for list of components ​that can be used to assemble your computer.
  
 Resource Limits Resource Limits
 --------------- ---------------
  
-Besides the obvious limitation of disk space, computers also have a limited amount of RAM. You'll actually have to keep this in mind when writing ​your programs, since low end computers can run out of memory pretty quickly  +OpenComputers ​have a limited amount of disk space and RAM, which can be configured in the OpenComputers config ​to your likings. This not only makes OpenComputers very server friendly, it as well gives you warm feeling of nostalgiaback at time where disk and RAM size was measured in Kilo and MegabytesHowever as programming in Lua is very resource-friendly,​ you should be able to solve most tasks even on mid-end OpenComputersAnd if not you could always spend some diamonds on even bigger RAM.
-This also makes computers quite server-friendly, ​since it's less likely for them to strain the server unduly. A few more limits are in place to further enhance server performance:​ OpenComputers does not have to spawn new thread for each coroutine. Insteadit uses fixed number of low-priority worker threads to drive all currently loaded ​and running computersComputers are also forced ​to yield regularly (per default within one second) to avoid them blocking the worker threadsIf they fail to do so, the computer will "​crash"​.+
  
-Power +In addition to those intuitive limitations,​ OpenComputers has been specifically designed to work flawlessly on servers: OpenComputers uses a fixed number of low-priority threads for coroutines to cause as little delay on the server tick as possible, in addition running programs are forced to yield on a regular, configurable basis or if for any reason fail to do so will crash (the in-game computer) forcefully to prevent server lag by malicious or malfunctioning programs.
------+
  
-Computers and certain components need power to operate. For example, computers and screens require a constant amount of energy per tick to continue running / displaying. If there is not enough power, computers will crash / stop. Graphics cards consume energy when modifying the screen they are bound to, the amount of energy being consumed depending on the size of the area that is being changed. Wireless network cards consume energy when sending wireless messages, based on the used signal strength. Robots use energy to move and perform other actions.+Persistence 
 +-----------
  
-There is - except for a robot upgrade - no built-in mechanic for generating power at this point, so you'll want to use this mod together with others. OpenComputers ​can convert power from BuildCraft, IndustrialCraft²ThermalExpansion 3 and Universal Electricity using the [[block:​power_converter|power converter block]]. Computer cases and Server Racks can accept power directly.+When OpenComputers leave the loaded Chunk area, they will be put on hold, but automatically resume ​at the exact point they were stopped once the Chunk is reloaded laterThis makes OpenComputers ​very intuitive to use in the Minecraft environmentas you do not have to worry about chunk loading or resuming ​and do not need to add chunk loaders from other mods just to keep those computers running.
  
-Connectivity +To do so OpenComputers comes with a native library ​the [[https://​github.com/​fnuecke/​eris|Eris]] library, specifically. This includes the official Lua VM implementation,​ which is already capable to support computers being put on pause temporarily. Currently the library is included in the mod for Windows, Mac OS X, Linux and BSD, which are *only* required to run on the server as all Lua code is executed purely on the server. If the library is not available for your system, the mod will fall back to LuaJ, a Java implementation of Lua, in which case computers will *not* persist, and memory will *not* be limited.
-------------+
  
-In OpenComputers there are item and block components, i.e. "​things that can be seen from Lua".+Power 
 +-----
  
-Block components can be seen from computers that are connected to the block by being next to it, or indirectly by any number of other blocks from this modIf you know how Applied Energistics powers its blocks, that's basically how it is heretooFor example, if a screen is next to a power distributor which is next to a computer, the computer ​can still see the screen, because it is connected ​to it via the power distributor. The cheapest way of connecting blocks this way is the cable block.+Computers consume power while running based on what they are doing. Beside a low base amount of power per tick consumedcomponents such as graphic cards or wireless network cards will consume extra power based on their work loadThis is not only realisticbut as well encourages players to optimize their code and to not keep an OpenComputers server busy with unnecessary tasksThe exact power consumption ​can be configured in the config file and even be completely removed if you wish to run in a power-free environment.
  
-Item components can usually be only seen by the computer they'​re installed in. An exception to that rule are floppy disks in disk drives, which behave like a block component. 
  
-See [[component:component_access|the page on component interaction]] to learn how to communicate ​with components from Lua.+OpenComputers mod provides electrostatic power generation with [[block:carpeted_capacitor|Carpeted Capacitor]]  as well as with [[item:​generator_upgrade|Generator Upgrade]] available ​to robots and [[item:​solar_generator_upgrade|Solar Generator Upgrade]] available ​to robots and microcontrollers. Opencomputers devices can also be powered ​with energy equivalents of a [[crossmod_interoperation#​power|number of other mods]].
  
 Configurability Configurability
 --------------- ---------------
  
-Almost every aspect of the mod can be tweaked via the configuration file. Not a fan of computers requiring power to run? Set their running cost to zero. Don't want power to play a role at all? Disable it completely! Think robots move too slow? Make 'em faster. Want bigger multi-block screens? Increase the maximum size. Just have a look at the [[https://​github.com/​MightyPirates/​OpenComputers/​blob/​master/​src/​main/​resources/​reference.conf|default configuration file]] to see all the options. They are hopefully well enough documented.+Almost every aspect of the mod can be tweaked via the configuration file. Not a fan of computers requiring power to run? Set their running cost to zero. Don't want power to play a role at all? Disable it completely! Think robots move too slow? Make 'em faster. Want bigger multi-block screens? Increase the maximum size. Just have a look at the [[https://​github.com/​MightyPirates/​OpenComputers/​blob/​master-MC1.7.10/​src/​main/​resources/​application.conf|default configuration file]] to see all the options.
  
 Contents Contents
 ----------- -----------
 {{page>:​contents&​noheader&​noeditbutton&​nouser&​nofooter}} {{page>:​contents&​noheader&​noeditbutton&​nouser&​nofooter}}