Difference between revisions of "10th Floor"
(→Game Name Goes here) |
(→Ryan Wang) |
||
(66 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | {{GAM666/DPS901 Index | 20103}} | + | [[Image:filename|thumb|widthpx| ]]{{GAM666/DPS901 Index | 20103}} |
= 10th Floor Maze = | = 10th Floor Maze = | ||
== Project Marking Percentage == | == Project Marking Percentage == | ||
Line 20: | Line 20: | ||
== Team Members == | == Team Members == | ||
# [mailto:rmwang@learn.senecac.on.ca?sujbect=GAM666/DPS901 Ryan Wang], Responsibility: Stage creation, textures, collision detection agains stage objects, loading map files. | # [mailto:rmwang@learn.senecac.on.ca?sujbect=GAM666/DPS901 Ryan Wang], Responsibility: Stage creation, textures, collision detection agains stage objects, loading map files. | ||
− | # [mailto:avathsalan@learn.senecac.on.ca?sujbect=GAM666 Aravinthan Vathsalan], | + | # [mailto:avathsalan@learn.senecac.on.ca?sujbect=GAM666 Aravinthan Vathsalan], Traps, collision detection against traps, update character stats in respond to traps (HUD), health bonus |
− | # [mailto:gmok@learn.senecac.on.ca?sujbect=GAM666 Geoffrey Mok], Responsibility | + | # [mailto:gmok@learn.senecac.on.ca?sujbect=GAM666 Geoffrey Mok], Responsibility: HUD(Progress bars, 2D sprite animations), Environment fog, Animated billboards |
# [mailto:scborges@learn.senecac.on.ca?subject=gam666 Steve Borges], Responsibility TBA | # [mailto:scborges@learn.senecac.on.ca?subject=gam666 Steve Borges], Responsibility TBA | ||
# [mailto:caangus@learn.senecac.on.ca?subjectgame666 Corey Angus], Responsibility TBA | # [mailto:caangus@learn.senecac.on.ca?subjectgame666 Corey Angus], Responsibility TBA | ||
Line 42: | Line 42: | ||
As the character progresses through the dungeon, the enemies and traps get increasingly stronger and complicated. | As the character progresses through the dungeon, the enemies and traps get increasingly stronger and complicated. | ||
− | = | + | = Iteration 1 = |
− | + | '''Assignment 2 Requirements''' | |
− | + | 1.draw a map of what you'd like the 3D world of your game to look like, with 3-dimensional coordinates of all of the major points in the world. Your map should include all of the "actors" (moving objects) in the world. You should attempt to make the coordinates as realistic as possible, being aware that you may need to scale them up or down as you implement your design in code. | |
− | == | + | |
− | + | 2.design and code one or more original objects of your own chosen shape for use in your game. You may derive the class(es) for your object(s) from the Object class of the framework. | |
− | + | ||
− | + | 3.implement a draft of your design by coding the framework's design component. If your design requires low-level coding or modifications to any other part of the framework, you should include those changes in your submission. | |
− | + | ||
− | + | == Revised Game Proposal == | |
− | + | ||
− | + | [[File:SampleGamePlay.jpg|400px]] | |
− | + | === Revised Proposal === | |
− | == | + | ==== Game Genre ==== |
− | + | Phase 1: First person maze puzzle | |
+ | |||
+ | Phase 2: Action role-playing game | ||
+ | |||
+ | === How to play - Stage clear conditions === | ||
+ | <ul> | ||
+ | <li>Sprint mode: Move the character with arrow keys through the maze and try to find the way out. </li> | ||
+ | <li>Time attack mode: Find the exit within given time.</li> | ||
+ | </ul> | ||
+ | ==== Game Items ==== | ||
+ | <ul> | ||
+ | <li>Haste item: Increases character's movement speed by 150% for 10 seconds. (Key 1)</li> | ||
+ | <li>Dexterity item: Allows player to pass through the obstacles more quickly for 10 seconds. (Key 2)</li> | ||
+ | <li>Revert ceiling collapse: Makes the collapsed ceiling tiles rise back up into initial position for 20 seconds. (Key 3)</li> | ||
+ | <li>Stop ceiling collapse: Stops ceiling collapse for 20 seconds. (Key 4)</li> | ||
+ | </ul> | ||
+ | |||
+ | ==== Current Status ==== | ||
+ | <ul> | ||
+ | <li>HUD</li> | ||
+ | <li><del>Map file loader</del></li> | ||
+ | <li>Main character <del>keyboard control</del>, <del>mouse control</del> & game pad control</li> | ||
+ | <li><del>Sound effects</del></li> | ||
+ | <li>Traps, items, enemy characters (next phase)</li> | ||
+ | <li>Collision detection against <del>map components</del>, enemy characters, traps, <del>obstacles</del> & items</li> | ||
+ | </ul> | ||
+ | |||
+ | == Map of the World of the Game == | ||
+ | |||
+ | === Dynamic Map Configuration === | ||
+ | ==== Overview ==== | ||
+ | The game is designed to load map information from map files and dynamically generate game environment and components accordingly. Map configuration is flexible in size and configuration and can be easily modified. As shown in the picture below, tile type is described in numbers and details are as follows: | ||
+ | <ul> | ||
+ | <li>Tile type 0, 4, 8... (4n): No wall.</li> | ||
+ | <li>Tile type 1, 5, 9... (4n+1): In the x-axis direction.</li> | ||
+ | <li>Tile type 2, 6, 10...(4n+2): In the z-axis direction.</li> | ||
+ | <li>Tile type 3, 7, 11...(4n+3): In the both directions</li> | ||
+ | </ul> | ||
+ | Syntax for the map file is as below, where 't' is tile type code and 'i' is item type code: | ||
+ | t,i|t,i|...|t,i|t,i; | ||
+ | t,i|t,i|...|t,i|t,i; | ||
+ | ... | ||
+ | t,i|t,i|...|t,i|t,i; | ||
+ | t,i|t,i|...|t,i|t,i | ||
+ | |||
+ | [[File:DynamicMapSystem2.jpg|810px]] | ||
+ | ==== Sample map file ==== | ||
+ | Below is a sample map configuration file that generates 5 X 9 stage. The image above is drawn based on this map configuration. | ||
+ | 1,0|1,0|3,0|9,9|2,0; | ||
+ | 1,0|3,0|3,0|2,3|2,0; | ||
+ | 2,0|2,2|3,0|2,2|2,0; | ||
+ | 3,0|2,0|1,2|2,0|2,0; | ||
+ | 0,0|2,0|2,0|1,0|3,0; | ||
+ | 1,0|2,0|2,4|3,0|0,0; | ||
+ | 1,0|1,0|2,0|3,5|1,0; | ||
+ | 2,0|1,0|2,0|1,0|2,0; | ||
+ | 0,1|3,0|3,0|3,0|3,0 | ||
+ | |||
+ | === Collision Detection Against Walls === | ||
+ | |||
+ | [[File:CollisionDetectionAgainstWalls.jpg|800px]] | ||
+ | Collision detection with the map structure is simplified by the use of simple int array that holds the tile type data. Considering the fact that the total number of Box objects created easily exceeds 1000 (when loading a 20 by 20 map), we thought it will be more efficient to compare the integer tile type codes than actually comparing floating point coordinates. To add more efficiency, as described in the image above, update() module selectively retrieves only the necessary tile data from the tile array and determines whether the character can proceed or not. | ||
+ | |||
+ | === Interactive Game Environment === | ||
+ | [[File:InteractiveGameEnv.jpg|400px]] | ||
+ | In the game, surrounding stage objects react to the player's motion. For example, ceiling tiles collapse as the player moves around. | ||
+ | |||
+ | == Traps == | ||
+ | |||
+ | === Trap Component of Map File === | ||
+ | The map file has a format of (''tl'', ''tr'') where ''tl'' represents the tile type, and ''tr'' represents whether there is a trap or another game item for that specific tile. | ||
+ | If the tile is to have no traps on it then place a 0 value for the ''tr'' component; otherwise place a value of 5 to indicate that there is a trap (note that this is simply an indicator for the map file that there is a trap associated to this tile but the full specifications for the this trap are located in the trap file that is independent to this map file). | ||
+ | |||
+ | The order of the trap indicators in the map file must correspond to the order of the traps in the trap file, i.e. must have a one-to-one relation (although a tile may have multiple tiles if the '''order''' used for an entry in the trap file starts with 'n' for the first trap, and uses 'r' for each subsequent trap for that tile resulting in multiple traps for a single tile). | ||
+ | |||
+ | e.g. The first two entries in the map file is associated to the following traps in the trap file (notice the values of 5 for the trap specifier in the map file): | ||
+ | |||
+ | <u>Map File</u>: | ||
+ | |||
+ | 1,0|1,0|1,0|1,5|1,0|1,0|1,0|1,0|1,0|1,0|1,0|1,0|1,0|1,0|1,0|1,0|1,0|1,0|10,9|3,0; | ||
+ | 2,5|2,0|0,5|0,0|0,0|1,0|1,5|0,5|0,0|0,0|2,0|1,0|1,0|1,0|0,0|0,0|1,0|0,0|2,0|2,0; | ||
+ | |||
+ | <u>Trap File</u>: | ||
+ | |||
+ | //Note: "ROW=?,COL=?" comments refer to the row and column entry in the map file, for quick; | ||
+ | //user testing (i.e. has no significance in trap map parsing code); | ||
+ | //; | ||
+ | /ROW=1,COL=4; | ||
+ | 20|n|2|0.45,0.4,0.1|0,0,0.15|-0.10|3.1,0,0|0,1,0|-0.5,4.5,0,0,0,0; | ||
+ | //ROW=2,COL=1; | ||
+ | 10|n|1|0.9,0.1,0.02|0,0,0|-0.05|15; | ||
+ | //ROW=2,COL=3; | ||
+ | 10|n|2|0.9,0.1,0.02|0,0,0|-0.05|15; | ||
+ | 10|r|4|0.9,0.1,0.02|0,0,0|-0.05|15; | ||
+ | //ROW=2,COL=7; | ||
+ | 10|n|2|0.9,0.1,0.02|0,0,0|-0.04|15; | ||
+ | 10|r|4|0.9,0.1,0.02|0,0,0|-0.04|15; | ||
+ | 10|r|3|0.9,0.1,0.02|0,0,0|-0.04|15; | ||
+ | 10|r|7|0.9,0.1,0.025|0,0,0|-0.02|25; | ||
+ | 10|r|8|0.9,0.1,0.025|0,0,0|-0.02|25; | ||
+ | //ROW=2,COL=8; | ||
+ | 20|n|1|0.7,0.35,0.15|0,-0.25,0|-0.15|1,0,0|1,0,0|-1.5,0.25,0,0,0,0; | ||
+ | 10|r|2|0.9,0.1,0.02|0,0,0|-0.05|15; | ||
+ | 10|r|4|0.9,0.1,0.02|0,0,0|-0.05|15; | ||
+ | |||
+ | === Line Entry Format of Trap File === | ||
+ | |||
+ | <h2>Floor Spike</h2> | ||
+ | <u>Format</u>: '''trapType|order|trapSubType|px,py,pz|posx,posy,posz|pctDamage|noSpikes;''' | ||
+ | |||
+ | '''trapType''' = 10 (for floor spike trap) | ||
+ | |||
+ | '''order''' = either 'n' or 'r' meaning 'n' is for a new tile or 'r' for the same tile creating multiple traps | ||
+ | |||
+ | '''trapSubType''' = 1-8 (depends) | ||
+ | 1 - ''faraway edge x-axis'' | ||
+ | 2 - ''close edge x-axis'' | ||
+ | 3 - ''edge left z-axis'' | ||
+ | 4 - ''edge right z-axis'' | ||
+ | 5 - ''middle x-axis'' | ||
+ | 6 - ''middle z-axis'' | ||
+ | 7 - ''diagonal from faraway left to close right'' | ||
+ | 8 - ''diagonal from faraway right to close left'' | ||
+ | |||
+ | '''px,py,pz''' = percentage of the trap's size with relation to a single tile size | ||
+ | |||
+ | '''posx, posy, posz''' = the percentage of translation to perform on the trap from the origin of the tile (percentage is with relation to a single tile size for x and z axis, while for y axis is relative to the stage height) | ||
+ | |||
+ | '''pctDamage''' = (represents percentage of players health that will be either decreased or increased upon collision); > 0 means ''health bonus'', < 0 means ''health loss'' | ||
+ | |||
+ | '''noSpikes''' = number of spikes | ||
+ | |||
+ | e.g. | ||
+ | 10|n|5|0.9,0.1,0.1|0,-0.25,0|-0.20|10; | ||
+ | |||
+ | <h2>Projectile</h2> | ||
+ | <u>Note:</u> by default is centered in all axis at origin of the tile's dimensions | ||
+ | |||
+ | <u>Format</u>: '''trapType|order|trapSubType|px,py,pz|posx,posy,posz|pctDamage|mvx,mvy,mvz|rx,ry|rz|pminx,pmax,pimy,pmaxy,pminz,pmaxz;''' | ||
+ | |||
+ | '''trapType''' = 20 (for projectile trap) | ||
+ | |||
+ | '''order''' = either 'n' or 'r' meaning 'n' is for a new tile or 'r' for the same tile creating multiple traps | ||
+ | |||
+ | '''trapSubType''' = 1-6 (depends) | ||
+ | 1 = DOUBLE_EDGE_SPEAR | ||
+ | 2 = CROSS | ||
+ | 3 = STAR | ||
+ | 4 = DIAGONAL_LTR | ||
+ | 5 = DIAGONAL_RTL | ||
+ | 6 = PIECE_WISE | ||
+ | |||
+ | '''px,py,pz''' = percentage of the trap's size with relation to a single tile size | ||
+ | |||
+ | '''posx, posy, posz''' = the percentage of translation to perform on the trap from the origin of the tile (percentage is with relation to a single tile size for x and z axis, while for y axis is relative to the stage height) | ||
+ | |||
+ | '''pctDamage''' = (represents percentage of players health that will be either decreased or increased upon collision); > 0 means ''health bonus'', < 0 means ''health loss'' | ||
+ | |||
+ | '''mvx,mvy,mvz''' = percentage for the trap's constant movement with relation to the game's traps forward speed (i.e. how fast to move for constant movement on the trap) | ||
+ | |||
+ | '''rx,ry,rz''' = percentage for the trap's constant rotation with relation to the game's traps rotation speed (i.e. how fast to rotate for constant movement on the trap) | ||
+ | |||
+ | '''pminx,pmax,pimy,pmaxy,pminz,pmaxz''' = the amount of movement with relation to a single tiles size. Note that this is relative to the orientation of the tile. | ||
+ | For example, if you want to move a trap along the x-axis from current origin of the trap | ||
+ | to the left of current tile and right of the current tile back and forth, then would do: | ||
+ | -0.5,0.5,0,0,0,0 | ||
+ | |||
+ | <u>e.g.</u> creates a star projectile with dimensions of 10% of the tile in all directions, and moving | ||
+ | to the left edge and right edge of the tile (with only rotation in y axis and moving at the | ||
+ | speed defined by default) with health loss of 30% upon collision with player: | ||
+ | ''20|n|3|0.1,0.1,0.1|0,-0.25,0|-0.3|1,0,0|0,1,0|-0.5,0.5,0,0,0,0;'' | ||
+ | |||
+ | <h2>Atom</h2> | ||
+ | <u>Note:</u> by default is centered in all axis at origin of the tile's dimensions | ||
+ | |||
+ | <u>Format</u>: '''trapType|order|trapSubType|px,py,pz|posx,posy,posz|pctDamage;''' | ||
+ | |||
+ | '''trapType''' = 30 (for atom trap) | ||
+ | |||
+ | '''order''' = either 'n' or 'r' meaning n is for a new tile or r for the same tile creating multiple traps | ||
+ | |||
+ | trapSubType = 1-6 (depends) <u>Note</u>: this sub type for the embedded projectile for the Atom | ||
+ | 1 = DOUBLE_EDGE_SPEAR | ||
+ | 2 = CROSS | ||
+ | 3 = STAR | ||
+ | 4 = DIAGONAL_LTR | ||
+ | 5 = DIAGONAL_RTL | ||
+ | 6 = PIECE_WISE | ||
+ | |||
+ | '''px,py,pz''' = percentage of the trap's size with relation to a single tile size | ||
+ | |||
+ | '''posx, posy, posz''' = the percentage of translation to perform on the trap from the origin of the tile (percentage is with relation to a single tile size for x and z axis, while for y axis is relative to the stage height) | ||
+ | |||
+ | '''pctDamage''' = (represents percentage of players health that will be either decreased or increased upon collision); > 0 means ''health bonus'', < 0 means ''health loss'' | ||
+ | |||
+ | <u>e.g.</u> | ||
+ | ''30|n|3|0.3,0.3,0.15|0,-0.25,0|0.35;'' | ||
+ | |||
+ | == Project Status & Documentation == | ||
+ | |||
+ | === Modifications to the framework === | ||
+ | |||
+ | |||
+ | === Progress / Updates === | ||
+ | ==== Aravinthan Vathsalan ==== | ||
+ | '''Responsibility: ''' Traps, collision detection against traps, update character stats in respond to traps (HUD), health bonus | ||
+ | |||
+ | <ul> | ||
+ | <li>November 22: Modified Object to include new graphic primitive of Pyramid</li> | ||
+ | <li>November 23: Added graphic primitive FloorSpike and implemented components specific to collision detection</li> | ||
+ | <li>November 23: Added graphic primitive Projectile and implemented components specific to collision detection</li> | ||
+ | <li>Added Atom and implemented specific to collision detection</li> | ||
+ | <li>Implemented trap file parser to create traps from specifications of a text file</li> | ||
+ | <li>Integrated map file with logic for placing a trap(s) for a specific tile</li> | ||
+ | <li>Creates traps for a specific tile in the map file and the specifications for the traps from the trap file</li> | ||
+ | <li>Added updated map file with indicators for trap(s) for a specific tile and the specifications of the traps in the associated trap file</li> | ||
+ | <li>Updated player object to have health attribute and updates the health with respect to collision (damage from traps)</li> | ||
+ | <li>Added health bar, health display, and number of restarts (i.e. deaths) to the HUD component</li> | ||
+ | <li>Moves the player back to the starting position when player loses all health and increments number of restarts(resets health and translate the player back to start position)</li> | ||
+ | <li>One time items such as health bonuses (represented as an Atom object with a positive "damage" to health) are destroyed when player collides with it for the first time (does not do so if the player is at max health)</li> | ||
+ | |||
+ | </ul> | ||
+ | |||
+ | ==== Corey Angus ==== | ||
+ | '''Responsibility: ''' Enemy AI - To Be Confirmed | ||
+ | |||
+ | ==== Geoffrey Mok ==== | ||
+ | '''Responsibility: ''' HUD(Progress bars, 2D sprite animations), Environment fog, Animated billboards | ||
− | |||
− | |||
<ul> | <ul> | ||
− | <li> | + | <li>November 14: Modified HUD to display multiple textures</li> |
− | <li> | + | <li>November 16: Added iHUDTexture interface, HUD can now display progress bars</li> |
− | <li> | + | <li>November 19: Added background image for progress bar, implemented progress bar for item duration</li> |
− | <li> | + | <li>November 21: Added basic environment fog</li> |
− | <li> | + | <li>November 23: Added 2D animated sprite functionality to HUDTexture</li> |
− | <li> | + | <li>November 28: Added iEnvironment for more dynamic fog manipulation</li> |
− | <li> | + | <li>December 02: Implementation of billboarding (2D sprite in 3d world, always faces the player)</li> |
+ | <li>December 07: Implementation of animated billboards)</li> | ||
</ul> | </ul> | ||
+ | |||
+ | ==== Ryan Wang ==== | ||
+ | '''Responsibility: ''' Stage/levels design | ||
+ | <ul> | ||
+ | [[File:TenthCeilingCollapse.jpg|200px|thumbnail|right|Fig.R1. Ceiling collapse effect]] | ||
+ | [[File:TenthUserDialog.jpg|200px|thumbnail|right|Fig.R2. Dialog Box UI Design]] | ||
+ | |||
+ | <li>October 11: Prepared texture images for the stage components. Created walls, ceilings and floor tiles.</li> | ||
+ | <li>October 31: Added the code that dynamically creates stage components according to the maze matrix.</li> | ||
+ | <li>November 2: Added codes (on the Camera.cpp) for camera movements and keyboard/mouse controls. Implemented simple collision detection against the walls. Added breathing/fainting/walking effects.</li> | ||
+ | <li>November 10: Main character object is created. Character movement is handled in the Design.cpp instead of Camera.cpp. Collision against walls is also handled in the Design.cpp.</li> | ||
+ | <li>November 11: Map is initialized based on the configuration in the map file. Added obstacles. Ceiling tiles collapse as the player travels around. Added sound effects. (Fig.R1)</li> | ||
+ | <li>November 13: Game items are added - Haste item, dexterity item, stop/revert collapse items. Try keys 1-4.</li> | ||
+ | <li>November 14: Added background image in the dialog box. (Fig.R2)</li> | ||
+ | </ul> | ||
+ | |||
+ | ==== Steve Borges ==== | ||
+ | '''Responsibility: ''' Audio |
Latest revision as of 10:36, 28 March 2011
GAM666/DPS901 | Weekly Schedule | Student List | Project Requirements | Teams and their Projects | Student Resources
Contents
10th Floor Maze
Project Marking Percentage
Group work: 50% (25 <= xx <= 50) Individual work: 50% + (50 <= xx <= 75) ------------------------- Total 100%
Repository
Repo path
svn://zenit.senecac.on.ca/dps901_103rep10
Trunk Status
committed by avathsalan / being committed by [NAME]
Team Members
- Ryan Wang, Responsibility: Stage creation, textures, collision detection agains stage objects, loading map files.
- Aravinthan Vathsalan, Traps, collision detection against traps, update character stats in respond to traps (HUD), health bonus
- Geoffrey Mok, Responsibility: HUD(Progress bars, 2D sprite animations), Environment fog, Animated billboards
- Steve Borges, Responsibility TBA
- Corey Angus, Responsibility TBA
Proposal
The proposed game for the GAM666 project is an action role-playing game (action RPG). The game is played in the first person perspective in which the goal of the game is to move the main character through an old, abandoned, and decaying dungeon while fighting/avoiding the monsters and traps in order to reach the end of the dungeon.
The objects in this game are: the main character (human controlled; move and battle through the dungeon), enemies (in the form of monsters), and traps (either hidden or visible traps, such as a suspicious panel on the floor, floor spikes, collisions, etc.). The environment is open such that the player has the choice of avoiding an enemy, choosing to battle an enemy, and avoiding traps.
The main character and the enemies have the following traits of: health (the life of the character/enemy and the amount of damage that can be inflicted before being defeated), speed (the pace at which movement through the dungeon occurs), strength (the ability to do a set amount of damage to an opponent during battle), and defence (ability to endure attacks from an opponent with reduced impact on health while blocking).
Moreover, the battle system is such that the main character as well as the enemies can be in only one of two states at a given moment during a battle: block or attack. Blocking, although does not prevent the damage from an attack, allows either the main character or the enemy, to have a less impact on health. However, in order to dissuade the main character from continuously blocking, there is a “block meter” that is used to show for how long the character can block before it is temporarily disabled (note that this interval for blocking can be increased with added levels and improvement to the defence trait by gaining experience; read more below).
Once an enemy is defeated in battle, the main character gains Experience Points (EXP) which can be added to the character’s current level and allow for the character to proceed to the next level. With each new level gained, the character can improve one of the traits of: health, speed, strength, and defence (choice is up to the user).
Movement of the main character is performed using the WASD keyboard keys for moving the character forward or backward, and in association with the mouse to view the character’s surroundings (i.e. look around).
As the character progresses through the dungeon, the enemies and traps get increasingly stronger and complicated.
Iteration 1
Assignment 2 Requirements
1.draw a map of what you'd like the 3D world of your game to look like, with 3-dimensional coordinates of all of the major points in the world. Your map should include all of the "actors" (moving objects) in the world. You should attempt to make the coordinates as realistic as possible, being aware that you may need to scale them up or down as you implement your design in code.
2.design and code one or more original objects of your own chosen shape for use in your game. You may derive the class(es) for your object(s) from the Object class of the framework.
3.implement a draft of your design by coding the framework's design component. If your design requires low-level coding or modifications to any other part of the framework, you should include those changes in your submission.
Revised Game Proposal
Revised Proposal
Game Genre
Phase 1: First person maze puzzle
Phase 2: Action role-playing game
How to play - Stage clear conditions
- Sprint mode: Move the character with arrow keys through the maze and try to find the way out.
- Time attack mode: Find the exit within given time.
Game Items
- Haste item: Increases character's movement speed by 150% for 10 seconds. (Key 1)
- Dexterity item: Allows player to pass through the obstacles more quickly for 10 seconds. (Key 2)
- Revert ceiling collapse: Makes the collapsed ceiling tiles rise back up into initial position for 20 seconds. (Key 3)
- Stop ceiling collapse: Stops ceiling collapse for 20 seconds. (Key 4)
Current Status
- HUD
Map file loader- Main character
keyboard control,mouse control& game pad control Sound effects- Traps, items, enemy characters (next phase)
- Collision detection against
map components, enemy characters, traps,obstacles& items
Map of the World of the Game
Dynamic Map Configuration
Overview
The game is designed to load map information from map files and dynamically generate game environment and components accordingly. Map configuration is flexible in size and configuration and can be easily modified. As shown in the picture below, tile type is described in numbers and details are as follows:
- Tile type 0, 4, 8... (4n): No wall.
- Tile type 1, 5, 9... (4n+1): In the x-axis direction.
- Tile type 2, 6, 10...(4n+2): In the z-axis direction.
- Tile type 3, 7, 11...(4n+3): In the both directions
Syntax for the map file is as below, where 't' is tile type code and 'i' is item type code:
t,i|t,i|...|t,i|t,i; t,i|t,i|...|t,i|t,i; ... t,i|t,i|...|t,i|t,i; t,i|t,i|...|t,i|t,i
Sample map file
Below is a sample map configuration file that generates 5 X 9 stage. The image above is drawn based on this map configuration.
1,0|1,0|3,0|9,9|2,0; 1,0|3,0|3,0|2,3|2,0; 2,0|2,2|3,0|2,2|2,0; 3,0|2,0|1,2|2,0|2,0; 0,0|2,0|2,0|1,0|3,0; 1,0|2,0|2,4|3,0|0,0; 1,0|1,0|2,0|3,5|1,0; 2,0|1,0|2,0|1,0|2,0; 0,1|3,0|3,0|3,0|3,0
Collision Detection Against Walls
Collision detection with the map structure is simplified by the use of simple int array that holds the tile type data. Considering the fact that the total number of Box objects created easily exceeds 1000 (when loading a 20 by 20 map), we thought it will be more efficient to compare the integer tile type codes than actually comparing floating point coordinates. To add more efficiency, as described in the image above, update() module selectively retrieves only the necessary tile data from the tile array and determines whether the character can proceed or not.
Interactive Game Environment
In the game, surrounding stage objects react to the player's motion. For example, ceiling tiles collapse as the player moves around.
Traps
Trap Component of Map File
The map file has a format of (tl, tr) where tl represents the tile type, and tr represents whether there is a trap or another game item for that specific tile. If the tile is to have no traps on it then place a 0 value for the tr component; otherwise place a value of 5 to indicate that there is a trap (note that this is simply an indicator for the map file that there is a trap associated to this tile but the full specifications for the this trap are located in the trap file that is independent to this map file).
The order of the trap indicators in the map file must correspond to the order of the traps in the trap file, i.e. must have a one-to-one relation (although a tile may have multiple tiles if the order used for an entry in the trap file starts with 'n' for the first trap, and uses 'r' for each subsequent trap for that tile resulting in multiple traps for a single tile).
e.g. The first two entries in the map file is associated to the following traps in the trap file (notice the values of 5 for the trap specifier in the map file):
Map File:
1,0|1,0|1,0|1,5|1,0|1,0|1,0|1,0|1,0|1,0|1,0|1,0|1,0|1,0|1,0|1,0|1,0|1,0|10,9|3,0; 2,5|2,0|0,5|0,0|0,0|1,0|1,5|0,5|0,0|0,0|2,0|1,0|1,0|1,0|0,0|0,0|1,0|0,0|2,0|2,0;
Trap File:
//Note: "ROW=?,COL=?" comments refer to the row and column entry in the map file, for quick; //user testing (i.e. has no significance in trap map parsing code); //; /ROW=1,COL=4; 20|n|2|0.45,0.4,0.1|0,0,0.15|-0.10|3.1,0,0|0,1,0|-0.5,4.5,0,0,0,0; //ROW=2,COL=1; 10|n|1|0.9,0.1,0.02|0,0,0|-0.05|15; //ROW=2,COL=3; 10|n|2|0.9,0.1,0.02|0,0,0|-0.05|15; 10|r|4|0.9,0.1,0.02|0,0,0|-0.05|15; //ROW=2,COL=7; 10|n|2|0.9,0.1,0.02|0,0,0|-0.04|15; 10|r|4|0.9,0.1,0.02|0,0,0|-0.04|15; 10|r|3|0.9,0.1,0.02|0,0,0|-0.04|15; 10|r|7|0.9,0.1,0.025|0,0,0|-0.02|25; 10|r|8|0.9,0.1,0.025|0,0,0|-0.02|25; //ROW=2,COL=8; 20|n|1|0.7,0.35,0.15|0,-0.25,0|-0.15|1,0,0|1,0,0|-1.5,0.25,0,0,0,0; 10|r|2|0.9,0.1,0.02|0,0,0|-0.05|15; 10|r|4|0.9,0.1,0.02|0,0,0|-0.05|15;
Line Entry Format of Trap File
Floor Spike
Format: trapType|order|trapSubType|px,py,pz|posx,posy,posz|pctDamage|noSpikes;
trapType = 10 (for floor spike trap)
order = either 'n' or 'r' meaning 'n' is for a new tile or 'r' for the same tile creating multiple traps
trapSubType = 1-8 (depends)
1 - faraway edge x-axis 2 - close edge x-axis 3 - edge left z-axis 4 - edge right z-axis 5 - middle x-axis 6 - middle z-axis 7 - diagonal from faraway left to close right 8 - diagonal from faraway right to close left
px,py,pz = percentage of the trap's size with relation to a single tile size
posx, posy, posz = the percentage of translation to perform on the trap from the origin of the tile (percentage is with relation to a single tile size for x and z axis, while for y axis is relative to the stage height)
pctDamage = (represents percentage of players health that will be either decreased or increased upon collision); > 0 means health bonus, < 0 means health loss
noSpikes = number of spikes
e.g. 10|n|5|0.9,0.1,0.1|0,-0.25,0|-0.20|10;
Projectile
Note: by default is centered in all axis at origin of the tile's dimensions
Format: trapType|order|trapSubType|px,py,pz|posx,posy,posz|pctDamage|mvx,mvy,mvz|rx,ry|rz|pminx,pmax,pimy,pmaxy,pminz,pmaxz;
trapType = 20 (for projectile trap)
order = either 'n' or 'r' meaning 'n' is for a new tile or 'r' for the same tile creating multiple traps
trapSubType = 1-6 (depends)
1 = DOUBLE_EDGE_SPEAR 2 = CROSS 3 = STAR 4 = DIAGONAL_LTR 5 = DIAGONAL_RTL 6 = PIECE_WISE
px,py,pz = percentage of the trap's size with relation to a single tile size
posx, posy, posz = the percentage of translation to perform on the trap from the origin of the tile (percentage is with relation to a single tile size for x and z axis, while for y axis is relative to the stage height)
pctDamage = (represents percentage of players health that will be either decreased or increased upon collision); > 0 means health bonus, < 0 means health loss
mvx,mvy,mvz = percentage for the trap's constant movement with relation to the game's traps forward speed (i.e. how fast to move for constant movement on the trap)
rx,ry,rz = percentage for the trap's constant rotation with relation to the game's traps rotation speed (i.e. how fast to rotate for constant movement on the trap)
pminx,pmax,pimy,pmaxy,pminz,pmaxz = the amount of movement with relation to a single tiles size. Note that this is relative to the orientation of the tile.
For example, if you want to move a trap along the x-axis from current origin of the trap to the left of current tile and right of the current tile back and forth, then would do: -0.5,0.5,0,0,0,0
e.g. creates a star projectile with dimensions of 10% of the tile in all directions, and moving to the left edge and right edge of the tile (with only rotation in y axis and moving at the speed defined by default) with health loss of 30% upon collision with player:
20|n|3|0.1,0.1,0.1|0,-0.25,0|-0.3|1,0,0|0,1,0|-0.5,0.5,0,0,0,0;
Atom
Note: by default is centered in all axis at origin of the tile's dimensions
Format: trapType|order|trapSubType|px,py,pz|posx,posy,posz|pctDamage;
trapType = 30 (for atom trap)
order = either 'n' or 'r' meaning n is for a new tile or r for the same tile creating multiple traps
trapSubType = 1-6 (depends) Note: this sub type for the embedded projectile for the Atom
1 = DOUBLE_EDGE_SPEAR 2 = CROSS 3 = STAR 4 = DIAGONAL_LTR 5 = DIAGONAL_RTL 6 = PIECE_WISE
px,py,pz = percentage of the trap's size with relation to a single tile size
posx, posy, posz = the percentage of translation to perform on the trap from the origin of the tile (percentage is with relation to a single tile size for x and z axis, while for y axis is relative to the stage height)
pctDamage = (represents percentage of players health that will be either decreased or increased upon collision); > 0 means health bonus, < 0 means health loss
e.g. 30|n|3|0.3,0.3,0.15|0,-0.25,0|0.35;
Project Status & Documentation
Modifications to the framework
Progress / Updates
Aravinthan Vathsalan
Responsibility: Traps, collision detection against traps, update character stats in respond to traps (HUD), health bonus
- November 22: Modified Object to include new graphic primitive of Pyramid
- November 23: Added graphic primitive FloorSpike and implemented components specific to collision detection
- November 23: Added graphic primitive Projectile and implemented components specific to collision detection
- Added Atom and implemented specific to collision detection
- Implemented trap file parser to create traps from specifications of a text file
- Integrated map file with logic for placing a trap(s) for a specific tile
- Creates traps for a specific tile in the map file and the specifications for the traps from the trap file
- Added updated map file with indicators for trap(s) for a specific tile and the specifications of the traps in the associated trap file
- Updated player object to have health attribute and updates the health with respect to collision (damage from traps)
- Added health bar, health display, and number of restarts (i.e. deaths) to the HUD component
- Moves the player back to the starting position when player loses all health and increments number of restarts(resets health and translate the player back to start position)
- One time items such as health bonuses (represented as an Atom object with a positive "damage" to health) are destroyed when player collides with it for the first time (does not do so if the player is at max health)
Corey Angus
Responsibility: Enemy AI - To Be Confirmed
Geoffrey Mok
Responsibility: HUD(Progress bars, 2D sprite animations), Environment fog, Animated billboards
- November 14: Modified HUD to display multiple textures
- November 16: Added iHUDTexture interface, HUD can now display progress bars
- November 19: Added background image for progress bar, implemented progress bar for item duration
- November 21: Added basic environment fog
- November 23: Added 2D animated sprite functionality to HUDTexture
- November 28: Added iEnvironment for more dynamic fog manipulation
- December 02: Implementation of billboarding (2D sprite in 3d world, always faces the player)
- December 07: Implementation of animated billboards)
Ryan Wang
Responsibility: Stage/levels design
- October 11: Prepared texture images for the stage components. Created walls, ceilings and floor tiles.
- October 31: Added the code that dynamically creates stage components according to the maze matrix.
- November 2: Added codes (on the Camera.cpp) for camera movements and keyboard/mouse controls. Implemented simple collision detection against the walls. Added breathing/fainting/walking effects.
- November 10: Main character object is created. Character movement is handled in the Design.cpp instead of Camera.cpp. Collision against walls is also handled in the Design.cpp.
- November 11: Map is initialized based on the configuration in the map file. Added obstacles. Ceiling tiles collapse as the player travels around. Added sound effects. (Fig.R1)
- November 13: Game items are added - Haste item, dexterity item, stop/revert collapse items. Try keys 1-4.
- November 14: Added background image in the dialog box. (Fig.R2)
Steve Borges
Responsibility: Audio