Session with Gemini 3 Pro

It was really cool session first I implemented the simulation of galaxy in python and then after hitting performance limits rewritten completely with C lang.
The experience of vibe coding with gemini 3 pro was super smooth. I didn’t expect such quality from the model - creating code in C language.
However I had to guide the rewrite, as first version after version was working but was missing most features implemented in python.
the source code for C version https://gist.github.com/pawel-dubiel/dcfef86130dd338a1d0ed4dd2c6ed2ef
Update. At some point I wanted to convert 2d into 3d, after failed attempt said
“The transition plan was effectively “aborted” in favor of stabilizing the feature-rich 2D version as per the user’s implicit priorities”
that wasn’t my priority the Gemini basically got lost. I insisted to continue
Features
-
Infinite Procedural Galaxy:
- Deterministic Generation: The entire galaxy is generated on the fly from coordinates (seeds), ensuring that revisiting a system always yields the exact same configuration. This allows for an effectively infinite universe without storing vast amounts of data.
- Star Existence: Stars appear randomly (with adjustable density) across the galaxy map.
- Galaxy Map Navigation: Pan and zoom across the galactic expanse to discover new star systems.
-
Detailed Star System Generation:
- Realistic Star Physics: Stars are classified (O, B, A, F, G, K, M types) with calculated Mass, Radius, Temperature, Luminosity, and Metallicity (heavy element content).
- Multi-Star Systems: Encounter Single, Binary, or Trinary star systems, with the stars orbiting each other under N-body gravitational physics.
- N-Body Physics Simulation: Planets and stars dynamically interact gravitationally, resulting in realistic orbital mechanics.
- Planet Generation: Planets form based on astrometric principles like the Frost Line, Goldilocks Zone (habitable zone), and Titius-Bode-like spacing.
- Diverse Planet Types: Discover Rocky, Terrestrial (Earth-like), Gas Giant, Ice Giant, Molten, and Icy worlds.
- Advanced Planet Physics: Each planet has calculated Mass, Density, Radius (derived from mass and composition), Surface Temperature, Atmosphere (e.g., N2/O2, H/He, CO2), Gravity, Albedo, Greenhouse Effect, and Tidal Locking status.
- Moons: Planets can host multiple moons, orbiting their parent planet.
- Geological Composition: Planets have detailed resource profiles, showing percentages of elements like Iron, Silicon, Water, Hydrogen, Helium, Gold, and Rare Earths, influenced by star metallicity and planet type.
-
Interactive Visualization (Python Version):
- Textured Planets: Planets are rendered with procedurally generated, circular textures (e.g., banded gas giants, terrestrial continents).
- Animated Orbits & Rotation: Witness planets and moons orbiting and rotating on their axes in real-time, with speeds adjustable by the user.
- Camera Tracking: Double-click on a star or planet to lock the camera onto it, observing its journey through space.
- Detailed Info Panels: Click any star, planet, or moon to view an extensive panel of its physical properties, including its geological resource breakdown.
- System Scanner: Hover over a star in the galaxy map to get a quick summary scan (number of planets, habitable worlds, major resources) before entering.
- Civilization Simulation: Two AI species (Terrans, Xenos) procedurally expand, sending colony ships to nearby habitable systems, visualizing galactic conquest.
- Session Persistence: Visited systems (with their current state, including planet positions) are cached for seamless revisits.
- Debug Mode: Optional overlay showing FPS, memory usage, and cache statistics.
-
C Implementation (cland):
- A high-performance, native C version replicating the core generation and N-body physics.
- Features deterministic generation, detailed planet types, N-body orbital mechanics for stars and planets, interactive controls, and info display.
- Utilizes SDL2 for efficient graphics.
- Currently Lacking: Advanced textures, Civilization Engine, Debug Mode (though core mechanics are there).