Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How to create a visual programming interface for a game?

Discussion in 'Game Design' started by Vinomakon, Aug 13, 2023.

  1. Vinomakon

    Vinomakon

    Joined:
    Jul 1, 2022
    Posts:
    5
    I’m currently trying to figure something out for a school project of mine. My idea is to create a game with which you can learn the basics of programming and apply it in a game. But I’m currently stuck on figuring out, how to do it. I wanted to create a Scratch-like interface, with which the player could interact and create “scripts” with. A different option would be something like the visual block like scripting in “Lego Mindstorms” (see attached picture)

    This I want to try to implement into a game. Does someone know a good tutorial or some kind of documentation of how to create something like this in unity? Anything would help.
     
  2. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,509
    Well, honestly... you're talking about implementing your own visual programming language. It requires an advanced level of programming skill, and If you need a tutorial for it then it's probably out of reach for now.

    You're going to need to be well versed in:
    - Computer science fundamentals. Not just how to write code, but why programming works the way it does.
    - User interface design and implementation. How to make complicated, dynamic and highly interactive, data-driven interfaces.

    And another would be a smaller scope where, instead of implementing a programming system, you have a game with a series of puzzles based on the fundamentals of programming. If you can find any videos of it, the built-in story in Project Spark is one example.
     
    Martin_H likes this.
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,841
    Yes — I started a project like this myself once; you can do it using a Canvas, a bunch of Image objects, and a whole lot of code. But it's a big project.

    And, I'm no longer convinced that these visual Scratch-like languages are really all that useful. They only help you with syntax, which is a relatively small barrier in the earliest stages of learning to code. They don't help with the hard parts, which are organizing your thoughts, making a plan, breaking that down into doable steps, and figuring out how to say those steps using whatever semantic pieces your programming environment gives you.

    Would you consider embedding MiniScript instead? I'd be happy to send you a free copy of the plugin for your school project, and give you any help you need integrating it via our Discord server.
     
    Nelvin123 likes this.
  4. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    there is a game called "baba is you" which is similar to what angry penguin mentioned. basically a 2d game where you solve simple logic puzzles in an immersive way.

    you could probably reasonably fake a programming language with just super simple logic coupled with widgets. But you won't find a tutorial. You would need to have mastered the basics of programming to be able to even begin imagining it.