I don't remember what the movie called but I know some of the details. I think it was a Chinese movie or a hong kong movie
The setting was in the old times. The main guy has to take care of his siblings when they go to a festival. One of his siblings is lost and the guy looks for them. He sees his sibling climbing this tower so the guy climbs up there to save him/her. He didn't know that he was participating in a game where the man who can climb to the top can be suitable for the girl up there. The guy also finds the sibling by this other girl who is doing some singing. The athletic style girl is moved by the guy as the artistic girl is too. There's some fantasy stuff in the movie along with wuxia. I know the ending is where one of the three between the 2 girls and the guy has to die for a reason.
Spoiler: The guy decides to die so that the two girls can live instead of one girl dead and the other girl can end up with him.
Please help me know what this movie is called.