In order to properly fire on a ship from a distance i.e. in WWI, I presume you'd have to know where it was headed and at what speed? How could that have been accomplished with no point of reference?
Fire control in WWI was in a strange position. The essential elements of effective fire control were in place, but technical and training factors meant that hit rates could be very low - ~5%. Fire control required working out where the target would be when the shell arrived, but the only available inputs were the position of the target at present and in the past.
The first part of solving the fire control problem was finding the range to the target. This was probably the easiest to solve, and was the first to be approached. In 1855, a British gunnery expert, Howard Douglas, proposed a device called a stadimeter. This allowed a gunnery officer to measure the angle between a target ship's waterline and the top of its mast. If you knew the height of the mast, you could derive the range with simple trigonometry. Alternatively, a sextant could be used from a mast of a known height; by measuring how far below the horizon a ship's waterline appeared, you could do similar trigonometry to work out the range. The stadimeter was the more effective of these techniques, surviving past WWII despite the appearance of more effective rangefinders. In the 1880s, the Royal Navy started to investigate optical rangefinders. An 1885 gunnery manual describes a failed experiment with a two-man rangefinder system. One man would be stationed at the ship's bow and one at the stern. By measuring the angle between the ship's centreline and the target, and knowing the length of the ship, the range could be derived. However, this required large amounts of communication between two widely separated teams, and so was deemed to be impractical. A similar system was developed by an American officer in 1889, which had successful tests with the American and French navies, though neither adopted it.
In 1891, the RN advertised for a rangefinder with 1% accuracy at 3000 yards. The next year, three systems were tested aboard the cruiser Arethusa. The winner was the system designed by the Glasgow-based Barr & Stroud company, called the coincidence rangefinder. This had a long tube with a set of mirrors and lenses at each end. The two mirrors produced two different images - one might produce the top half of the target and one the bottom, or one with the target vertical and one inverted. One of the mirrors could be moved, to line up the two images. By measuring the angle of the mirror, the range to the target could be derived. In 1893, the German Zeiss company designed a similar system, the stereoscopic rangefinder. The stereoscopic rangefinder had a similar basic design to the coincidence rangefinder, with two mirrors separated in a long tube. Unlike the coincidence rangefinder, neither mirror moved. Instead, it relied on an operator with perfect binocular vision, who could the mirrors produce a single image with apparent depth. A marker could be moved forwards and backwards through the image. When it coincided with the target, the range could be read off. The coincidence system was fairly widely used in the early 20th century, though the stereoscopic system, adopted by the German navy in 1912, began to supplant it in the 1930s.
The rangefinder, whether coincidence or stereoscopic, could give the range to a target, but could not tell you where to aim. This required knowledge of the speed at which the range and bearing to the target changed (the 'range rate' and 'bearing rate' respectively). However, in 1902, a British gunnery officer, John Dumaresq, made a significant discovery. He worked out that the vector that represented the changing distance between two ships steaming on constant courses at constant speeds had a constant magnitude and direction. However, if the two ships were not on parallel courses at identical speeds, the components of this vector along the line of sight and perpendicular to it would vary. These two could be measured over time with the rangefinder, by measuring the changes in range to the target and the change in bearing to the target. However, this was a slow process and was heavily influenced by errors in the measurements. Instead, Dumaresq used his insight to construct a mechanical calculator which could solve this problem. This device, which would be named after him, used three bars. One represented your ship's speed and course, another one the target's speed and course. The third was attached to a dial, and was rotated to point along the line of sight between the two ships. The range rate could then be read off. To translate this range rate to a range, the RN used a device called a Vickers Clock, which could be set to spin at a particular range rate and thus automated the process of calculating. The Dumaresq did require some knowledge of the target's course and speed. These could be estimated by looking at how foreshortened the target looked, and how big its bow wave was. These initial estimations could then be used to calculate a range rate, which would give a predicted range at some point in the future. At that point, the actual range could be compared to the predicted range. The difference between the two could be used to update the estimations of course and speed in an iterative process. The Dumaresq could also be used in reverse to determine the target's speed and course, a technique known in the RN as 'cross-cut'. If you knew the rate at which the range and bearing were changing, from plotting measurements of these, and the line-of-sight to the target, then by setting the Dumaresq to produce these results would give the target's speed and course. However, this required an accurate bearing rate, which could only be done on a ship which had a gyrocompass.
Plotting was another important concept in fire control, developed in the 1900s and 1910s by the civilian Arthur Pollen and naval officer Frederick Dreyer. Much like Dumaresq's idea, plotting was a fairly simple concept - data taken over time was graphed out, and used to derive the necessary data for fire control. Dreyer and Pollen championed two separate concepts of plotting. Dreyer assumed that range and bearing were only loosely connected. In this case, a plot of range against time would give the range rate. Pollen preferred a more complex plot, which tried to track the movement of the firing and target ship over time. The movement of the firing ship was known, while the movement of the target ship could be plotted from measurements of range and bearing at given times. A third option attempted to plot the motion of the target ship as if the firing ship was not moving, but this proved to be impossible as the motion of the two ships could not be disentangled. The Dreyer system was simpler and easier to implement, while the Pollen system was better able to handle ships making complex manouevres. In 1910, Dreyer patented a plotter, and a year later produced a system called the Dreyer Table. This combined his plotter, a range clock, a Dumaresq and a system for transmitting the ensuing range to the turrets. It was a fairly automated system for the time. Ranges measured by the rangefinders were transferred to the plot by an arm which pierced holes in a paper plot at the appropriate time. An operator turned a measuring dial to parallel the slope of the plot, which gave the range rate. This could be used to set the range clock, with the Dumaresq in reserve for setting ranges if rangefinding was impossible, for correcting the range rates from the plot or for calculating the target's course and speed by crosscut. The range clock, as well as showing the range at a given time, operated a pencil which drew the calculated range on the plot - this made it obvious if errors were present. Later designs added a number of refinements - automatic linkages to the ship's gyrocompass to cancel out the ship's movements, an additional clock for the bearing rate (which was also plotted) and a mechanism for taking ranges from multiple rangefinders being the most significant. The Dreyer Table, in its various iterations, was adopted as the main fire control system for the RN for WWI. The Pollen system, dubbed the 'Argo Clock', was much more complex. In its initial form, it took in a measurement of the target range, bearing and the rates of change of these two quantities. It then calculated the target's course and speed, using these measurements to create a virtual plot. It then generated an estimate of the target's range and bearing from this. Later iterations just took estimates of the target's course and speed, as well as the bearing and range to the target and the firing ship's speed. The RN used several of these systems, initially purchased for trials, during WWI, while the Russian Navy purchased several. The USN used similar systems produced by the competing companies of Sperry and Ford. Ultimately, WWI experience showed Dreyer's system to be less capable in action, and 'synthetic' systems along the lines of Pollen's won out in the interwar period.