Javascript reactor planner(EXTREME WIP)

  • I know it might be a bold request but it feels a bit like "wish for something"-day, so I wish we could set the cycles to a defined value, so we can e.g. see what result we have at 5000 cycles instead of waiting for the script to loop through! =)

  • It's a simulation, not a calculation. You can set it to stop at X cycles, but you will have to run though all of those, that come earlier, though.


    Stop-cycle button would be a great idea, indeed.


    A way to fasten it up is also needed, but I can see the technical limitations here.
    If you want to, you can try to recreate it as a Java Applet. Since even Minecraft is able to run as a Java Applet, I am certain it will give quite a performance boost. You've got to learn a whole new language, though. Well, it's up to you :)


    OCAdam: Do not mix JavaScript and Java. Although both contain "Java", they are COMPLETELY different.
    JS is a scripting language (as the name suggests), has no datatypes or complex structures.
    Java is a full-blown programming language, it is THE object-oriented language, right next to C++.
    Actually, C++ and Java are the most used languages today.


    Do you see the difference?
    Summary: JS is aimed at web development, while Java is a real programming language that creates executables. (jar files)


    (If anybody has a problem about how I am speaking so highly of Java: I hate it being a VM, too :D, it is fun to use it, though)

  • Okay, I'd just like to say awesome script. It is /EXTREMELY/ helpful, as you don't have to build dummy reactors and time them for how long they run before they blow a giant crater in your world. Although I agree with some others it could use some things if possible. I hope you are still working on it.


    Anyway, here are my suggestions:


    1.) Water buckets and ice.
    2.) A stop/pause cycle button, or just hitting cycle again.
    3.) Something to automatically figure out what the maximum heat level is, so for a max chamber reaction without any plates, it'd be like 16,000, while a single chamber would be 10,000.
    4.) Using the above value, have it automatically record which tick of the cycle that the heat levels first hit both:
    4a.) 50 percent when it starts boiling surrounding water.
    4b.) 85 percent where meltdown can first occur.
    (These numbers come from the wiki, so I assume they're accurate.)
    5.) Perhaps have it automatically stop when it reaches 100 percent heat, when I assume meltdown will have definitely occurred by then, as it can't work if it no longer exists. This might need to be toggled though, I don't know if some people like to have it run continuously so they can tweak the design while it's live.
    6.) Have the option of having it run after all the uranium is used up so you can time how long it needs to cool down for.(Wait, can it already do this? Do I just need to hit cycle again? I'm not sure. Haven't tried it.)


    Anyway, this is basically to get you some exact numbers. How long can you safely run it without meltdown? How much power can it generate per run cycle? How long does it take to cool down? etc.


    If you're still working on this, I thank you for listening.

  • WOW! AWESOME TOOL! So useful man! Really helped me understand how reactors worked. Though a suggestion: Allow for faster cycle speeds.


  • From what I saw, you can just download the .html file, put the pictures in the \Images folder and use it from your computer.


    I wanted to add an evolutionary algorithm to randomly mutate designs and try them out but I stopped when I realized I can't read javascript anymore, let alone write... You said something about rewriting it into a better language? Which one? Here's hoping I know it.

  • Hmm. Is the heat different than what the thermometer records? Because according to it, A nuclear reactor completely full of uranium, water cooled, 6 chambers, will explode in 4 ticks. While it actually takes like 16 ticks.

    Quote

    It has become a little stubbly. Implement facial hair growth in IC²? Vision continuously grows more furry until you shave. (approx once every 2 minecraft days ;P)


    Steve shaves with his chainsaw.
    Check out Factorio- A game where you build a factory from scratch.

  • Perhaps add a cycle speed setting, and a tick-number setting? So you can run it faster, or just jump to a specific tick. Also, later add an "Explosion Point" button that warps tells you the range on where your reactor can explode. If it's a MK I, then it will just say "Mark I"


    And once you're done with that, make it say what MK it would be classified as.

    Quote

    It has become a little stubbly. Implement facial hair growth in IC²? Vision continuously grows more furry until you shave. (approx once every 2 minecraft days ;P)


    Steve shaves with his chainsaw.
    Check out Factorio- A game where you build a factory from scratch.

  • Perhaps add a cycle speed setting, and a tick-number setting? So you can run it faster, or just jump to a specific tick. Also, later add an "Explosion Point" button that warps tells you the range on where your reactor can explode. If it's a MK I, then it will just say "Mark I"


    And once you're done with that, make it say what MK it would be classified as.


    Uhm, you do know that this is a simulator, it can't figure out a particular tick straight from the get go. It has to cycle through every single tick, and it's already processing as fast as it can. The only way I can think of to possibly make it run faster, would be to store everything in a data array, and not update the display every tick. Doing every thing in memory and shaving off the little bit of processing time it takes to display the results. I'm unsure of how much processing power this would actually save though. Other than that, the only way to make it run faster is to rewrite it in another language. And seeing as I haven't seen him reply to this topic since he posted it, I'm guessing somebody is going to have to take over his project eventually.

  • Uhm, you do know that this is a simulator, it can't figure out a particular tick straight from the get go. It has to cycle through every single tick, and it's already processing as fast as it can. The only way I can think of to possibly make it run faster, would be to store everything in a data array, and not update the display every tick. Doing every thing in memory and shaving off the little bit of processing time it takes to display the results. I'm unsure of how much processing power this would actually save though. Other than that, the only way to make it run faster is to rewrite it in another language. And seeing as I haven't seen him reply to this topic since he posted it, I'm guessing somebody is going to have to take over his project eventually.


    What I mean is that it runs at the maximum possible speed it can to that tick. I'm pretty sure that for a relatively simple simulation such as this, my computer can go faster than about 5-10 ticks/second. Judging from the fact that I can run minecraft with a dozen mods, 32x textures, and smooth lighting at about 20 FPS, I should easily get faster speeds. I can also get it to go faster by spamming the step button.

    Quote

    It has become a little stubbly. Implement facial hair growth in IC²? Vision continuously grows more furry until you shave. (approx once every 2 minecraft days ;P)


    Steve shaves with his chainsaw.
    Check out Factorio- A game where you build a factory from scratch.


  • What I mean is that it runs at the maximum possible speed it can to that tick. I'm pretty sure that for a relatively simple simulation such as this, my computer can go faster than about 5-10 ticks/second. Judging from the fact that I can run minecraft with a dozen mods, 32x textures, and smooth lighting at about 20 FPS, I should easily get faster speeds. I can also get it to go faster by spamming the step button.


    Uhm, first of all, minecraft is written in java not javascript, there's a big difference in speed, and even java is considered pretty slow as programming languages are concerned. Also, it's already programmed to go as fast as it can, it uses the setInterval function to fire at the lowest possible delay being 1 millisecond. The only way I can think of to possibly improve the speed is maybe setting it up to run multiple ticks per cycle, and that's a maybe. Other than that it would need to be rewritten in another language and then it would either have to be a java applet or maybe shockwave flash to still run in a browser window, otherwise it'd have to be downloaded as a program.

  • Just as idea but maybe it would speed things up if you wouldn't update the shown numbers after each calculation but do that only every 10 calculations.


    If that updating should be the biggest performance brake maybe it would even be possible to let it simulate all 100k ticks but only update after 100.

    On my install Mining Drill doesn't give off any sounds at all o.o
    Help! Somebody fix that please!
    Wait a sec... damnit.

    no idea if he was serious but either way that was damn funny xD