I'd have some design questions to start:
What happens when multiple bots are speaking at the same time? Do the sound vars of a third or Nth bot represent a summation of the values spoken by the others? Do values attenuate over distance? Over what distance does sound travel (please say the same as vision). I assume we use some standard distance/cycle ratio as the sound propagation rate. If a bot is moving counter to the sound wave, does it miss words do to wave compression?
Implimenting this might prove computationally expensive, along the same lines as vision. I'd have to keep a per bot buffer of the words spoken over the last N cycles and compute which words from which other bots strike each bot each cycle. You can foget about things like reflection and attenuation due to shape corners, etc. Too hard for now.
I guess I would want to dive a little deeper into the core functionality we want acheive with this before jumping into an implimentation. For example, I've been toying with the idea of bots being able to gather and store another bot's ID, say as a new refvar "refid", which gets populated along with the other refvars and trefvars. A bot could then grab this and use it for various things including getting the refvars of a bot without looking at it (as long as it is within visible range) or using memloc/memval.
If the goal is to create a "hey you, look at me over here" capability, we might simply add a sysvar that provides a bot with the ID of the nearest bot that happens to be looking at it.
If the goal is provide a richer communication mechanism, I'd want to discuss how to enhance the in/out pairs first. Requiring a bot focus on another to "hear" it is a huge compuation saver, but a bot could aim it's ears at another specific bot so to speak using the ID above and be able to receive the .in values from a bot without looking at it...
Ok, in situations where sounds overlap, a harmonic is created. So a harmonic array can be created to support say three overlapping sounds at a time. The information would be stored as independent to the other vars. The speed of sound:
In a fluid the only non-zero stiffness is to volumetric deformation (a fluid does not sustain shear forces).
Hence the speed of sound in a fluid is given by
where
K is the bulk modulus of the fluid
I would suggest using the same equation to slow the speed of the sound, thus reducing the ammount of information recieved, until it desolves. I would say make it last three times the maximum distance of sight, unless you want to emulate whale songs; but this could mean a bulk of refvars in the ear at once, and we could use disadence to remove certain bits of infromation.
Frequency Emulation:
So the value stored in a wave is a frequency, 1 = 1 hz, the lowest possible audible tone of a Darwinian. The lis of possible frequencies would be limited to DNA, and system specs.
I would suggest limiteing the frequency list to its maxmum, but audible tones should be somewhat lower since the higher frequencies are considered harmful in nature. The rules of physics can be aplie to such a system, allow for sound to happen naturally, in numbers
Solution to Overlapping Sound Waves:
Say we have a harmonic array, 1, 3, 4. 4 is even, but in this case its also the only one not a prime, so it can be considered a weaker frequency, it will become disanant under the following conditions. Say we have the exact same harmonic array overlap this one, well the values wont change, but will effectively combine the two wave ranges to double their range, due to amplification. If the values are reversed, say 4, 3, 1 the 4's would cancle, as they are not in the sound scheme for swaps, and 3 and 1 would switch to the 1 and 3. Its simple for frequencies, differences of 10times is considered an octave, and a 1-3 is something close to a 2nd minor in music, common to songs of natives, a step from 3-4 is actually some mathematical thing that removes part of the tone in either, causing slight alterations +/- by 10%. Inversions of waves tend to cancle, depending on the magnitude and direction, but I say just use it for Overlapping waves with same direction and speed only. Using the same formula for Collisions, the sound wave colliding into another can be altered to change its speed, range and harmonic array/frequency.
I think this shouldn't be as difficult as everyone thinks. Its like a long range caller, that's faster than shots, and doesn't have to be visible, so that should curtail most usage, and as for the numbers. I think by simply combingning overlapping (or closely touching within 50% of eachother's space) will reduce the amount of bolk information being transmitted, and still provide some information to the listener. I also think if the combined wave contained the ID of all bots inside the Harmonic combination be included, then its a matter of genetic integrity and propper speech/learning routines to know and interprut what's heard, otherwise its like static.
Edit: as for moving ears, I say fix them to a point on the body so it requires a rotation of the bot, then they can aim there eyes if they want, but the bot cannot take refvars from the eyes and ears at once. Similar to the bumb feature, only the information contained in a wave can be recieved, understood, and acted upon, while being able to look at another bot, and send/recieve information. The sound would enter the ear and disapear, so in that instance the bot must store the values, or lose the information. I think that there has to be a way to override the ears, to emulate deafs, and to prevent combat situations where a bot screams at another and it cuases the bot to go blind in combat... When a wave hits a bot, consider the Harmonic array to exist as thirds of the wave. Lower third 1st number, Middle 2nd number and Tp is 3rd number. As each third/number hits a bot, it goes away, and the rest go on until out of energy/mnomentum or hit a bot. THis could mean that some information may be lost, but could be effected for group theory, since it could hit multiple bots, and the recipients could use any of the numbers in that refvar included in the wave, to alert others, or act another way when more of the information in the wave is found later by another bot that recieved a bit of the wave.
1 ear or 2 I ask...