The subject of these lectures is enumerative geometry of curves on algebraic surfaces and its relation to Hilbert schemes of points, real algebraic geometry and tropical geometry. The generating function of the Euler numbers of Hilbert schemes of points on curves has been used by Pandharipande and Thomas to give a mathematical definition of Gopakumar-Vafa invariants, and by Kool-Shende-Thomas to give a proof of a conjecture of mine which describes the generating function of the numbers of δ-nodal singular curves in a linear system of dimension δ on any surface. Shende and me gave a conjectural refinement of this conjecture. Here the number of curves is replaced by a polynomial, whose meaning is still mysterious, but it can be seen to be related to tropical geometry and real algebraic geometry. In this series of lectures we want to explain this circle of ideas, and also use the opportunity to introduce a number of important concepts and techniques, generating functions, cobordism ring, localization, Severi degrees, Welschinger invariants, tropical geometry, Heisenberg algebra.