Author Topic: The Quick Questions Thread  (Read 882 times)

The Quick Questions Thread
« on: 11 Jul 2019, 14:03 »
Have you ever had a question about AGS itself, or a small doubt that just crossed your mind, or a moment of "huh, I wonder why that is" but you didn't think it was worth opening a new topic for and you don't have any BFFs (Best Forum Friends) you can DM (i.e., pester) about it? If so, this is your thread! Hopefully!

The idea would be to post your quick, maybe obvious, maybe not super-complex questions that you think probably have a short and simple answer, in the hopes that you will learn something new -- and of course, give someone the chance to show off their AGS knowledge :-D (And if it does prove useful, maybe it'll be worth sticky-ing?)

Here are a couple that I had this week:

- What is "better"? 40 fps or 60 fps? Is there really a whole lot of difference when it comes to resource use?

- Are sound clip and audiochannel volumes always relative to the global volume? In other words, if I have my global volume set at 70 and I do Audiochannel.Volume = 40, will the volume of Audiochannel be 40, in absolute terms, or 40% of 70%?

Hope somebody finds this idea useful!

Re: The Quick Questions Thread
« Reply #1 on: 11 Jul 2019, 15:33 »
Have you ever had a question about AGS itself, or a small doubt that just crossed your mind, or a moment of "huh, I wonder why that is" but you didn't think it was worth opening a new topic for and you don't have any BFFs (Best Forum Friends) you can DM (i.e., pester) about it?

There's also a AGS Discord server where you may ask quick questions in chat: https://discordapp.com/channels/221047797292597249

Are sound clip and audiochannel volumes always relative to the global volume? In other words, if I have my global volume set at 70 and I do Audiochannel.Volume = 40, will the volume of Audiochannel be 40, in absolute terms, or 40% of 70%

Unfortunately this is silly, but they all are absolute values. If you want relative values you'd have to script this on your own, keep track of master volume and adjusting channels accordingly.
« Last Edit: 11 Jul 2019, 15:35 by Crimson Wizard »

Privateer Puddin'

  • Mittens Knight
  • bob
Re: The Quick Questions Thread
« Reply #2 on: 11 Jul 2019, 15:44 »

- What is "better"? 40 fps or 60 fps? Is there really a whole lot of difference when it comes to resource use?


30 or 60. 40 is a bad default.

Re: The Quick Questions Thread
« Reply #3 on: 11 Jul 2019, 15:49 »
Have you ever had a question about AGS itself, or a small doubt that just crossed your mind, or a moment of "huh, I wonder why that is" but you didn't think it was worth opening a new topic for and you don't have any BFFs (Best Forum Friends) you can DM (i.e., pester) about it?

There's also a AGS Discord server where you may ask quick questions in chat: https://discordapp.com/channels/221047797292597249

I don't really like chat though (the main reason I don't have a Discord account). Asynchronous communication ftw.


Are sound clip and audiochannel volumes always relative to the global volume? In other words, if I have my global volume set at 70 and I do Audiochannel.Volume = 40, will the volume of Audiochannel be 40, in absolute terms, or 40% of 70%

Unfortunately this is silly, but they all are absolute values. If you want relative values you'd have to script this on your own, keep track of master volume and adjusting channels accordingly.

Oh crap  :(

Well, glad I asked, I guess. I always thought they would be relative. This complicates things for me pretty badly though... So just to be sure, what you're saying is that if the player chooses to set the master/global volume at, say, 50, and I trigger a sound with volume 80, this sound with be MUCH louder than everything else, right? (this doesn't make a lot of sense to me, because how can you have sounds that are louder than the master volume?  ???)

Edit: ok, this doesn't seem to be the case. If I set the Global.Volume of my game to something ridiculous like 10 and then I trigger a sound at 60 volume, it does not play at the level I would expect an "absolute" 60 to. So it does look like clip/channel volumes are at the very least kept in check by the system volume.

- What is "better"? 40 fps or 60 fps? Is there really a whole lot of difference when it comes to resource use?

30 or 60. 40 is a bad default.

Oh ok! Then I guess I should switch my game to 60 fps now while I still don't have too many animations. Thanks!
« Last Edit: 11 Jul 2019, 21:47 by notarobotyet »

Re: The Quick Questions Thread
« Reply #4 on: 11 Jul 2019, 15:50 »
- What is "better"? 40 fps or 60 fps? Is there really a whole lot of difference when it comes to resource use?

Because in AGS game and object speeds are strictly bound to FPS having higher FPS gives more precision when adjusting delays, would be walking, animation or timers.

There's no way to know beforehand how this will affect perfomance. I am not a game developer myself, but guess I would try to make 60 fps game and then provide "easy mode" for devices that cannot run that fast (if that's a problem).
« Last Edit: 11 Jul 2019, 15:51 by Crimson Wizard »

Re: The Quick Questions Thread
« Reply #5 on: 11 Jul 2019, 21:41 »
Are sound clip and audiochannel volumes always relative to the global volume? In other words, if I have my global volume set at 70 and I do Audiochannel.Volume = 40, will the volume of Audiochannel be 40, in absolute terms, or 40% of 70%

Unfortunately this is silly, but they all are absolute values. If you want relative values you'd have to script this on your own, keep track of master volume and adjusting channels accordingly.

The manual implies that it is 40% of 70%:
https://adventuregamestudio.github.io/ags-manual/System.html#volume

Surely if they were absolute then the volume wouldn't change at all when this value was adjusted?

Re: The Quick Questions Thread
« Reply #6 on: 11 Jul 2019, 21:51 »
Are sound clip and audiochannel volumes always relative to the global volume? In other words, if I have my global volume set at 70 and I do Audiochannel.Volume = 40, will the volume of Audiochannel be 40, in absolute terms, or 40% of 70%

Unfortunately this is silly, but they all are absolute values. If you want relative values you'd have to script this on your own, keep track of master volume and adjusting channels accordingly.

The manual implies that it is 40% of 70%:
https://adventuregamestudio.github.io/ags-manual/System.html#volume

Surely if they were absolute then the volume wouldn't change at all when this value was adjusted?


It certainly seems to make more sense this way. And my (very informal) testing seems to confirm it too. This is a huge relief!

Re: The Quick Questions Thread
« Reply #7 on: 11 Jul 2019, 22:47 »

The manual implies that it is 40% of 70%:
https://adventuregamestudio.github.io/ags-manual/System.html#volume

TBH I think this article does not make it fully clear.

But now I think I confused this with Game.SetAudioTypeVolume which changes actual volume of playing or future clips rather than adjust them by relative factor.

Re: The Quick Questions Thread
« Reply #8 on: 12 Jul 2019, 11:49 »
Another quick question for the thread:

Can I use dialog commands in the middle of scripted sections in a dialogue?

As in...

Code: Adventure Game Studio
  1. // Dialog script file
  2. @S  
  3.    if (boolean variable) {
  4.    anothervariable = 1;
  5. player: I am very confused!
  6.    player.Walk(somewhere);
  7. option-on 1
  8. option-on 2
  9.    }
  10.  
  11.    else {
  12.    anothervariable = 2;
  13. player: I am even more confused!
  14.    player.Walk(somewhere else);
  15. option-on 3
  16. option-on 4
  17.    }
  18.  
  19. return

...or would I have to call run-script / dialog_request for this kind of stuff?

Re: The Quick Questions Thread
« Reply #9 on: 12 Jul 2019, 13:13 »
Yes, you can use script in the middle of dialogs as long as they are not starting at the beginning of the line (precede with space to use scripting).

Ok, question, what's the integer limit? Can it go to 100000 (one hundred thousand)?

Re: The Quick Questions Thread
« Reply #10 on: 12 Jul 2019, 13:22 »
Yes, you can use script in the middle of dialogs as long as they are not starting at the beginning of the line (precede with space to use scripting).

My question was actually the other way around :-D If I have a "scripted" section in a dialog, I want to know if I can throw those "option-on" commands inside the "if" statement / curly brackets of my scripted section.

Re: The Quick Questions Thread
« Reply #11 on: 12 Jul 2019, 13:57 »
Ok, question, what's the integer limit? Can it go to 100000 (one hundred thousand)?

In AGS integers and floats are 32-bit.

Integers can be from -2147483648 to +2147483647
Floats are more complicated because it depends on precision and I could never remember how it works.


Yes, you can use script in the middle of dialogs as long as they are not starting at the beginning of the line (precede with space to use scripting).

My question was actually the other way around :-D If I have a "scripted" section in a dialog, I want to know if I can throw those "option-on" commands inside the "if" statement / curly brackets of my scripted section.

Yes, you can. All special dialog commands are actually converted into real AGS script before compiling into game.
« Last Edit: 12 Jul 2019, 14:01 by Crimson Wizard »

Re: The Quick Questions Thread
« Reply #12 on: 12 Jul 2019, 14:37 »
Yay. Thanks, CW!

Re: The Quick Questions Thread
« Reply #13 on: 12 Jul 2019, 17:23 »
Thanks CW!  :-D

(I did a quirk way with enums to separate my dialogs from script, but I am way below the integer limit, so this cool :D)

Re: The Quick Questions Thread
« Reply #14 on: 15 Jul 2019, 14:04 »
There goes another one!

Using VSync in fullscreen mode with Direct3D makes my characters walk and animate in general noticeably slower than when I'm not using it. Is this normal? Is VSync good for anything anyway if my game runs at 60 fps? (From what I gather, VSync limits fps to 60, so using it should not change anything... but apparently it does.)

For context, I am using large scrolling rooms (game resolution 320x200, rooms around 400x350 pixels or so) but this happens even when I move the character to a regular 320x200 room.

Edit: And since I'm here asking basic questions about graphics drivers, which is "better"? Direct3D or OpenGL? (I understand that "better" depends on context, but overall and for most average cases, which one tends to work better and give fewer issues?)
« Last Edit: 15 Jul 2019, 14:53 by notarobotyet »

Re: The Quick Questions Thread
« Reply #15 on: 16 Jul 2019, 00:15 »
Edit: And since I'm here asking basic questions about graphics drivers, which is "better"? Direct3D or OpenGL? (I understand that "better" depends on context, but overall and for most average cases, which one tends to work better and give fewer issues?)

This depends on system, and I think you should ask people who publish commercial games and get lot of feedback from users.
Also this is strictly Windows question, because for example on Linux you have only OpenGL (or slower software renderer).

Re: The Quick Questions Thread
« Reply #16 on: 16 Jul 2019, 06:39 »
Edit: And since I'm here asking basic questions about graphics drivers, which is "better"? Direct3D or OpenGL? (I understand that "better" depends on context, but overall and for most average cases, which one tends to work better and give fewer issues?)

This depends on system, and I think you should ask people who publish commercial games and get lot of feedback from users.

Then I hope one of those people will stop by this thread :)

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: The Quick Questions Thread
« Reply #17 on: 16 Jul 2019, 10:13 »
Just default it to the one you prefer, cause users will change it to fit their system/preference anyway.
In the end, just make sure your game plays nicely independently of the GD chosen.
There are those who believe that life here began out there...

Re: The Quick Questions Thread
« Reply #18 on: 22 Jul 2019, 17:09 »
Is there a way to display line numbers in the Dialog editor? Sometimes when running/compiling my game after scripting or modifying something, I'll get an error like "Dialog 1(92): Error (line 92): Undefined token 'patrick' " but since dialogue lines are not numbered in the editor, it can sometimes be a challenge to find where the problem lies.
« Last Edit: 22 Jul 2019, 17:13 by notarobotyet »

Re: The Quick Questions Thread
« Reply #19 on: 22 Jul 2019, 17:38 »
I don't think there is. Maybe this is because this editor component doesn't support line numbers (or doesn't support them without also enabling breakpoint controls - perhaps this is a separate problem), or just because no-one ever turned the line numbers on. Dialog scripts preserve leading and trailing whitespace, but maybe when dialog commands are substitued for actual script commands there is a risk of line numbers changing.