The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
July 25, 2024, 06:55:49 pm
Home Help Search Login Register
News: Celebrating 30 years of Star Control 2 - The Ur-Quan Masters

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Starbase Café (Moderator: Death 999)
| | |-+  Pseudo Retro Game Engine Demo
« previous next »
Pages: [1] Print
Author Topic: Pseudo Retro Game Engine Demo  (Read 960 times)
Frungy champion
Offline Offline

Posts: 66

View Profile
Pseudo Retro Game Engine Demo
« on: March 01, 2018, 05:53:31 am »

This is something I've been working on for a while.  It's a pseudo retro game engine.  What does that mean?  The engine provides a very retro style interface to doing thing that was common in the past.

For example, want to write a pixel to the screen?  Just copy the pixel data to the virtual video ram.  Want to play a sound?  Load up the sample, map a channel to it, and play it.  There's a rendering library that provides common functionality through the raw basics provide.  A lot of memcpy and memset happening.  The font you see, is actually a custom written ASCII character ROM.  I've even coded up my own line, triangle, and filled triangle functions.

The engine itself is heavily threaded.  Game logic, sound, controls, and display all operate on their own threads.  Display is 32-bit color, 24-bits of color data with an extra channel.  Sound is handled by 32 emulated channels running at 16-bit @ 44.1kHz.  Keyboard and Mouse are handled and data updated to global status registers.

Support for file formats has been written by hand off of specification documents.  Wave and Bitmap data can be partially interpreted enough to allow extraction of the data and converting it.  Fast Tracker Module files can be loaded and played with MOST the effects implemented.  (31 sample, 4 channels max at this point.)  Not all effects are fully handled, I been pouring through the reference data I can get and educating myself about how to translate what was written for the Amiga to modern computer standards.  Initial drafts of the module player were... interesting at times.  The player sequences everything while intricate effects are handled through the channel when rendering.

Written in C++ 11 (Very close to C in style), PortAudio for the raw access to OS audio buffers, GLFW for window handling, and OpenGL to create one textured quad that is streamed data constantly.  (Presently 720p worth of 32 bit color data at near 100FPS... or roughly 352MB/s, thank you OpenGL 4.4)

Here's a link of the latest video of the demo I recorded, playing some songs you all will probably be familiar with:

Here's the link to the GitHub, (my apologizes for the mess of the code base, I'm slowly working to make it proper):

Mostly started it to freshen up my C++ skills, learn C++ 11, and educate myself about how it all used to be done and how to do it today.  Admittedly, it runs pretty decently, roughly 4-6% CPU usage average on my old Core i7 920.  Hope to eventually get off my lazy ass and write a game to go with it.  But, I've been obsessing with tweaking stuff to get that little extra bit of optimization.  Plan on implementing a ANSI terminal emulator (hence the color test patterns) and see about loading the raw ship images from the original Star Control 2 game.  And I've on and off played with the idea of adding FM synthesis, but I just figure out an implementation I like.

Any thoughts or opinions would be appreciated, as it might help motivate me to get bits and pieces working on it.
Pages: [1] Print 
« previous next »
Jump to:  

Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!