[Mod] TurtleMiner ... programmable turtles in Minetest

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

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

by octacian » Post

  • turtle IDs introduced (allow for the following feature)
  • remote control re-introduced, and now functional
Next up, I'm going to be working on using tabs in the formspec for different areas of control. With this, the formspec will expand further, with an inventory, customization, and other things.

Note to rubenwardy: I'd really appreciate help with the tabs... I still cannot figure it out.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

BBmine
Member
Posts: 3476
Joined: Sun Jul 12, 2015 22:51
GitHub: BBmine
IRC: BBmine
In-game: Baggins
Location: USA

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

by BBmine » Post

Great mod! This is the best mod I've seen in a while :D

+100

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

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

by hajo » Post

endev15 wrote: [*] turtle IDs introduced (allow for the following feature)
[*] remote control re-introduced, and now functional
When clicking a turtle, the rc comes up, but I get the message

Code: Select all

ERROR[Server]: Item "turtleminer:remotecontrol" not defined
And "/giveme turtleminer:remotecontrol" complains about "unknown item".

Why do you want to bind a remote to a specific turtle ?
(One rc to rule them all :)

It would be more useful to have a chat-command "/list-turtles"
that shows the status / coordinates of all my turtles.
Same for "/help turtleminer".

Also, scriptvm.lua seems to be missing now ?

issa
Member
Posts: 121
Joined: Wed Apr 03, 2013 19:01

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

by issa » Post

hello i have start this mod, but how craft the turtle and using it please ?

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

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

by hajo » Post

issa wrote:hello i have start this mod, but how craft the turtle and using it please ?
It looks like there should be more prominent pointers to the tutor,
forum and other documentation.

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

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

by octacian » Post

issa: there are not yet recipes. I will work on adding a few, and will provide a documentation. For now, /grantme all and then run /giveme turtleminer:tech_turtle will give you a turtle to start with.

hajo: the remote control is not needed by default: just right-click a turtle without it (you should update your tutor to this). Instead, since there aren't yet recipes, do /giveme turtleminer:remote - if not in creative - and right-click a turtle. No formspec will be shown, but a chat message will be sent saying that you have bound to that turtle. Now if you left-click with the remote in hand, you can access that turtle from anywhere. Literally.

About the documentation, we will be writing a new set of documentation and tutorial resources, but that takes time and will probably not be completed today. Thanks for your work on the tutor, however, I realize this is not a tutor for Birgit's TurtleMiner. This looks like a tutor for rubenwardy's TurtleMiner. This tutor should not in this case be linked to through Birgit's TurtleMiner, only through rubenwardy's when he releases it.

BTW, there will also be an in-game documentation in the future.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

User avatar
ManElevation
Member
Posts: 896
Joined: Tue Aug 02, 2016 22:04
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

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

by ManElevation » Post

i like it, but i wont find a use for it
My Public Mods! Discord: Rottweiler Games#3368

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

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

by BirgitLachner » Post

It's an educational Mod. The idea is to have a Mod like ComputerCraft for Minecraft. http://computercraftedu.com/ It's thought to learn Programming in several steps. First that a Computer only understand a limited set of commands and you need to use them to make him do what you want, then go to loops and more.

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

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

by JulienPavageau » Post

If you want to see what it's now possible with my little script, I have make a vidéo :
https://www.youtube.com/watch?v=34w6UouqqTs

Before I look at how to use blockly with the editor, I would like to solve the "last" two problems in my fork :
- the problem with the local variables used to store the turtle's action (see Octacian reply nov 7 2016)
- make a pause to see the turtle working, I have the idea to add space in for exemple 10(CHCBA) to transform it in the "step by step" script 10(C H C B A).
If someone could help me...

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

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

by BirgitLachner » Post

Sorry Julien,
I don't have any answer ... but I love your ideas. Hopefully, there could be the possibility to add a script-turtle and the ant-button as an additional feature. But I'll wait ...

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

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

by BirgitLachner » Post

I wanted to change the formspec according to the type of the turtle.
My idea is to add a field to the "desc" variable, that is used while the registration of the different turtle-types. This should work

But there is a problem with the update of the formspec when the user clicks on the position button. As this happens outside of the registering function the desc-variable is not available.

Another solution might be to have something like a global variable that defines the formspec for a special type of turtles. But in the update-line I don't know to which kind of turtle it is. I'm not sure but maybe the meta-data can give me the informations for that.

Any other ideas or instructions how to do it?

It is not only for the animal turtles but I'd like to add in future turtle like the script turtles of Julien and then there is another formspec needed.

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

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

by rubenwardy » Post

Maybe save the def?

turtleneck.registered_turtles[turtletype] = def
Last edited by rubenwardy on Tue Jan 03, 2017 13:10, edited 1 time in total.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

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

by hajo » Post

BirgitLachner wrote:I wanted to change the formspec according to the type of the turtle.
How do you want this to work ?
Is there one 'superturtle' that can do everything,
and all others just have some features missing ?
That would simplify developement - switching parts off would be easy.

Or do you want all the different turtles to really have different features ?

And, as a workaround, you could use some existing feature
to decide what formspec to use, e.g. the (first char) of the turtle's name.

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

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

by octacian » Post

The way to go is to save the def as rubenwardy suggested. However, I think that for now we should stick to getting the main "superturtle" working (if you'd like to call it that). That means text editor, visual editor, upgrades, inventory, etc...

In fact, I'd like to suggest that we remove all but the two basic types of turtle (tech turtle, animal turtle), and simply rely on the upgrades part which I'll be working on soon.

But, for now I think we should keep to our old goal, then worry about making different things for each turtle. Plus, doing this right now would likely conflict with what I'm currently working on, that being a tabbed formspec for accessing the different features (somewhat like the creative inventory).
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

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

by hajo » Post

octacian wrote:I'd like to suggest that we remove all but the two basic types of turtle (tech turtle, animal turtle)
Underground, and in the dark, the darkgrey tech turtle is hard to see.
The 'digging' turtle (green, with yellow helmet) is much better in this regard.

I made an attempt at modding/reskinning the tech turtle, using
the standard textures from the nyancat ("Kittybot";)

But it turns out that there are only 3 facings (front, back, and side),
and just replacing the graphics didn't look too great.
I guess fixing all that would be about the same amount of work
as creating something new and original, so I didn't go thru with that.

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

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

by octacian » Post

hajo wrote:Underground, and in the dark, the darkgrey tech turtle is hard to see.
The 'digging' turtle (green, with yellow helmet) is much better in this regard.
For this reason, I've been considering making turtles emit a light level of 10 (3 less than torches, I believe). This would make it easier to find any turtle in the dark. What do you think? I'll experiment later and post a few screenshots.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

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

by hajo » Post

octacian wrote:
hajo wrote:Underground, and in the dark, the darkgrey tech turtle is hard to see.
For this reason, I've been considering making turtles emit a light level of 10
This would make it easier to find any turtle in the dark.
I was told that light-emitting nodes would cause too much lag.

How about a command like "/list-turtles", or
putting a dot for each turtle onto the minimap/radar ?

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

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

by octacian » Post

hajo wrote:I was told that light-emitting nodes would cause too much lag.

How about a command like "/list-turtles", or
putting a dot for each turtle onto the minimap/radar ?
AFAIK, light emitting nodes do not cause lag in themselves. Maybe a little for client, but not enough to not do that type of thing. What you mean, is that lag could be caused by trying to attach a light-emitting node to a moving entity. However, turtles in TurtleMiner are not entities. In the future, I may experiment with using entities instead as they would allow for smooth movement. It'd probably be an option though, as it would be more resource intensive.

A command to list all the turtles doesn't seem like a very good idea. On a server, that list could get pretty large. Do you mean to list the position of your own turtles? Cause if that's not all, people could also find and destroy other's turtles. Still not really my preference as it'd unlikely that you'd lose your turtle unless you had a remote controller bound to it; and the formspec now has a button allowing you to get the turtle's coordinates.

As I mentioned earlier, turtles aren't entities. If that option is introduced in the future, I'll look into displaying them on the minimap. Right now, the only option would be to attach an entity, but I'm not sure that would be a good idea performance-wise.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

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

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

by octacian » Post

Just pushed a commit giving turtles a light_source of 7. Tested at 5, 7, 10, and thought 7 looked the best. It makes both tech turtles and wild turtles far easier to see. I've attached screenshots of the tech turtle at 7 and 10.
Attachments
tech_turtle_10.png
tech_turtle_10.png (102.22 KiB) Viewed 694 times
tech_turtle_7.png
tech_turtle_7.png (59.11 KiB) Viewed 694 times
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

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

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

by BirgitLachner » Post

octacian wrote:The way to go is to save the def as rubenwardy suggested. However, I think that for now we should stick to getting the main "superturtle" working (if you'd like to call it that). That means text editor, visual editor, upgrades, inventory, etc...

In fact, I'd like to suggest that we remove all but the two basic types of turtle (tech turtle, animal turtle), and simply rely on the upgrades part which I'll be working on soon.

But, for now I think we should keep to our old goal, then worry about making different things for each turtle. Plus, doing this right now would likely conflict with what I'm currently working on, that being a tabbed formspec for accessing the different features (somewhat like the creative inventory).
Hmmm ... okay, I think I can live with it, but then I don't know what to do. I need to wait and promote the Mod ... or do you have other ideas?

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

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

by octacian » Post

BirgitLachner wrote:Hmmm ... okay, I think I can live with it, but then I don't know what to do. I need to wait and promote the Mod ... or do you have other ideas?
I don't really have any other ideas. Give me a day or two to get the tabbed formspec working, and then go ahead. In fact, on second consideration, feel free to give it a go. However, I am changing the formspec system for the next-to-last time during this, meaning that things might break a little. The last time will be to allow a custom formspec (or sets of formspecs) to be registered in the def - unless you do so first.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

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

by hajo » Post

octacian wrote:Give me a day or two to get the tabbed formspec working,
Have you tried rubenwardy's turtleMiner & editor ?
That editor has tabs, for multiple 'files', that is as good as a remotecontrol,
and even more flexible.
I also made a fork of it, to add some little changes,
e.g. allow comments in the code.

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

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

by octacian » Post

Yes, I have. And I'm sorry (no offense to rubenwardy), but I personally dislike it. What I don't like, is that commands are not given to the robot in Lua, but in plain English. It just doesn't make sense to me. If this is an Education thing, why are we using English to command the robot? If we're trying to teach kids stuff, we should be using Lua. But, I'll leave it up to Birgit as to what happens here. I'm about to merge it with digicompute anyways, and then I'll make a Lua editor. I'll still contribute to this main project, but more effort will go to digicompute.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

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

by rubenwardy » Post

Because the/my point is to teach children how a computer executes commands one after the other (which isn't obvious to children), not to teach them coding a real language yet. Syntax adds complexity. They can, ofc, progress onto lua later
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

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

by hajo » Post

octacian wrote:I don't like, is that commands are not given to the robot in Lua, but in plain English.
Well, look at an oldtimer like COBOL
("COBOL has an English-like syntax, which was designed to be self-documenting and highly readable":)
If we're trying to teach kids stuff, we should be using Lua.
Lua is just one of many programming-languages.
And there are basic concepts to show/explain first,
like sequence / decision / loop / variables / counting / calculations etc.

The current turtles can just have a sequence of commands
(i.e. "mindless automation"), all the control remains with the user.
But just that can already be quite useful, see my Tutorial/digger.

From there, the next step would be to introduce checks & conditions,
e.g. check block in front, and decide if to move, turn or to dig, etc.

Then loops, because they need to check for their end-condition.
Also variables, counting & calculations, depending on the problem.

Now throw in some tips on how to organise code longer then a screenful.
Maybe introduce comments and functions along with that.
Etc, etc. until you have covered as much of the language as you want.

To start right off with lua, see basic_robot.
But there, you might have issues with the sandbox.
(e.g. when digging is limited to 1, user-programs might not work as expected...)

So, starting with a simple, dumb "DSL"-language might not be a bad idea.

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests