Data Structures Lab Project: Crystal Quest
Data Structures Lab Project: Crystal Quest
The tasks required include implementing an AVL tree to manage the player's inventory of item scores, implementing Floyd's algorithm to calculate the shortest path between areas in the forest, implementing Prim's and Kruskal's algorithms to find the minimum spanning tree, and implementing Dijkstra's algorithm to find the shortest path from the player's current location to the crystal. Each algorithm must account for the presence of enemies and obstacles .
Dijkstra's algorithm is significant in finding the shortest path from the player's current location to the crystal. The game map handles obstacles by assigning them a weight of 100 to penalize paths passing through them, whereas other paths have a weight of 1. This weighting mechanism ensures the algorithm prefers clearer paths over obstacles. Enemy locations also need to be considered to avoid loss of inventory items, thus influencing path selection strategically .
Losing specific inventory items affects the gameplay score by decrementing the collected rewards, aligning with defeated enemies—Werewolves, Goblins, and Dragons reduce weapons, potions, and jewels respectively. This impacts strategy, making players cautious about enemy nodes and potentially dictating path choices to guard valuable inventory or necessitate item replenishment before critical encounters, thereby influencing overall gameplay dynamics and final scores .
Custom implementation is important as it enforces an understanding of the underlying algorithm mechanics, allowing tailored optimization and specific adaptations for the problem context, such as handling obstacles and varying path weights in the game map. Pre-built libraries may not provide the needed flexibility or insight into performance adjustments necessary for specialized game constraints, thereby diminishing learning opportunities and problem-solving skills .
The project requires submission as a single .zip file through the specified Google Form by the deadline. Emails or submissions past the deadline will not be considered. Group members must ensure the inclusion of mandatory elements in their submission and address potential internet issues by starting early. Proper naming conventions for the .zip file, adherence to guidelines, and a full ‘Clean Solution’ execution before the final packaging are also critical. These measures ensure the submission is complete and eligible for evaluation .
Prim's and Kruskal's algorithms should be implemented by evaluating paths that consider the weight attributed to obstacle locations and integrate enemy presence impacts. Prim's algorithm, which grows the minimum spanning tree using edge weights, requires careful selection of initial points to minimize traversal cost. Kruskal's algorithm necessitates a sort of all edges initially, requiring efficient handling of obstacles to avoid costly paths, thus minimizing total weight while encapsulating essential game pathways .
The project is subject to a strict plagiarism policy where any substantive section found plagiarized results in a -100% mark penalty. A code is considered plagiarized if over 20% is not original. Students are advised to start work early to prevent rush-induced plagiarism and ensure their work is original and compliant with academic integrity requirements. Effective collaboration within the group can also mitigate plagiarism risks .
The AVL tree is utilized to store and manage the player's inventory of item scores efficiently. It facilitates the operations of adding and removing items based on their reward scores. Each node in the AVL tree, beyond the root, is inserted based on the randomly generated id values. This ensures balanced and optimal search, insertion, and deletion operations, which is critical for maintaining a dynamic inventory during gameplay .
Different node types influence game strategy by affecting player movement and score. Safe paths allow unrestricted movement. Obstacles have high traversal costs, encouraging strategic detours. Rewards increase scores when collected but can be lost upon encountering specific enemies. Different enemies cause the loss of associated rewards (jewels, weapons, potions), affecting scores and future combats. Death points require complete avoidance to prevent game restarts. The understanding and integration of these node types are essential to optimizing paths and maximizing inventory and score .
The random id generation affects the AVL tree structure by diversifying insertion points, leading to balanced trees that optimize search efficiency critically required for real-time inventory management. This randomness encourages a balanced workload and prevents severe node clustering, enhancing performance by distributing node loads uniformly, which is important in maintaining the efficiency of dynamic insertion and deletion operations during gameplay .