[Mod] TurtleMiner ... programmable turtles in Minetest

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by octacian » Thu Nov 03, 2016 03:23

  • allow naming turtles
  • function to show / set turtle formspec more uniformly
  • make turtles move player

BirgitLachner:

How do you feel about removing the need for using the remote controller to access the turtle at all times, and allow the player to access the turtle at any time without a remote? The remote could then be used for literal remote access. I had considered "locking" the turtle so that only the player who placed it could access it, but I think this should be an upgrade rather than default.

If you'd like there to be something in between the player using a turtle after making it, taming could be easily implemented. I had considered this originally, but it doesn't really make sense because the player will have just crafted and placed the turtle. Still, if you'd rather taming, what should they "eat?" I was originally thinking apples, but that just doesn't make sense. Could use something else from the farming mod (e.g. wheat), but I think that it'd be better to register a custom item for this purpose.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by hajo » Thu Nov 03, 2016 08:05

endev15 wrote:How .. about removing the need for using the remote controller to access the turtle

How about an inventory for each turtle, with some spaces dedicated
to turtle-name, config, fuel, code, logfile.

Config: put in dye to color the turtle.
Maybe more spaces to put in other items (wood, ingots) to change the appearance.

Code and logfile: use books, or make a similar recipe for punchcards/disks/whatever.
Then we just need to define the commands/language.
With short commands, a single inputline might be enough for the code.

E.g. a set of simple one-letter-commands:
F=Forward, R=Right, L=Left, U=Up, D=Down, G/M=Get/Mine, P/B=Put/Place/Build,
T1=select slot 1 as tool, S5=select slot 5 as storage, L=Look at stuff in front,
.=Stop, !Hello=output a message, #comment ...

To make this a language, we need to add control-statements, e.g.
:=label, ^=goto, &=call/gosub .=stop/return, ?=if, @=do/loop, ...
also commands to move stuff around the inventory.

Logging: off / log-output to chat / log to book

what should they "eat?"

How about using the existing fuel-items that work in the furnace,
maybe with burntime * someFactor ?

Edit:
I just notice there is ComputercraftEdu - do you want something close to that,
or would you prefer to have a more or less different design/concept for your turtles ?
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by octacian » Thu Nov 03, 2016 14:46

hajo wrote:
endev15 wrote:How .. about removing the need for using the remote controller to access the turtle

How about an inventory for each turtle, with some spaces dedicated
to turtle-name, config, fuel, code, logfile.

Config: put in dye to color the turtle.
Maybe more spaces to put in other items (wood, ingots) to change the appearance.


Right now, config (settings) would only store things such as the turtle name, as until the meta-nodedef branch of MT gets finished and merged. Once it is merged, we will be able to allow customization of the turtle, even drawing your own texture for your turtle (note: in game).

hajo wrote:Code and logfile: use books, or make a similar recipe for punchcards/disks/whatever.
Then we just need to define the commands/language.
With short commands, a single inputline might be enough for the code.


If you take a look at the "editor" branch of TurtleMiner, you'll see what I was planning for the code editor. In the end, that branch will not be used, and only the formspec will likely be saved, though it will be redone. Instead of books / storage devices, the code and log will be stored in meta for now. The same will be done for logs, as there will be a debug section of the formspec. I'm definitely going to plan on disks to store the info, as it would allow transferring between turtles.

The "language" will still be plain Lua, but code will be run in an environment with custom function defined (e.g. move("left")), and the turtles will not be able to access minetest.* functions, etc... This means the kids will get experience using an actual, real-world language. Later on, a visual editor will be implemented like that used in ComputerCraftEDU. It will probably end up seeming almost identical to the one in ComputerCraftEDU, as it is a very good way to help the kids learn, and is more than possible in MT.

hajo wrote:
endev15 wrote:what should they "eat?"

How about using the existing fuel-items that work in the furnace,
maybe with burntime * someFactor ?


Great idea, if BirgitLacher is OK with it, once the inventory is implemented, turtles will require fuel of some type to run, and not need any taming at all. Just fuel. Note that a turtle would be able to collect more fuel and refuel itself.

hajo wrote:Edit:
I just notice there is ComputercraftEdu - do you want something close to that,
or would you prefer to have a more or less different design/concept for your turtles ?


Yes, I believe that the goal is to implement something like this for MT. It will be by no means identical, especially Birgit's textures and nodeboxes that I can't talk her into changing :P
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by hajo » Thu Nov 03, 2016 19:09

endev15 wrote:
hajo wrote:inventory for each turtle, with some spaces dedicated to turtle-name, config, fuel, code, logfile. ..
Code and logfile: use books, or make a similar recipe for punchcards/disks/whatever.
Then we just need to define the commands/language.

If you take a look at the "editor" branch of TurtleMiner, you'll see what I was planning for the code editor.
Do you have a link to that branch ?

In the end, that branch will not be used, and only the formspec will likely be saved, though it will be redone.
Instead of books / storage devices, the code and log will be stored in meta for now.
The same will be done for logs, as there will be a debug section of the formspec.

When looking at simple_robots and miner_robots,
a lot of the code is needed for the gui.
That makes it hard to change/extend.
With books/disks, just an inventory-type formspec is needed,
and code to access the books (plus processing the commands).
No change to the gui required when changing the commands or language.

Using 1-letter commands (mostly) to minimize typing for the user.
BTW, one of the config-slots could be for a disk with a language-definition,
e.g. with lines like "move forward = F", "turn right = R", etc.

I'm definitely going to plan on disks to store the info, as it would allow transferring between turtles.

So, a formspec as well a disks ?
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by octacian » Thu Nov 03, 2016 19:51

hajo wrote:Do you have a link to that branch ?


It's right here. Note that it will not be merged, as other changes will be made first. All that will be saved from it is the formspec.

hajo wrote:When looking at simple_robots and miner_robots,
a lot of the code is needed for the gui.
That makes it hard to change/extend.
With books/disks, just an inventory-type formspec is needed,
and code to access the books (plus processing the commands).
No change to the gui required when changing the commands or language.


Formspec GUIs are inherently kinda complex, due to the format used to create them. They don't have to be. I really don't see how a disk would remove the need for a GUI. You still have to have a GUI to write the code to the disk. Disks would be used to transfer data between turtles, that data already being stored in meta and displayed via the formspec.

The formspec will not be as complex though, as things will mostly be text-based. The GUI would not need to change to change the basic code, commands, or the language. It would simply grab new data and update the fields based on metadata.

hajo wrote:Using 1-letter commands (mostly) to minimize typing for the user.
BTW, one of the config-slots could be for a disk with a language-definition,
e.g. with lines like "move forward = F", "turn right = R", etc.


1-letter commands could minimize typing, but it would mean the user wouldn't really learn much. The purpose of this is to teach kids how to right structured step-by-step code, and having to type more kinda comes with that. Using 1-letter commands would mean the kids wouldn't be learning an actual language, meaning what they learned would only be useful for turtles, and nothing else. Also, it would create a huge amount of extra regex work to be able to parse this code and turn it into Lua.

hajo wrote:So, a formspec as well a disks ?


Yes. Disks to transfer info, and possibly store it in the first place. There still has to be a formspec for editing the data which would eventually be stored in meta.

More on the formspec.

When you first make a turtle, you right click on it and configure it (name, etc...). Then the default formspec is shown. The default formspec will be expanded to instead contain a text-based editor, and buttons to show the settings, inventory, and upgrades formspecs. Upgrades will be available to access the visual editor, access a basic step-by-step command form (the one used now), connect wirelessly with digicompute computers, and other cool stuff.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

BirgitLachner
Member
 
Posts: 135
Joined: Thu May 05, 2016 10:18
In-game: Bibs

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by BirgitLachner » Fri Nov 04, 2016 16:01

Wow ... so much happend since last time ... I'm still very busy at school. Finally the tests of my son are finished but I still need to correct tests.

First of all ... I'll answer to endev15.

endev15 wrote:
  • allow naming turtles
  • function to show / set turtle formspec more uniformly
  • make turtles move player

Nice!

endev15 wrote:How do you feel about removing the need for using the remote controller to access the turtle at all times, and allow the player to access the turtle at any time without a remote? The remote could then be used for literal remote access.

Good idea ...
Well, may be you use the remote control to connect to your turtle (only one?) and then a picture is shown via HUD with the control buttons and the letter/symbols to control the turtle? This can be may be reachable from the normal formspec of the remote control ... for example with a minimize-button ... and a letter to press to come back to the normal remote formspec. Leave the formspec with the exit button and the picture of the small remote is not shown.


endev15 wrote:I had considered "locking" the turtle so that only the player who placed it could access it, but I think this should be an upgrade rather than default.

Yes ... good idea. I only used the singleplayermode, so I thought, that was already done. Would be interesting for multiplayerworlds where a teacher is together with some pupils.


endev15 wrote:If you'd like there to be something in between the player using a turtle after making it, taming could be easily implemented.

Not at the moment ... only the other things are done.

endev15 wrote:I had considered this originally, but it doesn't really make sense because the player will have just crafted and placed the turtle. Still, if you'd rather taming, what should they "eat?" I was originally thinking apples, but that just doesn't make sense.

Funny idea ... something like the fuel for for tech-like turtle. But only for animal-like turtle.

endev15 wrote:Great idea, if BirgitLacher is OK with it, once the inventory is implemented, turtles will require fuel of some type to run, and not need any taming at all. Just fuel. Note that a turtle would be able to collect more fuel and refuel itself.

If you do the code for the tech turtle for that I think I would be able to adapt it to animal turtle. The taming will be a feature for version 5 ... or 6.

endev15 wrote:If you take a look at the "editor" branch of TurtleMiner, you'll see what I was planning for the code editor.

Well, I think that's much to high for me. I'll have a look at it but ...

endev15 wrote:Disks would be used to transfer data between turtles, that data already being stored in meta and displayed via the formspec.

Yes ... that is one think, I like from ComputerCraft.
Last edited by BirgitLachner on Fri Nov 04, 2016 16:53, edited 1 time in total.
 

BirgitLachner
Member
 
Posts: 135
Joined: Thu May 05, 2016 10:18
In-game: Bibs

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by BirgitLachner » Fri Nov 04, 2016 16:32

Hallo Hajo
kurz auf deutsch ... toll, dass du Interesse an dem Mod zeigst und dich schon im Code umgeschaut hast. Bist du auf Facebook auch dabei? Oder wie bist du hierher gekommen? Ich denke, dass im deutschsprachigen Bereich das Interesse an ein solches Mod groß sein könnte. Und wenn der Mirek (infchem) noch dazu kommt, wird das sicher gut.

Now I switch to english ...

hajo wrote:Ok, I tried that.
It looks like all those different types of turtles currently have the same abilities,
i.e. they all can dig, and have no inventory yet.


Yes ... I already wanted to do that and it should not be too difficult. Because the string that is needed to define the buttons in the formspec can be easily put together with some if-

hajo wrote:They don't look very different, so it would be nice if you could paint and/or
name them, so that it showed "turtle Hugo owned by singleplayer" when looked at.


Name is already implemented. The colour is another idea from ComputerCraft. I would like to do that, too ... but may be later.


hajo wrote:Stacking one on top of another looks strange, because it doesn't actually land.

It would be nice if you could ride turtles, like the boat.

Two turtles above each other can not be changed. But there is the idea of the collision box and then the player stands directly on the turtle (more exactly the collision box)
Riding on the turtle doesn't make sense to me at the moment. The turtle is tool (tech or animal) that is controlable and programmable.

hajo wrote:I just notice there is ComputercraftEdu - do you want something close to that,
or would you prefer to have a more or less different design/concept for your turtles ?
[/quote]
Yes ... it should be something like that. Not absolutely the same but with the same ideas for learning programming with the turtle. One reason for a difference are the different possibilities that offer Minecraft and Minetest for modders. And that I'm be a bit more childish like the original programmer and endev15 :-)

So may be ... the mod will offer to learners and teachers the possibility to use it in different ways. The features and the code will be mostly the same and thus it will not be hard to have different turtles.

If you like to join the project on github just give me your name.
 

BirgitLachner
Member
 
Posts: 135
Joined: Thu May 05, 2016 10:18
In-game: Bibs

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by BirgitLachner » Fri Nov 04, 2016 17:03

@endev15

If the turtle is one block higher than my feet it does not move me away but I'm inside of the turtle.
 

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by octacian » Fri Nov 04, 2016 22:08

BirgitLachner wrote:@endev15

If the turtle is one block higher than my feet it does not move me away but I'm inside of the turtle.


OK, thx for letting me know. When I get a chance, I'll make it check for entities above, as well as not move if there is a entity in front that would be pushed into another block as a result of moving.

I'll leave the complicated stuff like taming until the editor is done, I guess. It would simply require defining tameable = { true, "default:apple"} (for example) when calling turtleminer.register_turtle (note: this after I implement the feature).

Locking will be the "Security" upgrade. About remote controls:

Basically, a simple remote control will be bound to a single turtle, and will unbind if the turtle is destroyed. An advanced controller could bind to multiple turtles and present a menu to select which one to control. When rightclicking with the controller in hand, the normal formspec would be shown. With the player control upgrade, the turtle could be controlled using W, A, S, D, Space, and Shift. (space = up, shift = down.) The Camera upgrade would allow the player to see what the turtle would be seeing.

FYI, all of the above is simple to do.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

BirgitLachner
Member
 
Posts: 135
Joined: Thu May 05, 2016 10:18
In-game: Bibs

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by BirgitLachner » Sat Nov 05, 2016 09:20

FYI, all of the above is simple to do.

Okay ... that's good, because that is above my basic knowledge and would take me a lot of time to find a solution for that.

I would like to add you name to the Readme file because you did more in the code than me. I was just the starter and may be I'm the promoter.
 

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by hajo » Sun Nov 06, 2016 15:52

endev15 wrote:You still have to have a GUI to write the code to the disk.

Books from the default game already can be written to, and copied.
Technically, they already have a gui, save to metadata, etc.

More on the formspec.
When you first make a turtle, you right click on it and configure it (name, etc...).
Then the default formspec is shown. The default formspec will be expanded to
instead contain a text-based editor, and buttons to show the settings,
inventory, and upgrades formspecs.

I meant, the turtle-mod could just use "standard parts" like the books as "disks".
There is no real need to duplicate all that, except for flavor.

hajo wrote:Do you have a link to that branch ?
It's right here.

Ok, I installed that mod, but got a crash when running a program.

Placed a turtle, wrote a program like "forward", clicked "RUN", and got a crash:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
2016-11-06 16:09:39: ACTION[Server]: singleplayer places node turtleminer:digging_turtle at (120,2,18)
2016-11-06 16:09:39: ACTION[Server]: facedir: 3
2016-11-06 16:10:04: ERROR[Main]: ServerError: Lua: Runtime error from mod 'turtleminer' in callback on_playerReceiveFields(): E:\temp\minetest-0.4.14\bin\..\mods\turtleminer/env.lua:127: bad argument #1 to 'setfenv' (number expected, got nil)
2016-11-06 16:10:04: ERROR[Main]: stack traceback:
2016-11-06 16:10:04: ERROR[Main]:       [C]: in function 'setfenv'
2016-11-06 16:10:04: ERROR[Main]:       E:\temp\minetest-0.4.14\bin\..\mods\turtleminer/env.lua:127: in function 'run'
2016-11-06 16:10:04: ERROR[Main]:       E:\temp\minetest-0.4.14\bin\..\mods\turtleminer/env.lua:137: in function 'run_string'
2016-11-06 16:10:04: ERROR[Main]:       E:\temp\minetest-0.4.14\bin\..\mods\turtleminer/t_api.lua:79: in function 'p_editor'
2016-11-06 16:10:04: ERROR[Main]:       E:\temp\minetest-0.4.14\bin\..\mods\turtleminer/t_api.lua:97: in function <E:\temp\minetest-0.4.14\bin\..\mods\turtleminer/t_api.lua:94>
2016-11-06 16:10:04: ERROR[Main]:       E:\temp\minetest-0.4.14\bin\..\builtin\game\register.lua:369: in function <E:\temp\minetest-0.4.14\bin\..\builtin\game\register.lua:349>

I guess, there should be some syntax-check before running...
Last edited by hajo on Sun Nov 06, 2016 16:39, edited 1 time in total.
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by octacian » Sun Nov 06, 2016 16:20

hajo wrote:
endev15 wrote:You still have to have a GUI to write the code to the disk.

Books from the default game already can be written to, and copied.
Technically, they already have a gui, save to metadata, etc.


We're going to use a custom GUI though, because it allows us to customize it for specifically what we'd like. The book interface does not supply a debug panel, and having to create different books for each would be a waste of resources.

hajo wrote:Ok, I installed that mod, but got a crash when running a program.

Placed a turtle, wrote a program like "forward / right / forward", clicked "RUN", and crash:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
2016-11-06 16:09:39: ACTION[Server]: singleplayer places node turtleminer:digging_turtle at (120,2,18)
2016-11-06 16:09:39: ACTION[Server]: facedir: 3
2016-11-06 16:10:04: ERROR[Main]: ServerError: Lua: Runtime error from mod 'turtleminer' in callback on_playerReceiveFields(): E:\temp\minetest-0.4.14\bin\..\mods\turtleminer/env.lua:127: bad argument #1 to 'setfenv' (number expected, got nil)
2016-11-06 16:10:04: ERROR[Main]: stack traceback:
2016-11-06 16:10:04: ERROR[Main]:       [C]: in function 'setfenv'
2016-11-06 16:10:04: ERROR[Main]:       E:\temp\minetest-0.4.14\bin\..\mods\turtleminer/env.lua:127: in function 'run'
2016-11-06 16:10:04: ERROR[Main]:       E:\temp\minetest-0.4.14\bin\..\mods\turtleminer/env.lua:137: in function 'run_string'
2016-11-06 16:10:04: ERROR[Main]:       E:\temp\minetest-0.4.14\bin\..\mods\turtleminer/t_api.lua:79: in function 'p_editor'
2016-11-06 16:10:04: ERROR[Main]:       E:\temp\minetest-0.4.14\bin\..\mods\turtleminer/t_api.lua:97: in function <E:\temp\minetest-0.4.14\bin\..\mods\turtleminer/t_api.lua:94>
2016-11-06 16:10:04: ERROR[Main]:       E:\temp\minetest-0.4.14\bin\..\builtin\game\register.lua:369: in function <E:\temp\minetest-0.4.14\bin\..\builtin\game\register.lua:349>

I guess, there should be some syntax-check first...


Note, the latest commit said it was WIP. And the syntax is move("forward"), etc... That branch is not really ready for use, because when you use improper syntax, the game crashes.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by hajo » Sun Nov 06, 2016 16:47

endev15 wrote:
hajo wrote:Ok, I installed that mod, but got a crash when running a program. ..
I guess, there should be some syntax-check first...

the syntax is move("forward"), etc...

Well, with 1-letter-commands, there wouldn't be much room for errors :)

BTW, how about an in-game "Programming guide", i.e. a book-with-text,
like those crafting-guides provided to new players in some mods ?
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 

JulienPavageau
New member
 
Posts: 9
Joined: Sun Nov 06, 2016 16:15
GitHub: JulienPavageau

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by JulienPavageau » Sun Nov 06, 2016 16:51

I'me french and I don't know if you speak my language.
I hope you understand my poor english.
I love your project. I hope we can use in the futur a blockly language to program the turtle.
I have never program a mod for mintetest or over game and i don't know lua but i have tried (and succes ;-) to make a record/play/stop buttom to make a sequence of few instructions and to simulate a repeat loop. I thinks it s could be a first step for initiat children with code. You can see my script on Github (it's my first time and i hope i use it correctly) and i make a first vidéo :
https://www.youtube.com/watch?v=3kbbj4HP7lE

If you're ok, i want to make a tweet with this vidéo and probably make an "article in a web magazine" (i don't know the real traduction) on : http://revue.sesamath.net/

Thanks for your great idea.

@JulienPavageau
French Math Teacher
 

BirgitLachner
Member
 
Posts: 135
Joined: Thu May 05, 2016 10:18
In-game: Bibs

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by BirgitLachner » Mon Nov 07, 2016 05:09

C'est cool .. je parle bien francais, mais je crois que c'est mieux de parler anglais.

Well, what you've done is really great for your first trial. May be that's one idea to expand the abilities of the turtle. Something like a notebook to have the commands in mind. That's a good idea towards the use of loops.
Damn ... I would like to change the code for the turtles that the different turtles have different formspecs but I have too much to do at school now.

BTW ... What is the ant(?) button for? Looks a bit chaotic?

We'll wait for endev16 ...
 

BirgitLachner
Member
 
Posts: 135
Joined: Thu May 05, 2016 10:18
In-game: Bibs

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by BirgitLachner » Mon Nov 07, 2016 05:12

hajo wrote:BTW, how about an in-game "Programming guide", i.e. a book-with-text,
like those crafting-guides provided to new players in some mods ?


What are your idea for that? The text can be collected in the github wiki.
 

BirgitLachner
Member
 
Posts: 135
Joined: Thu May 05, 2016 10:18
In-game: Bibs

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by BirgitLachner » Mon Nov 07, 2016 05:34

JulienPavageau wrote:If you're ok, i want to make a tweet with this vidéo and probably make an "article in a web magazine" (i don't know the real traduction) on : http://revue.sesamath.net/


I would say yes ...
 

JulienPavageau
New member
 
Posts: 9
Joined: Sun Nov 06, 2016 16:15
GitHub: JulienPavageau

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by JulienPavageau » Mon Nov 07, 2016 09:15

BirgitLachner wrote:C'est cool .. je parle bien francais, mais je crois que c'est mieux de parler anglais.

Ok, mais dans ce cas je me permets de donner quelques liens en français ci-dessous.

BirgitLachner wrote:BTW ... What is the ant(?) button for? Looks a bit chaotic?

It's for fun and also to show how recording the play button can be used to simulate a repeat loop with 2^n iterations.
It's a Langton's Ant, you can see in this french article why i do this and why i may add a textarea for see and change the script (and why i choose a language with only one letter for command) :
http://revue.sesamath.net/spip.php?article897
 

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by hajo » Mon Nov 07, 2016 10:39

BirgitLachner wrote:
hajo wrote:BTW, how about an in-game "Programming guide", i.e. a book-with-text,
like those crafting-guides provided to new players in some mods ?

What are your idea for that? The text can be collected in the github wiki.

PG-Book1:
* Short introduction about the turtles,
* short descriptions about the different types of turtles,
* how to get a turtle and remote,
* short example program (*),
* "more details in Book2" + link to forum/github/webpage with docu
PG-Book2:
* Command-Reference

That is, a "minimal starter-text" with everything a smart kid
needs to know to start using the turtles - without leaving the game.

(*) For example, dig stairs downward
1-Simple: just dig + forward (this would be enough for Book1)
2-with checks: stop when anything unexpected comes up
3-with report/alert: tell what turtle found (cave/water/lava/stone too hard to dig...)
4-also collect minerals while digging steps (+report "inventory full")
5-counting: place a torch every 10 steps (+report "out of torches" / variables?)
6-after error, go upstairs (until out of steps upward)
7-dito, plus move a few spaces away from top-of-stairs (dont block entrance)
8-dito: go upstairs, plus return to base (+remember start-position)
9-unload inventory to chest / re-stock torches / craft torches
10-back to work (go downstairs without digging+placing torches, continue digging)
11-teamwork: turtle#1 just digs, turtle #2 places torches
...
I guess the problems/programs 2-11+ would fill a few days worth of lessons.

BTW:
Are the turtles using tools ?
Can they see without light ? Detect the light-level ? Time-of-day ?
Detect events ? (Players joining/leaving, Chat)
How high can they climb/fly ?
Can they crawl thru a 1x1 tunnel ?
Can they pass thru a door ? Open/close a door ?
Send/receive signals to/from other turtles ?
Store data ? What type (bits=inventory-slots, integer, float, string, ...)? How much ?
Last edited by hajo on Mon Nov 07, 2016 13:18, edited 4 times in total.
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by hajo » Mon Nov 07, 2016 11:18

BirgitLachner wrote:What is the ant(?) button for? Looks a bit chaotic?

It looks chaotic at first, but after about 10000 steps,
the Langton's ant starts to make a regular pattern ("highway").

See RosettaCode for some examples.
Last edited by hajo on Fri Nov 25, 2016 14:25, edited 1 time in total.
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by hajo » Mon Nov 07, 2016 12:45

endev15 wrote:the syntax is move("forward")

I tried that - no crash now, but still error (and the turtle doesn't move):
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
ACTION[Server]: [string "move("forward")"]:1: attempt to call global 'move' (a nil value)
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by octacian » Mon Nov 07, 2016 15:10

Yes, there will be an in game programming guide in the future. For now, refer to the GitHub wiki. However, the wiki has nothing about the turtle's Lua functions, as they are no where near completed.

Turtles will have the ability to use tools in the future. They cannot see without light, however, they can still detect blocks right in front of them, but not further away. In the future they will be able to get other environment variables like the light level, and possibly time of day. With an upgrade, they will be able to listen to the chat, and other events. They can fly as high as the world is. If you look at my turtle, you notice it looks a bit like a rocket at the bottom. Yes, they can crawl through 1x1 tunnels. In the future, they will be able to open and close doors. When the turtles get paired with digicompute, they will be able to for sure. I'm not sure about before that, though. All the data is stored in the blocks metadeta. There should be no need to implement a limit, right away anyways, all data would be plain text, or inventory information, stored separately.

Right now, this mod is no where near done. I would not even consider it stable right now, but rather in alpha.

EDIT: oh, and the editor branch, it's even worse. Most things did not work at all. I only committed it in case BirgitLacher was able to look at it before me, and needed an example.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by octacian » Mon Nov 07, 2016 15:23

JulienPavageau wrote:I have never program a mod for mintetest or over game and i don't know lua but i have tried (and succes ;-) to make a record/play/stop buttom to make a sequence of few instructions and to simulate a repeat loop. I thinks it s could be a first step for initiat children with code. You can see my script on Github (it's my first time and i hope i use it correctly) and i make a first video: https://www.youtube.com/watch?v=3kbbj4HP7lE


hmmmm nice job with the sequencing buttons! However, there are a few issues. When in multiplayer, since you used single local variables to store the turtle's action, different people using the sequencer at the same time will likely break the mod. Instead of each person's turtle moving as expected, it might move as someone else had recorded.

It'd be great to get this type of thing merged into the mod, but the above needs to be fixed first. At the same time, don't worry about in depth translation, at some point in the near future I'll attempt to make the mod work with kaeza's inttlib (I think that's what it's called?).

Edit: Oh, and it wouldn't be able to place a block from mesecons. I'd recommend instead placing red wool or something like that. Or hardened clay, if/when my PR (Pull Request) to MTG (Minetest Game) is completed. I can fix that at merge though. Oh, and what does the ant button do? Sorry, didn't watch the entire video... Maybe I will.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

BirgitLachner
Member
 
Posts: 135
Joined: Thu May 05, 2016 10:18
In-game: Bibs

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by BirgitLachner » Mon Nov 07, 2016 16:08

For the ant button see ... https://en.wikipedia.org/wiki/Langton%27s_ant

I did not see that there is a branch with the editor! I'll have a look at it.


I fully agree with endev15's ideas for the development of the turtles. First step will be to complete the correct usage with the remote control. At least ...
- name the turtle
? remove the turtle and put it anywhere else without the need to rename it again
- use turtle with open remote control (some turtles with limited number of buttons)
- use turtle with collapsed remote control and buttons (HUD-Picture with the controls)
- have an inventory to collect the diged blocks
- use the blocks in the inventory to put the blocks
? open the remote control without clicking on the turtle, because the control and the turtle are connected
- have a recorder to record and play sequences

May be ...
- upgrade the turtle by using some components to have more and more buttons and the inventory
- the turtle needs fuel/food to work


Concerning the Programming Guide ... I started a page at the github wiki but I'm more familiar with MediaWiki and therefore started something in the Minetest wiki http://wiki.minetest.net/Mods/TurtleMiner
I would prefer to offer a world where the programming newbie can learn how to use the turtle by walking through a course with excercises. I already have some ideas.
 

JulienPavageau
New member
 
Posts: 9
Joined: Sun Nov 06, 2016 16:15
GitHub: JulienPavageau

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by JulienPavageau » Mon Nov 07, 2016 16:38

endev15 wrote:... When in multiplayer, since you used single local variables to store the turtle's action, different people using the sequencer at the same time will likely break the mod. Instead of each person's turtle moving as expected, it might move as someone else had recorded.

Ok, I had just tested in singleplayer.
endev15 wrote:It'd be great to get this type of thing merged into the mod, but the above needs to be fixed first.

Ok, I thinks it's better you make change when you want.

endev15 wrote:Edit: Oh, and it wouldn't be able to place a block from mesecons. I'd recommend instead placing red wool or something like that. Or hardened clay, if/when my PR (Pull Request) to MTG (Minetest Game) is completed. I can fix that at merge though.

I have just choose this block to be use with a "mod" that can export to a 3d printer. You can see it at this adress (only in french) :
http://minetest.lespetitsdebrouillardspc.org/
or in this video :
https://www.youtube.com/watch?v=b__pAyIJIe0
 

User avatar
rnd
Member
 
Posts: 136
Joined: Sun Dec 28, 2014 12:24
IRC: ac_minetest
In-game: rnd

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by rnd » Tue Nov 08, 2016 10:01

Perhaps my basic_robot mod https://forum.minetest.net/viewtopic.php?f=9&t=15850 could be of help too - you can write simple lua programs and each player's robot runs independently of other robots

It has all the functionality of moving around, digging, placing blocks and can sense blocks in all directions. It can make very simple programs or very complex too. Example of simple program to navigate robot around and turn if it hits the wall
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
if read_node.forward()~="air" then
    turn.right()
else
    move.forward()
end
 

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by hajo » Wed Nov 09, 2016 16:28

rnd wrote:Perhaps my basic_robot mod could be of help too

A working 'bot - that's a nice surprise. Thanks !
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 

User avatar
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by DS-minetest » Fri Nov 11, 2016 12:47

hajo wrote:
rnd wrote:Perhaps my basic_robot mod could be of help too

A working 'bot - that's a nice surprise. Thanks !

simple_robots mod works fine, too
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by hajo » Fri Nov 11, 2016 17:28

rnd wrote:Perhaps my basic_robot mod could be of help too
DS-minetest wrote:simple_robots mod works fine, too

I have had a look at them - working, but the userinterface is quite cumbersome.
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] TurtleMiner ... programmable turtles in Minetest

by octacian » Fri Nov 11, 2016 20:33

hajo wrote:
rnd wrote:Perhaps my basic_robot mod could be of help too
DS-minetest wrote:simple_robots mod works fine, too

I have had a look at them - working, but the userinterface is quite cumbersome.


I agree.

And FYI, dev on my end is entirely postponed for about a week. Will be back to it November 20th.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

PreviousNext

Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 7 guests

cron