Google Blockly (better than Scratch) for easy visual mod development

User avatar
Neuromancer
Member
Posts: 958
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

Google Blockly (better than Scratch) for easy visual mod development

by Neuromancer » Post

A while back, I threw out the idea of using scratch to program mods, that wouldn't have worked out because scratch is a specific purpose language. Then I found blockly. It uses the visual programming of scratch, but lets you output/generate ANY language (in our case it could be lua). But what is also really cool is that it lets you create custom blocks that could be specific to Minetest modding. Thus there could be blocks to define nodes, nodeboxes or any other common aspect of Minetest modding.

Why is this cool? Because it would allow anyone to create Mods for minetest, even kids and non-developers.
Last edited by Neuromancer on Thu Nov 14, 2013 01:24, edited 1 time in total.

User avatar
Inocudom
Member
Posts: 3121
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Post

I found the link to Google Blocky's website. Look below:
http://code.google.com/p/blockly/?redir=1

User avatar
hoodedice
Member
Posts: 1374
Joined: Sat Jul 06, 2013 06:33
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice
Location: world
Contact:

by hoodedice » Post

Inocudom wrote:I found the link to Google Blocky's website. Look below:
http://code.google.com/p/blockly/?redir=1
I checked it out too. It's cool.

Code: Select all

Please do not attempt to maintain the Linux kernel using Blockly. 

-Google.
While it is cool, creating the modding API in Blockly will take a LOT of time. The app comes with Java and Python in-built, which means that someone will have to add lua support. Which is a lot.

Code: Select all

 Blockly is not an executable that can be double-clicked and played with.
Last edited by hoodedice on Thu Nov 14, 2013 03:52, edited 1 time in total.
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build

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:

by rubenwardy » Post

I cant see any way to actually make a project or use it.

It is also very unpolished.

Therefore, not better than scratch.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Inocudom
Member
Posts: 3121
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Post

Code: Select all

Please do not attempt to maintain the Linux kernel using Blockly. 

-Google.

Code: Select all

 Blockly is not an executable that can be double-clicked and played with.
Those words. I sense great hatred in those words.

User avatar
Neuromancer
Member
Posts: 958
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Post

I agree that it will take a lot of time to implement every aspect of lua, but we could start with just the basics that are used most commonly for Minetest Mods. I think you meant it currently has javascript implemented in it. I'm hopefully going to be using it to implement c#, so maybe I will learn a bit and that can help us do lua.
Last edited by Neuromancer on Fri Nov 15, 2013 01:08, edited 1 time in total.

User avatar
Neuromancer
Member
Posts: 958
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Post

rubenwardy wrote:I cant see any way to actually make a project or use it.

It is also very unpolished.

Therefore, not better than scratch.
It would be impossible to use scratch to generate luascript. It would just be a fair amount of work to do it in blockly. Blockly isn't better than scratch in general. But it is better for doing things like generating lua for Minetest mods. It is a code generator.

It has been used to do home automation projects see Domoticz.
http://www.openremote.org/display/forum ... ing+editor

It's all about creating custom blocks:
https://code.google.com/p/blockly/wiki/CustomBlocks
https://code.google.com/p/blockly/wiki/DefiningBlocks
Last edited by Neuromancer on Fri Nov 15, 2013 01:15, edited 1 time in total.

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

by BrandonReese » Post

Seems harder than just writing code to me...

User avatar
Inocudom
Member
Posts: 3121
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Post

If there are ways to get Google Blocky to work with Lua, then it could be useful. Of course, the modding api is a very important point to consider.

Would the authors of Google Blocky even allow for it to be used on open source projects?

User avatar
hoodedice
Member
Posts: 1374
Joined: Sat Jul 06, 2013 06:33
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice
Location: world
Contact:

by hoodedice » Post

It is, indeed like Brandon said, much more harder to implement than just writing the code.

I'm not a programmer (yet), however, I've downloaded that thing (Plus, used subversion for the first time) and I've checked it out and believe me when I say this: It ain't beautiful nor is it easy to implement any language in it. It's a major PITA (Not the one that says Plugging in the Answers).

For starts, Blockly has no syntax. People just connect blocks and a code is generated. The blocks must add the syntax themselves. Next, even adding the syntax isn't a day's work. There is something called an order of operation or something, which requires a knowledge of Lua in entirety. And then defining this is again, not pretty. Like the devs have themselves told, it isn't an executable that can be double clicked and played with. It's more like playing Minetest with a binary input method XD

A scratch like method for making mods is very possible, however I feel that Blockly, though Open Source isn't the framework we need. As Ruben said, it is VERY unpolished.

@Inocudom: It wasn't hating on it, Blockly is fun. But not so fun to create it. Plus Blockly is open source so of course we can change it to our needs and use it for whatever.

EDIT: Scratch too is open source.

EDIT 2: Rest assured, I'm seeing if there is an easier way to implement this. By easier, I mean a way in which I have to learn a minimum of programming lingos (Since I don't know any) to get the thing we want. So, I'm currently lookig if love2d can do the task (Yes, I'll try to start it from nothing) since love2d is in lua and lua is what we need anyway.
Last edited by hoodedice on Fri Nov 15, 2013 18:01, edited 1 time in total.
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build

User avatar
Neuromancer
Member
Posts: 958
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Post

I did find someone using blockly to generate Lua (ironically for Minecraft)
https://groups.google.com/forum/#!topic ... D13auzJ5m4

"I've working on a Blockly fork that supports generating Lua code to control ComputerCraft turtles in Minecraft. Testers, contributors, advisors, and evangelists are needed:"

http://blockly-lua.appspot.com/static/a ... index.html
https://github.com/espertus/blockly-lua
http://www.computercraft.info/forums2/i ... ockly-lua/


It looks pretty full featured already. Maybe she'll let us use it...
Last edited by Neuromancer on Sat Nov 16, 2013 00:19, edited 1 time in total.

User avatar
Blockly
New member
Posts: 6
Joined: Sat Nov 16, 2013 02:26
Location: San Francisco, California
Contact:

by Blockly » Post

Neuromancer wrote:I did find someone using blockly to generate Lua (ironically for Minecraft)
It looks pretty full featured already. Maybe she'll let us use it...
Let you? I'd be delighted. In any case, it's open source. Go for it, and let me know if you have any questions (or fixes).

User avatar
Neuromancer
Member
Posts: 958
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Post

Blockly wrote:
Neuromancer wrote:I did find someone using blockly to generate Lua (ironically for Minecraft)
It looks pretty full featured already. Maybe she'll let us use it...
Let you? I'd be delighted. In any case, it's open source. Go for it, and let me know if you have any questions (or fixes).
Whoa, you're not just the person who wrote the lua generator for blockly, you're the inventor/primary developer of Blockly?!

User avatar
general3214
Member
Posts: 122
Joined: Fri Oct 04, 2013 03:15

by general3214 » Post

Neuromancer wrote:
Blockly wrote:
Neuromancer wrote:I did find someone using blockly to generate Lua (ironically for Minecraft)
It looks pretty full featured already. Maybe she'll let us use it...
Let you? I'd be delighted. In any case, it's open source. Go for it, and let me know if you have any questions (or fixes).
Whoa, you're not just the person who wrote the lua generator for blockly, you're the inventor/primary developer of Blockly?!
I think you're confused, Neuromancer; if you go to Blockly's profile, you'll see that her (real) name is Ellen Spertus.
Avatar made by Annahstas

User avatar
hoodedice
Member
Posts: 1374
Joined: Sat Jul 06, 2013 06:33
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice
Location: world
Contact:

by hoodedice » Post

Well, that's a nice sequence of plot twists! XD

Hello Ellen and welcome to the minetest forums. It's always nice to see Minecraft people supporting Minetest :)
Last edited by hoodedice on Sat Nov 16, 2013 04:04, edited 1 time in total.
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build

User avatar
general3214
Member
Posts: 122
Joined: Fri Oct 04, 2013 03:15

by general3214 » Post

hoodedice wrote:Well, that's a nice sequence of plot twists! XD

Hello Ellen and welcome to the minetest forums. It's always nice to see Minecraft people supporting Minetest :)
How many Minecrafters have you met so far?
Spoiler
It's weird how discussions can get off topic in Minetest Forums; the staff at Minecraft Forum is strict.
Last edited by general3214 on Sat Nov 16, 2013 04:11, edited 1 time in total.
Avatar made by Annahstas

User avatar
hoodedice
Member
Posts: 1374
Joined: Sat Jul 06, 2013 06:33
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice
Location: world
Contact:

by hoodedice » Post

Quite a few, but I don't get their names from the top of my head... :/

I don't know JavaScript. As such, though Espertus' code is really nice and sorta complete, and all that needs to be added is the API, I can't. Someone else will have to do this :(
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build

User avatar
Blockly
New member
Posts: 6
Joined: Sat Nov 16, 2013 02:26
Location: San Francisco, California
Contact:

by Blockly » Post

Neil Fraser (https://neil.fraser.name/) is the inventor of Blockly, although I've been able to work on it and created the Lua fork.

FWIW, I didn't know JavaScript when I started working on Blockly. It's not hard to add new blocks by imitating existing ones, after which you start picking it up. There's also a "support group" (https://groups.google.com/forum/#!forum/blockly), which Neuro Mancer has already joined.

User avatar
general3214
Member
Posts: 122
Joined: Fri Oct 04, 2013 03:15

by general3214 » Post

XD Neil Fraser has goofy smile.
Avatar made by Annahstas

User avatar
Inocudom
Member
Posts: 3121
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Post

I am liking this turn of events. In time, the results could be positive.

User avatar
Neuromancer
Member
Posts: 958
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Post

Inocudom wrote:I am liking this turn of events. In time, the results could be positive.
My motivation for adding Blockly to Minetest is fairly small in scope. My kids love Minetest, and I want to teach them how to program. However, if you think about it, Minetest and Blockly are free. While many schools aren't going to shell out money for all kinds of Minecraft licences, I could see them installing Minetest and Blockly on every computer. Suddenly you have millions of kids all over the world writing Minetest Mods. That has got to be good for Minetest. Now these kids grow up. And they already understand all the basics of Minetest modding. What are they going to do? Start writing lua and maybe even c++. That has got to be great for Minetest! And for the world in general, all of these new software developers thanks to Minetest and Blockly. Minetest for making programming fun, Blockly for making programming accessible to kids and beginners.
Last edited by Neuromancer on Sat Nov 16, 2013 14:29, edited 1 time in total.

User avatar
Neuromancer
Member
Posts: 958
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Post

I think a good place to start would be to implement minetest.register_node in Blockly.
minetest.register_node("bushes:BushLeaves"..Num, {
description = "Bush Leaves "..Num,
drawtype = "allfaces_optional",
tiles = {"bushes_leaves_"..Num..".png"},
inventory_image = "bushes_leaves_"..Num..".png",
paramtype = "light",
groups = { -- MM: Should we add leafdecay?
snappy=3,
flammable=2,
attached_node=1
},
sounds = default.node_sound_leaves_defaults(),
})

It would be nice to have dropdowns for all the possible parameter values like drawtype and groups.

LorenzoVulcan
Member
Posts: 447
Joined: Mon Mar 12, 2012 06:46
GitHub: aegroto

by LorenzoVulcan » Post

Image
Developer of the BlockForge 2# Project!
Official thread: http://minetest.net/forum/viewtopic.php ... 290#p54290

User avatar
Neuromancer
Member
Posts: 958
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Post

That's kind of the point. Everyone starts out a noob. Blockly helps you bridge the gap from being a noob to an expert. Otherwise all you will ever have are a few experts and a boatload of people who can't bridge the gap.

LorenzoVulcan
Member
Posts: 447
Joined: Mon Mar 12, 2012 06:46
GitHub: aegroto

by LorenzoVulcan » Post

Neuromancer wrote: That's kind of the point. Everyone starts out a noob. Blockly helps you bridge the gap from being a noob to an expert. Otherwise all you will ever have are a few experts and a boatload of people who can't bridge the gap.
I think this GUI just breaks out all concept of programming.When you program you must have the scheme of every class in your head,an programming LUA mods for minetest is a nice training to learn this concept.Using Blockly to code mods for minetest will just make every user of this forum a noob.

And the gap can be bridged asking help to expert users or reading tutorial and APIs.
Developer of the BlockForge 2# Project!
Official thread: http://minetest.net/forum/viewtopic.php ... 290#p54290

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests