Skip to content

Abdoul111/openGL_COMP371_PROJECT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

City Simulation Brief report

Hicham Kitaz

Abd Alwahed Haj Omar

Introduction

Imagine a city that breathes and grows as you explore – a digital realm where streets form and buildings rise with each step. Our project harnessed OpenGL's power and procedural generation's magic to create this living cityscape. Walk through, and watch textures shift in response to changing light, adding a touch of realism to the experience. This report dives into the fusion of creativity and technology that birthed this dynamic world, showing the potential of interactive simulations. Welcome to a city that evolves with you.

Demo

Video Overview

image

Roles

Abdelwahed: Redefined procedural generation by crafting an algorithm that uses advanced object-oriented programming and data structures. As you move through the world, a dynamic, entirely randomized environment materializes. This isn't just randomness – it's a harmonious interplay of carefully designed data structures that create a world that's responsive, unique, and alive. With Abdelwahed's innovation, exploration takes on a whole new dimension, where every step reveals a world crafted by algorithms that adapt and evolve with you.

Hicham: he is the driving force behind our project's success, seamlessly blending design finesse with coding expertise. He meticulously enhanced textures, modeled the game world and contributed innovative algorithmic solutions that propelled our project to new heights. Hisham's meticulous testing unearthed and rectified elusive bugs, ensuring a flawless user experience. Beyond technical contributions, his motivational spirit, organizational skills, and insights into refining key functionalities were instrumental in keeping the team inspired and the project on track. Hisham's multidimensional role was indispensable in turning our vision into a reality.

Algorithm

This project went into multiple phases that are described below:

Modelling and texturing: One of the most time-consuming phases, involved crafting the very essence of our virtual world. Our team invested substantial effort in meticulously shaping each element. We paid meticulous attention to detail as we designed and added textures to breathe life into our creation. The cornerstone of our world became the 'square' – a fundamental building block that set the stage for our entire universe. Through careful coding, we constructed functions that rendered these squares and laid the groundwork for scalability. This strategic approach allowed us to seamlessly replicate and call these functions for diverse locations, a critical functionality for generating new squares in subsequent stages.

Lights, shadows, spotlight, camera, key calls: we harnessed these essential elements to craft a captivating virtual world that seamlessly evolves as players explore. Auto-generating the world while walking: Our team devised a clever mechanism within the keyCall function that constantly monitors the player's movements. With each step taken, the function would intelligently check if the player transitioned from one square to another. This pivotal check ensured that we seamlessly triggered the square generation functions for the new location, thereby expanding the world organically.

Making the world evolve randomly: Diversity and unpredictability were at the heart of our approach to crafting an immersive experience. In our quest to create a truly dynamic virtual world, we engineered a system that introduced an element of randomness into each square's identity. Through a sophisticated algorithm, our team ensured that as players ventured from one square to another, they'd encounter varied surroundings. The choice between a towering skyscraper, a cozy shopfront, a serene fountain, or even a bustling soccer field was made randomly. To enhance the sense of uniqueness, textures, colors, and experiences were also randomly assigned, ensuring that no two players encountered the same world. This innovation provided an enriching layer of exploration, keeping players engaged and curious about what the next square might hold. The culmination of our collective efforts in design and coding transformed the virtual landscape into a realm of endless discovery and surprise.

User Interaction:

The journey begins at the heart of the city, enveloped by towering trees, skyscrapers, apartment complexes, and the vibrant ambiance of a simulated football game. An animated fountain graces the surroundings, its waters in perpetual motion. As the player takes their first step, they embark on a captivating exploration of the urban landscape. Strolling through the city streets, the environment unfolds with a touch of randomness. Buildings materialize in real-time, creating a unique experience every time the game is launched. Abdelwahed's innovative approach to randomness adds another layer of dynamism, dynamically assigning textures to buildings, trees, shops, and apartments.

Navigating this digital metropolis is intuitive, guided by a set of responsive keys:

  • W: Move forward
  • A: Move left
  • S: Move backwards
  • D: Move right
  • N: Toggle night mode, illuminating the streets with ambient street lights.
  • M: Activate the flashlight for enhanced visibility.
  • 1: Transition to a top-down view.
  • 2: Revert to the default player perspective.
  • Spacebar: Toggle shadows on/off, modulating the visual atmosphere.
  • Y: Unlock free flight mode, allowing controlled exploration in three dimensions without intersecting buildings.

The core gameplay adheres to the project's cardinal principle: the player's interaction with the urban realm must be grounded in reality. The camera's journey halts upon contact with buildings, preventing the player from seamlessly traversing through solid structures. This design element ensures an immersive experience that aligns with the project's essence, fostering a connection between the player and the cityscape.

Special feature: Horror mode.(active only during night mode). When the player goes too far from the city the lights go out and the player is left without vision, in order to see the player has to turn on the flashlight. In this mode sometimes buildings are allowed to disappear making the player think he is hallucinating. Also, some buildings might appear like they are currently switching to add confusion to the player.

survival mode

Top-down view day

Top-down view night

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published