I finally made a functional 2d BSP engine after an embarrassing amount of time LOL. Nothing much else to say other than that it is shockingly small in terms of code (at least from what i saw compared to other BSP implementations) The render order is only listing lines facing the mouse tree structuring: parent (of current line) current line if the current line is in front or behind parent Child line front Child line behind separator (to make it easier to read the tree) if the front or behind child line slots are empty, that means there were no lines on a certain side of a line if both are empty, that means it is the end of the branch and there were no more lines to add to the tree