Code Monkey home page Code Monkey logo

processorframework's Introduction

ProcessorFramework

The successor to Universal Fermenter

Processor Framework is a framework for autonomous transformation of ingredients into products inside objects. The framework is largely based on the original universal fermenter, with some large-scale improvements.

Main Features:

  • Independent processes
  • Parallel processes
  • ProcessDefs
  • New UI

Indepedent processes allows stacks of items to process independently. This enables products to be retrieved as soon as their stack is complete, indepedent of other stacks. If turned off stacks will be combined as in vanilla beer fermenting.

Parallel processes allows different kinds of processes to run concurrently. This can be combined with indepedent processes.

ProcessDefs carry most settings for how items are processed and will be referenced by their defName in the ProcessorComp. This allows parent ProcessDefs to be created and used, reducing work for modders.

New UI features a custom Inspector Tab that lists available products with ingredients for those products as sub-nodes, allowing players to easily understand what can be used to make a product and allowing or disallowing specific products or ingredients.

processorframework's People

Contributors

syrchalis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

processorframework's Issues

Null pointer with processor framework barrels after saving/reloading a game

I ran into this issue, and saw some talk on Steam about it. Maybe I can shed a little light on it?

First, I had Processor Framework and Universal Fermenter loaded. Probably shouldn't have. Not sure if this may be one of the reasons for the bug. And maybe there are mods out which pull one of them in, and other mods pulling the other in, so others might have the same config.

What happened to me is:

  • One pawn made 5 wort which got put into the barrel
  • another pawn put some more wort into the same barrel after the first part had been working for a bit
    Result:
    image
    and in another barrel:
    image

Note how both of them say "wort, wort" in the content description.

This shows up in the save file as

                                                <PF_activeProcesses>
                                                        <li>
                                                                <PF_processDef>Beer</PF_processDef>
                                                                <ingredientThings>
                                                                        <li>Thing_Wort1143505</li>
                                                                        <li>null</li>
                                                                </ingredientThings>
                                                                <PF_ingredientCount>15</PF_ingredientCount>
                                                                <PF_activeProcessTicks>3667</PF_activeProcessTicks>
                                                                <targetQuality>Awful</targetQuality>
                                                        </li>
                                                </PF_activeProcesses>

and

                                                <PF_activeProcesses>
                                                        <li>
                                                                <PF_processDef>Beer</PF_processDef>
                                                                <ingredientThings>
                                                                        <li>Thing_Wort1143429</li>
                                                                        <li>null</li>
                                                                </ingredientThings>
                                                                <PF_ingredientCount>14</PF_ingredientCount>
                                                                <PF_activeProcessTicks>4268</PF_activeProcessTicks>
                                                                <targetQuality>Awful</targetQuality>
                                                        </li>
                                                </PF_activeProcesses>

and the save file also has a barrel that I didn't notice before saving which seems to have been filled 4 times that has

                                                <PF_activeProcesses>
                                                        <li>
                                                                <PF_processDef>Beer</PF_processDef>
                                                                <ingredientThings>
                                                                        <li>Thing_Wort1143411</li>
                                                                        <li>null</li>
                                                                        <li>null</li>
                                                                        <li>null</li>
                                                                </ingredientThings>
                                                                <PF_ingredientCount>25</PF_ingredientCount>
                                                                <PF_activeProcessTicks>11800</PF_activeProcessTicks>
                                                                <targetQuality>Awful</targetQuality>
                                                        </li>
                                                </PF_activeProcesses>

After loading the game, this leads, probably as should be expected, to
image
and
image

If I remove the extra <li>null</li> rows from the save file before loading, the barrels seem ok.

So there might be some issues with the code that detects merging "old content" with "newly filled content" in that it merges the new content into the existing one, and adds the amount together, but sets the new content to null instead of removing it from the list (or maybe has the two list entries point to the same object, which explains the "wort, wort" being shown, and only sets the extra list entries pointing to the same object to bull while saving).

Please Consider Adding a Turtorial to Convert Universal Fermentator Items to This Mod

Good afternoon.

I am trying to revive a Mod that was removed before the Universal Processor Mod succeeded the Universal Fermentator Mod. I unfortunately do not know how to transfer one to the other. Would you mind, if it is in your ability and you have the time, writing a tutorial on how to change it over?

Thank you for any assistance you may render.
-TURTLESHROOM

Unoptimized search function

The WorkGiver is using a resource heavy process to find ingredients for the processor jobs.

In WorkGiver_FillProcessor.cs:96 you're calling the ClosestThingReachable method with the HaulableEver ThingRequestGroup. Because of how that method is implemented, the game will calculate the relative distances of every haulable item on the map before checking to see if those items can actually be used with the processor.

I created a fix for this. Instead of searching all haulable items, I'm restricting it to only items which are valid ingredients for unfilled enabled processes. This significantly reduces unnecessary calculations. I've tested it on its own and with some additional mods that are built on the framework, performance is noticeably better.

I can send you the code changes for this if you like.

Processes with no input or output

Allowing pawns to start a process without input will require a fork in the workGiver and jobDriver and probably some overhaul of null checks everywhere.

Allowing processes without an output should be much simpler (but also much less useful).

Probably a good idea to not allow a process with neither input nor output.

mod version comparison

Can you tell the difference between process framework(universal fermenter) and universal fermenter HSK version. Since I found that it is not similar to (SYR)universal fermenter, but only partially similar to ProcessorFramework: a similar RecipeDef_UF function, which you call ProcessDef.

Finished Graphic

There is two graphics, for full and empty processors. A graphic for when the process is finished could be added.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.