It's hard to find ourselves in the middle of other people's over-activity. Many of those occur as sun-downing (anytime between say 2pm to 6pm and usually lasting a couple of hours, pretty regular in timing too).
People who continue all night long may in fact be suffering form some kind of PTSD (often, old soldiers do this, or women molested as children)and might well benefit from the right kind of medication prescribed through a psychiatrist or geriatric specialist.
Very wild behavior is not "normal" sun-downing, so do go and see an expert. Get the help that makes life bearable for everyone, including you. Get a doctor's referreal to the right epxert. It will be covered by the VA or Medicare.
In "normal" regular time sun-downing, you'll often hear what is really bothering a person. So, do listen and respond caringly and you will often find that people become calmer. Always, think about taking them for a drive, if they like that. It's calming for most people, including yourself probably (i know it works for me!).
Sun-downing is not always nonsense. Often it is when you really find out the unsettled life issues that bother your person. We don't have to fix them necessarily -- just listen.
Other times, maybe people are so bored they're just acting out. maybe some kind of activity or day program might work. Or have someone else sit with them while you get a break. Too many people are kind of stuck with nothing to do when they have dementia and they act out of having nothing.
Make up stuff for them to do. Sweep leaves, wash cuos, cut coupons, anything that you find works. There are some good activity books for people with dementia. Go on the internet.
There really are lots of answers to experiment with. What works on Monday may not work on Wednesday -- that's why we call it dementia.
For caregivers, get what you need to get through. Ear-plugs. Headphones and your favorite music. Go for a drive in the car, wind up the windows and scream == but not when your dad's in the car, okay?