Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Outerra Tech Demo download. Help with graphics driver issues

Author Topic: Placing custom sound sources for sceneries ?  (Read 6196 times)

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1755
Placing custom sound sources for sceneries ?
« on: January 30, 2019, 06:40:03 pm »

As visually very beautiful sceneries can be built in outerra I wonder if it is somehow possible to place custom made sound sources in a scenery, playing sounds of chosen type in a distance range around an object or point in the scenery. This would add a lot of enjoyment to user built sceneries ! If not possible presently it would be nice to have this as a tool in a future editor.
Logged

andfly

  • Sr. Member
  • ****
  • Posts: 346
Re: Placing custom sound sources for sceneries ?
« Reply #1 on: February 03, 2019, 12:27:40 pm »

Among the possible methods of defining the origin of sounds in Outerra exists:
Code: [Select]
/// set source ECEF position once it's used source always be using ECEF

    void set_source_ecef( uint source_id, const double3& pos );

https://github.com/Outerra/anteworld/blob/master/include/ot/sndgrp.h

I've never tried to use it but it would seem the right answer to your question ...
Logged
I do not know the English language. I use Google Translate. I hope it's all understandable.

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1755
Re: Placing custom sound sources for sceneries ?
« Reply #2 on: February 03, 2019, 12:47:28 pm »

Thanks andfly. I will try it.
Logged

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1755
Re: Placing custom sound sources for sceneries ?
« Reply #3 on: February 10, 2019, 10:48:36 am »

Hi andfly ! Thank you very much for your hint !
In fact with the command you suggested it is possible to precisely place custom sound sources wherever you want.
Actually you can use the scenery editor to choose the locations (ecef's) where to place sound sources and then set for each source the volume and attenuation distance
in a single javascript of a "soundscape controller object" spawned wherever you like.

Once launched the controller object all custom sounds in the scenery will be active ! very simple and effective and
result are really great !  =D =D =D. A demonstrative video of a simple scenery near tortoli sardinia is below. (no sound editing ! all sounds are "in-game")

Sound activation could probably even be programmed if one could figure out somehow what action is taking place in a scenery (don't know how to do that. maybe lua script ?)

Now I just need some code polishing and then I will release the "soundscape controller" object to share it with everybody for easy use.


« Last Edit: February 10, 2019, 10:50:44 am by fly77 »
Logged

aWac9

  • Hero Member
  • *****
  • Posts: 2538
  • newbie
Re: Placing custom sound sources for sceneries ?
« Reply #4 on: February 10, 2019, 01:25:41 pm »

 :)
Well ... this is going to be fun.
you will explain how this works, and how sounds are added ??, just missed the birds of andfly
a great contribution .. thank you friend for the fun
Logged

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1755
Re: Placing custom sound sources for sceneries ?
« Reply #5 on: February 10, 2019, 01:49:52 pm »

Hi aWac9. Yeah for sure I will make an instruction video and explain it all very simply. Hope to share it soon and then can't wait to see and hear ! what a talented scenery builder makes with it  ;) keep on your great work!
« Last Edit: February 10, 2019, 01:55:48 pm by fly77 »
Logged

andfly

  • Sr. Member
  • ****
  • Posts: 346
Re: Placing custom sound sources for sceneries ?
« Reply #6 on: February 10, 2019, 02:26:12 pm »

Hi andfly ! Thank you very much for your hint !
I'm glad you found my advice useful.  :D

As for connecting the sounds to the actions that take place in Outerra ... it becomes complicated.
Unfortunately, I have not yet foreseen (to my knowledge) empty global variables, available to users, to be used to recognize the carrying out of personalized actions.
It is certainly possible to create "personal arrays", in C ++ language, by writing a special plugin ... but this goes beyond the normal practice of those approaching Outerra and using Javascript.
(You can still go deeper into the topic by reading the posts in the PLUGIN section of this forum).

However ...
I can suggest you a trick I have already used successfully in the past.

Outerra already has global variables that serve to define the characteristics of the general environment.
These are the values ​​of the fog level, the forests, the snow etc ...
https://github.com/Outerra/anteworld/blob/master/include/ot/env.h
They are all "float" values ​​and can be read and set, as desired, by script commands.

Apart from some "delicate" parameters there are several in which the last decimal digits are not particularly important.
It is therefore possible to change these digits and use them as customized "flags" to define an action.
No user will notice this insignificant variation.
Writing and reading can be done by different scripts and you would get the desired passage of information, very limited, but anyway ... better than nothing!

It is clear that it is a "dirty trick", and one should not abuse it.

To solve an immediate problem, however, or for a particular need, it could be useful!
Logged
I do not know the English language. I use Google Translate. I hope it's all understandable.

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1755
Re: Placing custom sound sources for sceneries ?
« Reply #7 on: February 10, 2019, 03:38:42 pm »

Understood !  Thanks andfly for your insight and for giving this trick !  I will experiment with it, to explore the "game" character that can be given to outerra. Of course sharing whatever I achieve.  ;)
Logged

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1755
Re: Placing custom sound sources for sceneries ?
« Reply #8 on: March 09, 2019, 12:18:27 pm »

finally here is my post giving download link for the soundscape tool to create your own sound landscapes and detailed explanations on how to create them

https://forum.outerra.com/index.php?topic=3934.0
Logged

aWac9

  • Hero Member
  • *****
  • Posts: 2538
  • newbie
Re: Placing custom sound sources for sceneries ?
« Reply #9 on: October 12, 2020, 06:16:35 am »

practicing with the soundglobal by fly77

Logged