Skip to content

Commit 7eed6d2

Browse files
authored
Merge pull request #10 from nuzcraft/part_7
Part 7
2 parents 03f9316 + 7fd6177 commit 7eed6d2

15 files changed

+926
-184
lines changed

README.md

Lines changed: 56 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,49 +12,56 @@ I want to use this as an opportunity to:
1212
4. make a roguelike
1313
5. practice with git
1414

15-
## Part 1 Dev Notes
15+
## Part 7 Dev Notes
1616

17-
### Drawing the '@' symbol and moving it around
17+
### Creating the Interface
1818

19-
http://rogueliketutorials.com/tutorials/tcod/v2/part-1/
19+
https://rogueliketutorials.com/tutorials/tcod/v2/part-7/
2020

21-
It has been a long time since I did anything significant with python or tcod, so this should be a lot of fun.
21+
Heyo, it looks like this part will be focused on the UI. I'm looking forward to adding a bit of polish :). I'm also going to reorganize my Dev Notes so that the more recent dev notes show up on top.
2222

23-
Welp, after finishing part one, there is a lot of syntax in here that I'm not very familiar with. I think I understand the gist of what's happening, but it will take some work before I'm fully comfortable with it. Regardless, I'm really enjoying how this is going!
23+
Interestingly (or not I guess) I found it difficult to focus on part 7, and I think some of it was analysis paralysis on unit testing. I'm finding there are more and more things I want to unit test, but don't quite have the skills/experience to make it work; I don't understand what all unittest can do so my unit tests are pretty basic.
2424

25-
I got movin' and groovin' on unit testing and after some finagling I got a suite of unit tests running on the overwritten ev_quit and ev_keydown functions. I found this to be an educational experience, and look forward to setting up more unit tests as the codebase grows.
25+
I think the above was compounded by UI work being a bit more cumbersome to unit test. This section did a lot of good work to make things look nice on the screen and in the end, I enjoyed making it happen.
2626

27-
## Part 2 Dev Notes
27+
## Part 6.5 Building, Testing, Releasing, etc
2828

29-
### The generic Entity, the render functions, and the map
29+
I spent an evening futzing around with a couple things here that I want to document. Firstly, I set up a GitHub action that will very specifically build the project and run all my unit test whenever I commit to main! This is really nice as it will let me know if any code makes it to the repo that breaks some functions. This is a really important part of continuous integration even if I'm not really trying to continuously integrate this code anywhere. Secondly, I figured out how to use pyinstaller to build an executable of my python project. This has been difficult for me to do in the past, so it was really nice to get it somewhat figured out. The pyinstaller command I use to build is:
3030

31-
http://rogueliketutorials.com/tutorials/tcod/v2/part-2/
31+
- pyinstaller --add-data "dejavu10x10_gs_tc.png;." main.py
3232

33-
I had a good time setting up unit tests and such in part one, and I think part 2 is going to be a challenge. At this exact time, I'm looking at setting up unit tests for the engine scripts, am seeing functions that will be difficult to test, and am looking forward to the puzzle solving.
33+
This will build the python codebase and add the font file to the root of the folder. This goes into a 'dist' folder -> I can zip this up and distribute it as a release on GitHub!.
3434

35-
After quite a bit of futzing, I'm feeling really good about the development process here. Create script, write tests, implement code, see results. I think it will be really interesting to update/fix unit tests as the codebase changes. Part 2 is complete! Looking forward to part 3!
35+
That's everything for this section I think. Any new unit tests I add should automatically be ran by the GitHub action. I may need to adjust my pyinstaller commands, especially as I add/alter external font files.
3636

37-
## Part 3 Dev Notes
37+
## Part 6 Dev Notes
3838

39-
### Generating a Dungeon
39+
### Doing (and taking) some damage
4040

41-
http://rogueliketutorials.com/tutorials/tcod/v2/part-3/
41+
http://rogueliketutorials.com/tutorials/tcod/v2/part-6/
4242

43-
I'm really looking forward to dungeon generation. The procedural nature is probably my favorite part of roguelike development/working through these tutorials.
43+
Heyo, it looks like this part is going to start with a bit of a code refactor! This means we'll be making lots of changes to our existing codebase + lots of changes to our existing unit tests. This part might be a bit of a pain...but we'll come through!
4444

45-
This turned out to be quite a lot of fun. I liked breaking down the procgen into smaller pieces, rectangles and such. Unit testing is also going well? I'm not sure if I'm testing functions well, but it seems like some testing is better than none.
45+
DONE:
4646

47-
## Part 4 Dev Notes
47+
1. rewrite input_handler unit tests once the Engine refactor is complete
48+
2. rewrite our action unit tests once the engine refactor is complete
49+
3. rewrite game_map unit tests once the engine refactor is complete
50+
4. rewrite entity unit tests once the engine refactor is complete
51+
5. rewrite procgen unit tests once the engine refactor is complete
52+
6. rewrite engine unit tests not that the engine refactor is complete
4853

49-
### Field of View
54+
😆 with this refactor, only 8 of my 44 unit tests are passing 😎 there's a lot of testing work to be done before we work on part 6 proper.
5055

51-
http://rogueliketutorials.com/tutorials/tcod/v2/part-4/
56+
Alright! All done with the unit test refactor! I was right, there was a lot of work to do! When we change how objects are initialized, it causes problems all over the place.
5257

53-
Field of view is a really cool...and really annoying part of roguelike development. I think I'm going to make sure I have an easy way to turn on and off FOV since it is way easier to debug issues with FOV off.
58+
I've started adding a few of the components (so far, BaseComponent, Fighter, and BaseAI) but I haven't implemented any of them yet. Writing unit tests for them has been helpful, I'm relatively confident their implementation will work without too many headaches, provided I use them as intended.
5459

55-
OOF, development is starting off rough. At some point in part 3 I removed pyvenv.cfg from the repo (since it directly relates to the local development environment) and it got deleted when I pulled again 😑 I'm not sure how to remove files from a repo without deleting them. It seems like .gitignore should apply to pulls as well, don't pull adds/deletes/changes to files in the .gitignore. Regardless, I think I got it back up and running.
60+
We're making progress. There have been a couple things I've had issues adding unit tests for - mostly in HostileEnemy.perform - we have a component that will call the perform function on a different class, which has proven difficult to mock. Otherwise, things are going smoothly.
5661

57-
Complete! I got most of the tests up and running well too! Except for engine.compute_fov - for some reason, I couldn't get it set up to assert the tcod.map.compute_fov was called or that the engine.game_map.visible array changed after calling it. Which is weird, because in gameplay it's working just fine. I will likely need to revisit if I find a bug in the code :)
62+
And we're done!! I don't remember exactly how much time I spent on this part, I would hazard a week or so? The initial refactor and fixing of unit tests was pretty intense, then the subsequent code changes were pretty intense to! I've very happy with the results, and am reasonably confident in my learning progress so far. One thing I've got on my brain... this tutorial code IS NOT written to be robust, it's written to accept expected inputs and use them. As such, there is probably a lot of coding and testing that could be done to ensure that functions are only used as intended... that is extra work I'm not intending to do. I will implement positive and negative tests where applicable, but will likely not alter existing code to handle extra weird inputs at this time (nor look to test for them).
63+
64+
At the moment, I think the project is in a good spot where I can look to build up a deployment pipeline of some sort. I've never created releases for a python project, so this should be interesting.
5865

5966
## Part 5 Dev Notes
6067

@@ -66,41 +73,46 @@ Oh snap! Now that we have a dungeon, we're ready to start filling it with stuff!
6673

6774
This was a very fun chapter! We touched a lot of different functions, and I can see the pieces of things coming together really well. I liked the use of the BumpAction and I think it presented an interesting challenge for unit testing. As it stands, I'm starting to get confident in my ability to build and run the program and have it work as expected so long as my unit tests have passed! I think there's still plenty of room for improvement in them, but as it is, I'm happy with what I've learned.
6875

69-
## Part 6 Dev Notes
76+
## Part 4 Dev Notes
7077

71-
### Doing (and taking) some damage
78+
### Field of View
7279

73-
http://rogueliketutorials.com/tutorials/tcod/v2/part-6/
80+
http://rogueliketutorials.com/tutorials/tcod/v2/part-4/
7481

75-
Heyo, it looks like this part is going to start with a bit of a code refactor! This means we'll be making lots of changes to our existing codebase + lots of changes to our existing unit tests. This part might be a bit of a pain...but we'll come through!
82+
Field of view is a really cool...and really annoying part of roguelike development. I think I'm going to make sure I have an easy way to turn on and off FOV since it is way easier to debug issues with FOV off.
7683

77-
DONE:
84+
OOF, development is starting off rough. At some point in part 3 I removed pyvenv.cfg from the repo (since it directly relates to the local development environment) and it got deleted when I pulled again 😑 I'm not sure how to remove files from a repo without deleting them. It seems like .gitignore should apply to pulls as well, don't pull adds/deletes/changes to files in the .gitignore. Regardless, I think I got it back up and running.
7885

79-
1. rewrite input_handler unit tests once the Engine refactor is complete
80-
2. rewrite our action unit tests once the engine refactor is complete
81-
3. rewrite game_map unit tests once the engine refactor is complete
82-
4. rewrite entity unit tests once the engine refactor is complete
83-
5. rewrite procgen unit tests once the engine refactor is complete
84-
6. rewrite engine unit tests not that the engine refactor is complete
86+
Complete! I got most of the tests up and running well too! Except for engine.compute_fov - for some reason, I couldn't get it set up to assert the tcod.map.compute_fov was called or that the engine.game_map.visible array changed after calling it. Which is weird, because in gameplay it's working just fine. I will likely need to revisit if I find a bug in the code :)
8587

86-
😆 with this refactor, only 8 of my 44 unit tests are passing 😎 there's a lot of testing work to be done before we work on part 6 proper.
88+
## Part 3 Dev Notes
8789

88-
Alright! All done with the unit test refactor! I was right, there was a lot of work to do! When we change how objects are initialized, it causes problems all over the place.
90+
### Generating a Dungeon
8991

90-
I've started adding a few of the components (so far, BaseComponent, Fighter, and BaseAI) but I haven't implemented any of them yet. Writing unit tests for them has been helpful, I'm relatively confident their implementation will work without too many headaches, provided I use them as intended.
92+
http://rogueliketutorials.com/tutorials/tcod/v2/part-3/
9193

92-
We're making progress. There have been a couple things I've had issues adding unit tests for - mostly in HostileEnemy.perform - we have a component that will call the perform function on a different class, which has proven difficult to mock. Otherwise, things are going smoothly.
94+
I'm really looking forward to dungeon generation. The procedural nature is probably my favorite part of roguelike development/working through these tutorials.
9395

94-
And we're done!! I don't remember exactly how much time I spent on this part, I would hazard a week or so? The initial refactor and fixing of unit tests was pretty intense, then the subsequent code changes were pretty intense to! I've very happy with the results, and am reasonably confident in my learning progress so far. One thing I've got on my brain... this tutorial code IS NOT written to be robust, it's written to accept expected inputs and use them. As such, there is probably a lot of coding and testing that could be done to ensure that functions are only used as intended... that is extra work I'm not intending to do. I will implement positive and negative tests where applicable, but will likely not alter existing code to handle extra weird inputs at this time (nor look to test for them).
96+
This turned out to be quite a lot of fun. I liked breaking down the procgen into smaller pieces, rectangles and such. Unit testing is also going well? I'm not sure if I'm testing functions well, but it seems like some testing is better than none.
9597

96-
At the moment, I think the project is in a good spot where I can look to build up a deployment pipeline of some sort. I've never created releases for a python project, so this should be interesting.
98+
## Part 2 Dev Notes
9799

98-
## Part 6.5 Building, Testing, Releasing, etc
100+
### The generic Entity, the render functions, and the map
99101

100-
I spent an evening futzing around with a couple things here that I want to document. Firstly, I set up a GitHub action that will very specifically build the project and run all my unit test whenever I commit to main! This is really nice as it will let me know if any code makes it to the repo that breaks some functions. This is a really important part of continuous integration even if I'm not really trying to continuously integrate this code anywhere. Secondly, I figured out how to use pyinstaller to build an executable of my python project. This has been difficult for me to do in the past, so it was really nice to get it somewhat figured out. The pyinstaller command I use to build is:
102+
http://rogueliketutorials.com/tutorials/tcod/v2/part-2/
101103

102-
- pyinstaller --add-data "dejavu10x10_gs_tc.png;." main.py
104+
I had a good time setting up unit tests and such in part one, and I think part 2 is going to be a challenge. At this exact time, I'm looking at setting up unit tests for the engine scripts, am seeing functions that will be difficult to test, and am looking forward to the puzzle solving.
103105

104-
This will build the python codebase and add the font file to the root of the folder. This goes into a 'dist' folder -> I can zip this up and distribute it as a release on GitHub!.
106+
After quite a bit of futzing, I'm feeling really good about the development process here. Create script, write tests, implement code, see results. I think it will be really interesting to update/fix unit tests as the codebase changes. Part 2 is complete! Looking forward to part 3!
105107

106-
That's everything for this section I think. Any new unit tests I add should automatically be ran by the GitHub action. I may need to adjust my pyinstaller commands, especially as I add/alter external font files.
108+
## Part 1 Dev Notes
109+
110+
### Drawing the '@' symbol and moving it around
111+
112+
http://rogueliketutorials.com/tutorials/tcod/v2/part-1/
113+
114+
It has been a long time since I did anything significant with python or tcod, so this should be a lot of fun.
115+
116+
Welp, after finishing part one, there is a lot of syntax in here that I'm not very familiar with. I think I understand the gist of what's happening, but it will take some work before I'm fully comfortable with it. Regardless, I'm really enjoying how this is going!
117+
118+
I got movin' and groovin' on unit testing and after some finagling I got a suite of unit tests running on the overwritten ev_quit and ev_keydown functions. I found this to be an educational experience, and look forward to setting up more unit tests as the codebase grows.

0 commit comments

Comments
 (0)