I am planning to visiting several ancestral small towns including: Hambach, Diedesfeld, Stockach. I would appreciate finding out how to prepare for the visit.
I would take a look at this link. It is a great place to learn about this country it describes what kind of records are available, it's background, enjoy it:
There are several Hambach's in Germany. Which state is your Hambach in?
If you want addresses to visit, try civil registration (addresses were not always recorded) and directories. Contacting a local genealogical or historical society is a good idea. Note that Europeans tend to clear graves after a period of time (due to a lack of space in densely populated areas), therefore the chance of seeing gravestones of relatives from more than 100-150 years ago is slim.
Thank You for your question, there is a lot of Information on Wiki, go to Europe find Germany, and put your question into the search bar. There are many groups that you can join to find the correct information that you are looking for.
I hope this will help you before your visit to Germany
As others have pointed out information on the FamilySearch Wiki can be quite helpful. Since you know the ancestral villages, I would presume you have church records about the families, but the suggestion to contact local genealogy groups can also be beneficial as they would be aware of local resources. By specifically contacting the Rathaus for each village you may be able to arrange for a person knowledgeable about its history, families, and genealogy to meet you. Minimally take copies of pedigree sheets with you. Also inquire about books giving the history and details of the villages that you can purchase (or look ahead of time on WorldCat or the village website). My ancestors are mentioned in the 750 year history of their ancestral village. Finally, inquire about village or community (Gemeindearchiv) archives. The village where my ancestors lived is included in a Gemeindearchiv for 12 villages. When I visited in 2014 I took over 250 photos of documents for my family. These records give a great deal of information about them and their life. When planning your schedule, check opening times for all archives and similar places you plan to do research before departing. Also check for national and state holidays when things could be closed. Finally make reservations and reserve any special equipment needed (microfilm reader) for the research facilities you plan to visit. This will help to insure that you can access the materials you want when you are there. Some archives only pull documents at certain times of day, so if you know a specific type of record you want to research, order it in advance--particularly at larger archives like State Archives. If you have records from a Bürgerbuch, Kaufbuch, Katasterkarte, etc. you should be able to find the house where your ancestors lived (perhaps with the help of the county survey office (Vermessungsamt) to provide the current address, if it has changed.
One thing I forgot to mention is that you can check to see the people who still live in each of the villages with the surnames of interest by checking the online German telephone book at www.dastelefonbuch.de
You could then either call them (if you speak German) or write them a letter in advance of your trip to connect with possible cousins.