Welcome to Cod of Duty, our submission to the hackerspace game jam. https://itch.io/jam/hackerspace-gamejam-2025h/entries
Cod of Duty a fish simulator game where you take control of a fish navigating a dynamic underwater ecosystem! This game features realistic boid-based fish behavior, predator-prey dynamics, and a mathematically driven shader for fish animations that brings the underwater world to life.
- Boid System: Fish move in schools using alignment, cohesion, and separation rules.
- Weight Classes: Fish are categorized into weight classes, affecting their interactions:
- Smaller fish fear larger fish.
- Larger fish hunt smaller fish.
- Fish of the same weight class align and school together.
- Player Interaction: The player fish is part of the ecosystem:
- Boids react to the player as either prey or predator based on size.
- The player can eat smaller fish to grow.
- Custom Shader: Fish animations are driven mathematically using sine waves for realistic tail movement.
- Velocity Scaling: The shader dynamically adjusts animation speed based on the fish's movement velocity.
- Metallic and Smoothness Effects: The shader includes Fresnel highlights and metallic reflections for a polished underwater look.
- Boundary System: Fish are confined to a visible underwater box, ensuring they stay within the playable area.
- Growth Mechanics: Fish grow logarithmically as they eat, with a cap on maximum size.
- Predator-Prey Dynamics: Fish interact based on size, creating a natural food chain.
- Clone the repository:
git clone https://github.com/tobiasfremming/Cod-of-duty.git
- Open the project in Unity (tested with Unity version 2023.x or later).
- Ensure all dependencies are installed (e.g., URP for shaders).
-
Control the Player Fish:
- Move around the underwater world.
- Eat smaller fish to grow.
- Avoid larger fish to survive.
-
Interact with the Ecosystem:
- Watch fish school together and react dynamically to predators and prey.
- Explore the underwater boundary box.
-
Enjoy the Visuals:
- Admire the mathematically driven fish animations and metallic shader effects.
Here are some screenshots showcasing the game:
The boid system is implemented in the BoidManager.cs and Boid.cs scripts. It uses:
- Neighbor Detection: Fish detect nearby boids using radii for alignment, cohesion, and separation.
- Predator and Prey Logic: Fish react to others based on weight class and size.
The FishAffineShader.shader is a custom shader that animates fish tails mathematically:
- Sine Wave Animation: Tail movement is calculated using sine waves for smooth, realistic motion.
- Velocity Scaling: The shader dynamically adjusts animation speed based on the fish's velocity, controlled by the
FishShaderController.cs.
Dive into the underwater world of Cod of Duty and experience the life of a fish in a dynamic ecosystem! 🐟


