3D Survival Horror Game Design
Prompt
Create a detailed design document and implementation plan for a 3D survival horror video game developed for PC using Three.js and WebGL. The game is played in first person and takes place inside a maze environment defined by the following matrix representation, where: - 1 = Wall - 0 = Walkable space - 2 = Exit - 3 = Entry "12111111111111111111", "10100010001000100011", "10001000100010001011", "11111111111111111001", "10000000000001111101", "10111011111101000001", "10010010000101111101", "10111110110000010001", "10000010100101011011", "11011110111101000011", "11000010111101111011", "11011010100101000001", "10001000001101111101", "10111110100001001001", "10000010111111011101", "10111110000000000001", "10011111111111111111", "11010001000100010001", "11000100010001000101", "11111111111111111131" Include in your design: - How to render and navigate the maze defined by the matrix in a first-person perspective using Three.js and WebGL. - Player mechanics for movement and interactions within the maze. - Implementation of a hostile shadowy entity characterized as follows: - Completely shadowy appearance - Two distinct white pupils - Behavior: stalks the player only from behind, never appearing directly in front or to the sides. Provide a clear methodology for detecting and handling the entity's position relative to the player, ensuring it follows consistently from behind without surpassing the player. Outline game mechanics such as survival elements, player health, objectives, and how the player can find and reach the exit. Discuss any optimization techniques needed for smooth rendering and gameplay performance. # Steps 1. Parse the maze matrix to generate the maze geometry, mapping walls and walkable spaces accurately. 2. Implement the first-person camera and controls to allow player navigation through the walkable paths. 3. Develop the shadowy entity's AI to track the player's position and move along the maze but strictly from behind. 4. Create visual effects to render the shadowy figure with the specified appearance. 5. Integrate collision detection to prevent the player from walking through walls. 6. Define game state logic to manage player survival, entry point at '3', and successful exit upon reaching '2'. 7. Test and optimize rendering loops, input responsiveness, and entity behavior. # Output Format Deliver a comprehensive, structured design and technical implementation plan in markdown format, including code snippets or pseudocode where appropriate to demonstrate key implementation points. # Notes - Assume Three.js and WebGL are the primary libraries used. - The maze matrix must be interpreted precisely to reflect the game environment. - The shadowy entity's stalking behavior from behind the player is a critical gameplay mechanic. - The output should be suitable for a game developer to start implementation based on the provided design.
Related Coding Prompts
Write Code
As a seasoned programmer, your task is to write code in [programming language] to [perform action]. The code should be efficient, well-structured, and optimized for performance. Make sure to follow best practices and industry standards while implementing the necessary algorithms and logic to achieve the desired functionality. Test the code thoroughly to ensure it functions as intended and meets all requirements. Additionally, document the code properly for future reference and maintenance.
Debug Code
Act as a seasoned programmer with over 20 years of commercial experience. Analyze the provided [piece of code] that is causing a specific [error]. Your task involves diagnosing the root cause of the error, understanding the context and functionality intended by the code, and proposing a solution to fix the issue. Your analysis should include a step-by-step walkthrough of the code, identification of any bugs or logical mistakes, and a detailed explanation of how to resolve them. Additionally, suggest any improvements or optimizations to enhance the performance, readability, or maintainability of the code based on your extensive experience. Ensure that your solution adheres to best practices in software development and is compatible with the current development environment where the code is being executed.
Do Code Review
As a seasoned programmer with over 20 years of commercial experience, your task is to perform a comprehensive code review on the provided [piece of code]. Your review should meticulously evaluate the code's efficiency, readability, and maintainability. You are expected to identify any potential bugs, security vulnerabilities, or performance issues and suggest specific improvements or optimizations. Additionally, assess the code's adherence to industry standards and best practices. Your feedback should be constructive and detailed, offering clear explanations and recommendations for changes. Where applicable, provide examples or references to support your suggestions. Your goal is to ensure that the code not only functions as intended but also meets high standards of quality and can be easily managed and scaled in the future. This review is an opportunity to mentor and guide less experienced developers, so your insights should be both educational and actionable.