How do I lay joists over a complex-sloped basement floor
Use some self-leveling mortar or concrete.

It's a mortar/concrete that is liquid. You pour it out, and help it a bit and it levels itself automatically.

If the slope is extreme (more than an inch or two), then get it semi-close (but lower) with some regular concrete, then finish with the self leveling stuff.

You say joists, but are these joists actually suspended above the floor? You will have a very hard time cutting them to match a bumpy floor.

To find level on the floor get a bucket of water and a thin, flexible, transparent hose. Fill the hose with water and submerge in the bucket, then attach it to the bucket so it doesn't fall out and take the end of the hose to your wall, then mark the water level all over the place.

Subtract a fixed amount from the water level (cut a piece of wood the right length) to get the actual height you need.