Stationeers

Stationeers

Lihat Statistik:
Unintended benefit of sbn/lbn?
I'm sure the envisioned usage by the devs was to segregate common devices on a network under a group name for sbn/lbn. However, I went the other way and gave each device a unique name which allows me to effectively bypass the 6-pin limit on IC housing device assignments. This will come in quite handy.

https://steamcommunity.com/sharedfiles/filedetails/?id=2969040646

define LEDHASH -815193061 sbn LEDHASH HASH("L1") Setting 1 sbn LEDHASH HASH("L2") Setting 2 sbn LEDHASH HASH("L3") Setting 3 sbn LEDHASH HASH("L4") Setting 4 sbn LEDHASH HASH("L5") Setting 5 sbn LEDHASH HASH("L6") Setting 6 sbn LEDHASH HASH("L7") Setting 7 sbn LEDHASH HASH("L8") Setting 8 sbn LEDHASH HASH("L9") Setting 9 sbn LEDHASH HASH("L10") Setting 10 sbn LEDHASH HASH("L11") Setting 11 sbn LEDHASH HASH("L12") Setting 12

Update: Ignore the duplicate '11' bug in the screenie - lol
Terakhir diedit oleh DeathBirdsFly; 29 Apr 2023 @ 3:23pm
< >
Menampilkan 1-11 dari 11 komentar
Rocket  [pengembang] 29 Apr 2023 @ 5:06pm 
Yes there was quite some debate about this among the team.

Likely in future we may split the IC Chips into multiple types, with some having more instructions than others.

There is a reason to directly reference, the "batch named" instructions are not *quite* as performant as directly referencing something. The cost of finding the device(s) that you want to change goes up the more devices on the network.

The batch named instructions are the same as their batch counterparts, except a final 'test' is applied on the name hashes. So to do the batch named commands, the processor has to loop through all the devices on the network.

It is important to put this in perspective though. The list of devices is cached, and to compare each device it simply uses a "hash" (does one integer equal another). These are *very* simple operations for a computer and it can do thousands or tens of thousands of these kind of operations without breaking a sweat.

Additionally, all the IC code is run on a "thread", so concurrently. This means your main game framerate is generally not affected by the operation of the logic system at all.
JeanDeaux 19 Jul 2023 @ 10:50am 
I've come to find this VERY useful, though wish you could shorten the required text of HASH("name") since it takes up quite a bit of space on the text line.

Maybe just H("name") instead? Some of these hash names coupled with the logic name and collection method require more space than is allowed.
Terakhir diedit oleh JeanDeaux; 19 Jul 2023 @ 1:57pm
JeanDeaux 19 Jul 2023 @ 5:27pm 
You've found some way to achieve a bit of what I'm hoping to do, basically assign a variable to a hash code. What I don't get is even making that rainbow table, how would you access it? I just completed some coding for a group of 10 silos & sorters for off handling my automated rockets. If I can figure out how to set the name as a hash code that could be saved as a variable, then I think I could just Push/Pop a much longer list of sorters & silos with this routine. I'll post my code below, have some examples of how to achieve just that?
define Sorters HASH("StructureSorter")
define Silos HASH("StructureSDBSilo")
define Port 1 #0 = right side, 1 = left side
alias Var r0
alias QTY r1
alias Var1 r2
sb Silos On 1 #turn on all silos
sb Sorters On 1 #turn on all sorters
sb Silos Open 0 #close all doors
sb Sorters Mode 2 #set all sorters to logic mode
COAL:
lbns Var Sorters HASH("Coal") 0 Occupied Minimum
beqz Var COPPER #skip if empty
lbn QTY Silos HASH("Coal") Quantity Minimum
lbns Var Sorters HASH("Coal") 0 OccupantHash 0
seq Var Var HASH("ItemCoalOre") #is item Coal?
slt QTY QTY 600 #qty = 1 if silo has room
min Var Var QTY #1=correct ore type&has room else 0
bnezal Var NoSwap
beqzal Var SwapIt
sbn Sorters HASH("Coal") Output Var1
COPPER:
lbns Var Sorters HASH("Copper") 0 Occupied Minimum
beqz Var IRON #skip if empty
lbn QTY Silos HASH("Copper") Quantity Minimum
lbns Var Sorters HASH("Copper") 0 OccupantHash 0
seq Var Var HASH("ItemCopperOre")
slt QTY QTY 600 #qty = 1 if silo has room
min Var Var QTY #1=correct ore type&has room else 0
bnezal Var NoSwap
beqzal Var SwapIt
sbn Sorters HASH("Copper") Output Var1
IRON:
lbns Var Sorters HASH("Iron") 0 Occupied Minimum
beqz Var NICKEL #skip if empty
lbn QTY Silos HASH("Iron") Quantity Minimum
lbns Var Sorters HASH("Iron") 0 OccupantHash 0
seq Var Var HASH("ItemIronOre")
slt QTY QTY 600 #qty = 1 if silo has room
min Var Var QTY #1=correct ore type&has room else 0
bnezal Var NoSwap
beqzal Var SwapIt
sbn Sorters HASH("Iron") Output Var1
NICKEL:
lbns Var Sorters HASH("Nickel") 0 Occupied Minimum
beqz Var SILICON #skip if empty
lbn QTY Silos HASH("Nickel") Quantity Minimum
lbns Var Sorters HASH("Nickel") 0 OccupantHash 0
seq Var Var HASH("ItemNickelOre")
slt QTY QTY 600 #qty = 1 if silo has room
min Var Var QTY #1=correct ore type&has room else 0
bnezal Var NoSwap
beqzal Var SwapIt
sbn Sorters HASH("Nickel") Output Var1
SILICON:
lbns Var Sorters HASH("Silicon") 0 Occupied Minimum
beqz Var URANIUM #skip if empty
lbn QTY Silos HASH("Silicon") Quantity Minimum
lbns Var Sorters HASH("Silicon") 0 OccupantHash 0
seq Var Var HASH("ItemSiliconOre")
slt QTY QTY 600 #qty = 1 if silo has room
min Var Var QTY #1=correct ore type&has room else 0
bnezal Var NoSwap
beqzal Var SwapIt
sbn Sorters HASH("Silicon") Output Var1
URANIUM:
lbns Var Sorters HASH("Uranium") 0 Occupied Minimum
beqz Var COBALT #skip if empty
lbn QTY Silos HASH("Uranium") Quantity Minimum
lbns Var Sorters HASH("Uranium") 0 OccupantHash 0
seq Var Var HASH("ItemUraniumOre")
slt QTY QTY 600 #qty = 1 if silo has room
min Var Var QTY #1=correct ore type&has room else 0
bnezal Var NoSwap
beqzal Var SwapIt
sbn Sorters HASH("Uranium") Output Var1
COBALT:
lbns Var Sorters HASH("Cobalt") 0 Occupied Minimum
beqz Var GOLD #skip if empty
lbn QTY Silos HASH("Cobalt") Quantity Minimum
lbns Var Sorters HASH("Cobalt") 0 OccupantHash 0
seq Var Var HASH("ItemCobaltOre")
slt QTY QTY 600 #qty = 1 if silo has room
min Var Var QTY #1=correct ore type&has room else 0
bnezal Var NoSwap
beqzal Var SwapIt
sbn Sorters HASH("Cobalt") Output Var1
GOLD:
lbns Var Sorters HASH("Gold") 0 Occupied Minimum
beqz Var LEAD #skip if empty
lbn QTY Silos HASH("Gold") Quantity Minimum
lbns Var Sorters HASH("Gold") 0 OccupantHash 0
seq Var Var HASH("ItemGoldOre")
slt QTY QTY 600 #qty = 1 if silo has room
min Var Var QTY #1=correct ore type&has room else 0
bnezal Var NoSwap
beqzal Var SwapIt
sbn Sorters HASH("Gold") Output Var1
LEAD:
lbns Var Sorters HASH("Lead") 0 Occupied Minimum
beqz Var SILVER #skip if empty
lbn QTY Silos HASH("Lead") Quantity Minimum
lbns Var Sorters HASH("Lead") 0 OccupantHash 0
seq Var Var HASH("ItemLeadOre")
slt QTY QTY 600 #qty = 1 if silo has room
min Var Var QTY #1=correct ore type&has room else 0
bnezal Var NoSwap
beqzal Var SwapIt
sbn Sorters HASH("Lead") Output Var1
SILVER:
lbns Var Sorters HASH("Silver") 0 Occupied Minimum
beqz Var COAL #skip if empty
lbn QTY Silos HASH("Silver") Quantity Minimum
lbns Var Sorters HASH("Silver") 0 OccupantHash 0
seq Var Var HASH("ItemSilverOre")
slt QTY QTY 600 #qty = 1 if silo has room
min Var Var QTY #1=correct ore type&has room else 0
bnezal Var NoSwap
beqzal Var SwapIt
sbn Sorters HASH("Silver") Output Var1
j COAL
SwapIt:
seqz Var1 Port
j ra
NoSwap:
add Var1 Port 0
j ra
Terakhir diedit oleh JeanDeaux; 19 Jul 2023 @ 5:42pm
Rocket  [pengembang] 19 Jul 2023 @ 10:20pm 
Diposting pertama kali oleh Bonny01:
...
This is a really cool video, and also is a great explanation of the problems/benefits of hashes.
Bonny01 20 Jul 2023 @ 1:48am 
i am not the creator of this video. I'm just the one with the comment about the longest consecutive number sequence of this Rainbowtable, and i think 140 is more then enough :)
In the video at the beginning he shows exactly how he creates the rainbow table ! ? ! And yes, that is very helpful in so many imaginable and unimaginable ways. :)
HF
Terakhir diedit oleh Bonny01; 20 Jul 2023 @ 1:52am
JeanDeaux 20 Jul 2023 @ 2:52am 
Ah, thanks for clearing that point. I've got some ideas, I'll need to play with those to see where I can go.
Duke Leto 20 Jul 2023 @ 10:35am 
Diposting pertama kali oleh JeanDeaux:
You've found some way to achieve a bit of what I'm hoping to do, basically assign a variable to a hash code. What I don't get is even making that rainbow table, how would you access it? I just completed some coding for a group of 10 silos & sorters for off handling my automated rockets. If I can figure out how to set the name as a hash code that could be saved as a variable, then I think I could just Push/Pop a much longer list of sorters & silos with this routine. I'll post my code below, have some examples of how to achieve just that?

If you name the actual sorters for the Item that you wish to sort -- you can make a much shorter version of sorter/stacker control.

For example name the sorter "ItemCoalOre" instead of "Coal.' -- then you can find the stacker using the Item name and just check if the slot contains an actual item of that name.

Here is sample code that can control up to 14 sorters/stackers:

define SORTER HASH("StructureSorter") define STACKER1 HASH("StructureStacker") define STACKER2 HASH("StructureStackerReverse") alias count r15 alias hash r14 move sp 0 push HASH("ItemCoalOre") push HASH("ItemCobaltOre") push HASH("ItemCopperOre") push HASH("ItemGoldOre") push HASH("ItemIronOre") push HASH("ItemLeadOre") push HASH("ItemNickelOre") push HASH("ItemSiliconOre") push HASH("ItemSilverOre") push HASH("ItemUraniumOre") push HASH("ItemIce") push HASH("ItemNitrice") push HASH("ItemOxite") push HASH("ItemVolatiles") move count sp sb SORTER On 1 sb SORTER Mode 2 sb STACKER1 On 1 sb STACKER1 Setting 500 sb STACKER2 On 1 sb STACKER2 Setting 500 start: yield move sp count sort: pop hash lbns r0 SORTER hash 0 OccupantHash Minimum breqz r0 3 seq r0 hash r0 sbn SORTER hash Output r0 bnez sp sort j start
JeanDeaux 20 Jul 2023 @ 11:33am 
Thanks Duke,
That's an even simpler version of something i was going to try. Thanks for taking the time, much appreciated.

Also, I thought a POP removed that value from the stack; so a data stack of 10 would be empty after 10 pops. From the looks of your code, it looks like I might be mistaken and register "sp" loops back around?
Terakhir diedit oleh JeanDeaux; 20 Jul 2023 @ 11:40am
Duke Leto 20 Jul 2023 @ 12:45pm 
I reset sp to 0, then push the values on the stack, then store the stack pointer "sp" in "count".

I then pop the values off the stack -- but "poping" only moves the stack pointer down by one and returns the value -- it does NOT erase the value on the stack. So my outer loop (start loop) restores the stack pointer, and the inner loop (sort loop) "pops" values until back at 0 -- then the outer loop restores the stack pointer again... etc. etc....

As long as you do not "push" anything, you will not ruin the values on the stack.
Duke Leto 20 Jul 2023 @ 12:49pm 
Oh, and don't go to crazy with controlling lots of sorters -- the game has a built in limit of processing around 128 lines of code per IC per tick... and with 14 sorters it is getting close to that limit.

Controlling too many will slow down processing of the sorters because an automatic "yield" is inserted after processing about 128 lines of code.
< >
Menampilkan 1-11 dari 11 komentar
Per halaman: 1530 50

Tanggal Diposting: 29 Apr 2023 @ 3:21pm
Postingan: 11