## LUNAR Lua+Narrative

Show off your games, demos and other (playable) creations.
Echo
Prole
Posts: 46
Joined: Fri Jul 13, 2012 4:50 pm
Location: Lucid Moon

### LUNAR Lua+Narrative

LUNAR which is short for LUa+NARrative is a simple adventure game/visual novel game-engine built with Lua using the Love2d framework and Notepad++.

The *idea is to have something simple enough to create any "narrative" styled game ( that includes visual novels and graphical text adventure games ) in an open source and hopefully newbie friendly game engine. To use it however you would need Notepad ++ and Love2d.

Right now it's still in its early development stages but I have made this thread to make sure that LUNAR has enough feedback during it's production in order for me to make it as user friendly and as open source as possible while also taking time to make this *idea into a reality.

I've been frustrated with engines like Ren'py and Adventure Game Studios while they are very fantastic game engines and they do what they are supposed to do, they don't offer me the freedom I crave in making narrative styled games that borrow a bit from adventure games AND visual novels in a simple un-yet powerful way like how I hope LUNAR will. With this being made on Love2d, I'm sure a lot of you who have similar desires or interest in narrative-based game genres will benefit from this engine and also join me in my journey to make LUNAR.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

GUI:

I'm working on the GUI following a vintage notebook theme, so far this is just the base. I will create a mock up to show you how it looks like in action soon...
Attachments
notebook theme.png (117.27 KiB) Viewed 3883 times
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Contact:

### Re: LUNAR Lua+Narrative

I like the vintage theme.
I'll be happy to try and provide feedback.
What features have you been able to get working, so far ?
Echo
Prole
Posts: 46
Joined: Fri Jul 13, 2012 4:50 pm
Location: Lucid Moon

### Re: LUNAR Lua+Narrative

The basic visual novel system alone works perfect, you can go to the next page and previous page and I have sort of figured out a way to add a page skip feature and a bookmarking system (save system) only I need to look up saving and loading with Love2d
( you or anyone could help with this if you know how to save and load data for love (^_^)).
The VN-System uses a simple variable to "count" what page you are on and how many sequences of text you have read called next_text which is reset every new page to 0 and is incremented every time there is an output. This makes it easy to navigate through the VN and also easier for you ( the developer ) to organize events and content according to what page your audience (the player) is currently viewing, you could also sequence simple effects like a fade out by using basic if statements and a timer but that is still in prototyping. ( I also need a little help with making timers in Love ).
I am also adding some interactivity to the vintage notebook interface, when you're mouse is over the edge of the page, a fold appears, you then click this fold to go to the next page or load the next output as an alternative to pressing space. Also I think that would look a little cooler (^_^)

I'm glad you liked my vintage design Yonaba, that's the one for the adventure games though, the visual novel one is exactly the same just without the side stuff only the main screen and the message box. I'm yet to post it in action because I need to add the save and load buttons and also work up a mock-up screenshot.
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Contact:

### Re: LUNAR Lua+Narrative

Saving and loading is not a big issue. It depends on what you actually want.
It may be as simple as writing data into a file, and opening that very file and parse the same data.
Lua have an IO library that is perfect for that. But that library doesn't match well with Love. Though, LOVE features a nice API that will suits your needs : love.filesystem.
And have a look at serialization, Taehl made a great work on that.
Keep up the good job.
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: LUNAR Lua+Narrative

Yes on love.filesystem.

However, Taehl's TSerial only works with simple and small tables. It is not a very robust solution (with potential performance issues). So if there is any chance you might have to use strings that are not controlled by you (because they are typed in by the user) or tables may occur multiple times (or even be nested), it would be better to pick something else.
Echo
Prole
Posts: 46
Joined: Fri Jul 13, 2012 4:50 pm
Location: Lucid Moon

### Re: LUNAR Lua+Narrative

For now all I need to save is a few variables that tell Love what the user was last reading and where ( what page ) they where reading it. Then I think I can make a function to load this information. Nothing to complex as of now ( latter though I will need to save parser info and stuff ).
I will try love.filesystems and see if this works out... Taehl's TSerial is what I might need for now since I am saving the more complex save system for the graphical adventure game part of the engine. right now I can fist finish off the visual novel one and have it ready for beta-testing asap.
Echo
Prole
Posts: 46
Joined: Fri Jul 13, 2012 4:50 pm
Location: Lucid Moon

### Re: LUNAR Lua+Narrative

Hi guys.
Today I edited the design a little for the graphical adventure game interface and made a visual-novel interface with a mock-up screenshot.
You can see them in the attachments.

I think now I can move on to coding the save system and have a beta ready maybe later next week for the visual novel engine ( I should have the VN-engine ready by September latest). I will make sure to check my code over and add a lot of comments so that it is very easy for someone to make their own visual novel and understand what is going on. occasionally I will post some code here to verify that it makes sense to other people.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
So LUNAR has two modes, one is for making Visual Novels, the other is more suited to graphical adventure games. The VN mode which I call the Visual_Interface-Mode (VIM) has a bigger canvas for images and a simple choice system which you interact with using the mouse or number keys from 0 to 9.
*The dimensions of the Canvas for VIM are 642x444

The Graphical adventure game mode which I call the Graphical_Interface_Mode (GIM) has a smaller canvas but up to 20 buttons for commands such as open,close,talk,take e.t.c and an object system which shows objects that are not easily clickable on the canvas or as an alternate choice system.
*The dimensions of the Canvas for GIM are 504x444

In the comments I have labed in brackets (VIM) or (GIM) to show you which interface is for what.

*Please tell me if you think these dimensions are fine or not? I can try make them a bit more wholesome. this would need to be clarified soon since I intend to fix the canvas dimensions in my code so Its easy to co-ordinate the turning-page icon ( when you hover over the edge of the canvas, a folded-page image appears and when clicked you proceed to the next page or scene. the co-ordinates of this icon need to be hard-coded ).
Attachments
adventure-notebook theme.png (114.83 KiB) Viewed 3774 times
Visual-Novel Interface (VIM)
visual-notebook theme.png (105.19 KiB) Viewed 3774 times
Visual-Novel Mock-Up: The Great Wave of Kanagawa (VIM)
visual novel mock up.png (684.62 KiB) Viewed 3774 times
Party member
Posts: 223
Joined: Sun Mar 04, 2012 2:04 pm
Location: USA

### Re: LUNAR Lua+Narrative

I think that dimension is fine. Its VN so you don't need super high resolution with HD images.
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Contact:

### Re: LUNAR Lua+Narrative

I löve that.
Echo
Prole
Posts: 46
Joined: Fri Jul 13, 2012 4:50 pm
Location: Lucid Moon

### Re: LUNAR Lua+Narrative

Thank's Yonaba (^_^)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I'm having a hard time understanding love.filesystems and especially serialization and the Lua IO library are hard to get probably because I never really learned how tables work, I sort of just learned how to use a table to store variables ( I think that's as good as knowing how they work anyway ) but for example how do I save variables into a table that are NOT hard coded as part of that table?
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
That may sound confusing but my problem is this: I have a two variables page, next_text, upper_limit and lower_limit

The Variables
The variable page is an integer that holds the page number and tells the computer what page the reader is on.

The variable next_text is an integer that holds a number that tells the computer what sequence of output should be displayed.

The variable upper_limit is an integer that hold the maximum number next_text should hold before going to the next page
( this then adds 1 to page if next_text == upper_limit )

The variable lower_limit is an integer that hold the minimum number next_text should hold before going to the previous page
( this then subtracts 1 to page if next_text == lower_limit )

Creating a Save function
I want to use these codes that are part of Love's filesystem Application Programming Interface:

Code: Select all

love.filesystem.write  --to save the variables as data
love.filesystem.read   --to read the data and input it back into the variables

the best way would be to have all the variables in one table and then write them to a save directory right? But how would I store all my variables in one table, and why is this even necessary? ( apart from neatness )

Then I have another problem...making the save function drag and drop
Here is the tricky part

However I want this to work so that the user can click and hold anywhere over the canvas and then drag and drop into the journal to save and to load I want them to click and hold on the journals save-icon ( the floppy disk ) and then drag and drop anywhere into the canvas to load.

To notice if the mouse was pressed over the canvas or journal first I would need to write code using:

Code: Select all

love.mouse.getX
love.mouse.getY

and then figure out an algorithm using the dimensions and x,y co-ordinates of the journal and the canvas to make invisible boundaries and then check if the mouse is within those boundaries. Or I could use

Code: Select all

love.mouse.getPosition

but that's too vague

Then after I detect where the mouse was clicked I can check where it was released using the same method.

once there is a match between canvas and journal then I can use an if statement to call the save function.

once there is a match between journal and canvas then I can use an if statement to call the load function.

All of this seems possible BUT I am having trouble doing this practically and writing an algorithm to "map" the canvas and journal.

this looks very bleak to me... I might have to postpone the release of the VN engine to properly learn Lua since I feel like I'm still chasing the moon without any solid basis to keep me from getting lost in the space of all this confusion. In other-words I might be finding this hard because I have not studied Lua completely nor do I have experience with REAL programming like most of you. (GML is rubbish)

### Who is online

Users browsing this forum: No registered users and 2 guests