Space Engineers

Space Engineers

BARABAS
63 Comments
Burillo  [author] 24 Mar, 2020 @ 3:16pm 
@Wicorel thanks for reporting :) i've taken a long break from SE, but it's good to know that code is solid enough to still work!
Wicorel 20 Mar, 2020 @ 9:38pm 
FYI Still compiles under 1.194
Burillo  [author] 22 Apr, 2019 @ 10:55am 
v1.7 released

- Reworked power code, taking into account transient sources of power such as wind and solar
- Added "critical power" crisis mode, which turns off all refineries and assemblers until power situation improves
- Stone is no longer thrown out automatically - only gravel is
- Reworked ore prioritization and rebalancing code, to account for stone producing more than just gravel
- Uranium shortage is no longer indicated unless you have nuclear reactors
- Readjusted material shortage thresholds to account for changes in balancing
- Added threshold multiplier to config, to adjust further adjust material thresholds
- Fixed a few small bugs
Burillo  [author] 17 Apr, 2019 @ 12:04pm 
v1.65c hotfix

- Fixed crash on using survival kit to refine stone
Burillo  [author] 17 Apr, 2019 @ 11:03am 
v1.65b hotfix

- Fixed a bug in antenna scan
- Fixed text panels to set up their content type automatically.
Burillo  [author] 17 Apr, 2019 @ 10:23am 
BARABAS has been updated to version 1.65

New stuff:
- Added compatibility with latest API
- Added experimental support for checking assembler queues to count towards ore shortages
Burillo  [author] 2 Mar, 2018 @ 11:02am 
@BumbleGrum no, i haven't yet updated this version. this will only happen once i improve my minifier to do more advanced code minification(and that will only happen once i get enough time to actually figure out Roslyn...). The one you use works, but could do with some improvement, for which i do have plans but don't currently have the character space.
BumbleGrum 28 Feb, 2018 @ 10:17pm 
Hi Burillo,

I'm currently using the 'Next' version and it handles the refining really well. Excelent work.

Have you updated this version? Or should I continue to use the 'Next' version for now?

BumbleGrum 21 Feb, 2018 @ 7:14pm 
OK! Point taken. I better do some mining then!
Burillo  [author] 15 Feb, 2018 @ 11:52am 
Reactor will only be filled with enough uranium to sustain the base for set amount of hours at maximum load (set in config). Everything above that is considered a surplus and will be stored in storage for use in building stuff (or keeping reserves). My first priority here is to not make you run out of power. You should really mine more ;)
BumbleGrum 14 Feb, 2018 @ 7:44pm 
Ah! Ok. I had to cut the large reactor off of the conveyor system after moving some of the ur ingots to storage. That fixed the warning.
Burillo  [author] 14 Feb, 2018 @ 12:35am 
@BumbleGrum the warning happens because i don't consider uranium in reactors to be "available". You might want to build e.g. a rocket, and you'll be out - hence the warning. You must have some in storage, not just anywhere.
BumbleGrum 13 Feb, 2018 @ 2:35pm 
I may be fudging the program. At the moment I have all the storage capacity turned up to 50x while I'm building theis large ship. It's probably that that is causing the problem.

I find that welding with a welding ship using a blueprint is always fraught with the ptoblem of uncompleted internal blocks, so I'm building the ship with the players welder - hence the need for increased storage. Bit of a cheat, but .....
BumbleGrum 13 Feb, 2018 @ 2:21pm 
That's great Burillo. I'll certainly update my prog blocks to BARABAS-NEXT but atm, I have no ore left to process lol! I turned the program (BARABAS) back on and just waited until all the ore was processed.

A question: .. I have added a large reactor to my moon base (from the Easy Start Moon scenario) and though all the Uranium ore gets put into that reactor by BARABAS, and there is more than 1 ingots, the program reports a low ore/ingot warning of 0/0 for uranium. It has me a bit puzzled!
Burillo  [author] 13 Feb, 2018 @ 1:19pm 
@BumbleGrum i've bit the bullet and implemented support for ore reprioritization based on assembler queues, and uploaded it to BARABAS-next. Would you be so kind to test it and see if ore prioritization works better?

I've had to resort to some crude "minification" to make it under the char limit, which is why it's not in the release branch yet. In the meantime, i'll be familiarizing myself with Roslyn to make my minifier better.
Burillo  [author] 13 Feb, 2018 @ 10:01am 
@BumbleGrum this isn't just one person's problem - every user will hit this sooner or later, so while it's not an actual bug, it's still an issue i consider to be a no-brainer for this type of script, even if it's messy to implement. So i'll find a way, even if i'll have to switch to full-blown minification (that is, name mangling) to do it.

Thanks for the compliments. I work as a full-time software developer so i like to see i'm good at it, however you can probably see that i'm not a C#-native, and a lot of it is basically C-style code that happens to be written in C#. I learned a lot of idiomatic C# while doing SE scripts, but i couldn't be arsed to fix what was already there, so i ended up with this weird C/C# hybrid :D
BumbleGrum 12 Feb, 2018 @ 6:26pm 
Sounds like a lot of work just to ease 1 person's problem. I have finally processed all the ore now, so I thank you for looking into it. An external table sounds messy too, and you must be reaching the code limit even with minification. I think BARABAS is as good as it can be as it is!

I love your coding style, its given me a lot of delight looking theough it. You really are a master at coding (and I thought I was good! lol).
Burillo  [author] 12 Feb, 2018 @ 11:42am 
@BumbleGrum i've made some initial investigation to see if i can implement what you require - that is, looking at assembler queue and seeing if we can prioritize refining based on that.

long story short, it's doable but really ugly. there is no direct way to know which ingots are missing. instead, (and that's only theoretical, i haven't actually built code to do this) i can access assember's queue. from there, i can use a hardcoded table of which component requires which ingots (an enormous amount of work to compile, not to mention the fact that it can change, should devs decide to do a balancing pass again), and from there i can reprioritize ore based on this.

also, due to all the hardcoding of item definition id's, i might finally run out of space in my script.

i wanted to quickly get this in, but i'm afraid, there is no short-term solution for this problem.
BumbleGrum 9 Feb, 2018 @ 2:58pm 
That's Ok Burillo! I just didn't read your Doco properly. It is very possible to run out of more than one type of ingot for the same component, and that's what's happening. The only way I can get the components I need made, is to temporarily turn Off Barabas, and micro manage the refineries.

This shouldn't be a problem once this huge lot of ore is finally processed. I put in 2 more refineries yesterday complete with modules, so that should speed things up.
Burillo  [author] 9 Feb, 2018 @ 11:16am 
@BumbleGrum it's not looking at requirements for assemblers, however it should be looking at what you have, and if you've run out of ore, it'll prioritize it. i guess it's possible that it will prioritize "wrong" ore if you've run out of multiple kinds of ore, since i don't look at what assemblers require. that might be something i should look into - i guess ore that's missing in assemblers is more important than some other ore you might be missing but which you don't absolutely require right now.
BumbleGrum 9 Feb, 2018 @ 12:10am 
Is BARABS supposed to prioritize what ores are being refined to suit the requirement of the assemblers?

It the moment both of my assembles are clogged due to a lack of the correct ingots, but BARABAS keeps moving the wrong ore into place in both refineries.

I have a huge stack of ore to be refined. The refineries are filled to the BARABAS Max atm.
BumbleGrum 8 Feb, 2018 @ 5:51pm 
Sounds good Barillo. I'll take a look at it! Thanks for the heads-up.
Burillo  [author] 8 Feb, 2018 @ 10:24am 
@BumbleGrum as a side note, i've seen lots of airlocks on your base - you might be interested in another script of mine, JAMS. it's an airlock management script. not exactly a "trigger a door" script, but built specifically for managing airlocks (both 2-door "human" airlocks, and 1-door "hangar" airlocks).
BumbleGrum 7 Feb, 2018 @ 5:24pm 
I find myself asking that often! :) lol

Thanks for the followup.
Burillo  [author] 7 Feb, 2018 @ 11:03am 
@BumbleGrum found it! How the fuck did it ever work before...

Version 1.63 released, which fixed welder code.
BumbleGrum 6 Feb, 2018 @ 3:38pm 
The world is called 'DVE MOON Survey 01' and is friends only access. You'll find it in my workshop.
BumbleGrum 6 Feb, 2018 @ 3:18pm 
I'm in the process of uploading the world to the workshop atm. I'll net you know when it's available. I'd prefer to just have it available to friends though. I'll send a friend request. The ship in question is the ugly grey Welder on the pad aoutside the balst doors.

NOTE: the daoors in my worlds close automatically and a re opened by proximity. You may like to have a look at my code for the. It's been around since about 2013, but i just updated it to remove the nessesity of a timing block. Timing blocks haven't been reliably starting on world load since the last major update.
Burillo  [author] 6 Feb, 2018 @ 10:59am 
alternatively, you could make a screenshot of the echoed text - that would be very helpful as well, and would allow me to pinpoint where the crash happens much more precisely
Burillo  [author] 6 Feb, 2018 @ 10:57am 
@BumbleGrum can you share a world where this bug happens? i can see where, in code, it happens, but i can't figure out why, and cannot reproduce it.
BumbleGrum 5 Feb, 2018 @ 7:38pm 
Hi Burillo. I built a welder ship based on the large blocks. I'm getting an exception reported by the program block on the ship.

"BARABAS Exception: State: 19 Error: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"

This came from the block name (program block) but there was quite a bit more echoed to the status that I can't get a copy of!

The ship has 1 welder, 10 large ion engines, 1 large Gyro, 2 small containers, several conveyor junctions and 2 connectors.

Hope this helps!

Burillo  [author] 4 Feb, 2018 @ 6:44am 
glad you find it useful. to be clear, the problem was present since 1.60, it's just that i didn't notice it due to having Green Mode enabled on my base, and not spending enough time on my ships :)
BumbleGrum 3 Feb, 2018 @ 3:08pm 
Thanks Burillo. I'll update it. I have Barabas running on my moon base and the moon drill ship so far. Just a new game. So I have a lot of ships to build.

I found the Easy Start Earth Scenario very difficult to play due to the limitations of the Atmospheric Thrusters. Glad to be back to a more low/no gravity situ.

I noticed the refresh problem the second I loaded the cenario yesterday. You are certainly right on the ball as usual.

:steamhappy:
Burillo  [author] 3 Feb, 2018 @ 7:44am 
Version 1.62 released, which fixes refresh rate issues.
BumbleGrum 2 Feb, 2018 @ 3:50pm 
No Problem Burillo. I assumed you were using the VS extension for SE.
Burillo  [author] 1 Feb, 2018 @ 11:51am 
@BumbleGrum my guess is you're using the MDK extension. if you are using MDK, i can't help with that - i don't use it, so i have no idea what "Bootstrapper.cs" is or what it will do. I do code in VS, but i'm using plain C# project, without Malware's plugin.

So you can either strip my code of the extra regions (after minification, regions SEHEADER and SEFOOTER are removed by my minifier), or... or i dunno what else, really. Can't help you unless i install MDK, which i won't, because i'm lazy :)
BumbleGrum 30 Jan, 2018 @ 3:04pm 
All good now. Just created a programming block and the code compiled ok.

A question tho on programming in VS! When I loaded your code into Visual Studio into a new project, two of the three errors I got were the imoplicit double to float errors, but the other error was "The type or namespace 'Program' could not be found", even though it's defined in 'Bootstrapper.cs'. Can you throw any light on that?

Much thanks. Beautiful code by-the-way.
Burillo  [author] 30 Jan, 2018 @ 11:06am 
@BumbleGrum it's probably my fault. Since releasing BARABAS i've also released a new version of my minifier (to get rid of regions in my code), but forgot to update the link in the forum. so, without that new version current BARABAS code simply wouldn't fit into the 10K character limit.

that said, workshop items should work, so you should be able to subscribe and use them. let me know if you have any questions or suggestions, i'm always looking for new ideas to implement.
BumbleGrum 29 Jan, 2018 @ 1:55pm 
Thanks Burillo. I did find the culptris in the full script, but couldn't get the minify to work. I'm probably not using it correctly.

And thank you for responding. I really would love to use the script.
:steamhappy:
Burillo  [author] 29 Jan, 2018 @ 1:10pm 
@BumbleGrum, you should now be able to work with the script.
Burillo  [author] 29 Jan, 2018 @ 1:10pm 
version 1.61 released, compile fixes for recent API changes
Burillo  [author] 29 Jan, 2018 @ 12:59pm 
@BumbleGrum probably one of recent updates has blew things up again - i'll check it out, thanks for your report.
BumbleGrum 26 Jan, 2018 @ 2:29am 
I tried to compile this script but 4 double to float conversion errors are reported, and Space Engineers freezes, requiring shutdown of the program.

The errors are reported at positions 1, 29353 1,29402 1,93935 1,94034.

I also tried to use your minizer to use the code from reddit, but that doesn't see the clipboard data, so does nothing.

I had the same trouble with BARABAS-Next.

Hope you can help!
BumbleGrum 25 Jan, 2018 @ 9:26pm 
Great work Burillo. How come the forum only rates you as a Junior Engeneer? :)
Burillo  [author] 1 Jan, 2018 @ 4:59am 
Version 1.6 release. Timer is now optional, also "green mode" added which limits refresh rate and amount of processing done.
Burillo  [author] 17 Feb, 2017 @ 10:21am 
Hotfix, fix false oxygen leak reporting
Burillo  [author] 16 Feb, 2017 @ 1:35pm 
Version 1.53 released, compatibility for the new PB API changes
Burillo  [author] 26 Sep, 2016 @ 6:24am 
v1.51 released, numerous bugs fixed, plus a couple of new features added.
Burillo  [author] 19 Sep, 2016 @ 1:22pm 
be sure to check the changelog - there are a few useful things there. well, things i myself find useful anyway :)
xlodx 19 Sep, 2016 @ 1:19pm 
Thank you for the many Updates! You Rock!
Burillo  [author] 19 Sep, 2016 @ 12:49pm 
version 1.5 has been released. my crown achievement :)