Recent Posts

Pages: 1 [2] 3 4 ... 10
Suggestions / Re: Metalurgy
« Last post by Yves on February 26, 2019, 11:04:40 pm »
This is not the only way.
I have an efficient and reliable production of bronze and stainless steel, taking a ground surface of roughly 10×5 voxels.

Oh, well, let me publish the related article now :-) Here it is:
Suggestions / Re: The Sequencer
« Last post by Yves on February 26, 2019, 10:57:06 pm »
My two cents:
All other properties non-withstanding, I see 3 main properties to the current sequencer:

— It is first of all a programmable sequencer. And it is important to keep the ability to have a sequence of way more than 5 items, thus allowing sequencer chains. For example, my programmable robot and XTR-1 factories are 100% automated based on this ability.

— It is also a filter: it never absorbs an item that is not part of its programmed sequence.

— And it is a batch regulator: it never absorbs an item while a run of the sequence is still ongoing, and then it only absorbs what is needed for the next run of the sequence.

All those three properties are really useful, and I wish that they are kept. I wrote 2 articles (only one published for now), and they heavily rely on those three properties:
Suggestions / Re: Extended voxel interface
« Last post by Yves on February 26, 2019, 10:42:53 pm »
I have a wish of the same kind: I created a robot that digs automatically and then also stores each kind of voxel at the right place. So far so good.
My problem is, that storing eg. 5000 black-voxels in a storage takes a lot of time! Each time I see one of my robots stuck to a storage because of such an important stock, I end up taking the remaining voxels from its stock, so that I can put everything at once in the storage.
It becomes even more of a problem when I have several robots working simultaneously: a single robot can keep other robots from accessing a storage :-(
General Discussion / Re: Saving variables
« Last post by Yves on February 26, 2019, 08:41:17 pm »
This is an old topic, but I thought new players of the game may be interested in some feedback, because the language documentation is very sparse about saving and retrieving variables when quitting and resuming the game.

By trial and error, here is how I ended up saving and restoring my programmable robot:

Code: [Select]
// This function is called when robot is loaded from save file or when created

function Voxel_Load()
  local name = Get_Save_Filename();
  print("read state file = " + name + "\r\n");
    local save = dofile(name);
    InitDir      = save.InitDir;
    State        = save.State;
    StartX       = save.StartX;
    StartY       = save.StartY;
    StartZ       = save.StartZ;
    CenterX      = save.CenterX;
    CenterZ      = save.CenterZ;
    StepX        = save.StepX;
    StepZ        = save.StepZ;
    StepXBeforeZ = save.StepXBeforeZ;
    FlatSteps    = save.FlatSteps;
    Dir          = save.Dir;
    Depth        = save.Depth;
    Quarter      = save.Quarter;
    CellCount    = save.CellCount;
    RowCount     = save.RowCount;
    StartStock   = save.StartStock;
    UnloadType   = save.UnloadType;
    UnloadXYZ    = save.UnloadXYZ;
  catch (e)
    print("Could not read state file for robot " + GetRobotID() + "\r\n  " + e + "\r\n");
  if ( GetInfo(23) == 0 || GetInfo(23) == 4 )
    print("Robot " + GetRobotID() + " set to initial state.\r\n");
    State = ST_INIT;
    print("Robot " + GetRobotID() + " restored.\r\n");

// This function is called when robot is unloaded to save file or when destroyed

function Voxel_Unload()
  local name = Get_Save_Filename();
  local save = file(name, "w");
  local slot, xyz, data;
  local code = "return {\n";
  code += "  InitDir      = " + InitDir + ",\n";
  code += "  State        = " + State + ",\n";
  code += "  StartX       = " + StartX + ",\n";
  code += "  StartY       = " + StartY + ",\n";
  code += "  StartZ       = " + StartZ + ",\n";
  code += "  CenterX      = " + CenterX + ",\n";
  code += "  CenterZ      = " + CenterZ + ",\n";
  code += "  StepX        = " + StepX + ",\n";
  code += "  StepZ        = " + StepZ + ",\n";
  code += "  StepXBeforeZ = " + (StepXBeforeZ ? "true" : "false") + ",\n";
  code += "  FlatSteps    = " + FlatSteps + ",\n";
  code += "  Dir          = " + Dir + ",\n";
  code += "  Depth        = " + Depth + ",\n";
  code += "  Quarter      = " + Quarter + ",\n";
  code += "  CellCount    = " + CellCount + ",\n";
  code += "  RowCount     = " + RowCount + ",\n";
  code += "  StartStock   = " + StartStock + ",\n";
  code += "  UnloadType   = " + UnloadType + ",\n";
  code += "  UnloadXYZ    = {\n";
  foreach ( slot, xyz in UnloadXYZ )
    code += ("    [" + slot + "] = [" + xyz[0] + ", " + xyz[1] + ", " + xyz[2] + "],\n");
  code += "  }\n}\n";
  data = blob(code.len());
  foreach ( slot in code )
    data.writen(slot, 'b');
  print("Robot " + GetRobotID() + " saved.\r\n");

function Get_Save_Filename()
  local saves = GetPath(4);
  local sep = GetInfo(20);
  local nut = GetInfo(22);
  local robot = GetRobotID();
  return saves + sep + nut + "_" + robot + ".state";

Of course, this code is tailor-made for my robot’s variables, but you get the idea :-)
In case the solution above does not work (it happened to me), the Blackvoxel team gave me another “solution”, which is to die (DELETE key), and thus re-spawn at the start-coordinates…
Gallery / Learning with Blackvoxel
« Last post by Yves on February 26, 2019, 08:29:55 am »

You may have met me already on GitHub. I discovered Blackvoxel in late 2018, and enjoyed it very much.
In addition to being fun to play, with nice in-game programming capabilities, I found it also very educational where self-organization is concerned!

I wrote the following article, and I thought maybe you would be interested:
You might even want to plan missions along those lines ;-)

A second article is almost ready, still about Kanban.

And… well, since this place is about showcasing our creations, you can see my factory at the end of the article, producing almost everything.

And of course, I could not have gone so far, so fast, without the program I wrote for my programmable robots! This program:
  • digs a hole equivalent to what 4 regular robots around a storage would achieve;
  • when some depth has been reached, it climbs back up, all the while carving a staiway in case you need to go down;
  • when the top has been reached, it goes in turn to each location where each ore kind should be stored;
  • when an ore is still unknown, it asks where that ore should be stored;
  • when all has been stored, it goes back down the hole, and digs a new series of layers; and so on, until depth 1323 has been reached.
Thank you, indeed beter to know! 

I advanced a bit BlackVoxel robots programming, that's quite cool! 

General Discussion / Re: Evolutionary voxel robots?
« Last post by CordellM on January 04, 2019, 12:58:28 pm »
Voxels certainly have a lot of potential in so many industries. Not heard about voxel robots yet, but I'm not surprised.
Troubleshooting & Bug Reports / Re: Robot apparently silently fails to compile or edit
« Last post by Enigma on December 30, 2018, 05:02:16 am »
Hi, MUY_Belgium and Welcome to the Blackvoxel Forum  :)

Thanks for your return and comments.

Yes, it appears the manual should be improved about how to start with the programming robot. The Squirrel Robot should have an ingame status display like the assembly language one already have.

In the meantime, here are quick setup instructions :
  • In order to use the programmable robot, you should start the game in windowed mode because you'll have several programs alongside.
  • There is actually a compilation result and error output. These informations are displayed in the standard terminal. A terminal Windows is launched automatically along with the game when you use windows so you should see it when you are in Windowed mode. But if you use Blackvoxel with Gnu/Linux, you must launch Blackvoxel into a command line terminal in order to get it.
  • The choice was made to use an external editor(which can have complete features) rather to a simplified in-game one. When you click "edit", then an external editor is launched. The editor can be modified in the "Settings_Hardware.dat" file.
In the hope we have helped you :)
The Blackvoxel Team

I have made a programmable robot, then tried out some programming.  I saw that files are created in the Script/Squirrel directory, but cannot see a editor in my full screen game, but indeed no error message too. I could not realise that there was a syntaxt error in the code : no local variable declaration (variable X is not defined).  What if functin Voxel_Step is missing?

All this put together, looks as if the Programmable Robot Silently fails to compile. :'(

I think that displaying an error on execution errors should give more confidence to the player, explaining what his/her :-[ error was...

Hopes it helps,
Pages: 1 [2] 3 4 ... 10