Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Visual Novel Template

    Coding
    4
    5
    482
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      bananie123 last edited by

      Hi all!

      I am so happy to have a front end to learn more about game development on my favorite gaming system!

      I have experience coding for business, with querying report data and whatnot, so very different from this.

      I noticed most of the examples in the book are infinite programs. I'm looking to build a visual novel, and I'm not really sure where to start. Do all game programs have to be contained in one while loop?

      If there anyone with a visual novel template, or at least some good information to point me in the right direction?

      Thanks so much in advance for responding!

      1 Reply Last reply Reply Quote 3
      • pianofire
        pianofire Fuze Team last edited by

        Hi there. First I would recommend working through the tutorials to get the basics but you might want to take a look at this program

        https://fuzearena.com/forum/topic/1812/misspelt-poets-society

        1 Reply Last reply Reply Quote 2
        • PB____
          PB____ last edited by PB____

          Hi Bananie,

          Welcome to the community. And yes, programming a game is different from business applications, but your experience with coding should give you a head start 😉

          Any FUZE game would exit automatically if there isn't any code running. That doesn't mean it's required to have a single while loop, but it is a pattern that makes sense for most games.

          But if you would want to do something like this, that would work as well:

          chapter1()
          chapter2()
          chapterN()
          
          function chapter1()
              var done = false
              while !done loop
                  clear()
                  // do stuff for chapter
                  update()
              repeat
          return void
          
          // etc.
          

          But personally I feel it would still make sense to use a main loop that wraps the chapter logic, that gives you the opportunity to switch between a menu and the game for instance something like this:

          function main()
              loop
                  var choice = menu()
                  if isChapter(choice) then
                      chapter(choice)
                  else
                      displayMessage("Thanks for playing!")
                      break
                  endif
              repeat
          return void
          
          function menu()
          return int(input("Enter a chapter number", false))
          
          function isChapter(choice)
          return choice > 0 and choice < 3
          
          function chapter(nr)
              var done = false
              while !done loop
                  clear()
                  print("This is chapter", nr)
                  // do stuff for chapter [nr]
                  update()
              repeat
          return void
          
          function displayMessage(message)
              clear(red)
              ink(black)
              print(message)
              update()
              sleep(1)
          return void
          
          main()
          

          Obviously these are simplified examples, but the point is, you need a pattern that keeps code running while your game is running. This does not freeze your console, as long as you use the update() command to allow drawing towards the screen in between.

          I don't have a visual novel template, but hopefully I helped make sense about why having an infinite loop is not a bad thing in FUZE😋

          1 Reply Last reply Reply Quote 2
          • vinicity
            vinicity F last edited by vinicity

            Hi!

            Not sure if this is helpful. but the closest thing to a visual novel I have written is "Captain Boomer", which you can find here:

            https://fuzearena.com/catalogs/view/2233

            The game was written in three evenings time for a game jam, so it is a bit of a rushed mess. But it works as a proof of concept for how a visual novel could work. It has got different scenarios, each with different choices made by the player, and those choices affect how future scenarios play out.

            It's not really a finished game as it is now, and maybe I'll get back to it at a future time...

            1 Reply Last reply Reply Quote 2
            • B
              bananie123 last edited by

              thanks so much for all the great advice!

              I have worked through the tutorials, but most of the activities seemed to be more game-oriented, and as I mentioned, worked in an infinite while-loop.

              this is a great jumping-off point, and I really appreciate the comments. thanks so much!

              1 Reply Last reply Reply Quote 5
              • First post
                Last post