Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1377855 Posts in 65464 Topics- by 57789 Members - Latest Member: Cryofauna

June 05, 2020, 05:24:05 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsRTG - The Ray-Traced Game (Puzzle / Platformer)
Pages: [1]
Print
Author Topic: RTG - The Ray-Traced Game (Puzzle / Platformer)  (Read 538 times)
vdapps
Level 0
**


Head against wall since 2013


View Profile WWW
« on: May 08, 2020, 12:11:05 PM »

RTG

is going to be puzzle / platformer game which combines 2 principles.
Classic 2D puzzle / platformer gameplay with in-house software ray-tracing algorithm for rendering.

Idea for the game was born when I was browsing through my 17-years old source code (ray-tracing demo), yet from the times when I just finished university. As the game will use software ray-tracing for rendering, no special graphics HW will be required to run the game. Of course, as ray-tracing is very demanding algorithm, game will need to be low-poly and low-res (which is hardly an issue in indie game). The game will be integrated with my own simple 2D editor / engine, in which I made my previous game: Universe Quiz
(link: https://store.steampowered.com/app/1211100/Universe_Quiz/).

As the game will be puzzle / platformer, combination of 3D ray-traced rendering and 2D engine / editor for game logic will not be an issue.

For beginning, here's a sample of rendering output of my fore-mentioned 17-years old demo, which served as the base for the game.
(Please note that game will look totally different of course)


Test scene, I´m using for algorithm optimization


Very first test level to test basic mechanics
(with camera looking from side, so game can resemble 2D platformer)
« Last Edit: June 02, 2020, 01:04:54 PM by vdapps » Logged

vdapps
Level 0
**


Head against wall since 2013


View Profile WWW
« Reply #1 on: May 08, 2020, 12:40:20 PM »

-= Devlog #1 =-

I plan to update this devlog with at least every 2 weeks cadence. As the name of the game suggests, game world will be rendered using ray-tracing algorithm. Original idea for the game came to me when I was checking some super old sources from my early twenties, which I wrote 17 years ago. I was just finishing university and aspiring to enter game dev business (in which I succeeded, as I started as junior programmer in Slovak game dev company Cauldron later).

Fore-mentioned old C++ sources were ugly as hell Embarrassed (comparing it to my today's coding standards as senior developer). My obsessive-compulsive reflexes obliged me to rewrite and re-indent that code, as I was not able to stare at this coding mess and live with the fact that it's my own code Cry (hey, it was 17 years ago!)

More I indented the code, more ideas came into my head to possibly build some game above this algorithm. When I finished refactor, decision was already done. So here it is. What you can see now is the output from recent build (with now algorithm nicely refactored and re-indented) of my old demo, but running inside my own simple game editor (in which I made my previous game "Universe Quiz").
Logged

vdapps
Level 0
**


Head against wall since 2013


View Profile WWW
« Reply #2 on: May 22, 2020, 09:36:43 AM »

-= Devlog #2 =-

After 2 weeks, devlog update.

First things first, before implementing any gameplay mechanics I had to optimize current ray-tracing algorithm as it was too "academic" (not meant originally for making a game, but as just mere showcase of ray-tracing algorithm).

To tweak the algorithm I needed some good test case, and to have good test case, I had to implement some dynamic creation of geometries. Thing is that original demo with chessboard and one figure was brutally hard-coded, so not very suitable for optimizing. After implementing dynamic creation of geometries, I prepared new test case. The same reflective chessboard, but now 64 boxes over it and 2 light sources floating around.

As expected with heavier scene, frame-rate and "ray-rate" dropped significantly. So I headed up into optimizing. In scope of one week, I was able to improve performance around 2 to 3 times. Same scenario, before: ~1 MRays/second, now: 2,7 MRays/second.

Optimizations done:
 - move from double to float in most of computations (to save bandwidth)
 - optimized ray vs bounding box intersection search (most abundant geometries in game will be boxes)
 - objects clustering (first find ray vs cluster´s bounding box, if hit, then proceed into cluster to particular objects)
 - small tweaks in parameters passing in algorithm call tree (there are millions iterations per second through same routines. Any saving in most invoked routines is important)

I have more optimizations in mind, but I think now it's better to do some gameplay prototyping first. So hopefully with next update, I´ll be able to show off some first gameplay mechanics. ¡Hasta pronto!


Short animation (animated PNG) from current test scenario (2,7 MRays/second)




In case that above animated PNG is not displayed correctly in your browser, here's animated GIF version
(due to GIF-s limit of 256 colors, color reduction does not look very good in this particular scene)

Logged

JobLeonard
Level 10
*****



View Profile
« Reply #3 on: May 22, 2020, 12:17:36 PM »

Ooh, I am so down for this! Looking forward to more dev updates on your explorations of software-based raytracing Wizard
Logged
vdapps
Level 0
**


Head against wall since 2013


View Profile WWW
« Reply #4 on: May 22, 2020, 01:56:06 PM »

Ooh, I am so down for this! Looking forward to more dev updates on your explorations of software-based raytracing Wizard

Thanks JobLeonard! Smiley

Yep, one can play with ray-tracing algorithm and tweak and enhance it all along. On the other side, I need to progress also on gameplay, so I'll interleave. Moving forward with gameplay mechanics, if I'll see that I'm dropping under 60fps, ray-tracing tweaking, then progress in game again, then add some new ray-traced FX and so on.
Logged

vdapps
Level 0
**


Head against wall since 2013


View Profile WWW
« Reply #5 on: June 02, 2020, 12:37:41 PM »

-= Devlog #3 =-

Next DevLog update, now a bit sooner as is my planned "every 2 weeks" cadence. Last time I planned to implement some game mechanics, however I realized that better would be to implement editor integration first. Reason was that everything until now was a bit hard-coded on C++ side. I have already simple 2D engine with editor made in C# in which I made my previous game Universe Quiz (here's the link if you want to take a look: https://store.steampowered.com/app/1211100/Universe_Quiz/).

My ray-tracing engine is naturally 3D, engine / editor is 2D, but it's no problem as the game is going to be puzzle / platformer. Even if what you'll see in the game will be 3D in nature, game logic will be mostly along x and y axes with camera looking into level from side, so 2D engine / editor will suffice. Editor allows me to place elements into scene, those elements can have properties. All elements and properties have auto-support for serialization, elements query and properties change at runtime, either from C# or from built-in simple script language.

What I had to do is to make new elements for this editor which then will translate into ray-traced game world objects at run-time. This way I'm be able to edit / manage world from editor and more comfortable C# language (or from my script) using all underlying goodies of my engine, and ray-traced algorithm in C++ will be just interpreting current state of world.

That said, I integrated first elements: RTBox, RTLight and RTGActor. To have an idea, here is a screenshot of editor and how looks VERY first test level in it.


After basic editor integration, finally I was able to implement some basic gameplay mechanics. So, I started with basic gravity and player vs box collision. Together with fore-mentioned test level (one actor, one light source and few boxes), voilà, it results in such "gameplay": Smiley


As a next step I want to make first few levels (simple tutorial levels) which will resemble intended look and gameplay of final product.

¡Hasta pronto! Smiley
« Last Edit: June 02, 2020, 01:02:07 PM by vdapps » Logged

JobLeonard
Level 10
*****



View Profile
« Reply #6 on: June 03, 2020, 01:57:59 AM »

Niiice, and that gif looks solid!
Logged
vdapps
Level 0
**


Head against wall since 2013


View Profile WWW
« Reply #7 on: Today at 12:10:04 PM »

Niiice, and that gif looks solid!

Thanks! It's very inspiring for me. Now I finally started on very nice part of development. Namely implementing game mechanics and specific game elements, which will be present in final game, so game will start taking a shape. I can't wait to post new devlog. Wink
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic