Handmade Hero»Episode Guide
Trying Separate Y and Z Sorts
?
?

Keyboard Navigation

Global Keys

[, < / ], > Jump to previous / next episode
W, K, P / S, J, N Jump to previous / next marker
t / T Toggle theatre / SUPERtheatre mode
V Revert filter to original state Y Select link (requires manual Ctrl-c)

Menu toggling

q Quotes r References f Filter y Link c Credits

In-Menu Movement

a
w
s
d
h j k l


Quotes and References Menus

Enter Jump to timecode

Quotes, References and Credits Menus

o Open URL (in new tab)

Filter Menu

x, Space Toggle category and focus next
X, ShiftSpace Toggle category and focus previous
v Invert topics / media as per focus

Filter and Link Menus

z Toggle filter / linking mode

Credits Menu

Enter Open URL (in new tab)
0:50Be our own code fairyα
0:50Be our own code fairyα
0:50Be our own code fairyα
1:16Recap and set the stage for the day
1:16Recap and set the stage for the day
1:16Recap and set the stage for the day
1:57Z-buffering is not a good idea for 2D stuff
1:57Z-buffering is not a good idea for 2D stuff
1:57Z-buffering is not a good idea for 2D stuff
4:08quartertron's sorting suggestion, or potentially using an insertion sort to make a poor man's binary space partition1
4:08quartertron's sorting suggestion, or potentially using an insertion sort to make a poor man's binary space partition1
4:08quartertron's sorting suggestion, or potentially using an insertion sort to make a poor man's binary space partition1
7:04Blackboard: Separately sorting Z-sprites and Y-sprites, then merge sorting those sorted sprites
7:04Blackboard: Separately sorting Z-sprites and Y-sprites, then merge sorting those sorted sprites
7:04Blackboard: Separately sorting Z-sprites and Y-sprites, then merge sorting those sorted sprites
14:23handmade_sort.cpp: Introduce versions of MergeSort() for MergeSortY() and MergeSortZ()
14:23handmade_sort.cpp: Introduce versions of MergeSort() for MergeSortY() and MergeSortZ()
14:23handmade_sort.cpp: Introduce versions of MergeSort() for MergeSortY() and MergeSortZ()
19:29handmade_sort.cpp: Introduce versions of IsInFrontOf() for IsInFrontOfY() and IsInFrontOfZ()
19:29handmade_sort.cpp: Introduce versions of IsInFrontOf() for IsInFrontOfY() and IsInFrontOfZ()
19:29handmade_sort.cpp: Introduce versions of IsInFrontOf() for IsInFrontOfY() and IsInFrontOfZ()
20:51Consider how to separate the Y- and Z-sprites
20:51Consider how to separate the Y- and Z-sprites
20:51Consider how to separate the Y- and Z-sprites
23:26handmade_sort.cpp: Make MergeSort() separate the Y- and Z-sprites
23:26handmade_sort.cpp: Make MergeSort() separate the Y- and Z-sprites
23:26handmade_sort.cpp: Make MergeSort() separate the Y- and Z-sprites
24:12Blackboard: Separating and compacting an array
24:12Blackboard: Separating and compacting an array
24:12Blackboard: Separating and compacting an array
25:14handmade_sort.cpp: Continue making MergeSort() separate out those sprites
25:14handmade_sort.cpp: Continue making MergeSort() separate out those sprites
25:14handmade_sort.cpp: Continue making MergeSort() separate out those sprites
27:55Blackboard: The sizes of the two arrays
27:55Blackboard: The sizes of the two arrays
27:55Blackboard: The sizes of the two arrays
29:08handmade_sort.cpp: Make MergeSort() call MergeSortY() and MergeSortZ()
29:08handmade_sort.cpp: Make MergeSort() call MergeSortY() and MergeSortZ()
29:08handmade_sort.cpp: Make MergeSort() call MergeSortY() and MergeSortZ()
31:01Blackboard: Copies of the sorted stuff
31:01Blackboard: Copies of the sorted stuff
31:01Blackboard: Copies of the sorted stuff
31:57handmade_sort.cpp: Consider making MergeSortZ() copy to the Temp buffer
31:57handmade_sort.cpp: Consider making MergeSortZ() copy to the Temp buffer
31:57handmade_sort.cpp: Consider making MergeSortZ() copy to the Temp buffer
33:24handmade_sort.cpp: Make MergeSort() copy to the Temp buffer if there are 1 or 2 Z-sprites to be sorted
33:24handmade_sort.cpp: Make MergeSort() copy to the Temp buffer if there are 1 or 2 Z-sprites to be sorted
33:24handmade_sort.cpp: Make MergeSort() copy to the Temp buffer if there are 1 or 2 Z-sprites to be sorted
39:16"It's no skin off our back"β
39:16"It's no skin off our back"β
39:16"It's no skin off our back"β
39:18handmade_sort.cpp: Clean up compile errors
39:18handmade_sort.cpp: Clean up compile errors
39:18handmade_sort.cpp: Clean up compile errors
41:21"We probably need to go through this code more carefully"γ
41:21"We probably need to go through this code more carefully"γ
41:21"We probably need to go through this code more carefully"γ
42:14Run the game and see that we are sort of anywhere close
42:14Run the game and see that we are sort of anywhere close
42:14Run the game and see that we are sort of anywhere close
42:51Run the game and hit the assertion in SortEntries()
42:51Run the game and hit the assertion in SortEntries()
42:51Run the game and hit the assertion in SortEntries()
43:41Debugger: Break into MergeSort() and inspect the YCount and ZCount
43:41Debugger: Break into MergeSort() and inspect the YCount and ZCount
43:41Debugger: Break into MergeSort() and inspect the YCount and ZCount
45:02handmade_sort.cpp: Give MergeSort() some verification tests
45:02handmade_sort.cpp: Give MergeSort() some verification tests
45:02handmade_sort.cpp: Give MergeSort() some verification tests
45:31handmade_sort.cpp: Introduce IsZSprite()
45:31handmade_sort.cpp: Introduce IsZSprite()
45:31handmade_sort.cpp: Introduce IsZSprite()
46:27handmade_sort.cpp: Continue giving MergeSort() these tests
46:27handmade_sort.cpp: Continue giving MergeSort() these tests
46:27handmade_sort.cpp: Continue giving MergeSort() these tests
47:05Debugger: Break into MergeSort() and find that it passed the tests
47:05Debugger: Break into MergeSort() and find that it passed the tests
47:05Debugger: Break into MergeSort() and find that it passed the tests
47:19handmade_sort.cpp: Introduce VerifyBuffer() to verify the type of sprites in that buffer, and make MergeSort() call it
47:19handmade_sort.cpp: Introduce VerifyBuffer() to verify the type of sprites in that buffer, and make MergeSort() call it
47:19handmade_sort.cpp: Introduce VerifyBuffer() to verify the type of sprites in that buffer, and make MergeSort() call it
49:23Debugger: Break into MergeSort() again and find that everything is in the right place
49:23Debugger: Break into MergeSort() again and find that everything is in the right place
49:23Debugger: Break into MergeSort() again and find that everything is in the right place
49:58Consider making a better merge
49:58Consider making a better merge
49:58Consider making a better merge
51:38Blackboard: What the sort is doing
51:38Blackboard: What the sort is doing
51:38Blackboard: What the sort is doing
53:10handmade_sort.cpp: Look at what IsInFrontOf() is doing
53:10handmade_sort.cpp: Look at what IsInFrontOf() is doing
53:10handmade_sort.cpp: Look at what IsInFrontOf() is doing
55:28handmade_sort.cpp: Make VerifyBuffer() verify that the sprites are correctly sorted
55:28handmade_sort.cpp: Make VerifyBuffer() verify that the sprites are correctly sorted
55:28handmade_sort.cpp: Make VerifyBuffer() verify that the sprites are correctly sorted
56:26Debugger: Run the game and hit the assertion in VerifyBuffer()
56:26Debugger: Run the game and hit the assertion in VerifyBuffer()
56:26Debugger: Run the game and hit the assertion in VerifyBuffer()
56:53A few words on "test driven development"
56:53A few words on "test driven development"
56:53A few words on "test driven development"
58:02Debugger: Break into VerifyBuffer() and inspect the positions of the sprites upon failing
58:02Debugger: Break into VerifyBuffer() and inspect the positions of the sprites upon failing
58:02Debugger: Break into VerifyBuffer() and inspect the positions of the sprites upon failing
59:38handmade_sort.cpp: Turn MergeSortY() into MergeSort() in order to do IsInFrontOf() in both cases
59:38handmade_sort.cpp: Turn MergeSortY() into MergeSort() in order to do IsInFrontOf() in both cases
59:38handmade_sort.cpp: Turn MergeSortY() into MergeSort() in order to do IsInFrontOf() in both cases
1:00:37handmade_sort.cpp: Rename MergeSort() to SeparatedSort(), and remove MergeSortZ() entirely
1:00:37handmade_sort.cpp: Rename MergeSort() to SeparatedSort(), and remove MergeSortZ() entirely
1:00:37handmade_sort.cpp: Rename MergeSort() to SeparatedSort(), and remove MergeSortZ() entirely
1:01:17Debugger: Run the game and catch some sprites that our test thinks are incorrectly sorted
1:01:17Debugger: Run the game and catch some sprites that our test thinks are incorrectly sorted
1:01:17Debugger: Run the game and catch some sprites that our test thinks are incorrectly sorted
1:02:39handmade_sort.cpp: Temporarily toggle SortEntries() to do only the partial ordering check
1:02:39handmade_sort.cpp: Temporarily toggle SortEntries() to do only the partial ordering check
1:02:39handmade_sort.cpp: Temporarily toggle SortEntries() to do only the partial ordering check
1:02:54Run the game and see the visual results
1:02:54Run the game and see the visual results
1:02:54Run the game and see the visual results
1:03:12Q&A
🗩
1:03:12Q&A
🗩
1:03:12Q&A
🗩
1:05:37roam00010011 I'm trying to take a different approach, using the projected sprites on the screen to sort, and using the min / max y values (up) as a depth sorting key
🗪
1:05:37roam00010011 I'm trying to take a different approach, using the projected sprites on the screen to sort, and using the min / max y values (up) as a depth sorting key
🗪
1:05:37roam00010011 I'm trying to take a different approach, using the projected sprites on the screen to sort, and using the min / max y values (up) as a depth sorting key
🗪
1:06:19roam00010011 Working on it
🗪
1:06:19roam00010011 Working on it
🗪
1:06:19roam00010011 Working on it
🗪
1:07:24staythirsty90 What is a full stack developer?
🗪
1:07:24staythirsty90 What is a full stack developer?
🗪
1:07:24staythirsty90 What is a full stack developer?
🗪
1:10:08poohshoes Won't sorting fail because a lower Z sometimes needs to be drawn on top of a higher Z if a Y-sprite overlaps them?
🗪
1:10:08poohshoes Won't sorting fail because a lower Z sometimes needs to be drawn on top of a higher Z if a Y-sprite overlaps them?
🗪
1:10:08poohshoes Won't sorting fail because a lower Z sometimes needs to be drawn on top of a higher Z if a Y-sprite overlaps them?
🗪
1:11:05Blackboard: PoohShoes's diagram
1:11:05Blackboard: PoohShoes's diagram
1:11:05Blackboard: PoohShoes's diagram
1:12:52Miblo At the start you mentioned "insertion sort" and potentially automatically getting a binary tree representation of the sprites. What happened to that idea, assuming I roughly understand correctly what you've done?
🗪
1:12:52Miblo At the start you mentioned "insertion sort" and potentially automatically getting a binary tree representation of the sprites. What happened to that idea, assuming I roughly understand correctly what you've done?
🗪
1:12:52Miblo At the start you mentioned "insertion sort" and potentially automatically getting a binary tree representation of the sprites. What happened to that idea, assuming I roughly understand correctly what you've done?
🗪
1:13:11Blackboard: Graph sort
1:13:11Blackboard: Graph sort
1:13:11Blackboard: Graph sort
1:14:49roam00010011 How do you transform the sprites from world to screen coordinates?
🗪
1:14:49roam00010011 How do you transform the sprites from world to screen coordinates?
🗪
1:14:49roam00010011 How do you transform the sprites from world to screen coordinates?
🗪
1:15:11That's it for today
🗩
1:15:11That's it for today
🗩
1:15:11That's it for today
🗩