Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Autonauts

Make and teach robots to automate the world! · By Denki

Log Chopping Program

A topic by kernelstubbs created Aug 04, 2017 Views: 4,841 Replies: 27
Viewing posts 1 to 13

OK...so I'm trying to get my bot to chop logs until hands empty OR storage full...if I nest the hands empty command inside the full storage one, it will chop trees all over and if do the reverse, its axe will break and not be replenished until wood storage fills...anyone have an elegant solution for this?


My goal is to use as few steps as possible...I hope for deeper logic, even variables :D - 'Human Resource Machine'esque



(general storage contains axes)

make repeats be able to look for multiple criteria. such as repeat until hand is empty and storage is not full. if one of the criteria is not met, it doesnt repeat.

(1 edit)

and then you would probably want to nestle it in a repeat until hands empty loop so it doesnt just go off and make/get more tools

That won't work with tools.  A tool is only 1/n hand slots and will not trigger a "hands full" flag.

Forever
-Go till storage is full
--Go till hands empty
---Find and chop trees
--Grab axe once hands empty
So basically your two repeats are backwards for it to work forever.

If you do it that way, bot will chop logs until axe breaks even if storage is full.  Right now, it will chop one tree each time storage empties and two other bots are basically always immediately putting a log in storage to fill it back up again.  Only, once the axe breaks - unless storage is full, it will not replace it with a new one.

(2 edits)

I do a similar thing kernelstubbs, but have an additional repeat within the hands empty.

This inner most repeat is an "until Log storage is NOT empty" and causes a loop of nothing. So the robot sits idle waiting for some room in storage before proceeding. The combined repeats mean the robot handles the storage filling up before or after the robot having an axe.

Note I just make a bunch of tools and leave them on the ground near my workers, so let them find their own tool :)


It did take a bit of trial and error to get to this working setup.

(1 edit)

That actually works incredibly well...thanks!

For the moment the repeats create this problem just wait for mondays update and see what is fixed;-)

(1 edit)

Come Monday if obtaining this behaviour is less obscure that will be nice :)

i have not really used the "untill storage is full" command, i'm a little lost on how to link the command with the proper storage, so I have a huge mess of wood everywhere :(

Click the white circle right of Repeat.

thanks I will try that in a few, I am taking a break from it LOL I have a few saves, trying different layouts to find what's efficient. Been playing for hours. I really like this game though, even half finished it has more potential and is updated more often than half the Steam Alpha and Beta's.

Its a awesome pre pre pre alpha game.  

agreed

I haven't had any problems with this kind of setup

it can run for hours unattended without any overflow and your logging camp looks clean

I used until storage not for both repeat loops.  

by doing it this way the repeat loop pauses the bot until the storage isnt full and parks my bot in the base of my logging camp. the outer repeat loop creates a delay before the bot can start mining if the storage is no longer full.  this is nice as there are usually 1 or 2 bots with logs ready to re top off the storage to full.  without the delay the bot begin chopping trees even though the storage was refilled within a second of it being not full.

This is also a handy way to add delay for any other operation and all you have to do to increase the delay is make the to move points further away from each other.

and since these steps are only when storage is not full it doesn't slow them down at all.

the last section is just for once his tool is broken to go make another one on his own and pick it up.

that way i don't need to have mountains of pre-made tools in the sky.

Now only if i new what to do with all these tree seeds and stones!!!!!

Everything else has a place but them


(+1)

This actually gave me an idea...by adding an "until log storage not full" to the start of my loop, it will pause there until a log is removed - then the bot will cut one tree and one tree only until another is removed.


I like that!

that's exactly my point and when you one inside another with the use of the move commands it adds a delay.  So if you have logs or ore waiting to be deposited into storage it gives your other bots time to refill the storage before your logger/miner/crafter goes back to work.

I see what you did.  I use two gather bots who ultimately replenish the storage immediately forgoing the need for a delay - my goal is always to use the least number of steps possible, even if that means building redundancy into my bot army :)

(+1)

I use this Code, to let my Bot do it's work and re fit it's tool. All of my Bots with a Tool that breaks do that on a per tool created Workbench.


Nice setup

Thanks i like it a lot , did a similar one in version 4 withe the crude bots but over did it and got than a overload on tools. xD
This one is simple and works clean and great, no more tool supplying. xD

(+2)

I changed my setup to this now. No Bots that just makes tools.  

The only issue I see with this is that if log storage fills up with a fresh axe, your bot could fell 500 trees before exiting the "until hands empty" loop.

(+1)

nope he loops only sometimes after loading the game, if you setup this in a active save the bot stops fine. i play for houres with it and mostly need to search for him when he stops. i already extended this code so he can work on a apple tree farm as primary, sourced on apple storage and switches over to pine trees until Logs are full and stops when the log storage is near full.

Deleted 7 years ago