Author Topic: Visual Programming and AGI  (Read 934 times)

0 Members and 1 Guest are viewing this topic.

Offline lance.ewing

Visual Programming and AGI
« on: March 27, 2015, 06:35:09 PM »
This is something I've thought quite a bit about over the past couple of years. You'll all know about the Raspberry Pi I'm guessing, and the Scratch programming language that they're promoting on there for introducing kids to programming. Both my daughters have spent quite a bit of time playing around with Scratch, and I've dabbled a bit as well so that I can help them with their questions. It occurred to me how close the IDE for Scratch is to what we ideally need for AGI. It has sprites, background pictures, sounds. And it has the ability to write code by dragging and dropping blocks and joining them together like a jigsaw.

Snap is another one based on Scratch but with more powerful features. Scratch 1 is written in Squeak, Scratch 2 in Flash, and Snap is written in JavaScript. Due to it being written in JS, Snap is probably my personal favourite.

https://scratch.mit.edu/projects/editor

http://snap.berkeley.edu/snapsource/snap.html

Google Blockly is yet another one with the same concept, once again written in JS. And it supports building custom blocks.

https://developers.google.com/blockly/

Such an editor probably wouldn't work for SCI, but imagine an AGI editor where all of the commands were blocks. I really think it would work. And the bit that is exciting for me is that once such a thing was built, thousands of kids around the world would pick it up quickly, not to mention their schools and probably the Raspberry Pi foundation, and under the hood its all AGI based!  What a great way to bring AGI back to life. I think AGI has commands that are ideal for working with animated sprites. I tried making a walking man (controlled by the arrow keys) in Scratch and, although I succeeded, it was a bit of a mission. It's because the blocks and sprite editor isn't really geared around that type of animation. But with some tweaks to "retro"-fit the sprite editor with an AGI View editor, and the available blocks switched for AGI ones, ...  hey presto!

As I said in another thread, lots of ideas for projects but not enough time to work on them. I'm mentioning the idea in case someone else is inspired to fly with it.



Offline troflip

Re: Visual Programming and AGI
« Reply #1 on: March 27, 2015, 07:04:46 PM »
I tried incorporating something like this into SCI Companion, but it didn't work out. SCI code is just too flexible to allow going back and forth between code and the "visual designer" (which requires a consistent way to set properties, etc..).

I haven't done any AGI programming, but my impression is that there are "less ways to do things" with AGI, and that might make it feasible?
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline lance.ewing

Re: Visual Programming and AGI
« Reply #2 on: March 28, 2015, 06:36:52 AM »
Yeah, I'd imagine that trying to build something like that for SCI would be very difficult. The problem would be the object-oriented aspects of the language, which I don't think the existing Visual Programming examples (Scratch, Snap, etc) have addressed yet. And thinking about it, it would be difficult to represent concepts like that with blocks.

AGI is not object-oriented and reads more like a script. There are no user defined procedures or anything like that. It simply executes from the start of the script to the end. In some ways it is actually even simpler than what is possible in Scratch and Snap (where it is possible to raise events and have multiple event handlers, running in parallel). In the latest version of Scratch, and also in Snap, it is possible to "build your own blocks". So I think they're already beyond what AGI is capable of. And with AGI there is a one to one relationship between the original source and the compiled format, whereas SCI would in theory start off in some form of any language (even AGI source perhaps) and compile to the SCI byte code.

AGI commands logically fall in to groups as well, and therefore the Scratch and Snap way of grouping blocks under different sections would work well. AGI's concept of global variables and flags matches what Scratch has for variables (although Scratch also allows variables scoped specifically to a sprite, which is quite interesting, but once again shows that Scratch is more complex than what we'd need for AGI).

Offline lance.ewing

Re: Visual Programming and AGI
« Reply #3 on: March 31, 2015, 02:23:25 PM »
I probably did Snap an injustice lumping it together with Scratch. I've been reading over the documentation for Snap and it is actually really powerful. I've only ever played with it having come from experience using Scratch. Snap supports quite a lot of the more complex features that we're used to in non-visual programming languages. The documentation shows ways in which classes can be defined and how to implement classical hierarchical inheritance and also prototypical inheritance. One of the nice features that makes a lot of this possible is that you can return a block of code as a return value from a user defined block and that block of code has access to the local vars defined in the block that returned it. I'm surprised that Snap isn't as popular as Scratch.

An AGI visual programming tool would be very simplistic compared to both Snap and Scratch.


SMF 2.0.11 | SMF © 2015, Simple Machines
Simple Audio Video Embedder

Page created in 0.13 seconds with 22 queries.