DEV Community

Cover image for Chasing the Sun: Building a 3D AI-Powered Solstice Runner with React Three Fiber

Chasing the Sun: Building a 3D AI-Powered Solstice Runner with React Three Fiber

S M Tahosin on June 21, 2026

This is a submission for the June Solstice Game Jam What I Built For this game jam, I built Solstice Runner, a 3D endless adventure whe...
Collapse
 
ben profile image
Ben Halpern

Very neat

Collapse
 
tahosin profile image
S M Tahosin

Thanks Ben πŸ™‚

Collapse
 
hosseinyazdi profile image
Hossein Yazdi

Very cool concept. I like that you didn't stop at making another endless runner and actually tied the mechanics to the solstice theme and Alan Turing.

React Three Fiber is such a good choice for projects like this too. it makes experimenting with 3D much more approachable compared to working directly with Three.js.

I've seen something like Flexbox Adventure, before, but these AI powered games alike are something totally different, love them in every aspect. Great job!

Collapse
 
tahosin profile image
S M Tahosin

Thanks a lot, Hossein! That was exactly what I was aiming for. React Three Fiber made it much easier to bring the idea to life, and I'm glad you enjoyed the AI and Turing-inspired mechanics.

Collapse
 
mudassirworks profile image
Mudassir Khan

the "API calls not blocking the render loop" problem is the one that actually separates AI toys from playable games. requestAnimationFrame is ruthless β€” even a 200ms API call tanks the experience.

curious what you landed on: did you prefetch the next checkpoint's challenge during gameplay, or just fire and hope the Gemini call completes before the player reaches the gate? i'd lean on prefetch but that adds state complexity.

what happens if the API call fails mid run? fallback to static challenges, or does the game halt?

Collapse
 
tahosin profile image
S M Tahosin

Thanks for the question! I sidestepped this problem entirely by design.

I don't use the API to generate challenges mid run. The core gameplay loop runs completely locally using math functions to spawn obstacles, guaranteeing zero network latency and a perfectly smooth render loop.

Instead, the Gemini API is used strictly in a pre run menu called the AI Forge to generate custom characters, maps, or skills.

It uses an async fetch request, so the main thread never blocks and the 3D background keeps rendering smoothly while waiting.

If the call fails, I just catch the error and show a message on the menu. Since active gameplay doesn't rely on the API, no mid run fallback logic is needed.

Keeping AI generation out of the active loop was my exact solution!

Collapse
 
mudassirworks profile image
Mudassir Khan

the pre run separation is the clean version. we usually end up bolting on the async wrapper after discovering the blocking problem in prod β€” you designed it out before it could happen.

the "AI Forge as a menu" pattern is reusable. any feature where the AI result doesn't need to be realtime is a candidate for that preload slot.

does the Forge content persist between sessions, or does each run start fresh?

Thread Thread
 
tahosin profile image
S M Tahosin

The Forge content handles persistence differently based on what is generated. Custom characters, maps, and skills persist between sessions because they are permanently saved in the browser's local storage. However, if the Forge is used to modify game controls or physics, those changes only apply to the current session and will start fresh upon a reload, as they are kept in the game's in memory state.

Collapse
 
tanay_dwivedi9098 profile image
Tanay Dwivedi

Awesome project @tahosin

Collapse
 
tahosin profile image
S M Tahosin

Thanks πŸ™‚

Collapse
 
nube_colectiva_nc profile image
Nube Colectiva

Great project πŸ‘πŸΌ congratulations.

Collapse
 
tahosin profile image
S M Tahosin

Thanks Nube :)

Collapse
 
adrianng profile image
Adrian Ng

Nice AI integration :D

Collapse
 
tahosin profile image
S M Tahosin

Thanks :D

Collapse
 
mansadatta profile image
Mansa Datta

I tested it in my mobile and it feels a little bit laggy when i change controlls from ai forge. I think you will fix it asap

Collapse
 
tahosin profile image
S M Tahosin

I have already fixed it. Thanks for your suggessions.

Collapse
 
ismailhasan profile image
Ismail Hasan

I played your version 1 game few days ago. But Version 2 smooth and far better than version 1. You also changed a lot in design and ai integration. Best wishes for next Version.

Collapse
 
tahosin profile image
S M Tahosin

Thanks. I tried hard for better game experience, And you liked itπŸ™‚