AGS 3.3.0 Release Candidate

Started by Crimson Wizard, Thu 04/04/2013 19:16:28

Previous topic - Next topic

Crimson Wizard

Well, I found this "voice lip sync" in code... the engine code is messy at the speech part. Can anyway provide any small project to test how lipsync works? I never did that lipsync thing myself.

Shane 'ProgZmax' Stevens

Well, I haven't changed anything between builds, I literally just loaded it up in the final to make sure it was still working since the March build so there must be something it's doing differently.  You might try placing it in a script other than global (I have mine in customcontrols.asc/.h):

Joystick *joy;
export joy;

import Joystick *joy;


Same error I listed before.  It's not recognizing Joystick as a proper function from the agsjoy.dll which is in the editor folder and the game folder.


monkey0506

Quote from: Ryan Timothy on Sun 23/06/2013 06:31:24
Quote from: Crimson Wizard on Sat 22/06/2013 10:14:56
   game.speech_portrait_placement = 1; // enable custom offsets
I haven't had the chance to check this out, but is this what I think you've done. Instead of adding a new built-in enum, you've done the "unspeakable" mess of using an int that doesn't help the programmer in anyway to know what they're reading? I don't agree with this at all. Just my 2 cents.

I'm glad to see that we can finally agree on something Ryan. :P I was actually going to say that the whole idea of adding things to the game instance as opposed to the Game structure goes directly against what CJ was working toward with OO-izing AGS. I've said it before, but there is no reason to do something wrong now just because "it's easy to fix later".

Quote from: Crimson Wizard on Sun 23/06/2013 17:45:35something like

Code: ags
bool Game.EnableSpeechPortraitOffsets;

This is better, but properties shouldn't be named this way. "Enable" is an action, which is indicative of a function. Further, it implies that there should be an opposing function to "Disable" and a function to check "IsEnabled". The proper way of naming properties should be more like an adjective (describing the current state) rather than a verb (action):

Code: ags
bool Game.SpeechPortraitOffsetsEnabled;


This is consistent with other built-in properties, and makes it clear that it is a property describing (and by being writable, changing) the current state.

Although, really, is this particular property even necessary? After reading the discussion about how it's implemented, it seems reasonable to have it, but I agree with Ryan's logic that the offset properties themselves are named misleadingly.

@ProgZ: I know this is probably obvious, but it has to be asked. Is the plugin enabled in the project tree? If it's not enabled then its script header won't be added to the built-in headers, and Joystick won't be registered as a type. This would perfectly describe what you are experiencing.

Crimson Wizard

#123
Quote from: monkey_05_06 on Mon 24/06/2013 19:12:12The proper way of naming properties should be more like an adjective (describing the current state) rather than a verb (action):

Code: ags
bool Game.SpeechPortraitOffsetsEnabled;


This is consistent with other built-in properties, and makes it clear that it is a property describing (and by being writable, changing) the current state.

Although, really, is this particular property even necessary? After reading the discussion about how it's implemented, it seems reasonable to have it, but I agree with Ryan's logic that the offset properties themselves are named misleadingly.

I am not sure what to choose, hesitating between -
SpeechStyle.*
SpeechStylePortrait.*
SpeechStyleSirra.*
also it may be set by properties, or function.

There's no certain plans for the future of speech styles, so this feels like a random selection.



E: I was trying to figure out how engine may let user to customize speech styles, and I thought it is possible to make it similar to custom dialog options rendering: you make an instance of some SpeechStyle class and few functions with built-in names, like start_speech, render_speech etc, that take SpeechStyle pointer to your object as parameter.
In such case it should be SpeechStyle with few built-in properties and array of custom properties (similar to characters etc).

monkey0506

Don't get me wrong, functions are useful where functions are what's needed. But in the particular example above, a single property was able to sufficiently replace three parameterless functions.

As to structurizing the speech styles, I agree that it should be kept fairly generic, but are custom speech rendering methods really a priority request? I don't know that I've ever actually even seen it requested.

The exact naming isn't necessarily that important, as long as it accurately reflects what it does. For example (pseudo-code):

Code: ags
Speech.Style = eSpeechSierra; // SpeechStyle Speech.Style
Speech.TextGUI = gTextwindow; // GUI* Speech.TextGUI
Speech.TextAlign = eAlignLeft; // Alignment Speech.TextAlign
Speech.PortraitAlign = eAlignRight; // Alignment Speech.PortraitAlign
Speech.PortraitX = 50; // int Speech.PortraitX
Speech.PortraitY = 100; // int Speech.PortraitY
// etc.

Crimson Wizard

#125
Quote from: monkey_05_06 on Mon 24/06/2013 19:54:22
But in the particular example above, a single property was able to sufficiently replace three parameterless functions.
This left me puzzled. Which property and "parameterless functions" are that?

Quote from: monkey_05_06 on Mon 24/06/2013 19:54:22
but are custom speech rendering methods really a priority request? I don't know that I've ever actually even seen it requested.
No, they aren't priority, I am just trying to think in advance... I don't like it when user API is changed too often.
Regarding requests, there are numerous times when people were struggling to implement custom speech in their own way, and had troubles, for example, with playing voices. If custom speech styles were implemented, they could use standard Character.Say functions with custom speech rendering/behavior.

monkey0506

Quote from: Crimson Wizard on Mon 24/06/2013 20:06:51
Quote from: monkey_05_06 on Mon 24/06/2013 19:54:22
But in the particular example above, a single property was able to sufficiently replace three parameterless functions.
This left me puzzled. Which property and "parameterless functions" are that?

Uh... like I said, in the example above... Game.SpeechPortraitOffsetsEnabled (a property) would effectively replace three functions (Game.EnableSpeechPortraitOffsets(), Game.DisableSpeechPortraitOffsets(), Game.AreSpeechPortraitOffsetsEnabled()).

Quote from: Crimson Wizard on Mon 24/06/2013 20:06:51I don't like it when user API is changed too often.

Which is ironic given your predisposition to implement new changes the pre-AGS 2.7 (a.k.a., "wrong") way now in hope of changing them later (based on the rationale that it will be "easy") in favor of implementing them in the post-2.7 ("right") way in the first place. ;)

Quote from: Crimson Wizard on Mon 24/06/2013 20:06:51Regarding requests, there are numerous times when people were struggling to implement custom speech in their own way, and had troubles, for example, with playing voices. If custom speech styles were implemented, they could use standard Character.Say functions with custom speech rendering/behavior.

Again...

Quote from: monkey_05_06 on Mon 24/06/2013 19:54:22I don't know that I've ever actually even seen it requested.

Where are these "numerous times" that people have "[struggled] to implement custom speech in their own way"? Off the top of my head, I can't honestly think of a single example. You mentioned playing voices... I don't understand. Voice speech is a built-in feature...

Crimson Wizard

#127
Quote from: monkey_05_06 on Mon 24/06/2013 20:26:30
Quote from: Crimson Wizard on Mon 24/06/2013 20:06:51I don't like it when user API is changed too often.

Which is ironic given your predisposition to implement new changes the pre-AGS 2.7 (a.k.a., "wrong") way now in hope of changing them later (based on the rationale that it will be "easy") in favor of implementing them in the post-2.7 ("right") way in the first place. ;)

No...
There's already a certain style existing, which may be bad, but it does exist. If we add a new property or function of same (bad) style we will increase the amount of "bad" elements, but we will keep the language in the same form. If then we decide to rework the language, we may plan it thoroughly and split all those functions and properties to separate classes.
If, however, we add those elements in a new style, we have to decide which class/namespace they go, which may be difficult for we do not have a thorough plan about those classes yet. This may require to change their syntax/naming again later.
That's the simple reason I am reluctant to do this.
Okay, this might be my personal psychological issue... I won't deny that. :p

Quote from: monkey_05_06 on Mon 24/06/2013 20:26:30
Quote from: Crimson Wizard on Mon 24/06/2013 20:06:51Regarding requests, there are numerous times when people were struggling to implement custom speech in their own way, and had troubles, for example, with playing voices. If custom speech styles were implemented, they could use standard Character.Say functions with custom speech rendering/behavior.

Again...

Quote from: monkey_05_06 on Mon 24/06/2013 19:54:22I don't know that I've ever actually even seen it requested.

Where are these "numerous times" that people have "[struggled] to implement custom speech in their own way"? Off the top of my head, I can't honestly think of a single example. You mentioned playing voices... I don't understand. Voice speech is a built-in feature...

Oh, come on.
http://www.adventuregamestudio.co.uk/forums/index.php?topic=48244.msg636457955#msg636457955
That's one asked 15 days ago. Sorry, I won't search for more, but such topics appear every now and then.
Also custom speech (as it is made now) makes it difficult to use Dialogs: you have to call your custom functions from dialog scripts instead of using common dialog syntax.

Shane 'ProgZmax' Stevens

monkey- yeah, that was it.  I'm not sure why the newer ags didn't have the dll loaded for the project, though.  Thanks.

Crimson Wizard

#129
Since I am on it, this is what I am planning to add to script api:

Code: ags

enum SkipSpeech {
  eSkipKeyMouseTime = 0,
  eSkipKeyTime      = 1,
  eSkipTime         = 2,
  eSkipKeyMouse     = 3,
  eSkipMouseTime    = 4
};
  
managed struct Speech {
  /// Enables/disables the custom speech portrait placement.
  import static attribute bool         CustomPortraitPlacement;
  /// Gets/sets speech portrait x offset relative to screen side.
  import static attribute int          PortraitXOffset;
  /// Gets/sets speech portrait y position.
  import static attribute int          PortraitY;
  /// Gets/sets special key which can skip speech text.
  import static attribute eKeyCode     SkipKey;
  /// Gets/sets how the player can skip speech lines.
  import static attribute SkipSpeech   SkipStyle;
  /// Gets/sets the style in which speech is displayed.
  import static attribute eSpeechStyle Style;
  /// Gets/sets how text in message boxes and Sierra-style speech is aligned.
  import static attribute Alignment    TextAlignment;
  /// Gets/sets whether voice and/or text are used in the game.
  import static attribute eVoiceMode   VoiceMode;
};


I should probably also put global functions/variables I am replacing with these properties under "#ifndef STRICT" to disable them unless backward compatible mode is enabled.

E: I can't make TextGUI right now, the related code is bit more complicated than I expected. Engine has TWO text window ids, which may be the same or different, and are used in different cases...

Ryan Timothy B

Curious question, will there be an internal Set script for PortraitXOffset or PortraitY which turns CustomPortraitPlacement to true? In case I'm being misunderstood, I meant that whenever you change the PortraitXOffset or PortraitY, have it change CustomPortraitPlacement to true. It sounds like a good idea to me, but I'm not 100% certain if you agree.

Also another question. What is the SkipKey for? In case someone wants a very specific Speech style, where for example, you can only hit Enter to skip the text? Overall I suppose it isn't a terrible idea.

Also let me direct you to this thread. I was going to type it in here but decided a separate thread makes more sense.

Crimson Wizard

Quote from: Ryan Timothy on Wed 26/06/2013 23:36:01
Curious question, will there be an internal Set script for PortraitXOffset or PortraitY which turns CustomPortraitPlacement to true? In case I'm being misunderstood, I meant that whenever you change the PortraitXOffset or PortraitY, have it change CustomPortraitPlacement to true. It sounds like a good idea to me, but I'm not 100% certain if you agree.
Hmm, that sounds reasonable, but I am unsure... I mean, obviously user won't set those properties without intent to use them, but what if he will like to prepare them beforehand and enable later?
Well, anyway, that's easy to add.
And, yes, "attribute" tag automatically creates get/set methods using provided property name. Property (attribute) itself does not contain any data.

Quote from: Ryan Timothy on Wed 26/06/2013 23:36:01
Also another question. What is the SkipKey for? In case someone wants a very specific Speech style, where for example, you can only hit Enter to skip the text?
Yes, exactly.
Also, it is not my invention, this is the replacement for "game.skip_speech_specific_key" variable.

Ryan Timothy B

Quote from: Crimson Wizard on Wed 26/06/2013 23:49:01
Also, it is not my invention, this is the replacement for "game.skip_speech_specific_key" variable.
Oh wow. Learn something new about AGS everyday. You've done your homework.

Crimson Wizard

#133
AGS 3.3.0 BETA 5 released (engine version 3.3.0.1136)
-------------------------------------------------------
Changes from BETA 4:

Features:
- Introducing new Speech class to the AGS Script with several static properties replacing old-style global functions and variables.
Spoiler

Added extra constant to enum eKeyCode:
Code: ags

eNoKey // self-explanatory

Introducing enum SkipSpeech.
Defines how player may skip speech:
Code: ags

  eSkipKeyMouseTime,
  eSkipKeyTime,
  eSkipTime,
  eSkipKeyMouse,
  eSkipMouseTime

Introducing class Speech:
Code: ags

  /// Enables/disables the custom speech portrait placement.
  bool Speech.CustomPortraitPlacement;
  /// Gets/sets speech portrait x offset relative to screen side.
  int  Speech.PortraitXOffset;
  /// Gets/sets speech portrait y position.
  int  Speech.PortraitY;
  /// Gets/sets special key which can skip speech text.
  eKeyCode Speech.SkipKey;
  /// Gets/sets how the player can skip speech lines.
  SkipSpeech Speech.SkipStyle;
  /// Gets/sets the style in which speech is displayed.
  eSpeechStyle Speech.Style;
  /// Gets/sets how text in message boxes and Sierra-style speech is aligned.
  Alignment Speech.TextAlignment;
  /// Gets/sets whether voice and/or text are used in the game.
  eVoiceMode Speech.VoiceMode;

[close]


** WARNING **
Following functions and variables are now deprecated. If you have any of them in script you will likely receive compilation errors.
Either turn Backwards Compatibility mode in Global Settings, or consider using corresponding property from Speech class.
Spoiler

Code: ags

void SetVoiceMode(eVoiceMode);       // use Speech.VoiceMode
void SetSkipSpeech(int skipFlag);    // use Speech.SkipSpeech
void SetSpeechStyle(eSpeechStyle);   // use Speech.Style

int game.speech_text_align;          // use Speech.TextAlignment
int game.skip_speech_specific_key;   // use Speech.SkipKey

(introduced in 3.3.0 beta 4)
int game.speech_portrait_placement;  // use Speech.CustomPortraitPlacement
int game.speech_portrait_x;          // use Speech.PortraitXOffset
int game.speech_portrait_y;          // use Speech.PortraitY

[close]

Bug fixes:
- Fixed crash when displaying certain styles of text windows (regression).

Download links (also updated at first page):
Official: http://www.adventuregamestudio.co.uk/betas/AGS-3.3.0-beta5.exe
ZIP:
Official: http://www.adventuregamestudio.co.uk/betas/AGS-3.3.0-beta5.zip


Still need to find time to update manual, also waiting for corrected BASS template from Ghost.

Joseph DiPerla

Very nice as usual!!! Thanks CW.
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

monkey0506

eNoKey doesn't follow the naming convention of every other member of the same enumerated class. Every built-in enum that deals with a set of data groups the enum values together by a common naming convention due to the fact that AGS enums are stupidly injected into the global namespace. IMO something like "eKeyNone" would better follow the example of the existing built-in enums. Please feel free to share opinions on this.

I was going to say that the SkipSpeech enum wasn't needed, but I was thinking of the CutsceneSkipType enum, which doesn't exactly match the skip styles offered by/to speech. Might it be worthwhile to normalize these skip styles and then provide a common enum "SkipType" or "SkipStyle"?

Still harping on naming conventions (because it actually does matter), I'll comment to the "old" vs "new" convention issue by pointing out that CJ was the one who initiated the change. He left AGScript in a halfway-OO state that really is, I believe, the underlying issue. Ultimately the goal was, is, and should be to finish what CJ started in OO-izing the language (or in the case that AGScript were ever scrapped, the "framework"). This is the reason why I insist that anything new should follow the new style. If you disagree, well you're the one implementing all this while I'm busy trying to figure out a way of creating a virtual clone method returning by reference.

On that same note, CJ actually did a horrible job naming the built-in enums. If I counted right, at least 6 of the 25+ built-in enums start with an 'e' prefix, whereas the rest don't. This is just confusing and frustrating rather than helping identify the enum types as such. I think we should decide on one convention or the other, and fix it sooner rather than later.

Crimson Wizard

#136
Quote from: monkey_05_06 on Tue 02/07/2013 05:06:33
eNoKey doesn't follow the naming convention of every other member of the same enumerated class.
Yes, that's true... but it was a deliberate choice.
When I first made eKeyNone I paid attention that it appears in the middle of the autocomplete list; also its compliance with other key enums make it not stand out at it should be, being a special value. IMHO.

Quote from: monkey_05_06 on Tue 02/07/2013 05:06:33
I was going to say that the SkipSpeech enum wasn't needed, but I was thinking of the CutsceneSkipType enum, which doesn't exactly match the skip styles offered by/to speech. Might it be worthwhile to normalize these skip styles and then provide a common enum "SkipType" or "SkipStyle"?
Might be, but I don't know how to do this. Some of them options are not fit for other style: e.g. "skip by time" is non-sensical for Cutscenes, while "skip by escape" may be implemented as "skip by key" + special skip key for Speech.

Quote from: monkey_05_06 on Tue 02/07/2013 05:06:33
Ultimately the goal was, is, and should be to finish what CJ started in OO-izing the language This is the reason why I insist that anything new should follow the new style. If you disagree,
Of course I don't disagree. It's just what I said: I can't (=do not want) to do this without proper plan. That's why I was intending to limit these changes to minimum. This addition I made with portraits - it went slightly off my plans, I made it just because I was asked and it seemed a pretty easy thing to do.
(Meanwhile you can make your new script convention, I promise to try not break anything else in there ;))


cat

#137
I just got a crash with AGS Editor .NET (Build 3.3.0.1132) ** BETA VERSION ** (that's Beta 4 I think). I sent an error report, does this actually work? Who gets them?

Edit: Now the game/engine crashed when debugging, but no error message.

Crimson Wizard

Quote from: cat on Tue 02/07/2013 19:59:42
I just got a crash with AGS Editor .NET (Build 3.3.0.1132) ** BETA VERSION ** (that's Beta 4 I think). I sent an error report, does this actually work? Who gets them?
I think only AGA can tell where they go...
Regarding crash, can you tell any details? There was a bug in BETA 4 related to text messages (Display command) that could cause crash; I know for sure that it happened with DisplayTopBar.

cat

It was when I created a new room. Or when I wanted to open the newly created room? I don't remember and didn't write it down because I sent the error report. Is there maybe a logfile made?

The debugging stuck was when I was having a scripting problem and got an exception. I had to force-close the Studio in Taskmanager.

Should I get BETA 5?

SMF spam blocked by CleanTalk