Difference between revisions of "GAM666/Team A*"
m (changed irc) |
(→To-Do List: '''DONE''') |
||
(40 intermediate revisions by 4 users not shown) | |||
Line 3: | Line 3: | ||
== Project Marking Percentage == | == Project Marking Percentage == | ||
<big> | <big> | ||
− | Group work: | + | Group work: 40% |
− | Individual work: | + | Individual work: 60% + |
------------------------- | ------------------------- | ||
Total 100% | Total 100% | ||
</big> | </big> | ||
== Team Members == | == Team Members == | ||
− | # [mailto:cfbale@learn.senecac.on.ca?subject=GAM666 Clinton Bale], | + | # [mailto:cfbale@learn.senecac.on.ca?subject=GAM666 Clinton Bale], Lead Programmer |
− | # [mailto:jsantos13@learn.senecac.on.ca?subject=GAM666 Jesse Santos], | + | # [mailto:jsantos13@learn.senecac.on.ca?subject=GAM666 Jesse Santos], Programmer |
− | |||
− | |||
[mailto:cfbale@learn.senecac.on.ca,jsantos13@learn.senecac.on.ca?subject=GAM666 Email All] | [mailto:cfbale@learn.senecac.on.ca,jsantos13@learn.senecac.on.ca?subject=GAM666 Email All] | ||
== Repository == | == Repository == | ||
=== Repo ID === | === Repo ID === | ||
− | + | svn://zenit.senecac.on.ca/dps901_123arep2/ | |
+ | |||
=== Trunk Status === | === Trunk Status === | ||
Refer to [irc://irc.freenode.net:6667/teamastar #teamastar] for current trunk status. | Refer to [irc://irc.freenode.net:6667/teamastar #teamastar] for current trunk status. | ||
+ | |||
+ | == Meetings == | ||
+ | * [[TeamA*_10102012|October 10th, 2012]] | ||
== Proposal == | == Proposal == | ||
− | == | + | Our game will be a Tower defense styled game. Where enemies spawn on one side of the map and you have to prevent them from getting to their destination as they wind though the paths. The camera will be in a fixed position over the field. Looking down at the world at around a 30-45 degree angle. The player will be able to rotate this camera 90' around the field but that is it. The player will start with an undetermined amount of money that will allow him to buy towers to defend off the incoming waves. The towers will be modeled in 3DS max and imported into the game. The game will have a max of 2-3 towers upon finish. There are multiple types of waves that the player will encounter: fast waves, slow but strong waves and boss waves; There could be more depending on the time we have. |
+ | |||
+ | === Outline === | ||
+ | * Fixed 3D camera looking down at the world on an angle from the four compass directions. (player controlled) | ||
+ | * Multiple waves of enemies | ||
+ | * Grid based tower placement. | ||
+ | * Node based waypoint enemy movement. | ||
+ | |||
+ | === Concept Picture === | ||
+ | |||
+ | *Note: 3D Representation not present in picture. | ||
+ | [[File:team_as_concept.jpg|thumb||left]] | ||
+ | <br/><br/><br/><br/><br/><br/><br/><br/><br/> | ||
+ | == Controls == | ||
+ | === Keyboard === | ||
+ | Left Arrow = Move camera 90' to the left. | ||
+ | |||
+ | Right Arrow = Move camera 90' to the right. | ||
+ | |||
+ | WASD = Move the currently selected tile around the level. | ||
+ | |||
+ | Space = Select tower or block | ||
+ | |||
+ | Ctrl = Place tower | ||
+ | |||
+ | F = Cycle available towers. | ||
+ | |||
+ | === Xbox Controller === | ||
+ | D-Pad Left = Move camera 90' to the left. | ||
+ | |||
+ | D-Pad Right = Move camera 90' to the right. | ||
+ | |||
+ | Left Thumb-Stick = Move the currently selected tile around the level. | ||
+ | |||
+ | A = Select tower or block | ||
+ | |||
+ | X = Place tower | ||
+ | |||
+ | Y = Cycle available towers. | ||
+ | *Note: All controls above are subject to change. | ||
+ | |||
+ | == To-Do List == | ||
+ | === Priority 1 === | ||
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | ! Task | ||
+ | ! Status | ||
+ | ! Notes | ||
+ | ! Assigned To | ||
+ | |- | ||
+ | |World loading / rendering | ||
+ | |'''DONE''' | ||
+ | | | ||
+ | # Load the world from file into an array in memory. (file format to be decided) | ||
+ | # Draw the world based on the array. | ||
+ | |cfbale | ||
+ | |- | ||
+ | |User input | ||
+ | |'''DONE''' | ||
+ | | | ||
+ | #Ability to recognize all user actions based on the control list above. | ||
+ | |cfbale | ||
+ | |- | ||
+ | |Camera placement and movement | ||
+ | |'''DONE''' | ||
+ | | | ||
+ | #Camera looks down on the world in the center, between a 30-60 degree angle. | ||
+ | #Ability to rotate the camera in all four pole positions (N E S W) | ||
+ | |cfbale | ||
+ | |- | ||
+ | |HUD | ||
+ | |'''DONE''' | ||
+ | | | ||
+ | #Shows current wave number | ||
+ | #Shows current selected tile (or tower) | ||
+ | #Shows amount of enemies remaining on wave | ||
+ | #etc... | ||
+ | |jsantos13 | ||
+ | |- | ||
+ | |Enemies | ||
+ | |'''DONE''' | ||
+ | | | ||
+ | #Enemies traverse the map using a node based system. | ||
+ | #Enemy Class stores information: | ||
+ | ##* Current Health/Max Health | ||
+ | ##* Speed | ||
+ | ##* Speed Modifier (for slow/freeze towers) | ||
+ | ##* Current Node | ||
+ | ##* Next Node | ||
+ | |jsantos13 | ||
+ | |- | ||
+ | |Tower Building | ||
+ | |'''DONE''' | ||
+ | | | ||
+ | # Move through nodes. | ||
+ | # Select nodes (currently highlighted is selected?) | ||
+ | # Purchase/Place tower on node. | ||
+ | # Sell/Remove tower on node. | ||
+ | |cfbale | ||
+ | |- | ||
+ | |Towers and Tower AI | ||
+ | |'''DONE''' | ||
+ | | | ||
+ | # Tower class which includes all information for the tower: | ||
+ | #* Name | ||
+ | #* Type | ||
+ | #* Cost | ||
+ | #* Sell Cost | ||
+ | #* Upgrade Cost | ||
+ | #* Upgrade Level | ||
+ | #* Enemies Killed | ||
+ | #* etc... | ||
+ | # Towers shoot little pellets at the '''closest''' enemy from them AND damage them. | ||
+ | |cfbale | ||
+ | |- | ||
+ | |Lighting | ||
+ | |'''DONE''' | ||
+ | | | ||
+ | # <s>Towers emit some light.</s> | ||
+ | # One giant light (the sun) across whole world. | ||
+ | |cfbale | ||
+ | |- | ||
+ | |Win/Lose Condition | ||
+ | |'''DONE''' | ||
+ | | | ||
+ | #Player has 100hp | ||
+ | #Each enemy does 10hp | ||
+ | #If all HP is lost, the player loses and lose screen is shown. | ||
+ | #If all waves are completed, the player wins and the win screen is shown. | ||
+ | |jsantos13 | ||
+ | |- | ||
+ | |Start Dialog | ||
+ | |'''DONE''' | ||
+ | | | ||
+ | # Make the start dialog similar to that of [http://paulbourke.net/exhibition/askap_walk/dialog.jpg Unity's] | ||
+ | # Simple options and easy to read interface/font. | ||
+ | # <s>Simple graphics options (filtering mode: anisotropic and linear filtering)</s> | ||
+ | |jsantos13 | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | === Priority 2 === | ||
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | ! Task | ||
+ | ! Status | ||
+ | ! Notes | ||
+ | ! Assigned To | ||
+ | |- | ||
+ | |Full Screen Anti Aliasing | ||
+ | |'''DONE''' | ||
+ | |Smooth the edges using DirectX FSAA | ||
+ | |cfbale | ||
+ | |- | ||
+ | |Skybox | ||
+ | | | ||
+ | |Draw a skybox with a texture around the world. | ||
+ | | | ||
+ | |- | ||
+ | |Smoother Camera | ||
+ | | | ||
+ | |Smooth rotating camera around the origin of the level. | ||
+ | | | ||
+ | |- | ||
+ | |Sound | ||
+ | |'''DONE''' | ||
+ | |Add sound to projectiles firing and enemies dying. Sounds from [http://www.superflashbros.net/as3sfxr/ here] | ||
+ | |jsantos13 | ||
+ | |- | ||
+ | |Fancy Dialog | ||
+ | | | ||
+ | |Something like [http://cf.shacknews.com/images/20120716/7562103516_7022f79aff_o_22760.nphd.jpg this] possibly | ||
+ | | | ||
+ | |- | ||
+ | |Moving Turrets | ||
+ | | | ||
+ | |Turrets on towers move and track the enemy. | ||
+ | | | ||
+ | |- | ||
+ | |More Enemies | ||
+ | | | ||
+ | |More enemy types! | ||
+ | | | ||
+ | |- | ||
+ | |More Towers | ||
+ | | | ||
+ | |More tower types! | ||
+ | | | ||
+ | |- | ||
+ | |More Waves | ||
+ | | | ||
+ | |More waves! | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | == Level File Format == | ||
+ | This file format is a work in progress. The final file format may or may not be the same as described. | ||
+ | === Example File === | ||
+ | <div style="white-space: pre; font-family: monospace;"> | ||
+ | <span style="color:#0000BF; line-height:200%">Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F</span> | ||
+ | <span style="color:#0000BF">00000000</span> <span style="background-color:#FF00FF; color:#000000">10 10 02 00 00 63 6C 61 73 73 69 63 00 00 00 00</span> <span style="color:#000000">.....classic....</span> | ||
+ | <span style="color:#0000BF">00000010</span> <span style="color:#000000">01 01 01 01 01 01 02 01 02 01 01 01 01 01 01 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">00000020</span> <span style="color:#000000">01 02 02 02 02 02 02 01 02 02 02 02 02 02 02 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">00000030</span> <span style="color:#000000">01 02 01 01 01 01 01 01 01 01 01 01 01 01 02 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">00000040</span> <span style="color:#000000">01 02 01 01 01 01 01 01 01 01 01 01 01 01 02 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">00000050</span> <span style="color:#000000">01 02 01 01 02 02 02 02 02 02 02 02 01 01 02 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">00000060</span> <span style="color:#000000">01 02 01 01 02 01 01 01 01 01 01 02 01 01 02 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">00000070</span> <span style="color:#000000">01 02 02 02 02 01 01 01 01 01 01 02 01 01 02 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">00000080</span> <span style="color:#000000">01 01 01 01 01 01 01 01 01 01 01 02 01 01 02 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">00000090</span> <span style="color:#000000">01 01 01 01 01 01 01 01 01 01 01 02 01 01 02 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">000000A0</span> <span style="color:#000000">01 01 01 01 01 01 01 01 01 01 01 02 01 01 02 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">000000B0</span> <span style="color:#000000">01 02 02 02 02 02 02 02 02 02 02 02 01 01 02 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">000000C0</span> <span style="color:#000000">01 02 01 01 01 01 01 01 01 01 01 01 01 01 02 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">000000D0</span> <span style="color:#000000">01 02 01 01 01 01 01 01 01 01 01 01 01 01 02 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">000000E0</span> <span style="color:#000000">01 02 01 01 01 01 01 01 01 01 01 01 01 01 02 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">000000F0</span> <span style="color:#000000">01 02 02 02 02 02 02 02 02 02 02 02 02 02 02 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">00000100</span> <span style="color:#000000">01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01</span> <span style="color:#000000">................</span> | ||
+ | <span style="color:#0000BF">00000110</span> <span style="background-color:#33CCFF; color:#000000">FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF</span> <span style="color:#000000">ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ</span> | ||
+ | <span style="color:#0000BF">00000120</span> <span style="background-color:#33CCFF; color:#000000">FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF</span> <span style="color:#000000">ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ</span> | ||
+ | <span style="color:#0000BF">00000130</span> <span style="background-color:#33CCFF; color:#000000">FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF</span> <span style="color:#000000">ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ</span> | ||
+ | <span style="color:#0000BF">00000140</span> <span style="background-color:#33CCFF; color:#000000">FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF</span> <span style="color:#000000">ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ</span> | ||
+ | </div> | ||
+ | |||
+ | === Header === | ||
+ | |||
+ | Shown in <span style="background-color:#FF00FF; color:#000000">Magenta</span> above, this part of the file describes the rest of the file. | ||
+ | |||
+ | <source lang="cpp"> | ||
+ | #define MAX_LEVEL_WIDTH 16 | ||
+ | #define MAX_LEVEL_DEPTH 16 | ||
+ | |||
+ | struct LevelHeader { | ||
+ | byte width; | ||
+ | byte depth; | ||
+ | byte num_nodes; | ||
+ | byte theme; | ||
+ | char name[12]; | ||
+ | }; | ||
+ | </source> | ||
+ | * width: The true width of the level, up to a maximum of 16. | ||
+ | * depth: The true depth of the level, up to a maximum of 16. | ||
+ | * <s>height: The true height of the level, up to a maximum of 2. May be lowered to 1 if the 3rd dimension is not needed for representing the level properly.</s> | ||
+ | * num_nodes: The amount of path nodes listed at the bottom of the file. | ||
+ | * theme: The texture set to use for this level. | ||
+ | * name: The name of the level. | ||
+ | |||
+ | === World Data === | ||
+ | |||
+ | Shown in White above, this is where all the world texture data is stored. Every 32 bytes of this section represents one 20x20x2 row of the level. Each number on these rows represents a texture that that portion of the row will use. | ||
+ | |||
+ | <source lang="cpp"> | ||
+ | static TextureData WorldTextureData[] = { | ||
+ | { L"", ... }, | ||
+ | { L"grass.bmp", ... }, | ||
+ | { L"path.jpg", ... } | ||
+ | }; | ||
+ | </source> | ||
+ | |||
+ | The above source code shows how some of the textures are stored in the game, this storage is not final, the texture info may be stored in the map itself by the end of development. | ||
+ | |||
+ | When you look at the following section of the world data: | ||
+ | <div style="white-space: pre; font-family: monospace;"> | ||
+ | <span style="color:#0000BF">00000010</span> <span style="color:#000000">01 01 01 01 01 01 02 01 02 01 01 01 01 01 01 01</span> <span style="color:#000000">................</span> | ||
+ | <s><span style="color:#0000BF">00000020</span> <span style="color:#000000">00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</span> <span style="color:#000000">................</span></s> | ||
+ | </div> | ||
+ | <s>The top 16 bytes of this data represents 16 columns in the first row where y = 0. The second 16 bytes represents 16 columns in the first row where y = 1.</s> | ||
+ | |||
+ | The 16 bytes in this data represents one row of the game world. | ||
+ | |||
+ | In the above example, 00 represents an empty texture and is '''NOT''' drawn. 01 represents a grass texture and 02 represents a path texture. This correlates to the WorldTextureData array depicted above. | ||
+ | |||
+ | === Pathing Data === | ||
+ | |||
+ | Shown in <span style="background-color:#33CCFF; color:#000000">Blue</span> above, this 64 byte section of the file describes the path that the AI will take in order to reach the end of the map. The data shown in the above example is incomplete and will not work. 0xFF just means it is an invalid node: -1. | ||
+ | |||
+ | <source lang="cpp"> | ||
+ | #define MAX_PATH_NODES 32 | ||
+ | |||
+ | struct Coord { | ||
+ | Coord(char x, char y) : x(x), y(y) {} | ||
+ | Coord() : x(0), y(0) {} | ||
+ | public: | ||
+ | char x, y; | ||
+ | }; | ||
+ | |||
+ | Coord _pathNodes[MAX_PATH_NODES]; | ||
+ | </source> | ||
+ | |||
+ | The _pathNodes array stores the series of x,y coordinates from 0-num_nodes. This is read from the file in sequence. | ||
+ | |||
+ | For example: | ||
+ | <pre>00 00 01 00 01 01 02 01 FF FF</pre> | ||
+ | Contains a total of five path nodes: | ||
+ | <pre> | ||
+ | x: 0 , y: 0 | ||
+ | x: 1 , y: 0 | ||
+ | x: 1 , y: 1 | ||
+ | x: 2 , y: 1 | ||
+ | x: -1, y: -1 | ||
+ | </pre> | ||
+ | |||
+ | The first path node is at 0,0. The enemy will start at this node. The next node is 1,0. The enemy will then move from it's current node (0,0) up in the x direction to it's new node (1,0). The enemy will continue to follow this series of nodes over time until he reaches the end node (num_nodes) or when the node's x or y value is less than 0 (invalid node). | ||
+ | |||
+ | With this basic system we should easily be able to represent the enemy movement in the 3d world. |
Latest revision as of 23:54, 7 December 2012
GAM666/DPS901 | Weekly Schedule | Student List | Project Requirements | Teams and their Projects | Student Resources
Contents
Pathfinder
Project Marking Percentage
Group work: 40% Individual work: 60% + ------------------------- Total 100%
Team Members
- Clinton Bale, Lead Programmer
- Jesse Santos, Programmer
Repository
Repo ID
svn://zenit.senecac.on.ca/dps901_123arep2/
Trunk Status
Refer to #teamastar for current trunk status.
Meetings
Proposal
Our game will be a Tower defense styled game. Where enemies spawn on one side of the map and you have to prevent them from getting to their destination as they wind though the paths. The camera will be in a fixed position over the field. Looking down at the world at around a 30-45 degree angle. The player will be able to rotate this camera 90' around the field but that is it. The player will start with an undetermined amount of money that will allow him to buy towers to defend off the incoming waves. The towers will be modeled in 3DS max and imported into the game. The game will have a max of 2-3 towers upon finish. There are multiple types of waves that the player will encounter: fast waves, slow but strong waves and boss waves; There could be more depending on the time we have.
Outline
- Fixed 3D camera looking down at the world on an angle from the four compass directions. (player controlled)
- Multiple waves of enemies
- Grid based tower placement.
- Node based waypoint enemy movement.
Concept Picture
- Note: 3D Representation not present in picture.
Controls
Keyboard
Left Arrow = Move camera 90' to the left.
Right Arrow = Move camera 90' to the right.
WASD = Move the currently selected tile around the level.
Space = Select tower or block
Ctrl = Place tower
F = Cycle available towers.
Xbox Controller
D-Pad Left = Move camera 90' to the left.
D-Pad Right = Move camera 90' to the right.
Left Thumb-Stick = Move the currently selected tile around the level.
A = Select tower or block
X = Place tower
Y = Cycle available towers.
- Note: All controls above are subject to change.
To-Do List
Priority 1
Task | Status | Notes | Assigned To |
---|---|---|---|
World loading / rendering | DONE |
|
cfbale |
User input | DONE |
|
cfbale |
Camera placement and movement | DONE |
|
cfbale |
HUD | DONE |
|
jsantos13 |
Enemies | DONE |
|
jsantos13 |
Tower Building | DONE |
|
cfbale |
Towers and Tower AI | DONE |
|
cfbale |
Lighting | DONE |
|
cfbale |
Win/Lose Condition | DONE |
|
jsantos13 |
Start Dialog | DONE |
|
jsantos13 |
Priority 2
Task | Status | Notes | Assigned To |
---|---|---|---|
Full Screen Anti Aliasing | DONE | Smooth the edges using DirectX FSAA | cfbale |
Skybox | Draw a skybox with a texture around the world. | ||
Smoother Camera | Smooth rotating camera around the origin of the level. | ||
Sound | DONE | Add sound to projectiles firing and enemies dying. Sounds from here | jsantos13 |
Fancy Dialog | Something like this possibly | ||
Moving Turrets | Turrets on towers move and track the enemy. | ||
More Enemies | More enemy types! | ||
More Towers | More tower types! | ||
More Waves | More waves! |
Level File Format
This file format is a work in progress. The final file format may or may not be the same as described.
Example File
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 00000000 10 10 02 00 00 63 6C 61 73 73 69 63 00 00 00 00 .....classic.... 00000010 01 01 01 01 01 01 02 01 02 01 01 01 01 01 01 01 ................ 00000020 01 02 02 02 02 02 02 01 02 02 02 02 02 02 02 01 ................ 00000030 01 02 01 01 01 01 01 01 01 01 01 01 01 01 02 01 ................ 00000040 01 02 01 01 01 01 01 01 01 01 01 01 01 01 02 01 ................ 00000050 01 02 01 01 02 02 02 02 02 02 02 02 01 01 02 01 ................ 00000060 01 02 01 01 02 01 01 01 01 01 01 02 01 01 02 01 ................ 00000070 01 02 02 02 02 01 01 01 01 01 01 02 01 01 02 01 ................ 00000080 01 01 01 01 01 01 01 01 01 01 01 02 01 01 02 01 ................ 00000090 01 01 01 01 01 01 01 01 01 01 01 02 01 01 02 01 ................ 000000A0 01 01 01 01 01 01 01 01 01 01 01 02 01 01 02 01 ................ 000000B0 01 02 02 02 02 02 02 02 02 02 02 02 01 01 02 01 ................ 000000C0 01 02 01 01 01 01 01 01 01 01 01 01 01 01 02 01 ................ 000000D0 01 02 01 01 01 01 01 01 01 01 01 01 01 01 02 01 ................ 000000E0 01 02 01 01 01 01 01 01 01 01 01 01 01 01 02 01 ................ 000000F0 01 02 02 02 02 02 02 02 02 02 02 02 02 02 02 01 ................ 00000100 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ................ 00000110 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 00000120 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 00000130 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 00000140 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
Header
Shown in Magenta above, this part of the file describes the rest of the file.
#define MAX_LEVEL_WIDTH 16
#define MAX_LEVEL_DEPTH 16
struct LevelHeader {
byte width;
byte depth;
byte num_nodes;
byte theme;
char name[12];
};
- width: The true width of the level, up to a maximum of 16.
- depth: The true depth of the level, up to a maximum of 16.
-
height: The true height of the level, up to a maximum of 2. May be lowered to 1 if the 3rd dimension is not needed for representing the level properly. - num_nodes: The amount of path nodes listed at the bottom of the file.
- theme: The texture set to use for this level.
- name: The name of the level.
World Data
Shown in White above, this is where all the world texture data is stored. Every 32 bytes of this section represents one 20x20x2 row of the level. Each number on these rows represents a texture that that portion of the row will use.
static TextureData WorldTextureData[] = {
{ L"", ... },
{ L"grass.bmp", ... },
{ L"path.jpg", ... }
};
The above source code shows how some of the textures are stored in the game, this storage is not final, the texture info may be stored in the map itself by the end of development.
When you look at the following section of the world data:
00000010 01 01 01 01 01 01 02 01 02 01 01 01 01 01 01 01 ................
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
The top 16 bytes of this data represents 16 columns in the first row where y = 0. The second 16 bytes represents 16 columns in the first row where y = 1.
The 16 bytes in this data represents one row of the game world.
In the above example, 00 represents an empty texture and is NOT drawn. 01 represents a grass texture and 02 represents a path texture. This correlates to the WorldTextureData array depicted above.
Pathing Data
Shown in Blue above, this 64 byte section of the file describes the path that the AI will take in order to reach the end of the map. The data shown in the above example is incomplete and will not work. 0xFF just means it is an invalid node: -1.
#define MAX_PATH_NODES 32
struct Coord {
Coord(char x, char y) : x(x), y(y) {}
Coord() : x(0), y(0) {}
public:
char x, y;
};
Coord _pathNodes[MAX_PATH_NODES];
The _pathNodes array stores the series of x,y coordinates from 0-num_nodes. This is read from the file in sequence.
For example:
00 00 01 00 01 01 02 01 FF FF
Contains a total of five path nodes:
x: 0 , y: 0 x: 1 , y: 0 x: 1 , y: 1 x: 2 , y: 1 x: -1, y: -1
The first path node is at 0,0. The enemy will start at this node. The next node is 1,0. The enemy will then move from it's current node (0,0) up in the x direction to it's new node (1,0). The enemy will continue to follow this series of nodes over time until he reaches the end node (num_nodes) or when the node's x or y value is less than 0 (invalid node).
With this basic system we should easily be able to represent the enemy movement in the 3d world.