Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
6aebea9
DS 3.2 - Generate UserStories.md for Github
mbozada Feb 25, 2021
d8b382e
End of Sprint Review
mbozada Mar 5, 2021
91e9528
Missed point value for 6.2
mbozada Mar 5, 2021
b91f145
Formatting typo fixed
mbozada Mar 5, 2021
4b4fd1e
DS6.1, DS 6.2 - Created SprintTracker.md
mbozada Mar 13, 2021
4b7edec
DS6.1, DS6.2 - Fixed new line spacing
mbozada Mar 13, 2021
e47bb3c
US5.1.1 - Add TNT Block
mbozada Mar 13, 2021
b73df6f
Update UserStories.md
alexreigle Mar 13, 2021
b2b577f
Merge pull request #4 from mbozada/DS-4.1-(Cherno)-reallocation
mbozada Mar 13, 2021
d53e6a2
Merge branch 'master' into Sprint-Review-1
alexreigle Mar 14, 2021
24f73c6
Merge pull request #3 from mbozada/Sprint-Review-1
alexreigle Mar 14, 2021
524ab71
US 5.1.2, US 5.1.3 - Basic Explosion
mbozada Mar 14, 2021
d209b9d
DS_2_3 (Doxy standards) and DS_2_4 (gitignore update)
Mar 18, 2021
fc8e236
Update UserStories.md
alexreigle Mar 18, 2021
b9df724
Updated cloud texture. It now is darrk underneath and light on top.
Mar 18, 2021
4d0891a
Update .gitignore
alexreigle Mar 18, 2021
70a238b
File is not needed to maintain documentation
alexreigle Mar 18, 2021
1065431
File is not needed to maintain documentation
alexreigle Mar 18, 2021
af87443
Merge pull request #6 from mbozada/DoxyBranch
mbozada Mar 18, 2021
424ac8c
Merge pull request #7 from mbozada/master
mbozada Mar 18, 2021
1c051c9
Sprint 2 Review
mbozada Mar 19, 2021
199f194
Fixed spacing
mbozada Mar 19, 2021
ee63109
Removed new user stories from sprint 1
mbozada Mar 19, 2021
70c935e
Updated User Stories and Tasks
mbozada Mar 19, 2021
ae4f057
Removed Total Point Values
mbozada Mar 19, 2021
25f1ee6
Forgot to strike through TNT
mbozada Mar 19, 2021
9914aa3
US5-TNT Getting ready for Pull
mbozada Mar 28, 2021
6bf5ab9
Merge pull request #8 from mbozada/US5-TNT
alexreigle Mar 30, 2021
5fc1d2f
US3.2.1 - Add Ice Block
mbozada Mar 30, 2021
cbb55d4
US3.1.1 - Add Snow Block
mbozada Mar 30, 2021
43eb92a
US3.2.1 - Adjusted Ice Texture
mbozada Mar 30, 2021
7fa5f27
Added Fog. Needs Line-on_sight effects added.
Mar 31, 2021
f9cf913
Merge pull request #9 from mbozada/US3.1.1_US3.2.1
alexreigle Mar 31, 2021
251349f
US5.2.1 - Initial Chain Trigger Effect
mbozada Apr 1, 2021
9edf923
US 5.2.1 - Removed Testing print()s
mbozada Apr 1, 2021
ae6d047
Removed an unneeded comment
Apr 2, 2021
11edc6d
Sprint-Review-3
mbozada Apr 2, 2021
72b6440
Merge pull request #11 from mbozada/Sprint-Review-3
alexreigle Apr 2, 2021
46582b1
Fixed Spacing
mbozada Apr 2, 2021
523da44
Makes cloud destructable and solid
Apr 5, 2021
a5f42f2
Update item.c
alexreigle Apr 5, 2021
8ddb6e4
Update main.c
alexreigle Apr 5, 2021
7ac0803
Update world.h
alexreigle Apr 5, 2021
cc9eda0
Update main.c
alexreigle Apr 5, 2021
6e8f2b2
Resolved conlficts from last pull request.
Apr 5, 2021
c97f6a2
Fixes suggested from pull request 11
Apr 5, 2021
4af54e0
Address Pull Request #12 comments
Apr 5, 2021
4924962
Merge pull request #14 from mbozada/CloudBranch
mbozada Apr 5, 2021
aef754e
Does Not Build. Converted main to C++ and am fighting with cmake files
Apr 13, 2021
335f0d1
Merge pull request #15 from mbozada/US5.2.1
alexreigle Apr 13, 2021
f11184e
Corrected Build fail problems. The project's main function not compil…
Apr 14, 2021
c7dd3d0
DOES NOT BUILD. I've set up the intial functions required for moving …
Apr 15, 2021
c2cbee6
Update UserStories.md
alexreigle Apr 17, 2021
b739677
DNB. resolved conflicting declaration error. Now getting an undefined…
Apr 17, 2021
e6f57b8
Merge branch 'CloudBranch' of https://github.com/mbozada/Craft into C…
Apr 17, 2021
af2dd47
Project Builds but Game is broken and needs testing/debugging. Howeve…
Apr 18, 2021
70097eb
Fixed Git Change Issue
mbozada Apr 20, 2021
5d99d2c
all files converted to C++; project builds and renders
Apr 22, 2021
9496fbd
Figured out the version control problem. The branch has main, map, an…
Apr 22, 2021
2082440
Added Task to UserStories.md to represent the significant effort spen…
Apr 22, 2021
bb99382
Removed commented code per Pull Request Review
Apr 22, 2021
08d5b5a
Fixed Merge Conflicts
mbozada Apr 22, 2021
386a1a3
Still working out the kinks. Cannot get the cloud functions to access…
Apr 25, 2021
dd4cef8
Update UserStories.md
alexreigle Apr 25, 2021
64ccc0a
Corrected definition of tasks
alexreigle Apr 25, 2021
d5e967a
Refactored Functions: DS 7.1, DS 7.2.2, DS 7.3.5
Apr 25, 2021
20fd2de
Merge branch 'CloudBranch' of https://github.com/mbozada/Craft into C…
Apr 25, 2021
0400bef
DS7.3.3 - Refactored delete_all_chunks()
Apr 25, 2021
e90bf20
Updated Task Status
alexreigle Apr 25, 2021
f7f2ba9
Merge branch 'CloudBranch' of https://github.com/mbozada/Craft into C…
Apr 25, 2021
cae73f3
Minor reworking of functions and comments
Apr 25, 2021
1dfed2d
Corrected formatting of completed tasks
alexreigle Apr 26, 2021
abc9005
Remove an unused class.
Apr 26, 2021
74f0460
Merge branch 'CloudBranch' of https://github.com/mbozada/Craft into C…
Apr 26, 2021
22246c0
Updated cloud files to address vector manipulation problems bore out …
Apr 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ log.txt
*.dll
*.pyc

//! DS_2_4 #Ignore files unneeded.
//! (i.e. cmake and /dep/... files)
//!*.cmake

/deps/*
deps/*
/html/*
html/*
CMakeDoxyfile.in
CMakeDoxygenDefaults.cmake
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8)

project(craft)

FILE(GLOB SOURCE_FILES src/*.c)
FILE(GLOB SOURCE_FILES src/*.c*)

add_executable(
craft
Expand Down
2,494 changes: 2,494 additions & 0 deletions CraftDoc

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions SprintTracker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Sprints

## Sprint 1 (2/19/21 - 3/5/21)
### Velocity: 9

Completed Tasks
DS 2.1 - 5
DS 2.2 - 2
DS 1.1 - 1
DS 3.2 - 1

Continuing Tasks
US 1.1.1 - 3
US 5.1.1 - 3
US 5.1.2 - 2
US 5.1.3 - 2

DS 2.3 - 2
DS 2.4 - 3
DS 4.1 - 5

## Sprint 2 (3/5/21 - 3/19/21)
### Velocity: 17

Completed Tasks
US 1.1.1 - 3 - Alex
US 5.1.1 - 3 - Michael
US 5.1.2 - 2 - Michael
US 5.1.3 - 2 - Michael

DS 2.3 - 2 - Alex
DS 2.4 - 3 - Alex
DS 6.1 - 1 - Michael
DS 6.2 - 1 - Michael

Continuing Tasks
DS 4.1 - 5 - Alex
DS 4.2 - 5 - Michael

## Sprint 3 (3/19/21 - 4/2/21)
### Velocity: 18
Completed Tasks
US 1.1.5 - 3 - Alex
US 3.1.1 - 1 - Michael
US 3.2.1 - 1 - Michael
US 5.2.1 - 3 - Michael

DS 4.1 - 5 - Alex
DS 4.2 - 5 - Michael

Continuing Tasks
US 1.1.2 - - 3 - Alex
97 changes: 97 additions & 0 deletions UserStories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# User Stories and Tasks

## US - User Stories
### 1. As a player, I want the clouds to move so that the environment is more immersive.
1. Dynamic Clouds
1. ~~Add Cloud Block - 3~~
2. Add Cloud Movement - ~~3~~
1. ~~Add function to move cloud at same altitude - 2~~
2. ~~Add function to test cloud motion functtion~~ - 2~~
3. Implement functions into map.cpp - 8
4. ~~Dynamic Cloud Shape Generation - 5~~ (Already implemented)
5. Bound Cloud Movement and Generation - 8
6. Continuous Cloud Generation during Runtime - 5
7. Convert files the Cloud source code is dep. on to C++ compilation - ~~3~~
1. ~~Create cloud.h - 2~~
2. ~~Create cloud.cpp - 2~~
3. ~~Allow program to be called by C code - 2~~
4. ~~Implement into map.cpp and main.cpp - 3~~
### 2. As a player, I want a weather system so that there's more variety day-to-day.
1. Rain
1. Create Dark Cloud Texture - 2
2. Create Rain Texture - 2
3. Add Rain Effect to the Game - 5
4. Add a button or command to change weather - 5
5. Research Weather Cycle or Random Generation - 5
2. Fog
1. ~~Add Fog Effect - 3~~
2. Fog dependent on time of day - 3
1. ~~Alter map functions to accept time as an argument - 2~~
2. ~~Write function to change cloud/fog depending on time - 2~~
3. Access time passed in game world - 5
4. Implement time dependent functions - 5
4. Make Fog Transparent - 3
5. Clouds Lower to Fog, Fog Rises to Clouds - 3
1. ~~Write function to get cloud blocks - 2
2. ~~Write function to lower cloud blocks - 2~~
3. ~~Write function to raise cloud blocks - 2~~
4. ~~Write function to test cloud position change - 2~~
5. Implement functions into main.cpp and map.cpp - 8
### 3. As a player, I want more biomes so that exploration is more rewarding.
1. Snow Blocks
1. ~~Add Snow Block to Textures - 1~~
2. ~~Add Snow Block Texture to Bitmap - 2~~ (Trivial after more research)
3. ~~Add Snow Block - 3~~ (Trivial after more research)
2. Ice Block
1. ~~Add Ice Block to Textures - 1~~
2. Graphics: Make it transparent - 2
3. Effect: Slow down player movement - 2
4. Advanced Effect: Momentum - 5
### 4. As a player, I want the world to endlessly generate so that I can explore forever.
1. Find where world generation happens in source files - 8
2. Figure out how world is generated in craft - 8
### 5. As a player, I want TNT so that I can blow things up.
1. Add TNT Block
1. ~~Add the TNT Block - 3~~
2. ~~Effect: Destroy Blocks in Radius - 2~~
3. ~~Trigger: Right-Click TNT Block - 2~~
2. Refined TNT Effects
1. ~~Chain Trigger: TNT explodes other TNT - 3~~
2. Graphics: Add an Explosion effect - 5
3. Sound: Add an explosion sound - 5
4. Add radial vector explosion for dynamic craters - 8

## DS - Dev Stories
### 1. As a dev, I want our tasks up on a kanban board so that they are easier to assign and visualize. <br>
1. ~~Add tasks to the kanban board - 1~~
### 2. As a dev, I want us to use Doxygen or some other documentation generating software so that we can have fancy .htmls that track our design.
1. ~~Research Doxygen and Alternatives - 5~~
2. ~~Get Doxygen up and running - 2~~
3. ~~Decide on Doxygen standards between the two of us - 2~~
4. ~~Figure out what can be added to .gitignore. - 3~~
### 3. As a dev, I want pertinent documents up on github so that the team always has the most current version to look to for reference.
1. Look into using wiki to store our documents - 2
2. ~~Generate a UserStories markdown file for github - 1~~
### 4. As a dev, I want to learn more about OpenGL so that I feel confident adding new textures and effects to Craft.
1. ~~Alex Completes Watching [Cherno](https://www.youtube.com/playlist?list=PLlrATfBNZ98foTJPJ_Ev03o2oq3-GGOS2) - 5~~
2. ~~Michael Completes Watching [Cherno](https://www.youtube.com/playlist?list=PLlrATfBNZ98foTJPJ_Ev03o2oq3-GGOS2) - 5~~
### 5. As a dev, I want a solid branching strategy for our repository so that our version control is stable and effective.
1. ~~Generate branches for repository - 1~~
### 6. As a dev, I want a document that tracks our velocity so that we can measure our progress.
1. ~~Generate SprintTracker.md - 1~~
2. ~~Add it to github - 1~~
### 7. As a dev., I want the project code to be more easily read and highly refactored.
1. Refactor World.c functions
1. ~~Refactor create_world() - 1~~
2. Refactor map.cpp functions
1. Refactor map_get() - 1
2. ~~Refactor map_set() - 1~~
3. Refactor main.cpp functions
1. Refactor _hit_test() - 1
2. Refactor compute_chunks() - 1
3. ~~Refactor delete_chunks() - 1~~
4. Refactor check_workers() - 1
5. ~~Refactor set_lights() - 1~~
6. Refactor cylinder() - 1
7. Refactor sphere() - 1
8. Refactor cube() - 1
2 changes: 1 addition & 1 deletion src/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
size_t write_function(char *data, size_t size, size_t count, void *arg) {
size_t length = size * count;
char *dst = (char *)arg;
char *src = malloc(length + 1);
char *src = (char*)malloc(length + 1);
memcpy(src, data, length);
src[length] = '\0';
strncat(dst, src, MAX_RESPONSE_LENGTH - strlen(dst) - 1);
Expand Down
4 changes: 2 additions & 2 deletions src/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ char *client_recv() {
}
if (p >= queue) {
int length = p - queue + 1;
result = malloc(sizeof(char) * (length + 1));
result = (char*)malloc(sizeof(char) * (length + 1));
memcpy(result, queue, sizeof(char) * length);
result[length] = '\0';
int remaining = qsize - length;
Expand All @@ -177,7 +177,7 @@ char *client_recv() {
}

int recv_worker(void *arg) {
char *data = malloc(sizeof(char) * RECV_SIZE);
char *data = (char*)malloc(sizeof(char) * RECV_SIZE);
while (1) {
int length;
if ((length = recv(sd, data, RECV_SIZE - 1, 0)) <= 0) {
Expand Down
164 changes: 164 additions & 0 deletions src/clouds.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@


#include "clouds.h"

struct cloudData{
private:
std::vector<cloudPosition> privateCloud;
public:
void set(std::vector<cloudPosition> cloud){
privateCloud = cloud;
}
std::vector<cloudPosition> get(){
return privateCloud;
}
} allCloudData;


//Worker Functions
extern "C"
std::vector<cloudPosition> setClouds(std::vector<cloudPosition> allClouds, int x, int y, int z)
{
cloudPosition p;
p.x =x;
p.y = y;
p.z = z;
allClouds.push_back(p);

//cloudData data;
//allCloudData.set(allClouds);
return allClouds;
}

extern "C"
std::vector<cloudPosition> getClouds(){
cloudData data;
std::vector<cloudPosition> clouds = allCloudData.get();
printf("Get!\n");
return clouds;
}

extern "C"
std::vector<cloudPosition> moveAllCloudsDown(Map *map, std::vector<cloudPosition> allCloudPositions, int t)
{
int xyz = 2;
int posChange = -1;
allCloudPositions = moveClouds(map,allCloudPositions, posChange, xyz, t);
return allCloudPositions;
}

extern "C"
std::vector<cloudPosition> moveAllCloudsUp(Map *map, std::vector<cloudPosition> allCloudPositions, int t)
{
int xyz = 2;
int posChange = 1;
allCloudPositions = moveClouds(map,allCloudPositions, posChange, xyz, t);
return allCloudPositions;
}

extern "C"
std::vector<cloudPosition> moveAllCloudsOver(Map *map, std::vector<cloudPosition> allCloudPositions, int t)
{
int xyz = 1;
int posChange = 1;
std::vector<cloudPosition> movedClouds = moveClouds(map,allCloudPositions, posChange, xyz, t);
return movedClouds;
}

extern "C"
std::vector<cloudPosition> moveClouds(Map *map, std::vector<cloudPosition> clouds, int posChange, int xyz, int t)
{
std::vector<cloudPosition> cloudCopy = clouds;
std::vector<cloudPosition> returnClouds = clouds;
while (clouds.size() > 0)
{
cloudPosition p = clouds.back();
//map_set(map, p.x, p.y, p.z, 0, t); //remove cloud at current position
clouds.pop_back();
}
while (clouds.size() > 0)
{
cloudPosition p = cloudCopy.back();

if(xyz == 1){
//map_set(map, p.x + posChange, p.y, p.z, 16, t);
}
else if(xyz == 2){
//map_set(map, p.x, p.y + posChange, p.z, 16, t);
}
else if(xyz == 3){
//map_set(map, p.x, p.y, p.z + posChange, 16, t);
}
clouds.pop_back();
}
if(xyz == 1){
for(int i = 0; i < returnClouds.size(); i++){returnClouds[i].x = returnClouds[i].x + posChange;}
}
else if(xyz == 2){
for(int i = 0; i < returnClouds.size(); i++){returnClouds[i].y = returnClouds[i].y + posChange;}
}
else if(xyz == 3){
for(int i = 0; i < returnClouds.size(); i++){returnClouds[i].z = returnClouds[i].z + posChange;}
}

return returnClouds;
}


//Test Functions
extern "C"
int gotClouds(std::vector<cloudPosition> clouds){
if(clouds.size() == 0)
{
printf("Test FAILED: Clouds in Vector "); printf("%ld", clouds.size()); printf("\n");
return -1;
}
else{
printf("Test PASSED: Clouds in Vector "); printf("%ld", clouds.size()); printf("\n");
return clouds.size();
}
}

extern "C"
int isPositionChanged(std::vector<cloudPosition>startData, std::vector<cloudPosition> endData){
int test = 0;
int done = 0;
while( test < 1 && done == 0){
if (startData.size() == endData.size()){
for(int idx=0; idx<startData.size(); idx++){
if(startData[idx].x == endData[idx].x){
if(startData[idx].y == endData[idx].y){
if(startData[idx].z == endData[idx].z){
/*Point is the same;*/ }
else{ test++; }}
else{ test++; }}
else{ test++; }
}
done++;
}else {test++;}
}

if( test >= 1 )
{
/// @note Output supressed for testing function efficacy
/// printf("Test FAILED: US 2.2.4 Cloud Position Changed\n");
return -1;
}
else{
/// @note Output supressed for testing function efficacy
/// printf("Test PASSED: US 2.2.4 Cloud Position Changed\n");
return 0;
}
}
extern "C"
int isValidChar(char xyz){
if( xyz == 'x' || xyz == 'y' || xyz == 'z')
{
printf("Test PASSED: valid position char change\n");
return 0;
}
else{
printf("Test PASSED: valid position char change\n");
return -1;
}
}
Loading