Distant-Hill's Implementation Goals for in-house Visual Novel Engine:

Main Menu & Game Menu

C will be used for the main loop and creating two menus: one for starting/continuing a game, loading, saving, adjusting settings, etc. Another for managing games during gameplay. We can use Lua to script the options that are displayed on these menus.

Automatic Saving

Implement autosaving functionality in C, saving the state at specific intervals and/or when certain events occur. Possibly add user-defined intervals. Use Lua to define what data should be saved and how it is structured.

Rollback Feature

This feature requires maintaining a history of game states. We can use a stack-based approach, where each time the game state changes it is pushed onto the stack. To rollback we simply pop from the stack until reaching the desired state.

Predictive Image Loading

Use background threads or asynchronous loading techniques to load images in the background while the main game loop continues executing. Lua can be used to determine which images need loading based on the current game state and display.

Input Handling

Create a unified input system in C that supports mouse, keyboard, and gamepads/controllers. Use Lua to define how inputs are processed within specific games or storylines.

Display Settings

Implement options where users can select between fullscreen, windowed, borderless. Lua can be used for dynamic adjustments based on player input.

Skipping/Auto-Advance Features

Use Lua to script the text displays in game and create functions that allow skipping, hiding, or auto-advancing through the text depending on certain conditions or key presses

Audio Control

Separate music, sfx, and voice controls into independent systems. Players should be able to adjust these settings through an audio configuration menu. C handles the lower-level details of playback and management, while Lua could control when and how audio assets are played.

The key here is that C would handle most of the heavy-lifting:

  1. Game Logic
  2. Rendering
  3. Input Handling
  4. State Management

Implementation of the Dialogue System

Dialogue Presentation Styles

Use Lua to define the different styles of text presentation - ADV and NVL. We can create functions that handle the display logic for each mode, which can be called by C main loop when appropriate.

Style Customization

Implement a system in C where style attributes (fonts, colors, sizes) can be set or modified dynamically through Lua scripts. The interface should allow creators to easily adjust text and button styles via a UI, storing the changes in an accesible format, i.e. configuration files or embedded data structures.

Screen Language & Layout

Design a screen management system in C that utilizes Lua for defining layout and behavior. We could use a combination of tables and functions in Lua to represent the different elements (buttons, text blocks, etc.) on each screen and how they should be arranged visually.

Runtime Interface Changes

For games that want to change interface dynamically based on player actions or story progression we could create an event-driven system in C in which Lua scripts emit events triggering changes to the UI. The C code will handle these events by adjusting the screen layout and component appearance accordingly.

Dialogue System Summary:

The C code will manage the underlying engine functionality (text display, user input handling, etc.) while Lua scripting is used for defining dialogue presentation styles, customizing visual elements, and controlling dynamic UI layouts and behavior. This will give us a flexible, interactive interface that can be customized by non-programmers.

Transition Effects

  1. Pixellation & Unpixellation
  2. Fading
  3. Dissolving
  4. Image-Controlled Dissolves

List of Desired Compatible File Formats

Images: JPEG, PNG, WEBP (ew), BMP, GIF,

Audio: OPUS, OGG Vorbis, FLAC, WAV, MP3, MP2

Movies: WEBM, OGG Theora, VP9, VP8, MPEG 4, MPEG 2, MPEG 1

Scalable Fonts: TrueType

Image-based Fonts: SFont, BMFont, MudgeFont