Visual Novel Template
-
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!
-
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
-
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😋
-
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...
-
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!