You can buy a product at your local home improvement store that is like cement but is design to level floors. You can also jack up the floor from underneith and add new supports to keep the floor level. If your subfloor has chunks out of it you could replace that section with new wood.