Introduction

How animals use space is an important attribute of their life history and ecology. Their mobility and site fidelity substantially vary, from foraging within a local home range, through nomadic movements at larger scales, to seasonal global migration (Nathan et al. 2008). Variations across scales often occur among similar movement phenomena. For example, some central-place foragers (Pyke et al. 1977), such as albatrosses, may travel over 1000 km to and from their central site, whereas site-attached fish might never travel more than a few meters from their shelter. Space use also depends on social structure, which varies from solitary living to highly social groups. In site-attached social groups, foraging individuals keep close to each other, thereby gaining safety from the proximity to a shared shelter (White and Warner 2007a), enhanced vigilance (Ridley et al. 2013) and a dilution effect (Lehtonen and Jaatinen 2016). Yet, living in groups also increases competition (Hixon and Jones 2005; White and Warner 2007b), especially in site-attached animals where group members share a restricted foraging space.

One solution to alleviate competition is spatial partitioning, which is much more common than other types of niche partitioning such as temporal or dietary partitioning (Schoener 1974; Amarasekare 2003). Spatial niche partitioning is a central mechanism for promoting coexistence among species, as shown in prokaryotic and eukaryotic organisms (Winder 2009), plants (Sapijanskas et al. 2014), land animals (Albrecht and Gotelli 2001) and aquatic ones (Eurich et al. 2018). Spatial partitioning has also been well documented within species, such as conspecific breeding colonies of gannets along the British Isles coasts (Wakefield et al. 2013), and adjacent roosting colonies of conspecific bats just a few kilometers apart (Lourie et al. 2021). Moreover, gannets (Patrick et al. 2014) and bats (Goldshtein et al. 2020) also showed spatial partitioning among foraging individuals departing from the same central colony. At an even finer intraspecific level, spatial partitioning among members of consistent groups has been under-investigated. Theory suggests that group members competing for the same resource will partition space hierarchically (Hirsch 2007), with more dominant (Robinson 1981), larger (Forrester 1991; Croft et al. 2003; Andrews et al. 2009) or older (Pereira 1988) individuals occupying the more favorable locations. Factors affecting this type of spatial partitioning include the distribution of resources, risks and their trade-offs (Krause 1994; Hirsch 2007). For example, front position in shoaling fish was found to be preferable in terms of feeding rates, and food-deprived individuals preferred to swim in the front, while frightened individuals preferred central positions (Krause 1993a). Furthermore, the level of site fidelity, whether individuals return to the same site, depends on the heterogeneity and predictability of the resources (Switzer 1993). Switzer’s (1993) theoretical study suggests that site fidelity is expected in unpredictable habitats, when the mean quality within a territory is equal among territories. In contrast, when the site is predictable, it is better to leave after an unsuccessful outcome of the current territory.

Despite considerable progress in tracking technologies (Nathan et al. 2022), studies of spatial partitioning among group members in the wild are still limited due to the need to simultaneously track all group members for extensive time intervals. Difficulties in addressing these challenges have led to study this subject under controlled laboratory settings (Hansen et al. 2016b), in enclosed domesticated animals (Šárová et al. 2010) or in those that can be frequently recaptured (Nagy et al. 2013). In situ studies typically track only part of the group (Krause 1993b) or individuals at different times (Ang and Manica 2010). Only a few studies, limited to relatively large animals, successfully tracked all group members simultaneously in their natural environment. Examples include studies that used GPS to track baboons and guineafowl (Strandburg-Peshkin et al. 2015; Papageorgiou and Farine 2020), acoustic techniques that were used to track dolphins during their cooperative herding of prey (Benoit-Bird and Au 2009) and coordinated foraging movements of squids (Benoit-Bird and Gilly 2012), as well as optical techniques used to track coral reef fishes (Hein et al. 2018; Francisco et al. 2020; Engel et al. 2021). The optical method we utilized in our study enabled us to obtain in situ, simultaneous, 3D tracking of each and all group members in social groups of coral reef fishes. Our high-resolution video cameras provided records of relatively long periods (~ 10 min) during repeated sessions performed over periods lasting > 1 month (Engel et al. 2021).

The objective of this study was to examine the patterns and potential drivers of spatial partitioning within site-attached social groups by tracking all group members over sufficiently long periods, focusing on site-attached, zooplanktivorous, coral reef fish. These fish live in close associations with corals where they hide from predators and forage around them for food (Holzberg 1973; Fishelson et al. 1974; Fricke 1980). Many fish species belonging to this guild are common in most coral reefs world-wide; they live in small groups that forage across a rather restricted space around their sheltering coral, thereby facilitating the tracking of all group members for relatively long periods.

Previous studies on groups of zooplanktivorous coral reef fish found a correlation between the fish’s size and its social rank. Larger fish generally ranked higher and foraged farther up-current than smaller individuals, capturing more zooplankton (Webster and Hixon 2000) and higher proportions of larger prey (Coates 1980; Forrester 1991). By investigating the proportion of fish outside the coral, zooplanktivorous fish were found to balance risk by utilizing environmental and social cues (Hansen et al. 2016a; Kent et al. 2019). Due to technical limitations, none of those studies relied on long-term, high-resolution, 3D tracking of marked individuals. Therefore, assessment of persistent space utilization by group members, if occurring, was impossible. Moreover, as past studies typically tracked fish in 2D along the axis parallel to the flow, “shading” effects–when an up-current individual forages in a water parcel that later becomes the foraging turf of a down-current individual—could not be tested (Forrester 1991). The only exception is a study of 5 groups of Pseudanthias squamipinnis consisting 100–200 females each, where a subset (~ 15–30%) was marked and visually observed their occurrence within four cells, ~ 12 m3 in volume each (Cisarovsky et al. 2012). The coarse spatial resolution, where many fish share the same resolution unit (“cell”), the lack of simultaneous current measurements, and the visual tracking of only a subset of each group precluded the assessment of space partitioning and shading effects.

Here we used high-resolution underwater cameras to record the tracks of individually tagged fish in social groups of the damselfish Dascyllus marginatus in their natural habitat. Current speed and direction were simultaneously recorded to assess their effects on fish behavior.

Fish in this species live in stable social groups, inhabiting the same coral head for months and longer (Sale 1971; Holzberg 1973; A. Engel and A. Genin, unpublished data). The fish are site-attached, foraging within a limited distance from their home coral, allowing rapid retreat to their shelter between the coral branches upon the approach of predators or other risks (Holzberg 1973; Fricke 1980). Their food availability is delimited by the current speed and the prey density, and as the current intensifies the striking angles become more narrow around the direction of the flow (Kiflawi and Genin 1997). Spatial partitioning of hiding space within the home coral has been reported (Holzberg 1973), but no study has yet examined spatial partitioning while foraging.

Our main hypothesis is that (a) in social groups of planktivorous fish, where members mate one with another, group members should minimize intra-group competition while keeping optimal feeding rates. Testable corollaries of this hypothesis included the following questions: (a1) Is the position of the foraging spaces stable, especially when changes in the current direction occur? (a2) Are individual foraging spaces separated? (a3) What is the level of “shading” (see above) and are the movements of neighboring individuals coordinated in a way that significantly minimizes such shading, compared with a null model?

Additional hypotheses we tested include: (b) The volume of the foraging space is affected by other parameters such as current speed, group size, and the fish position relative to the coral. Here, for example, we tested the hypothesis of Kiflawi and Genin (1997) who suggested that under stronger currents, the foraging space should decrease. (c) Is there a difference among group members in the proportion of time allocated for foraging? For example, the occurrence of a better diet in dominant fish (Forrester 1991) may indicate differences in their foraging efforts.

Methods

Study species

Our study focused on the group-forming damselfish Dascyllus marginatus. Similar to other members in this guild of site-attached fish, D. marginatus feeds during the day on drifting zooplankton near its shelter. Large branching corals, mostly Stylophora pistillata and Acropora spp. (Holzberg 1973; Fishelson et al. 1974; Fricke 1980; Kent et al. 2006) provide D. marginatus a shelter into which they retreat at a moment of danger (Fishelson et al. 1974) and in which the fish are found during the night (Goldshmid et al. 2004). D. marginatus lives in social groups ranging in size from 2 to 25 individuals (Fricke 1980). At our study site, most groups consist 5 or less individuals (Kent et al. 2006). The groups exhibit social hierarchies in which the dominant individual is a male and breeding usually occurs within the group (Holzberg 1973; Fricke 1980). When found inside the corals, different individuals appear to maintain separated locations (Holzberg 1973). Social groups use the same host coral and the same composition of individuals for months (Sale 1971; Holzberg 1973, personal observations). To be able to identify the individuals in the studied groups at all times, we selected 4 groups of 3 to 5 individuals each, found at 9–14 m depth. All the fish were adults, 4–6 cm in length. Their sex could not be determined non-intrusively, as the two sexes are morphologically indistinguishable. Three groups resided in relatively isolated corals over sandy area. One group, originally found in close proximity to populated neighboring corals, was translocated ~ 7 m sideways (same depth) to avoid inter-group interactions.

Study site

The study was carried out at the reef in front of the Interuniversity Institute for Marine Sciences in Eilat, Israel, northern Gulf of Aqaba (Eilat), Red Sea. This fringing reef is dominated by stony corals that live on a steep slope extending from the subtidal zone to more than 50 m depth (Rickel and Genin 2005). A detailed description of the reef and the local oceanographic conditions were reported in Genin et al. (2009) and references therein. The reef is exposed to relatively weak currents, dominated by semidiurnal tides and current reversals (average speed of 10 cm s− 1; Genin and Paldor 1998; Reidenbach et al. 2006). The waves are usually weak, due to the proximity of the site to the northern end of the Gulf, and swell-driven flow reversals occur at the depths where the fish were studied (Monismith and Genin 2004).

Fish tagging and tracking

The fish were tagged using black visible implant elastomer dye implanted beneath the fish’s translucent scales. Each fish was tagged at a different point on its body, allowing the identification of all individuals within each group in the video records. The movements of the fish were tracked in situ in 3D using three high-resolution GoPro cameras (2704X1524 pixels) tightly attached at the corners of a 3 m equilateral triangle frame positioned around the fish’s home coral. The three cameras were synchronized every ~ 10 min to within one frame using a sharp acoustic cue, generated by a diver hammering a metal cylinder. The need for this repetitive synchronization was an occasional loss of the cameras’ synchronization over longer period. Synchronized frame numbers in each video record (i.e., the frame at which the acoustic cue started) were determined using VirtualDub (VirtualDub 1.10.4, Avery Lee, http://virtualdub.org). Extensive intrinsic and extrinsic calibration of the cameras was done by recording an object with a known length underwater, later processed using Camera Calibration Toolbox for MATLAB (Bouguet 2010) for the intrinsic calibration, and the open program easyWand5 (Theriault et al. 2014) for the extrinsic calibration.

Each recording session, lasting ~ 1 h, typically consisted of a net fish recording time of ~ 30 min and additional activities (e.g., acoustic synchronizations of the cameras, calibration). The GoPro cameras were set to record at 29.97 frames per sec.

In each video, the fish were detected using a faster-RCNN (Ren et al. 2017) inception V2 model (Huang et al. 2017), pre-trained on the COCO (Common Objects in Context) dataset (Lin et al. 2014). Using transfer learning, we trained the model to detect D. marginatus in the wild under changing lightning and background and fish orientation. Tracking the fish, i.e., connecting their detections to a continuous trajectory in 2D in each video, was done by automatically linking close detections of the same fish in consecutive frames. Ambiguities such as occlusions or fish entering and exiting the branching coral were resolved manually using a custom code written in MATLAB. The calculations of the 3D trajectories from the 2D trajectories were based on the direct linear transformation (DLT) technique as implemented in DLTdv5 (Hedrick 2008). The alignment of reconstructed tracks to true compass bearing was achieved through the recording of underwater, custom-made metal compass. Detailed descriptions of the field work and the video processing at the laboratory, as well as an assessment of the spatial precision of out tracking technique, are available in Engel et al. (2021).

The 3D trajectories were smoothed using a moving average with a window of 5 frames. For each group, the coordinates of the origin were aligned with the center of the coral. To find the center of the coral, the same several points on the surface of the coral were manually digitized and reconstructed in 3D in each tracking day, and a sphere was fitted on them. The center of the sphere was treated as the center of the coral. Figure 1 shows examples of the tracks recorded for a single group during 3 different days.

Fig. 1
figure 1

Tracking coral reef fish in their natural environment under changing currents. Top view of fish trajectories in group III during 3 different days at different current directions: a An interval of 3.6 min in length recorded on March 6th, 2017, during NE current direction. b Combined tracks during two consecutive segments, 2 min long each, separated by 4.2 min in which the entire group entered and remained in the coral (not shown), recorded on March 17, 2017, during NE current direction. c 7.9 min of data recorded on March 18, 2017, during SW current direction. Gray spheres indicate the coral, centered at the origin, and the arrows indicate the direction of the current. Each individual is colored with the same colors in all panels. Note the purple fish’s absence in c when the fish sought shelter inside the coral. During different days with similar current direction (panels b and c), the fish foraged in approximately the same location. When the current reversed (panels a vs. b, panels a vs. c), the fish changed their positions, keeping their relative position with respect to their specific neighbors. The most noticeable change was that of the individual found closest to the bottom in front (up current) of the coral (purple)

Unless otherwise noted, trajectory analysis was done using MATLAB R2020b (Mathworks Inc., Natick, MA).

Dataset

A total of four groups (I-IV) of D. marginatus were video recorded. Groups I and II were tracked in 3D on 3 days for each group during 2015, while groups III and IV were tracked on 5 and 4 days, respectively, during 2017. Each tracking day is termed hereafter a “run.” During two of the runs in group III, one of the fish had not emerged from the coral. Two of the runs of group IV occurred after one of the fish disappeared from the group. Total tracking time in each run ranged between 3:39 and 11:44 min, out of which some fish temporarily entered the corals, resulting in gaps in the trajectories. Further gaps are due to technical limitations and errors. For details, see Table 1. One fish in one of the runs was removed from the analysis, due to non-recoverable problems in the calibration of one of the cameras and because it was not continuously visible by the two other cameras, rendering impossible its tracking in 3D.

Table 1 The reconstructed 3D trajectories of the four groups of D. marginatus. Data points were sampled at 29.97 Hz during runs at different lengths. Detected time is not necessarily continuous, some gaps occur and result in detected time shorter than time outside the coral. Maximum and minimum (among the fish) time outside the coral and detection rate are reported for each run, and detection time for each fish in each run

Additional recording days were done for all groups, for which we did not perform 3D tracking. These, together with the recording mentioned above, were used for the analysis of foraging time (see below).

Current velocity

Currents were measured simultaneously with the video records using an Aquadopp Current Profiler (2 MHz, Nortek, Norway). This current profiler was deployed on the bottom 4–6 m away from the studied group. For our analyses we used the mean velocity calculated across the heights above the bottom within which the fish foraged, averaged over 10-min interval during each run. An interval of 10 min is typically used in analyses of currents at our study site (e.g., Genin and Paldor 1998; Reidenbach et al. 2006).

Foraging spaces

We define the foraging space of a fish as the space it occupies while foraging around the coral. The volume of that space was determined as the size of the volume encompassing 95% of the fish trajectory points that were closest to the center of the fish’s locations, calculated as the average location of each fish in each run. A convex hull was computed for these points and its volume was calculated using the MATLAB function convhull (Fig. 2). The proportion of overlap in a group in a run was determined as the total volume of overlap among the fish divided by total volume of foraging spaces of the fish in that run (sum of volumes of foraging spaces minus the overlap). Overlaps were calculated only for runs during which we had tracks for all group members, resulting in a removal of one run from this analysis.

Fig. 2
figure 2

The volumes of the foraging spaces of different fish. In each panel, each individual fish is indicated by 2 polyhedrons with a similar color (e.g., two shades of green)—see legends. Each polyhedron indicates the position of a single fish in a single run (day). The polyhedrons encompass 95% of the positions closest to the center of the fish’s positions. Gray spheres indicate the corals, centered at the origin, arrows mark the direction of the current. a Two runs of group I with 4 fish, on March 9 and 10, 2015, when the current direction was toward NE. b Two runs of group II with 5 fish, on July 6, 2015, and July 15, 2015, when the current direction was toward SW. Note that while the volume changed between runs, the position of the fish relative to the coral and each other remained constant

Potential shading

“Shading” of fish B by fish A was defined to describe a situation in which fish A was foraging inside a water parcel that later, moving with the current, reach the foraging space of fish B. Thus, fish A had the potential to catch prey that otherwise could have been captured by fish B. To assess that shading potential, we followed a virtual spherical water parcel, 5 cm in diameter (~ the size of the fish) that drifted and arrived at the point where fish B was found at time t. Fish B was considered “shaded” if at any point in the past 3 s, any other fish in the group was found within that water parcel.

In each run, trajectories were cut to 3-s-long sections. Gaps in the data were unified across fish, such that if one fish had a gap in a certain time points, the position of the other fish at this time points was considered as a gap as well. Sections with more than 10% gaps in the data (~ 50% of the sections) and runs with less than 20 sections were discarded (2 runs) resulting in a total of 13 runs used for this analysis. This procedure was chosen in an attempt to balance between the need for data without gaps, and the need to have sufficiently high number of sections to perform statistical tests.

Foraging time

The proportion of time each fish in each group was foraging, measured as the proportion of time spent outside the coral, was manually observed and measured in recordings lasting 10 min. This was done 6 times for each group over 6 independent days.

Statistics

Position and separation of foraging spaces

For a measure of the position of a foraging space we used the center of its foraging space during a run. To evaluate the consistency in those positions for each fish (corollary a1), we calculated the deviation in its position in each run from its average position calculated over all runs. Since in our study site the reversing currents have two opposite directions (see above), and since we expect the fish to position themselves up current, facing the approaching prey, we tested for a “mirroring effect” on the positions of the fish (i.e., when the current reversal occurs, each fish moves to the same position on the other side of the coral). We performed a mirroring transformation on all runs with NE current (see Fig. 5 in the supplementary material) and calculated the deviation from the mean position after transformation. As a comparison for both measures, we calculated for each fish in each run the distance to the nearest neighbor. Assuming the fish keep their position relatively constant across different runs, we predicted that the deviation distance from the mean position of each fish will be significantly lower than the distance of that fish to its nearest neighbor. If the fish mirror their position with the current reversal, we expected an even larger difference between the deviation distance and the distance to the nearest neighbor. For this test we did not include runs with current speed lower than 7 cm s− 1, because the directions of weaker currents were highly inconsistent. We used generalized linear mixed-effects model using “lme4” package (Bates et al. 2015) in R (https://www.r-project.org/) to test this prediction, with the distances (in cm) as the dependent variable, the category of distance (nearest neighbor, deviation, or deviation mirrored) as the fixed factor, and the group and the fish ID nested in it as the random factors. To account for the differences in trajectory length, hence in the amount of data used to calculate the centers, we used the relative length of trajectories as the “weights” parameter in the model. The length chosen for the nearest neighbor distances was the shortest in the group in that run, and the length chosen for the deviation distances was the shortest per fish per group over all runs. To meet the assumption of the model on the distribution of residuals we used Gamma distribution with a log link function and added 0.01 cm (1% of the shortest non zero distance) to the distances to avoid zeros (one fish in group IV appeared only once in the data, so it had zero deviation from its mean). We performed model selection by comparing the full model to an intercept-only model. To select between the models, Akaike Information Criterion with a modification for small sample size (AICc) was calculated using the function AICc of the package MuMin (Barton 2009), and its weights with the function akaike.weights of the package qpcR (Ritz and Spiess 2008) in R. The Akaike weights calculates the weight of evidence for each model, the probability for each model to best explain the data. To evaluate the results with their uncertainties, we used the function bootMer of lme4 to perform bootstrapping, with re.form =  ~ 0 to average across random effects, and with FUN = predict and nsim = 200. The predictions as well as the results of the bootstrapping were transformed with exp function to return to units of distances after the log link function in the model. The standard deviation of the bootstrapping was calculated and used as error bars in the figures below.

Potential shading

In order to test the occurrence of “coordination” through which the down-current fish avoided shading (corollary a3), we permuted in time the sections of trajectories of the different fish and compared the percent of times in which shading was observed with that of the “null” value obtained by the permutation.

The volume of foraging spaces

To test for the possible effect of the current speed, position around the coral and group size on the volume of the foraging spaces (hypothesis b), we used linear mixed-effects model (lmer) of the “lme4” package. To meet the assumptions of the model, the volume was log-transformed. Fixed factors included current speed (in cm s− 1), position around the coral (5 categories) and the group size (3–5 fish, group size includes the entire group, even if some of the fish are currently inside the coral. Group size was centered around zero to reduce correlation with the intercept). The random factor included group ID. Fish ID was ignored since it is redundant to the position and group ID. (Fish ID is defined almost entirely by these two variables, apart from one fish in group IV that changed position after another fish disappeared.) To account for the differences in trajectory length, and hence in the amount of data used to calculate the volumes, we used the relative length of trajectories as the “weights” parameter in the model. We performed model selection by comparing the above full model to all sub-models (all combination of fixed factors including none) and followed the same procedure mentioned above. Bootstrapping procedure was performed as mentioned above.

Foraging time

To test for the possible effect of the position around the coral on the foraging time (hypothesis c), we used generalized linear mixed-effects model (glmer) of the “lme4” package with a Gamma family distribution and a log link function. To meet the assumptions of the model, we transformed proportion of time outside the coral to proportion of time inside the coral (1-time inside) and scaled the data between 0.05 and 0.95 to avoid zeros and ones. Fixed factor included the position around the coral (5 categories). Random factor included group ID. As mentioned above, Fish ID was ignored since it is redundant to the position and group ID. Model selection was performed as mentioned above, comparing the full model with an intercept-only model. Bootstrapping procedure was performed as mentioned above.

Results

Position and separation of foraging spaces

Within groups, individual fish maintained foraging spaces that were well separated from one another (Fig. 1), agreeing with our main hypothesis. Across different runs, covering periods of days to > 1 month, those spaces remained at approximately fixed locations with respect to the coral and current direction (Fig. 2). Each individual fish occupied a different position allowing us to label the fish based on their position relative to the coral: “front,” “top,” “back” (behind “front”), “east” (southeast) and “west” (northwest). Prior to the last two runs of group IV, the fish in the front position disappeared and the one in the west position took its place in the front. Current reversals, driven by the semi-diurnal tide (Genin and Paldor 1998) led a corresponding reversal in the orientation of the fish without changing their location relative to others, and the move of the “front” fish (purple in Fig. 1) to the other side of the coral, positioning itself on the new up-current side. The “back” fish (yellow in Fig. 1) maintained its position behind the front fish, either in front of the coral or behind it. Visual inspection of the video records showed that the fish were stably facing into the flow, as reported by others (Hamner et al. 1988; Forrester 1991).

The consistency in the fish’s position, quantified as the average (± SD) deviation from the average position of each foraging space, was 14 (11) cm, while after mirroring transformation of the runs under NE current (to cancel the possible effect of the current reversal) was 12 (9) cm. Average (± SD) nearest neighbor distance was 29 (9) cm. According to the generalized linear mixed-effect model, the deviations of each fish from the mean position of its foraging spaces were significantly lower than the distance to the fish’s nearest neighbor, and that the effect was stronger after mirroring transformation (ΔAICc < 2, Akaike weight = 1 of the full model in comparison with the intercept-only model, see Fig. 3 and supplementary material for details), in agreement with corollary a1.

Fig. 3
figure 3

Consistency in the position of the fish. The distance to the nearest neighbor is significantly higher than the deviation of each fish from its own mean position across runs, with a slightly larger effect when we mirror the positions to account for current reversals. The distances and their distributions shown are based on the results of the generalized linear mixed-effects model. Error bars represent the standard deviation of bootstrapping made with bootMer, see methods for details on the calculations and the definitions of the distances

Spatial overlap among foraging spaces was negligible (corollary a2). The mean (± SD) percentage of overlap of foraging spaces was 1.4 (± 3)%, median = 0.06%, (14 runs). The distribution of overlaps was highly skewed to low values, as reflected in the substantially lower values of the median compared with the mean. In two of the runs there was no overlap at all. Two runs had high values of 6–10% (group IV at current speed of 4.3 cm s− 1, and group II at 11.8 cm s− 1). The high values of overlap in group IV resulted from the fish in the front position switching sides under very weak currents.

Potential shading

The level of shading was low (corollary a3). In most cases (43 of the total 56 tests of shading) no shading was observed. In the remaining 13 cases, the average duration (± SD) of shading was only 4.3% (± 3.6) of the sections.

Using permutations, we tested the expected shading under null conditions (no coordination) for each fish. In 21 of 56 cases, shading was not possible as the fish’s foraging volume had no fish up-current of it (either at the “front” position or sufficiently sideways of the coral). In all other cases, where shading was possible, the observed level of shading was not lower than expected. Overall, the rare occurrence of shading and its fit to the expected under random movements indicated no coordination of the fish’s foraging movements within their respective volumes.

The volume of foraging spaces

The average (± SD) volume of foraging space of individual D. marginatus was 37,000 (± 16,000) cm3 (Fig. 6 in the supplementary material). Similar results were found for the mean values per run (= mean of all fish in the group within a run): 38,000 (± 18,000) cm3 (N = 64, 15 runs). Among the three factors that were hypothesized to explain the volume of the foraging space (current speed, position around the coral and group size), none were found to explain it, since the intercept-only model was included in the set of best-fitting models (Linear Mixed-Effects model, ΔAICc < 2, see supplementary material for details), in contrast to hypothesis b.

Foraging time

In 18 out of 24 sampled recordings, the “front” fish remained substantially longer inside the coral than all other group members (Fig. 7 in the supplementary material). In agreement with hypothesis c, foraging time was explained by the position around the coral, where the fish in the front position spent significantly longer time inside the coral than the rest of the group (Generalized linear mixed-effects model, Akaike weights = 0.99, see Fig. 4 and supplementary material for full model results). A visual examination of the video records showed that the “front” fish also performed some “duties” that other group members did not perform, including chasing away large predatory fish (in groups II and III), cleaning the coral (in groups I and III) and performing signal jumps (in group I and III)—an apparent sexual behavior by dominant males in this species (Fricke 1980).

Fig. 4
figure 4

The fish in the front position spent significantly more time inside the coral than the rest of the fish in the group, based on the results of the generalized linear mixed-effects model. Error bars indicate the standard deviation of bootstrapping made with bootMer

Discussion

Differential marking of individual fish and video-based, in situ tracking in 3D of all individuals forming a group enabled us to precisely assess the key attributes of foraging behavior in D. marginatus in its natural environment. Our main finding was that within a group, the fish separated their foraging spaces, supporting our main hypothesis (Fig. 1). Thus, individual D. marginatus do not only maintain separate locations when seeking shelter inside the coral during the day (Holzberg 1973) and night (Goldshmid et al. 2004), but also during their foraging outside the coral. This keeping of a quasi-permanent position agrees well with theory of site fidelity (Switzer 1993) in the sense that the distribution of zooplankton is ubiquitously patchy (Haury et al. 1978) with the patches being unpredictable in space and time. In that model, Switzer (1993) found that individuals should be site-faithful in unpredictable habitats, as long as the mean territory quality is equal among available territories. This agreement with theory is especially relevant to site-attached planktivorous fish that cannot search for feeding turfs, and therefore have no control on the patches that drift into their foraging space.

We suggest that the way group mates separated their foraging spaces is an effective means to reduce direct and indirect intra-group competition. First, the stable separation of between the spaces minimizes situations where two individuals strike the same prey at the same time, thereby minimizing the frequency of direct (aggressive) competition. Another mechanism of reducing indirect competition is by the maintenance of extremely low level of shading. The level of shading was not significantly different from that expected under the null model, indicating the absence of coordinated movement among neighboring fish. This lack of coordination suggests that from an evolutionary point of view the cost of minimal shading (< 5%) has been too low to select for, compared with other gains associated with group living over relatively small corals. In other words the separation of the fish’s foraging spaces and their spatial distribution around the coral sufficiently reduce the intra-group competition for food.

In all four groups, the front fish behaved differently than all other group members (hypothesis c). It remained relatively longer time inside the coral (Fig. 7 in the supplementary material), defended the group from other fish, cleaned the coral from apparent debris, and appeared to impose its dominance in the group (Fricke 1980). Despite this apparent dominant and up-current position, our findings did not support the notion that it occupied favorable positions in terms of foraging, as was suggested in previous studies (Coates 1980; Forrester 1991; Webster and Hixon 2000). Evidently, the effective separation between the foraging spaces, their similar sizes, and the minimal shading that we found in D. marginatus allow different individuals within a group a similar access to the drifting prey. Note however, that the groups we studied were smaller (3–5 individuals) than those studied by Forrester (5–19 individuals), Webster and Hixon (17–71 individuals), and Coates (> 5). Such differences in group size could explain the different findings, as larger groups may be more crowded and individual foraging spaces less separated than those we found. Under conditions of more crowded groups and more overlapping foraging spaces, occupying up current positions may result in improved feeding. Whether or not the attributes of space partitioning found in our study apply to larger groups of D. marginatus, commonly found along the Red Sea (Fricke 1980; Kent et al. 2006), or to other species is yet unknown.

The volume of the foraging space greatly varied among different runs (Fig. 6 in the supplementary material), but none of the variables we measured, including current speed, position around the coral and the group size, explained that observed variation. It could reflect variation in the (unknown) presence of nearby predators or another risk, as well as variation in the plankton density. Unfortunately measuring zooplankton density simultaneously with our tracking runs was logistically impossible, so we could not validate this point directly. Kiflawi and Genin (1997) reported that the strike distances by fish belonging to the same guild of zooplanktivorous coral reef fishes in the flume had mean components of ~ 2 and ~ 7 cm along and perpendicular to the axis of the flow, respectively. Under the assumption that similar values apply to D. marginatus in the reef, the average foraging volume of an individual fish that we found this study (37,000 cm3, hence a diameter of ~ 40 cm, assuming a spherical shape) indicates that the fish have ample space to strike prey without competing with neighbors for the same prey.

To conclude, our study revealed a clear and consistent spatial partitioning in groups of site-attached coral reef fish. Living in social groups is a common behavior seen across many animal species. However, alongside its benefits, this behavior can bring about certain disadvantages, such as an increased competition for food among group members. Spatial partitioning is a key mechanism to promote coexistence (Schoener 1974; Amarasekare 2003). Here we propose that such partitioning is a primary mechanism through which coral reef fish that form social, site-attached groups can effectively minimize intra-group competition. Such a mechanism can allow selfishly motivated animals to live together despite potentially conflicting demands.