Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Monsieur OUXX

#881
Critics' Lounge / Re: Indy sprite : rear view
Wed 14/12/2016 12:07:46
Amelie made a great improvement; I've made more improvements on top of her work.

Which do you like most? A, B, C or D?
Look carefuly each image, to see what has changed.

[imgzoom]https://68.media.tumblr.com/563701c1270846b685bbaf8cb99f0832/tumblr_oi6cq0uvtl1tsfksfo1_250.gif[/imgzoom]
#882
Critics' Lounge / Indy sprite : rear view
Tue 13/12/2016 23:47:11
Disclaimer : We're discussing the rear view only.

So we have this first draft for the rear view (a big big thank you to Nr. 2698 and selmiak for the sprite they drew despite me fixing a few things here and there).
[imgzoom]https://68.media.tumblr.com/9d6985b8e5c320e7a8a87567934bdd6a/tumblr_oi5dugqaOM1tsfksfo2_75sq.png[/imgzoom]
3x:
[imgzoom]https://68.media.tumblr.com/ba745feec6f1a7fc0f559694745849c3/tumblr_oi5dugqaOM1tsfksfo1_250.png[/imgzoom]

How would you make it better?
#883
Quote from: MiteWiseacreLives! on Tue 06/12/2016 03:16:59
So I live in a rural area and I'm trying to decide on an Internet provider upgrade.

Sorry to hijack your question MiteWiseacreLives but I have a question too.

Has anyone ever used the utility Sqirlz Water reflections"

It's a cool little standalone utility to generate animated water reflections in a still image. If you never heard of it, then good for you, you learnt something today, but that's not what I want to ask ;)
My question is : Have you ever managed to generate a reflection when there's a foregound and a background?

Let's take this image :
[imgzoom]https://68.media.tumblr.com/f80f11589afe89634f4c55eb6c2b41af/tumblr_oi2ujgvSqN1tsfksfo2_500.png[/imgzoom]

I want to generate this :
[imgzoom]https://68.media.tumblr.com/2a3f7bf58c8cd776ee50884d5c575eeb/tumblr_oi2ujgvSqN1tsfksfo1_500.png[/imgzoom]
Notice how the reflection of the background moutains start at their base, while the reflection of the foreground island starts at its base. It wouldn't work if the reflectio of the island started as high up as the mountains' base.

Attempt #1 :
(the red outline is the reflection area, as defined in Sqirlz)
[imgzoom]https://68.media.tumblr.com/6c453cdf2a802bcbc32168c295367315/tumblr_oi2ujgvSqN1tsfksfo3_500.png[/imgzoom]
This doesn't work because the software apparently doesn't like non-convex shapes. It breaks the reflection.

Attempt #2 : (using a baseline)
[imgzoom]https://68.media.tumblr.com/7911e2ad63240c069065993cdb1f3fe8/tumblr_oi2ujgvSqN1tsfksfo4_500.png[/imgzoom]
This doesn't work because the baseline for the island is inside the reflection outline (the red outline)


So, does anyone have an idea?

=========

EDIT

For anyone interested, here's a clever answer by Grundislav

Quote from: Grundislav link=action-profile;u=19 date=1481561624
I would recommend would be playing around with your background a bit and making a version to generate your reflection. In this case, you want the reflection of the island to show up more towards the bottom of the screen, so I would push it up in your reflection background like so.



Then when you define the rectangular reflection area in the water, it will look like this:



It might take a little playing around to get the base of the reflection and the base of the island in your original background to line up, but this is the best way to do it.  One way would be to use a walk-behind to cut out the area of water above the upside down island, but I think the easiest way would be to actually have your island as a separate room object and just place it over the water reflection.
#884
How about producing a proof of concept of a template for a basic data structure, like let's say a List, that would rely on a type not know in advance, provided it provides a few basic methods (Compare and stuff)
I've done that in the past but it was very clunky because there could be only one macro. But with macros inside macros, I guess that gives access to a whole new world of fun.
#885
OK; good to know thanks

EDIT:
Quote from: Snarky on Wed 30/11/2016 16:40:39
it's actually a problem with stopping/preempting channels playing certain clips. In this case, it seems like all copies of the clip stop playing if you stop or preempt any channel that is playing the clip (even if you preempt it with itself).
Could it be that the engine internally calls its internal implementation of AudioClip::Stop, which (by design) stops all instances of the playing AudioClip?

#886
- I'm relieved to read that there isn't an implicitly-reserved channel for the built-in AudioTypes that have MaxChannels=0. That would have been one more irregularty to manage :-D
- I don't think the potential bug you've observed is what made me start my investigations; I was just too stupid to spot that the "pointers" to AudioChannels are constant even if the channel starts playing something new.
- However, yes this is potentially a bug -- except if CW manages to shade some light onto this behaviour.

#887
Quote from: Snarky on Wed 30/11/2016 01:11:07
even if you set its MaxChannels to 0, each AudioType still reserves 1 channel for its exclusive use.

I haven't observed that with my custom type.
I'll need to try that with built-in types while some AudioClips (that use the built-in types) play .

#888
I've written a module that counts and lists almost everything that's possible to count (AudioTypes, AudioChannels, AudioClips, reserved channels, etc.), even in AGS 3.3.x.
Retrospectively, I agree that the channels are not so hard to understand, but they're confusing at first. Writing this module helped me a great deal to pay attention to aspects of channel management that seem straightforward if you don't pay enough attention but are actually quite subtle.

I'll publish it in the next few days. There's a graphical interface to it to visualize what's going on, and everything is named instead of using numbers. It should help beginners a lot.

#889
Quote from: Snarky on Tue 29/11/2016 12:07:54
Quote from: Monsieur OUXX on Tue 29/11/2016 12:00:44
So does that mean that the AudioType that has MaxChannels=2 reserves the channels?

Yes.
Damn. Thanks.
At the moment I'm trying to find tricks to reduce the waste of channels as much as possible.
#890
A thing is puzzling me : how does the number of channels vary?
- In AGS 3.4.x+ : Is System.AudioChannelCount constant? Even when clips are playing?
- In older AGS versions: what would be a good way of counting the channels?

I've tried as follows:
- All my AudioTypes have "MaxChannels"=0 (unlimited channels), except one. That one has MaxChannels=2.
- Then I run this function, using a clip that has an "unlimited channels" AudioType with MaxChannels=0.
Code: ags

//This function only makes sense before System.AudioChannelCount was introduced -- AGS 3.3.x

//MAX_AUDIOCHANNELS : any value higher than the expected result (probbaly should be 7 or 8)
#define MAX_AUDIOCHANNELS 9
void CountAudioChannels(AudioClip* testClip)
{
    AudioChannel* audioChannels[MAX_AUDIOCHANNELS];

    //We'll count the audiochannels by playing priority 1 sounds until one of them uses a previously-used channel
    //IMPORTANT: this clip's Audiotype must have a setting that allows to use an unlimited number of channels (max channel = 0)
    AudioChannel* firstChannel = testClip.Play(eAudioPriorityVeryHigh, eOnce);
    audioChannels[0]= firstChannel;
    AudioChannel* otherChannel = testClip.Play(eAudioPriorityVeryHigh, eOnce);

    nbAudioChannels = 1;
    while (otherChannel != firstChannel)
    {
        audioChannels[nbAudioChannels] = otherChannel;
        nbAudioChannels++;
        otherChannel = testClip.Play(eAudioPriorityVeryHigh, eOnce);
    }
    #endif

    Display("Counted %d AudioChannels.", nbAudioChannels);
}



the result is 5. When al my AudioTypes have MaxChannels=0, the same function returns 7. So I infere that 5 is probably the result of 7-2.
So does that mean that the AudioType that has MaxChannels=2 reserves the channels? I thought that would mean it can use 2 channels at most.
#891
Quote from: morganw on Mon 28/11/2016 22:42:06
(it's probably quite hard to playback 8 sounds at once and also hear that a crossfade is still working).
you could set the volume of all but one to 0.

Another thing is puzzling me about the audio Channels (see the other thread I just started to count them manually)
#892
Quote from: Snarky on Mon 28/11/2016 17:02:56
The crossfade uses linear (dB) volume fading; because of how the decibel scale work, this means there's a "dip" in the volume during the fade (to maintain constant mixed volume, AGS would have to use a logarithmic volume curve for the fade).
I learnt something! Cool.

Quote from: HandsFree on Mon 28/11/2016 18:44:55
With ogg everything always plays seamless in my experience.
I learnt seomething!!! Cool cool.

Quote from: morganw on Mon 28/11/2016 20:59:45
This returns -1 for the audio clip that is fading out, and the actual channel number for the one that is fading in. So if it using another channel it's not accessible. System.AudioChannelCount still returns 8 during the crossfade, so I would guess that it isn't wasting a channel to do the crossfade.
I think your test is valid (good to know that a channel can be "lost" by an AudioClip even though it's still hears but already being faded out). However, about System.AudioChannelCount: isn't it supposed to be the total number of channels, at all times (constant) ?

#893
I've run some tests and the crossfade seems:
- to be just a fade out at the end and a fade-in at the beginning. (no overlapping. Not a real crossfade)
- to use only one channel.

Am I correct? My ears might be betraying me.
#894
Quote from: selmiak on Sun 27/11/2016 22:04:00
I know AGS has sound stuttering issues when changing rooms, but when in the same room a flawless repeat without a short silence or crack or stutter inbetween is what I expect from the ambient sound engine, otherwise there is a serious bug in the audiosystem, but I think it works and you are overcomplicating things.
On a side note I know the guy who made most if not all ambient sounds for the 7cog, he is okay with looping ambient sounds and thinks playing the same ambient sound overlapping could sound even worse ;) 8-) (fedora icon)

Selmiak I know you're up to making the sounds loop, but trust me, if I'm asking it's because I want to save as much work as possible, and I'm 99% sure the question is worth asking. The engine is flawless but the short loading time (if it really exists) might be an issue (except with the crossfade feature activated, hopefully). I'm running my own tests anyways.
#895
Quote from: selmiak on Sun 27/11/2016 20:22:29
can't you just make an audiofile that loops and repeat it in one channel?
But then there would be no crss fading, and if I recall my old tests correctly, AGS slips a very short silence inbetween each repeat (but I might be wrong -- that's why I'm asking and testing around). Also, the purpose here is to save development time by NOT having to make every ambient sound loop.

#896
Spoiler

Consider this : you want n ambient sounds to play simultaneously.
By nature, an ambient sound will crossfade with itself, so that the repeating is seemless to the player's ear.

I've implemented this by using 2 channels per ambient sound: I simply play the sound twice (which implicitly uses 2 channels), with eRepeat parameter, so that the AudioClip repeats itself on eachc hannel. Those two identical AudioClips are shifted in time so that when the second one starts, the first one is around its middle. When one of the channels is reaching its end, the sound gets faded out by my script. Then when it's starting again, the volume is faded back in. This way, out of the two channels for this one ambient sound, there's always one that's being played full volume, and the other one that's near its end or start, that's being faded out or in.

That works well.

But that's a waste of channels. If I have n channels then I can play only n/2 ambient sounds.

Do you think there would be a clever way of using the "crossfade tracks" property of the AudioTypes to achieve the same feature? While asking the question I realize that the solution probably revolves around playing an ambient clip only once (no eRepeat), but then having the script check if it's reaching its end. By then, calling .Play on the same AudioClip would make it play again, but with crossfade.

HOWEVER, what I'm wondering, is this: Would that use the same AudioChannel (the crossfading is done by the engine internally to the channel) OR does it implicity use another channel, hence defeating the purpose of the idea?

[close]

Question: If you play an AudioClip that has an AudioType that was set up to "crossfade", does it use only one channel?
ANSWER: I've run some tests and the crossfade seems to be just a fade out at the end and a fade-in at the beginning. It seems to use only one channel. Am I correct?


See also (interesting thread about volume management on a crossfade track): http://www.adventuregamestudio.co.uk/forums/index.php?topic=50093.msg636482411#msg636482411
#897
Thanks a lot; I'll see how I can best use this. Thanks thanks thanks.
#898
I've been reading this and this and I can't sort out what's real, what's a suggestion, and from what version it applies.

I've tried this script in both 3.3.4 and 3.4.0.6 and both display only "FLAGS:"

Code: ags
    String result="FLAGS:";
    //I think API_VERSION does not exist -- testing just in case
    #ifdef API_VERSION >= 3.4.0
    result=String.Format("%s 1", result);
    #endif
     
    #ifdef API_VERSION < 2.7.2
    result=String.Format("%s 2", result);
    #endif
    
    #ifdef API_VERSION < 3.4
    result=String.Format("%s 3", result);
    #endif
    


    //At least one of those should work??? At least in 3.4.0.6 ???
    #ifdef SCRIPT_API_v330
    result=String.Format("%s 4", result);
    #endif
     
    #ifdef SCRIPT_API_v334
    result=String.Format("%s 5", result);
    #endif
    
    #ifdef SCRIPT_API_v340
    result=String.Format("%s 6", result);
    #endif
    
    #ifdef SCRIPT_API_v3406
    result=String.Format("%s 7", result);
    #endif

    Display( result);


How should I proceed to test the current version?
#899
Oh, one thing I'd love: if Each clip had its name stored in a string.
#900
Quote from: Snarky on Thu 24/11/2016 20:30:57
You'd need to monitor each channel to catch it when a clip stops playing

It's kinda what I'm doing in my own module (except functionally I focus more on "is this channel still playing the expected clip?")
SMF spam blocked by CleanTalk