In the case of a perpetual motion machine, the point is typically not to gain altitude for the whole machine. However, 'free' altitude can be gained in some specific situations in which the rising portion of the weight has reduced resistance (such as by being positioned on a very slight slope), and when the counter-balance of this mass moves a smaller distance. Additionally, specific aspects must be arranged so that the smaller mass has advantage to repeat the cycle through operation of leverage or some other (?) principle, thus placing considerable restraint on the exact design. Sometimes the entire advantage might take place through having sufficient counterbalance to raise the weight to a position in which it can be unsupported. Another entire example is if dominoes don't have to be reset. In that case, enough units must take place in the correct arrangement of pulleys and with the right proportions to permit not only continuation between one unit and the next, but the entire cycle of all units, at any altitude that has gravity.
More at my website at: http://www.nathancoppedge.com/Generato.html
International Society for the Philosophy of Architecture » Ethics and Aesthetics of Architecture and the Environment