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 - Crimson Wizard

#3281
In AGS currently the sounds are modified by accessing the channel they are played on.
At the moment it is possible to change Volume and Speed.

Here's the related articles in the manual:
https://adventuregamestudio.github.io/ags-manual/AudioChannel.html



Quote from: Pajama Sam on Fri 31/12/2021 18:40:33
so you cant play a sound in repeatedly execute.

You can, but if you do that unconditionally, then it will start over every game frame.
What Snarky said is that your script logic should be fixed, for example to not replay same sound until the previous instance has stopped.

EDIT: or, alternatively, you may play looping sound as Sound.Play(eAudioPriorityNormal, eRepeat), and stop it when the player releases the key.
#3282
Quote from: Pajama Sam on Sat 01/01/2022 05:17:50
Code: ags

function object_AnyClick()
{
   Sound.FadeIn=-or+ number;
   Sound.FadeOut=-or+ number;
}


By "fade" do you mean volume? You may adjust the volume from the channel returned from Play function.
Code: ags

AudioChannel *chan = aSound.Play();
...
// later
...
chan.Volume += 1;


More info in the manual: https://adventuregamestudio.github.io/ags-manual/AudioChannel.html


Quote from: Pajama Sam on Sat 01/01/2022 05:17:50
I would also like to suggest making the scripting text size adjustable in prefrences.

Scripting text may be changed with Ctrl + Mouse Wheel, the only problem at the moment is that it does not save, so you have to do it every time.
I guess it should be possible to save the script font size in user settings.
#3283
Normally, if the audio type runs out of channels, then it either replaces one of the active sounds with the new one, or does not play a new one at all (this depends on clip priority setting).
Game crash would mean that something is wrong.

Regarding game upload, there is a number of free file host services, personally I know Dropbox, Mediafire and Google drive, but there should be many more.
#3284
I think that the number of channels is an issue in the first place because of how AGS system works: right now is made so that the channel always have a one individual clip bound to it, and also the script channel directly corresponds to the sound source object in the sound library we're using.

If this system was changed to something different, e.g. allowing multiple clip playbacks going into the same channel, then the channel number would be much less of an issue (or not at all). For example, the above case of piano simulation could be rather solved if there was a Sound Mixer API, where you could merge multiple sounds on the same output channel (guess the meaning of a "channel" would change also in such case).

So I believe that instead of keeping increasing sound channels in its current form, it might be more optimal to redesign the system into something that allows more flexibility with the sound.

There has been a topic opened couple of years back, but unfortunately everything is postponed:
https://www.adventuregamestudio.co.uk/forums/index.php?topic=56079.0


Quote from: Pajama Sam on Fri 31/12/2021 00:55:28
If the user was to make a chord or play too fast before the channels freed up the game would crash.

It should not crash, unless there's some mistake either in script or in the engine. Could you post an example of the game that crashes?
#3285
Quote from: arj0n on Thu 30/12/2021 16:11:58
note:
As a test, if I add an empty line after the last line (after the title line) the
complete title, including the last character, is correctly read. But that would
not be a solution for my problem as these files are (and should be) exported
without adding an extra empty line.

Oh, I did not notice this at first.

I think it should also be possible to use File.ReadRawChar() and read byte by byte until the line break to get a line. Thus essentially scripting your own "Read Line".
This will be relatively slower (because of the many function calls in script) so may not be a good solution if files are very large.
#3286
This is a known bug, someone else recently discussed this on AGS Discord.

The workaround is to always add an extra linebreak at the end of the file.

This seems to be fixed in 3.6.0.
#3287
Quote from: Dave Gilbert on Thu 30/12/2021 16:32:30
One small thing I noticed. You incorporated this feature where you can resize the sprite images in the sprite tab (which is fantastic!), but it's not implemented in the view tab as well. The test that eri0o created in the thread contained both. Is it possible to include the view loop resizing as well?

Ah, right, this was suspended because it also included the "sound" icon, but there has been an argument about how this icon should be positioned.
But it must be possible to only add the zoom controls alone for now. I'll try do that on the next update.
#3288
Quote from: Pajama Sam on Thu 30/12/2021 06:31:41
Is anyone planning on making this able to create AGS apps on android easily?

There has been a plan for 3.6.0 to setup a game for Android in the Editor, so that it creates a package, similar to how it does for Linux now.

If I understand correctly, we have a working method now, but it still must be run by hand. So the remaining tasks are:
1) Add a Android setup menu into the Editor (like a panel where you enter necessary options for your game);
2) Make Editor run APK building.

Presumably a user will still have to install some tools on their own (Android SDK, etc); as we do not want to distribute these big programs with AGS (and maybe that is also illegal, idk).

Now, the biggest question is who is going to do this and when. I've been more focused on the engine lately, and the person who updated Android port (eri0o) is currently away busy with something. OK, he's back now.
So unless someone else does this, maybe I will be able to look into this after 3.6.0 gets into the "Beta" stage at least.
#3289
My plan in regards to 3.6.0 is currently this:

1. Fill in most noteable gaps in existing functionality; fix known issues with the base features, etc.
2. Release 3.6.0 as Beta version, and encourage people to use and test it more.
3. While in Beta stage, look if there are feature requests that are significant and don't require much changes to implement, and maybe do some.

For some time I hoped to bring 3.6.0 to almost finished state before the New Year, but somehow I got distracted and did not work much during the autumn months... So now I do not want to prolong its development further. It's been worked on roughly for 13 or 14 months now, so it's time to wrap up.



Quote from: Pajama Sam on Thu 30/12/2021 06:51:35
Does this version have 16 sound channels now?

Yes, it does for a while. All the additions to 3.6.0 are mentioned in the first post (a little disorganized list, but I will make a proper one soon).

Quote from: Manu on Thu 30/12/2021 10:19:10
One question, do you think it will ever be possible to customize the font size of the editor UI? Not the code editor, because you can zoom in/zoom out, but the right panel (Explore project and Properties) would be extremely useful!

Sorry, I cannot really tell, this is something to plan ahead and think through. Editor currently supports "color themes" (File -> Preferences -> Editor appearance -> Color themes), which recolor all controls. So I suppose similar method could be used to alter fonts everywhere. But we need to ask those who were working on this last time, maybe they have certain plans already (Chamber of Fear (persn on github) and Alan v. Drake).

#3290
I think that the first part of the code where you stop the sound is unnecessary, because function MySay will stop the sound itself.
But more importantly, the way you wrote the first if/else pair: if you click second time while the first sound is playing, it will just stop the playing sound but won't start the new one.

Perhaps try this variant:
Code: ags

int speak;
function max12_AnyClick()
{
  if(speak==0)
  {
    player.MySay(aWeird, "You mean even dummer than you!");
  }
  else if(speak==1)
  {
    player.MySay(aFries1, "dfdgfskjdgsigrjsbdfijsdbsd");
  } 
  
  speak+=1;
  if(speak==2)
  {
    speak=0;
  } 
}
 
#3291
Quote from: Pajama Sam on Thu 30/12/2021 02:19:07
I still dont understand you.
do I have to change this to play other sounds or not?
  talk.Play();
  this.SayBackground(text);

No, you do not need to change anything in the function itself.
To play different sounds you need to pass different sound names into it.

Code: ags

player.MySay(aWeird, "You mean even dummer than you!");
...
player.MySay(aWeird2, "This is a different text");
...
player.MySay(aSound10, "This is a completely different text");
#3292
Updated to Alpha 14
(use download links in the first post)

Contains all the changes from 3.5.1 Patch 6.

PLEASE NOTE: For the technical reasons Editor now requires .NET Framework 4.6 to run (was 4.5).


Editor
- Added "Sprite file compression" option in General Settings, replacing "Compress the sprite file" option. The new option allows a selection of compression algorithm used for sprites. Currently supported: None, RLE (old default compression) and LZW.
- Added "Enable sprite storage optimization" option to the General Settings, that permits the editor to repack sprites in a different storage format, reducing their disk size whenever possible. This option may be used alongside with the sprite compression. Note that this does not change how the sprites work in game.

NOTES: RLE compression is best for the games with simple graphics without much detail. LZW works better than RLE when the graphics are detailed, especially with anti-aliasing etc.
"Enable sprite storage optimization" is best for games with low-res "old-school" gfx which use relatively small number of individual colors. Games with anti-aliased sprites with alpha channel will benefit less from this (or not at all). Having this option enabled does not have any consequences if sprite storage cannot be optimized, these sprites are simply stored as default, so it's okay to keep this enabled at all times (unless your tests show that game loading times became longer because of this).

Engine
- Fixed default black room backgrounds were displayed as magenta / "magic pink" (regression).
#3293
Quote from: Pajama Sam on Thu 30/12/2021 01:35:59
I have it that when you click the character once it says something and every time you click on him it says something different according to a pattern. All I was asking is if I have to change anything in this so I could play the next talking sound.

Ah okay, no I think it should work if you just call this function with the different sound name / text.

You may require additional changes if you have a more complex behavior, for example, a sequence of lines played one after another after just one click.
#3294
Quote from: Pajama Sam on Thu 30/12/2021 01:24:41
Do I have to change anything in this if I want to have the character say more than one saying.   

Do you mean, have more than one speech line after the first line? Or say something else on different interaction?
#3295
Quote from: Pajama Sam on Thu 30/12/2021 01:10:34
so do you put anything into this or just place it without descriptions  in globalscript.ash.
Code: ags
 
import function MySay(this Character*, AudioClip *talk, String text);


I'm not sure what do you mean by "without descriptions", but yes, you put that function declaration in globalscript.ash (header), and the function itself in globalscript.asc (the script body):

Code: ags

function MySay(this Character*, AudioClip *talk, String text)
{
    if(Game.IsAudioPlaying(eAudioTypeTalk2))
    {
        Game.StopAudio(eAudioTypetalk2);
    }
    talk.Play();
    this.SayBackground(text);
}


This way you will be able to call it inside both GlobalScript and room scripts.
#3296
Quote from: Pajama Sam on Thu 30/12/2021 00:47:55
what I want is to modify this same script

by having a quick way to copy this for any character.and just change the sound name.

The point of a custom function is to store the most of the code, so that you dont have to copy all of it over and over again. Instead you just place a function call:

Code: ags

function max12_AnyClick()
{
  player.MySay(aWeird, "You mean even dummer than you!");
}


And then you do same for other characters, or other interactions, changing the name of the sound and text that you pass to the function.
#3297
Quote from: Pajama Sam on Wed 29/12/2021 22:19:55
Would this require placing every  sound that the character says into this

This example requires you to pass a sound as an argument. This works best if the sounds change often.
If the sound is always same for all characters, then this argument may be removed, and sound's name used directly inside the function.

If the sound is always same per character, then there are couple of possible solutions here, but the most straightforward is to do this:

Code: ags

function MySay(this Character*, String text)
{
    if(Game.IsAudioPlaying(eAudioTypeTalk2))
    {
        Game.StopAudio(eAudioTypetalk2);
    }

    if (this.ID == player.ID) {
         aWeird.Play();
    } else if (this.ID == cOtherGuy.ID) {
         aAnotherSound.Play();
    } else if (this.ID == cSomeDifferentPerson.ID) {
         aAnotherSound2.Play();
    } // and so on...

    this.SayBackground(text);
}


Quote from: Pajama Sam on Wed 29/12/2021 22:19:55
also this needs to be for all charcters.

That will work for all characters; the first argument is basically the Character's pointer, so it will work from any character like cAnotherGuy.MySay(...).
#3298
AGS standard speech (Say command) is blocking, which means that it also intercepts any player input.

If you want to be able to click elsewhere while the player speech is on screen, you'd need to create your own custom speech function, where you would not use regular blocking speech (Say command), but would instead use background speech (SayBackground) or custom Overlays (see Overlay functions in the manual).

With non-blocking speech player input will be not intercepted by the speech itself, and instead go directly to an object they are clicking on again.

The big problem there is to decide how does the non-blocking speech stops (under which condition).





Following is the trivial example of such function, that may be placed in a GlobalScript:

In the header (GlobalScript.ash):
Code: ags

import function MySay(this Character*, AudioClip *talk, String text);

(this is function's declaration)

In the script itself (GlobalScript.asc):
Code: ags

function MySay(this Character*, AudioClip *talk, String text)
{
    if(Game.IsAudioPlaying(eAudioTypeTalk2))
    {
        Game.StopAudio(eAudioTypetalk2);
    }
    talk.Play();
    this.SayBackground(text);
}


Now you can use this like:
Code: ags

player.MySay(aWeird, "You mean even dummer than you!");

#3299
Quote from: Pajama Sam on Wed 29/12/2021 05:30:58
I forgot to ask you Crimson Wizard.Would creating more sound types allow you to play more channels at once.

No, like i mentioned, all sound types take channels from one limited pool.


Quote from: Pajama Sam on Wed 29/12/2021 05:30:58
also I forgot to mention that I can give you perfect examples of 10 sounds playing at once without becoming indistinguishable. The Freddi fish game series has this constantly. they have a spot that the player can click a whole bunch of times as fast as they can and more animations with their sounds keep coming.
And there were many spots like this not shown in that video. Just saying this if your still curious of what possibly could use so many channels.

Sorry, but that is not an example; the example would be an actual video demonstrating this, or a demo scene that one could run and observe. It's possible to make up to 8 sounds playing simultaneously with the current stable version of AGS (7 + 1 played as a voice-over), or 16 sounds (15 + 1 voice-over) played in 3.6.0 wip version, so it is quite possible to create such demo and experiment with it.
My doubts come from the fact that personally I have trouble distincting 4+ sounds already, they become a merged ambience at that point if they have same volume. This is why I wonder if there's an actual sense to play as much as 10 at the same time, let alone more. In the referenced case this is also not a gameplay necessity (like, to indicate some important events).

In any case, I am not in a position to suggest you how to make your game. I voice my doubts about meaningfullness of supporting more simultanous sounds, as increasing channels would come at certain perfomance cost when playing all of them at once. If it's found absolutely necessary, I may increase their limit further, but I would have to first test whether the engine is capable of perfoming that.
#3300
Quote from: Pajama Sam on Wed 29/12/2021 00:23:10
Also what do you mean by a demo scene.I assume you just mean a test room right?

Yes, for example a game with one room which tests this kind of behavior.


I found the playthrough video for "Pajama Sam":
https://www.youtube.com/watch?v=5vte0EXhK3Y

TBH I am not certain that playing more than 3-4 of cartoon sounds like that simultaneously would make much sense from player's perspective, as they would just blend together, but maybe it's just me...
SMF spam blocked by CleanTalk