Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Laura Hunt on Thu 11/07/2019 14:03:46

Title: The Quick Questions Thread
Post by: Laura Hunt on Thu 11/07/2019 14:03:46
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!
Title: Re: The Quick Questions Thread
Post by: Crimson Wizard on Thu 11/07/2019 15:33:32
Quote from: notarobotyet on Thu 11/07/2019 14:03:46
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

Quote from: notarobotyet on Thu 11/07/2019 14:03:46
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.
Title: Re: The Quick Questions Thread
Post by: Privateer Puddin' on Thu 11/07/2019 15:44:30
Quote from: notarobotyet on Thu 11/07/2019 14:03:46

- 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.
Title: Re: The Quick Questions Thread
Post by: Laura Hunt on Thu 11/07/2019 15:49:23
Quote from: Crimson Wizard on Thu 11/07/2019 15:33:32
Quote from: notarobotyet on Thu 11/07/2019 14:03:46
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.


Quote from: Crimson Wizard on Thu 11/07/2019 15:33:32
Quote from: notarobotyet on Thu 11/07/2019 14:03:46
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.

Quote from: Privateer Puddin' on Thu 11/07/2019 15:44:30
Quote from: notarobotyet on Thu 11/07/2019 14:03:46
- 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!
Title: Re: The Quick Questions Thread
Post by: Crimson Wizard on Thu 11/07/2019 15:50:21
Quote from: notarobotyet on Thu 11/07/2019 14:03:46
- 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).
Title: Re: The Quick Questions Thread
Post by: morganw on Thu 11/07/2019 21:41:18
Quote from: Crimson Wizard on Thu 11/07/2019 15:33:32
Quote from: notarobotyet on Thu 11/07/2019 14:03:46
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 (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?
Title: Re: The Quick Questions Thread
Post by: Laura Hunt on Thu 11/07/2019 21:51:41
Quote from: morganw on Thu 11/07/2019 21:41:18
Quote from: Crimson Wizard on Thu 11/07/2019 15:33:32
Quote from: notarobotyet on Thu 11/07/2019 14:03:46
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 (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!
Title: Re: The Quick Questions Thread
Post by: Crimson Wizard on Thu 11/07/2019 22:47:21
Quote from: morganw on Thu 11/07/2019 21:41:18

The manual implies that it is 40% of 70%:
https://adventuregamestudio.github.io/ags-manual/System.html#volume (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.
Title: Re: The Quick Questions Thread
Post by: Laura Hunt on Fri 12/07/2019 11:49:52
Another quick question for the thread:

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

As in...

Code (ags) Select
// Dialog script file
@S 
   if (boolean variable) {
   anothervariable = 1;
player: I am very confused!
   player.Walk(somewhere);
option-on 1
option-on 2
   }

   else {
   anothervariable = 2;
player: I am even more confused!
   player.Walk(somewhere else);
option-on 3
option-on 4
   }

return


...or would I have to call run-script / dialog_request for this kind of stuff?
Title: Re: The Quick Questions Thread
Post by: eri0o on Fri 12/07/2019 13:13:20
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)?
Title: Re: The Quick Questions Thread
Post by: Laura Hunt on Fri 12/07/2019 13:22:41
Quote from: eri0o on Fri 12/07/2019 13:13:20
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.
Title: Re: The Quick Questions Thread
Post by: Crimson Wizard on Fri 12/07/2019 13:57:56
Quote from: eri0o on Fri 12/07/2019 13:13:20
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.


Quote from: notarobotyet on Fri 12/07/2019 13:22:41
Quote from: eri0o on Fri 12/07/2019 13:13:20
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.
Title: Re: The Quick Questions Thread
Post by: Laura Hunt on Fri 12/07/2019 14:37:57
Yay. Thanks, CW!
Title: Re: The Quick Questions Thread
Post by: eri0o on Fri 12/07/2019 17:23:53
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)
Title: Re: The Quick Questions Thread
Post by: Laura Hunt on Mon 15/07/2019 14:04:26
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?)
Title: Re: The Quick Questions Thread
Post by: Crimson Wizard on Tue 16/07/2019 00:15:32
Quote from: notarobotyet on Mon 15/07/2019 14:04:26
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).
Title: Re: The Quick Questions Thread
Post by: Laura Hunt on Tue 16/07/2019 06:39:33
Quote from: Crimson Wizard on Tue 16/07/2019 00:15:32
Quote from: notarobotyet on Mon 15/07/2019 14:04:26
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 :)
Title: Re: The Quick Questions Thread
Post by: Cassiebsg on Tue 16/07/2019 10:13:59
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.
Title: Re: The Quick Questions Thread
Post by: Laura Hunt on Mon 22/07/2019 17:09:44
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.
Title: Re: The Quick Questions Thread
Post by: morganw on Mon 22/07/2019 17:38:14
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.
Title: Re: The Quick Questions Thread
Post by: Laura Hunt on Mon 22/07/2019 17:49:53
Quote from: morganw on Mon 22/07/2019 17:38:14
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.

I see. So it could even be the case that the line number that the compiler is returning in the error message isn't even the actual line number that I would get if I counted down by hand in the dialog editor, but the line number post-compilation (once everything has been converted into script commands)?
Title: Re: The Quick Questions Thread
Post by: Crimson Wizard on Mon 22/07/2019 18:08:03
Quote from: notarobotyet on Mon 22/07/2019 17:49:53
I see. So it could even be the case that the line number that the compiler is returning in the error message isn't even the actual line number that I would get if I counted down by hand in the dialog editor, but the line number post-compilation (once everything has been converted into script commands)?

This is how it is, although IIRC dialog commands are simple and should normally take only 1 line.
Title: Re: The Quick Questions Thread
Post by: Snarky on Tue 23/07/2019 07:53:55
This is not my board to moderate, but I feel I have to say that I don't think this type of thread is such a good idea. Is it really that much more difficult to start a new thread for each question?
Title: Re: The Quick Questions Thread
Post by: Laura Hunt on Tue 23/07/2019 09:07:01
Sure, in the end it's the moderators' call, of course. I already explained that I feel that sometimes opening a whole new thread for a quick, silly question doesn't feel appropriate (to me at least), but if moderators don't like the idea of this thread existing, feel free to nuke it or whatever!
Title: Re: The Quick Questions Thread
Post by: Danvzare on Tue 23/07/2019 18:06:02
Quote from: notarobotyet on Tue 23/07/2019 09:07:01
Sure, in the end it's the moderators' call, of course. I already explained that I feel that sometimes opening a whole new thread for a quick, silly question doesn't feel appropriate (to me at least), but if moderators don't like the idea of this thread existing, feel free to nuke it or whatever!
Of course it doesn't feel appropriate. That's why there's a search function.  :-D
Every single question you could ever ask (especially the quick and silly ones), has already been asked at least twice already (usually more). It's only a matter of searching for it. Unless you're too lazy or frustrated to search for it, like I was once.  :-[
Title: Re: The Quick Questions Thread
Post by: Crimson Wizard on Tue 23/07/2019 21:49:50
Imho for what is worth such thread indicates that manual misses a good FAQ, and maybe needs more/better explanations in some topics.