[Build System]
- Integrate 'sqlite3' and 'sqlite_modern_cpp' using FetchContent.
- Enabled 'C' language to allow compilation of 'sqlite3' lib.
[Persistance]
- Adds a 'DatabaseManager' class to handle all SQLite operations.
- Creates a 'players' table on server startup.
- Server uses separate database for single-player 'bettola_sp.db' and
'bettola.db'
[UI]
- Adds a new 'LoginScreen' UI.
- Game flow is now MainMenu -> LoginScreen -> bootSequence -> Desktop.
- 'LoginScreen' has interactive tabs to switch between "Login" and
"Create Account" 'modes'.
- Full client-server communication for creating accounts and
authentication.
[Server]
- Refactor 'NetworkManager' to handle an 'AUTHENTICATING' state for new
connectiosn.
- Player state is only set to 'ACTIVE' after a successful login
- Real time on-screen debug overlay to display performance metrics.
Overlay can be toggled with C-d.
[Fixed]
- Corrects a "click-through" bug by implementing Z-ordering for window
stack.
- Decouples taskbar from window z-order to provide a stable button
layout that isn't affected by focus changes.
- Adds culling to the terminal history view to prevent rendering
off-screen lines.
This mirrors the previous refactor of the TextRenderer. All calls to
draw_rect and draw_triangle now buffer vertex data (position and color).
A begin()/flush() system is introduced to manage batching.
Prevents rendering of UI windows that are completely hidden by other
windows.
Desktop rendering now checks if a window is fully occluded by any single
window higher in the Z-order. If a window is determined to be hidden,
its entire render function can be skipped.
This is a pragmatic implementation that handles the most common
occlusion scenario (i.e., a maximised window). There would be little
benefit of other edge cases in the particular game I think.
Overhauls text rendering to improve performance.
Renderer was really ineffient, sending a separate GPU draw call for
every character rendered. This created a bottleneck, especially with
text-heavy UI stuff like the wallpaper.
- The 'TextRenderer' now generates a single texture atlas for all font
glyhs on load so all characters share a single texture.
- 'begin()' / 'flush()' was added to the 'TextRenderer'. Calls to
'render_text' now buffer vertex data (position, texture coords,
colour) instead of drawing immediately. A single 'flush()' call at the
end of a pass draws all buffered text in one draw call.
- A simple batching introduced some shitty visual layering bugs. to
solve this, a staged flushing architecture has been implemented. Each
logical UI component is now responsible for managing its own rendering
passes, beginning and flushing text batches as needed to ensure correct
back-to-front layering.
The UI codebase was suffering with complexity due to the need to
manually convert between two different coordinate systems:
- Top-down "screen coordinates" used by SDL for input and windowing.
- Bottom-up "GL coordinates" used by low-level renderers.
This was making layout calculations diffucult and is bug prone.
With this commit, I'm introducing a 'UIRenderer' abstraction layer that
wraps the low-level 'ShapeRenderer' and 'TextRenderer'. This is
responsible for centralising all coordinate system conversations.
All UI components has been refactored to use the 'UIRenderer' so the
entire UI code opeates exclusively in a single, top-down screen
coordinate system as one would expect.
- Adds a taskbar that displays and manages open application windows
- close, minimise and restore functionality
- resizeable windows
- Refactored desktop event handling to manage window focus and render
order
Introduces a central GameState class to manage the client's lifecycle,
network connection and UI components. The Terminal has been demoted to a
pure UI widget and main has been simplified to a basic entrypoint as
they should be!
Old vfs_node was getting a bit big for its boots, trying to be a
filesystem, network interface and the whole damn computer all at once.
This server-side refactor introduces a 'Machine' class that rightfully
owns the VFS, network services and other machine-state sh.t.
the SDL3_net implementation was causing blocking behaviour and was
difficult to debug and has bad docs due to not being released. Caused
crashes all over. so moved to Asio. This thing took so damn long as this
also had it's issues!
- All networking now uses Asio's async callback model.
- TcpConnection class encapsulates logic for a single client-server
connection, managing socket and message framing.
- Implmented thread-safe queues for handling incoming and outgoing
messages between the network thread and the main application.
- Refactored ClientNetwork and NetworkManager, the primary client and
server networking classes have been rewritten to use the new
asio-based architecture.
- Player objects on the server are not managed by std::unique_ptr to
ensure proper lifetime management and prevent memleaks.
- VFSManager is now a single instance on the server, passed by reference
to new players, avoding redundant script loading for every connection.
- Resolved server crash that occured immediately upon client connection.
This was traced to an object lifetime issue within Asio's async
handlers which was fixed by simplifying the send operation.
Client architecture has been refactored to be fully
server-authoritative, remove the previous "hybrid" model that supported
both local and remote command execution, that was a stupid idea.
- Client now connects to server on startup.
- The local command processor and VFS have been removed from the
Terminal class.
- All command processing is now handled by the server.
- The client is now just a thin client essentially
I'll in the future enable single player mode by running the server on
the local machine in a separate thread.