Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

Fingercomp

Members
  • Content Count

    120
  • Joined

  • Last visited

  • Days Won

    35

Reputation Activity

  1. Upvote
    Fingercomp got a reaction from ZefTheFox in Guide to the Sound Card   
    The sound card is added by Computronics, a wonderful addon for OpenComputers. There are a few who actually know what it does. Even less people are able to use it. No one dares to understand how it works, or so I hope.
    Anyway, it appeared a few years (?) ago, and is still mostly undocumented. There is a page in the in-game manual, which fails to explain how great the card is. Of course it does! It has a heap of different methods, which you can use to cast many crazy magics to make the sound card sound, and it's impossible to teach someone to do magic by reading a single page.
    OK, I'm serious now. Last year I managed to understand how to use it, and even wrote a few posts about that. In Russian. Half a year later, I translated them to English. And now I thought of posting a topic here so that you could read them, too.
    Here's the link.
    The first two parts are all about basic things, like getting simple sounds, ADSR, and modulation. The third part features a little bit more complex things, like complex numbers and Fourier transforms. I tried to keep it simple, so I could get something wrong. If so, please leave a comment there pointing out the mistake. Grammar fixes are also highly appeciated.
  2. Like
    Fingercomp reacted to asie in pngview - High-resolution .PNG viewer in OpenComputers   
    Those of you who have followed my OpenComputers work might be aware of CTIF, my high-quality image converter for OpenComputers. However, it has always required an external converter to pre-process image files. Others may be aware of greaser's ocpng, an utility-turned-library for displaying regular PNG files without pre-processing - however, that capped out at 160x50 as it only used low-resolution characters.
    However, I am proud to present pngview - a .PNG viewer right in OpenComputers, based off greaser's ocpng library but capable of displaying images at up to 320x200. Unfortunately, it does not display images as well as CTIF - it has far more severe limitations related to being a simple Lua script that, as such, cannot perform calculations that complex. In particular, it handles slowly changing gradients a lot worse and is incapable of finding additional colors to supplement the image's palette the way CTIF does.

    Comparison: the top image is viewed via pngview, the bottom image is rendered via CTIF.
    Known issues:
    Currently, it only works on Tier 3, as the palette calculation process relies primarily on the 240 RGB colors exclusive to it. It does not perform any image scaling, so ~320x200 is the maximum image size (on Tier 3). Downloads:
    pngview is part of a Lua script collection called octagon.
  3. Like
    Fingercomp reacted to feldim2425 in OpenComputers for ComputerCraft users   
    Hello.
    So you know how to make a program in ComputerCraft and you want to switch to OpenComputers or just want to know OC better, this tutorial shows you how to use OpenComputers.
    0. Some concepts you have to know
    You can think of Components like Peripherals in CC. They are basically the same require is a function in Lua that returns a module. It can be compared to ComputerCrafts os.loadAPI. But require doen't load an API global like loadAPI, instead it returns the API and it doesn't return the _G table that the api defines. It returns what the loaded File returns like a function. More examples to that later in that Tutorial A computer from OC has no OS and no BIOS. So a computer can't start or load something without an Lua EEPROM and a typical OS, with a fancy Text terminal and some programs, is also not available without installing OpenOS first. That makes setting up a OC Computer a bit more complicated but it allows you to make a real OS for your Computer and not just a fancy UI or a Overlay to the predefined Operating System. An Address is used instead of the peripheral name and the ID in ComputerCraft. So your computer won't get the name "computer_0" or the id 0. The Address is a random UUID string and not a number that increments for every computer. So a Address looks more like "cd6c4e39-bbb6-491c-826d-48112912f44d". That can be a problem to remember, but components are usually uniquely identifiable by the first 3 characters of the UUID and later we will learn some other tricks to copy them. You can't shutdown a Computer with Ctrl+S or restart it with Ctrl+R. You have to type "reboot" or "shutdown" in the console or press the green button in the UI for the Computer Case. To interrupt a program in OpenComputers you press Ctrl+C or to forcefully kill it you can press Ctrl+Alt+C. In ComputerCraft you would press Ctrl+T and there is no way to forcefully kill a program in ComputerCraft other than restarting the computer. A Computer doesn't restart when you leave the world or the chunk unloads. Instead they keep the memory and the program running on it won't notice that the computer stopped for a moment. Some features are only available with cards. Like the Internet Card for HTTP and TCP (also Pastebin and Wget), Redstone Card for sending and receiving Redstone signals or a graphics card for connecting to a screen. Memory is limited and the amount you can use is determined by the Memory Items you put into the Case Your computer will use Power (If you didn't disable it in the config). Cases can convert RF and other electricity types into OC's own power system. There is also a Adapter that can convert power faster. Creative Cases generate their own power. 1. How to build a Computer
    If you play with ComputerCraft you just place one block and done. In OpenComputers however you need more.
    What you have to craft: ComputerCase .... Better Tier means that you can have more components and also components with better tier. CPU or APU ... The Tier of the CPU determines the amount of components that can be connected to your computer. The APU has the same features like a CPU but it can replace the Graphics Cards. OpenComputers allows you to have different Languages by default Lua 5.3 is selected. You can change that by shift+rightclicking the CPU or APU in your hand. Memory ... The memory determines the amount of RAM your program can use. Graphics Card (if you didn't craft a APU) .... This will determine the resolution and the color your screen can have. A Tier 1 Card can only display black and white (like a basic CC Computer) a Tier 2 can display colors (like an advanced Computer) and Tier 3 can display more colors. Screen ... The screen determines the resolution and color like a graphics card. The setup will only be as good as the weakest part. So if you have a Tier 1 Card and a Tier 2 screen you can't display colors and the resolution will only match a Tier 1 setup. So both GPU and Screen should have the same Tier. A Tier 2 or 3 Screen can also handle touch events like an Advanced Computer from ComputerCraft. Keyboard ... The keyboard doesn't really do anything other than enabling the GUI of the screen to type something. Without a keyboard you can only look at the screen and use it as a touchpad (if you have Tier 2 Screen or higher). Disk Drive ... A disk drive is similar to the disk drive in ComputerCraft. A tier 3 cases and a creative cases have a builtin Disk Drive, so you don't need one if you selected one of these cases. OpenOS Floppy ... This item contains the OpenOS ready for installation. This floppy won't get consumed so you only need one and as long as you don't lose it you never have to craft a new one. Hard Disk Drive ... This allows you to store data. The tier determines the amount of storage you have. (Lua BIOS) EEPROM ... This is the BIOS that loads our OS. It is required for the startup of our computer. If you have crafted one, you can copy the EEPROM by combining the Lua BIOS EEPROM in a crafting Table with an empty one. The setup:

    As you can see on the first image, the power cable can be connected directly to the case (no need for the adapter in this setup). The keyboard has to be a neighbor of the screen, but it doesn't have the be placed on the screen. So if you want to build a fancy table in from of the screen with the keyboard on top of it, you can do that. The Disk Drive and the screen is placed directly next to the case, you can also place the case somewere else and connect the screen and the drive via a cable, like in ComputerCraft. (except you don't need modems)
    In the second picture you see, how you have to put the components into the UI of the case. The tier of the component has to be the same or lower than the number shown in the slot. OpenComputers helps you by highlighting possible slots and items in your inventory and also in JEI if you have it installed, you just have to hover over the item to see possible slots or hover over the slot to see possible items. In the second picture you can also see, that items get an address. That would be the address of the component if the items acts as a component. Like a redstone card would give you the redstone component.
    If you have TOP (The One Probe) or WAILA installed the address of a component is also visible in there. You can see them on Cases, Screens, Redstone IO blocks, ... . If you don't have WAILA or TOP installed you can use an analyser from OpenComputers to get the address. If you hold Ctrl while rightclicking a block with the analyer you can copy the address of that component block.
    2. Install OpenOS
    As I already mentioned, the OS is not preinstalled when you build the Computer. You can write your own OS, but that's not what we want to do here. So now its time to put the OpenOS disk into the Disk Drive. You can open the GUI and put it in the slot or you can shift rightclick the disk drive (doens't work on the integrated disk drive in Tier 3 cases). The disk drive block will show you the inserted disk.
    If you now start the computer by pressing the green button inside the gui or shift rightclicking the case with an empty hand, the light of the computercase will light up with a green color, and you should hear some floppy noise. 
     
    You should see something like this if you open the UI of the screen. Sadly we are not done yet. 
    If your try to type in " edit test.lua " you will see the error message "file system is read only", that's because the OpenOS disk doesn't store anything on your computer it is a fixed storage, if you craft an empty floppy you would be able to store files on it. But in our case we already installed a Hard Disk Drive we just have to boot from it. To do that we have to copy OpenOS onto it. To do that you simply type  " install ". The program asks you if you want to install OpenOS. Now you have to type " y " and enter to start the process. This will take some time. After it is done the program will ask you if you want to reboot. So you can type "y" again. There shouldn't be much floppy sound and more sound from the hard drive. You can now take the floppy disk out and try " edit test.lua " again. It should now open the text editor. In the text editor you can press Ctrl + S to save and Ctrl + W to exit.
    3. Troubleshooting
    So chapter 2. didn't work and your computer won't turn on. If the green light is on but you don't see anything on your screen. It's likely that the screen is not connected or you forgot the graphics card. 
    If there is only a red blinking light you should see a error message in your chat, if that's not the case build an analyser and shift + rightclick the case. You should see the "Last Error". These error messages should tell you what went wrong.
    Somtimes you also get a blue screen with an error message. If you see the message "Too many components connected" it can means 2 things. One is that you exceeded the maximum amount of components that are allowed for your CPU Tier or you forgot the CPU. 
    4. Programming
    This is not a full Lua tutorial I will show you some basic programs and show you the difference to ComputerCraft.
    First we have to create the file. Simply type "edit test.lua" to open the editor and yes all lua Programms should end with ".lua".
    Since I want to work with redstone, I put a tier 1 redstone card in the second slot of my case. Since it is the only redstone component it is also the primary component. The primary component should be the first connected component of a type. In this example the redstone card is a "redstone" component. You will see why this is important in a second.
     
    --First thing we have to do is to load the component library. --Some libraries are loaded by default but "component" we have to load manualy --Thats the biggest difference from ComputerCraft, that APIs are not loaded from the beginning. local component = require("component") --OpenComputers defines sides as numbers and not as a string like ComputerCraft --But we don`t want to learn every number for every side so we can load a library that does that for us. local sides = require("sides") --Now we see what primary component means. OpenOS defines the primary component as a variable with the name of the type in component. --So we can access component.redstone and will get the redstone card. Later I will show you how to connect to multiple components of --the same type. local redstone = component.redstone while true do --Set the redstone output to 15 (maximum strength). The first argument defines the side. We use the sides api here to help us out --You can also put 3 instead of sides.front but as I sayed we don`t have to remember every number redstone.setOutput(sides.front, 15) --"os" is a library thats loaded by default. We use the sleep function to sleep for 500 milliseconds os.sleep(0.5) redstone.setOutput(sides.front, 0) os.sleep(0.5) end  
    (Sorry it seems like the coloring is a bit off)
    INFO: You can paste ingame by pressing your mouseweel in the UI of the OpenComputers screen.
    This program has no exit condition so the only way to stop it is with Ctrl+Alt+C (or reboot the computer).
    So how can you load multiple components with the same type?
    We first have to get the Address. You can copy the address into the clipboard by holding Ctrl while clicking with the analyser on a component block. As I mentioned in most cases the first 3 characters in the address should be enough. Lets do the same thing with with a redstone component.
    --First thing we have to do is to load the component library. --Some libraries are loaded by default but "component" we have to load manualy --Thats the biggest difference from ComputerCraft, that APIs are not loaded from the beginning. local component = require("component") --OpenComputers defines sides as numbers and not as a string like ComputerCraft --But we don`t want to learn every number for every side so we can load a library that does that for us. local sides = require("sides") --This line now contains 2 functions. The proxy function is the same as peripheral.wrap in ComputerCraft but it needs an address and it doesn't work with --sides. To get the full address out of the 3 Characters we have to search for it. The component api has a builtin function called "get" for this purpose. --If you copy the full address with an analyser you can get rid of the component.get call and give the address directly to to proxy function --You should replace "a37" with the address of your redstone card or redstone IO Block local redstone = component.proxy(component.get("a37")) while true do --Set the redstone output to 15 (maximum strength). The first argument defines the side. We use the sides api here to help us out --You can also put 3 instead of sides.front but as I sayed we don`t have to remember every number redstone.setOutput(sides.front, 15) --"os" is a library thats loaded by default. We use the sleep function to sleep for 500 milliseconds os.sleep(0.5) redstone.setOutput(sides.front, 0) os.sleep(0.5) end You can find more information about the apis here: https://ocdoc.cil.li/api
    In the section "Standard libraries" you can find the libraries that are loaded by default and you don't have to require them
    In the section "Custom libraries" you can find the libraries that are offered by OpenOS and you have to call "require" in order to load them
    More information about the components can be found here: https://ocdoc.cil.li/component
     
    Many APIs that are built into ComputerCraft are moved to components in OpenComputers like "HTTP", "Redstone", "Rednet", "Disk", "Fs" (partially), "Turtle" (Robot in OC).
    Fs and Disk are mostly moved to the "filesystem" component, which allows you to get the empty space, rename the disk and basic File access. The "filesystem" api is a more abstract, which allows you to work with file "objects" and it has some more features.
    HTTP is the internet component in OpenComputers and it is provided by the internet card. The internet component also allows you to make raw TCP requests.
    The Rednet API in ComputerCraft is basically another way to access the modem peripheral in CC so you can find it in the modem component from OC, which is available if you add a network card or a wireless network card to your setup.
     
    Events work similar to the events from ComputerCraft but they have their own Api in OpenComputers called "event". You can find a list of signals (other name for event) here: https://ocdoc.cil.li/component:signals
    So lets make a example for a touch event: 
    local event = require("event") while true do --This will wait an infinite amount of time for any event local ev, arg1, arg2, arg3, arg4, arg5 = event.pull() --"interrupted" event is fired when you press Ctrl+C if ev == "interrupted" then return --The "touch" event is fired by the screen and gives us: The Screen Address (1), X & Y - Coordinate (2 & 3), The Mouse Button (4) and the Player (5) elseif ev == "touch" then print("Player " .. arg5 .. " touched screen " .. arg1 .. " at X="..arg2.." Y="..arg3) end end You can also filter for one event / signal or give the "pull" function a timeout. If you want to filter for multiple events you can use event.pullMultiple(). More information here: https://ocdoc.cil.li/api:event
    If you want to handle Ctrl+Alt+C in your program you have to handle errors thrown by event.pull(). You can do that with pcall() but I won't go into details here (this is a normal lua function, so you can search it online).
    If you want to handle an unknown amount of return arguments from any lua function you can also do " local ev = { event.pull() } "  this will create a array with all the arguments and you can access them with ev[1], ev[2], .... 
    5. Filesystem
    OpenComputers OpenOS has a more complex filesystem than the OS from ComputerCraft and it resembles the UNIX filesystem. If you bootup your computer you will start in /home. This is where you should write your own programs and store data. 
    /bin ... Programs installed by OpenOS
    /lib ... Libraries installed by OpenOS ( This is one of the paths where "require" searches for libraries
    /usr/bin ... Programms installed by the user. Usually via a package manager like OPPM
    /usr/lib ... Libraries installed by the user. Usually via a package manager like OPPM
    /usr/man ... Manual pages for programms. You can type " man <command> " to open them
    /usr/misc ... Some miscellaneous data for some programms
    /etc ... Configs for programs.
    /boot ... Scripts that run during bootup
    /mnt ... This is where you can access other storage devices like floppy disks. OpenOS will create a directory inside mnt with the first letters taken from the address of the disk
    /tmp ... Temporary storage. Cleaded after a reboot.
    /init.lua ... File that gets executed by the BIOS
    /autorun.lua ... This File doesn't exist after a fresh installation. But you can create it to execute a program after startup. (Like the "startup" file in ComputerCraft)
    INFO: Not all of these directories exist after you install OpenOS. Some of them are created when they are needed by some program.
     
    I hope this tutorial helps you to learn how to use OpenComptuers.
    Maybe I will make a second part about the differences between a CC Turtle and a OC Robot.
  4. Like
    Fingercomp reacted to DevonTheNovice in RFC #13: Universal Networking Stack   
    Back in the day, I had started to look into 
     and even attempted to develop
    An advanced networking system for OC. I failed before, but I feel I now have the experience and knowledge to truly pull it off (thanks to working in the field). So, I would like to re-introduce the Unet Project!
    The Unet framework is a full stack IP routing solution, featuring 64 bit IP address and subnet masks, VLANs, MAC (modem address) aware interfaces and the ability to be filtered by routers.
    The key behind Unet is its abstraction layer, aggregating all communications media (Loopback, Wired Modems, Wireless Modems,  Tunnel Cards, etc) into an interface, completely independent of the media. This vastly simplifies the transmission process. 
    These interfaces are then farther hidden behind the basic send command. When presented with an IP address, will automatically resolve which media to use and how in the following process.
    If an interface with this address exists on the local system, the message is immediately looped back on behalf of the interface. If an interface resides on the same subnet as this address,  it will be used to transmit the message If a route entry is found in the local route table that points to the subnet in which this interface resides, the routing information will be used in transmission If a default route is found, it will be used If no route is found, a route not found message will be looped back. In addition, an advanced series of router operating systems, both for microcontrollers (using side based transmission control) and full-fledged servers (using modem-side bindings and tunnel cards) Will allow massively scaled networks.
    In addition to the Unet IP addresses, the headers will have space for auxiliary transport layer info. An int will be used for Source IP addresses, a second int will be used for Destination IP Addresses, and a third int will contain an 8-bit hop counter, and a 16-bit protocol flag showing what the packet is carrying. At this time there is no other data, and comments are more than welcome regarding what to do with the extra space
    The project is still very early stage, as I work on it in my spare time at home, but should there be enough interest in this (Admittedly competing) system, I have however committed the code to Github and loaded the WiKi with information about the current designs. Anyone is welcome to discuss this with me! https://github.com/LetDevDev/unet
  5. Upvote
    Fingercomp reacted to Nexarius in Tank Display Program | now with energy and essentia too !   
    This program can display the contents of tanks on a big screen with a colored bar that can dynamically change its size.
    It can show up to 256 128 64 different liquids which are sorted from highest amount to lowest.
    5x8 is the optimal size for the screen.
    Multiple tanks with the same liquids are automatically added together and empty tanks are ignored.
    This display is split into 2 programs.
    1) Server - this receives the tank information and displays it
    2) Client - this has the adapter with the tank controller (you can have as many as you like)

    optimal screen sizes: 8x5; 8x2; 4x1
    pastebin run -f cyF0yhXZ installation guide:
    https://www.youtube.com/watch?v=avvYO2xSxGw
    github: https://github.com/Nex4rius/Nex4rius-Programme/tree/master/Tank#start
    server / display components:
    Internet Card (to install) Network Card Graphics Card T3 Screen T3 client / adapter + tank components:
    Internet Card (to install) (Wireless-) Network Card It supports now the following blocks:
    Adapter + Tank Controller Upgrade Transposer Batbox CESU MFE MFSU Gregtech Batterybuffer Capacitor Bank ALL RF storage blocks ME Interface ME Controller Warded Jar Void Jar  
    Big Update version 2
    The screen scales better to utilize the "room" to the fullest.
    Thaumcraft:
    I've added support for jars and essentia (Thaumcraft 6 needs the Thaumic Computers mod)
    ExtraCells:
    It's now possible to connect this to the ME System and read all liquids from it.
    Thaumic Energistics:
    Additionally it can read essentia from the system if you have Thaumic Energistics installed.
    Energy EU:
    You can connect EU storage devices and it will show it on the screen.
    Energy RF:
    Furthermore you can also connect any RF storage block and it will work too.
     
    The version 2 is not compatible with the version 1. You will have to update the server and all clients.
     



    I've double the limit from 64 to 128 and doubled it again to 256!

  6. Upvote
    Fingercomp got a reaction from XyFreak in Big Reactors Grid Control   
    It's better to use block symbols:
    ▁▂▃▄▅▆▇█ ▏ ▎ ▍ ▌ ▋ ▊ ▉ █ http://www.unicode.org/charts/PDF/U2580.pdf
  7. Upvote
    Fingercomp reacted to XyFreak in Big Reactors Grid Control   
    WARNING! This post is long and contains math! Continue at your own risk!
    There's also a TL;DR!
    Once upon a time, XyFreak tried to came up with ideas how to predict the energy/steam output of a Big Reactor.
    His test reactor was a small 7x7x2 reactor.
    He played around with some settings and thought "cool! If I pull out the rods by 10, the output goes up by roughly 10%. There HAS to be a linear correlation!". Not knowing what he's doing, he just went on and wrote some code for his Big Reactors Grid Control program.
    In his attempts to make BRGC work out of the box, he came up with a way to figure out the sweet spot of passive reactors. He knew that with really unbalanced reactors the algorithm may have some issues but...who uses unbalanced reactors anyways, right?
    His ideas seemed to work perfectly. He and his friends used his program with many different actively cooled generators and everything worked as intended.
    Time passed, Minecraft 1.7.10 was nearing the end of its lifespan. Minecraft 1.10.2 emerged!
    Suddenly, "Gelid Cryotheum" was gone! Reactors have become a lot less balanced and many people emerged that found actively cooled reactors to be a hassle.
    But there was a problem: For some reason, less balanced reactors didn't quite work as intended.
    "Yeah right... I'm an idiot.", XyFreak thought. His past lazyness came to bite him in the a**. He opened up his Visual Studio Code (Use it! It's great!) and started reworking his algorithm. But something was not right. For some reason, all his attempts to improve the algorithm failed! Either the controller undershoots the power target or overshoots it by... a lot.
    He looked at the calibration data of his (now bigger) test reactor and saw a value twice as large as it should've been (again, http://br.sidoh.org is your friend).
    And this is where the tale of advanced mathematics begins for real.
    And this is also where I stop writing in story telling mode
    So, I told you above that I assumed the reactors output (be it energy or steam) to be linear in regards to the rod level.
    Well... for actively cooled reactors this is true (or at least a near perfect approximation). And since I mostly used actively cooled reactors (both in my real playthroughs and my test worlds) everything worked fine.
    And since my passive test reactor was so small and well balanced, it worked there as well.
    Now.... look at this image here:

    This graph shows the energy output plotted against the (inverse) rod level. Doesn't look linear, does it? It's not linear at all!
    I assumed the energy production to be linear, but the fuel consumption would go up dramaticaly as heat increases. Turns out it is the other way around! (Stupid me!)
    Fuel consumption is linear with rod level but energy production decreases greatly as heat increases.
    So... if it's not linear, what is it? Well... a polynomial 3rd degree seems to fit extremely well.

    But how do you get such a polynomial? "Heh! Easy! We did this at high school!" you may think and that's what I thought as well.
    <MATH WARNING!>
    If you have N samples for x and f(x) you can easily create a polynomial of degree N-1. There're a couple of different methods to do it.
    Now.. I don't have 4 samples, I have 17! "Easy! Just leave out some!". Yeah right....
    I tried that and all polynomials sucked. Also, the polynomial libreoffice calculated seemed to fit perfectly. I wanna do that too!
    After a while it struck me: It's a linear optimization problem (Of course it is! But it's been a while since I last worked with those, sorry.)
    So...how to solve it?... ... ... QR decomposition...
    Great! Now I'll have to do linear algebra in lua.
    I always wanted to avoid using advanced math in brgc and now I have to work with matrices... great!
    So...what do I need first? Right... matrices in lua. So I wrote a small library to work with matrices and the operations (and only those) I'm going to need to get QR decomposition working.
    Next up? QR decomposition! But how does it work again? It's been a while since I last did something with that (at least 4 years).
    Fortunately, Google is your friend (I'll append the links to the end of this post in case you're interested).
    After 4 hours of implementation and debugging, everything worked. Well that was easy...not.
    Next up: We're going to have to work with polynomials. So we need a library for that as well, right? 10 Minutes later: done.
    I fed everything with my sample reactor values aaaaand....perfect!
    Now...we got a nice way to interpolate functions. Maybe we can use it for the optimization as well?
    Let's see...
    Let the reactors efficiency denoted by E(p) = O(p) / C(p)
    Where p is the percentage of the inverted rod insertion level, O(p) is a function that gives us the energy generation for rod level p and C(p) gives us the fuel _c_onsumption for rod level p.
    O(p) is a polynomial of degree 3 and C(p) is of form C(p) = a * p. So we just devide two polynomials, right? How bad can it be.
    I'll spare you the details, it's not worth it. The result is NOT a polynomial (well duh!).
    BUT! Turns out we can use polynomial interpolation if we feed the interpolator the rod level and the efficiency values as samples (we already got those from the calibration).
    Now we have a polynomial that describes the reactors efficiency!

    (We want to figure out the peak of that little mountaint)
    For optimization purposes we're interested in the local maxima of that polynomial between 0 and 1 (0 = reactor off, 1 = reactor max). Thankfully, this is easy!
    Thanks to the QR decomposition, the numerical calulus lecture was still on my mind and we did that stuff as well.
    And when I'm saying "easy" I mean it. Take this code:
    function polynomial.converge(polynomial, x, iterations) local df1 = polynomial:derivate() local df2 = df1:derivate() local dx = 0 - df1:eval(x) / df2:eval(x) for i=1, iterations do x = x - df1:eval(x) / df2:eval(x) end return x end That's the code. Here's some background, if you like: https://en.wikipedia.org/wiki/Newton%27s_method_in_optimization
    DONE! Does everything work? Hell yes it does! This time I tested it with multiple designs and on 1.7.10 and 1.10.2.

    TL;DR
    XyFreak assumed stuff about reactors that's complete bullshit. It never came to light because his testing sucked.
    Magic (math) happened. Stuff now works perfectly fine. Optimization-mode is gone. Everything is awesome.
    Also:
    I'd like to mention that I've now officially used more university knowledge to develop Big Reactors Grid Control than I've ever used in my day job.
    So kids...keep this in mind: Pay attention in school! You may not need it in real life. But you may need it in Minecraft someday!
    If you read everything, thanks for staying with me
    -XyFreak

    QR decomposition links (german)
    http://www.math.uni-frankfurt.de/~numerik/lehre/Seminare/ProSem_MA_SS11/qrzerlegung.pdf
    http://numerik.uni-hd.de/~lehre/SS12/numerik0/12-la-5.pdf
    http://www.mathematik.uni-muenchen.de/~lerdos/SS08/Num/trans4.pdf
  8. Upvote
    Fingercomp reacted to Sangar in OpenPrograms   
    There you go, made that screenshot just for you:

  9. Upvote
    Fingercomp reacted to Totoro in Hologram Editor   
    1) Install
    0.7.1: http://pastebin.com/LPb4FEv4
    0.7.0: http://pastebin.com/2kG4V3tB
    0.6.0: http://pastebin.com/bR33cXDU
    You can use internet card, and command:
    pastebin get LPb4FEv4 holo 2) What do you need
    a) Diamond Screen and Graphics card (for good resolution). Beginning from version 0.7.0 you can use a golden GPU card.
    Diamond processor (just faster; before OC 1.4 it's not important) 
    c) 2 Golden memory planks.
    d) Internet card (to get program from pastebin)
    e) Hologram projector (to preview your creation)
    f) other parts, any levels
     
    3) What can it do?
    This is a simple tool for hologram edition, viewing, saving and distribution (as `*.3d` or `*.3dx` files).
    You create hologram in layers. (48x32x48 voxels). You can switch between "Top", "Front" and "Side" projections. The editor can show additional layer as "ghost", for comparison between layers. By default this is layer "below" or "above" current.
    Also the editor allow you to use some hotkeys: '~' '1' '2' '3' for eraser tool or brushes, 'Del' to clear layer.
    3DX format is quite lightweight (around 1.4 kB for a complex model). Old 3D format is around 19kB per model, but is easier to parse.
     
    4) What does this look like?

     
    5) I just want to show my model, do I need a full editor tool for this?
    To "deploy" hologram (any computer, any components), you cant use small `show` tool:
    0.7.1: http://pastebin.com/1iW9fX7i
    0.7.0: http://pastebin.com/vvxKKGff
    0.6.0: http://pastebin.com/ggwXr81P
    pastebin get 1iW9fX7i show Usage:
    show filename[.3d/.3dx] [scale] 6) What do you think?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.