AGS 3.6.0 WIP (Alpha 20) - SDL2-based engine + Unicode support

Started by Crimson Wizard, 25 Mar 2021, 02:28

« previous - next »

Crimson Wizard

Quote from: Stranga on 18 Feb 2022, 06:57if I save at night and load it's day (or background frame resorts to default which I think is 0). Basically, it's not saving room background frames (Not sure if this is affecting other frame animations, haven't tested it with views yet)

Looks like a bug.

Stranga

Thanks for the update and fix CW  :-D

I also found this, not sure if it's a bug either but when running custom dialog options via scripting I get these errors:
[spoiler]

[/spoiler]

the first one is in Turkish, which just seems to show some displacement of the letters and the other two are Russian which doesn't show up at all, I've tried a few different fonts with Russian but still, the same result.
The rest of the GUI and regular text seems to work fine :)

Crimson Wizard

Quote from: Stranga on 02 Mar 2022, 06:09
I also found this, not sure if it's a bug either but when running custom dialog options via scripting I get these errors:

I cannot answer this question without knowing more details - what script you have, which fonts you have, and so on.

Stranga

Quote from: Crimson Wizard on 02 Mar 2022, 08:20
I cannot answer this question without knowing more details - what script you have, which fonts you have, and so on.

My apologies, here's the script:
[spoiler]
Code: ags

// new module script

//int dlg_opt_color = ;
int dlg_opt_acolor = 30719;
int dlg_opt_ncolor = 65535;
int DlgCursorPos = 1;

import int  KeyUp[2];
import int  KeyDown[2];
import int  KeyLeft[2];
import int  KeyRight[2];
import int  KeyAction[2];
import int  KeyBack;
import int  KeyMenu;
import int  KeySprint[2];

import bool CanPress;

function repeatedly_execute()
{
  btnDialogCursor.Visible = false;
  btnOptionsBox.Visible = false;
}

function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
  // Create a 200x200 dialog options area at (50,100)
  info.X = 30;
  info.Y = 50;//50
  info.Width = 256;
  info.Height = 256;
  info.ActiveOptionID = 1; // set to first option
}

function dialog_options_render(DialogOptionsRenderingInfo *info)
{
  //info.Surface.Clear(dlg_opt_color);
  int i = 1,  ypos = 24,  xpos = 0;
  // Render all the options that are enabled
  while (i <= info.DialogToRender.OptionCount)
  {
    if (info.DialogToRender.GetOptionState(i) == eOptionOn)
    {
      if (info.ActiveOptionID == i){
       
          btnDialogCursor.SetPosition(6, ypos+42); //Cursor Position
          btnDialogCursor.Animate(5, 0, 5, eRepeat);
      }
       else
       
        info.Surface.DrawingColor = dlg_opt_ncolor;
        info.Surface.DrawStringWrapped(5, ypos, info.Width - 10,
        eFontfntDefault, eAlignLeft, info.DialogToRender.GetOptionText(i));
        ypos += GetTextHeight(info.DialogToRender.GetOptionText(i), eFontfntAll, info.Width - 10);   
    }
    aMenuSelector.Play();
    i++;
  }
}

function dialog_options_key_press(DialogOptionsRenderingInfo *info, eKeyCode keycode)
{
  switch (keycode)
  {
  case KeyUp[0]:
  case KeyUp[1]:
    // check all options upwards until found an active one
    for (int next_opt = info.ActiveOptionID - 1; next_opt >= 1; next_opt--)
    {
      if (info.DialogToRender.GetOptionState(next_opt) == eOptionOn)
      {
        info.ActiveOptionID = next_opt;
        break;
      }
    }
  break;
  case KeyDown[0]:
  case KeyDown[1]:
    // check all options downwards until found an active one
    for (int next_opt = info.ActiveOptionID + 1; next_opt <= info.DialogToRender.OptionCount; next_opt++)
    {
      if (info.DialogToRender.GetOptionState(next_opt) == eOptionOn)
      {
        info.ActiveOptionID = next_opt;
        break;
      }
    }
  break;
  }
 
if(CanPress)
  {
    switch(keycode)
    {
      case KeyAction[0]:
      case KeyAction[1]:
        btnDialogCursor.Visible = false;
        btnOptionsBox.Visible = false;
        btnPopUp.Visible = false;
        btnPopTalk.Visible = false;
        info.RunActiveOption();
      break;
    }
  }
}

function dialog_options_repexec(DialogOptionsRenderingInfo *info)
{
    btnOptionsBox.Visible = true;
    btnDialogCursor.Visible = true;
}
[/spoiler]

Here's the font I am using too: https://opengameart.org/content/lanapixel-localization-friendly-pixel-font
The game is keyboard-only based so I used the custom choice scripting found in the manual. I also use this same font with other languages too and it works fine with them.

Crimson Wizard

Quote from: Stranga on 02 Mar 2022, 23:33
Here's the font I am using too: https://opengameart.org/content/lanapixel-localization-friendly-pixel-font
The game is keyboard-only based so I used the custom choice scripting found in the manual. I also use this same font with other languages too and it works fine with them.

I will make some tests, but something I noticed in the script:
- calling GetTextHeight you use eFontfntAll, but
- calling DrawStringWrapped you use eFontfntDefault.

What's the difference between these fonts, could you double check that this is correct?

Stranga

That was the problem! Thanks, CW! I can't believe I missed that  :-[ Everything works fine now  :-D

Edit: the difference was that "Default" was the AGS font I was using during the development "All" was the one that contained the customer symbols and such for different languages

Crimson Wizard

#186
Updated to Alpha 19
(use download links in the first post)

New changes:

Editor:
- Finally, full Unicode support right in the Editor. Script, game properties and so on, support any human language. Note that you have to use proper Unicode fonts for this to work correctly.
To upgrade your game to unicode mode, goto General Settings and check the "Text format" option. Changing it will convert game files and resave the project. If you had only basic latin text - nothing should change; this is mostly done in case you had other languages in your game. After we update templates, unicode mode should be default for all the new projects.
ANSI mode is still supported, mostly in case you're upgrading an old game and wish to stick to old fonts.
- Upgraded script editor to Scintilla 3.21.1 and ScintillaNET 3.6.3. This was done for easier unicode support. I don't think anything has changed feature-wise, but keep an eye for regressions.
- Added Android build target support (requires "Android component" installed).
More info on building for Android is here: https://www.adventuregamestudio.co.uk/forums/index.php?topic=59772.0
- Removed game Cursors hard limit (was 20), fwiw.
- Fixed few editor panes were not opening correct help topics in F1.

Engine:
- Added "--clear-cache-on-room-change" command-line arg (and similar config option).
- Fixed OGV Theora videos positioned incorrectly if they have certain sizes or aspect ratios.


I think we're now done with major features in this version. In order to move to Beta stage, we only need to update game templates, because they are still upgraded from 3.5.1, and some options are set to backward compatible values at start.

eri0o

The web component is now in too (as part of the installer), so it's not necessary to link it separately in the main page anymore.

I think during beta we will also be writing the missing manual pages, updating script API changes in documentation.

Crimson Wizard

Unfortunately found two bugs in Alpha 19:
- When converting text format (in General Settings) all your scripts should be closed, otherwise the editor may crash;
- In script editor deleting multiple lines at once (with selection) may cause crash.

Both are fixed in this temp build:
https://cirrus-ci.com/task/6570224085368832

I will be releasing a proper update too soon.

Crimson Wizard

#189
Updated to Alpha 20
(use download links in the first post)

Had to make new update soon, to fix couple of problems found since the last update.

New changes:

Editor:
- Fixed crash when changing game encoding if any script window is open (since 3.6.0.18).
- Fixed script editor "random" errors when deleting multiline selection (regression in 3.6.0.18).

Compiler:
- Support hexadecimal number literals (32-bit max). May be used anywhere where regular decimal numbers are used.
Code: ags

int a = 0xFFFFFF00;
int b = 0x01234567;
int c = 0xabcdefab; // both capital and small x and a-f letters are supported
int d = 16 + 0x10; // means 16 + 16


Engine:
- Removed limit of simultaneous Button animations (was 15).
- Removed limit of Character followers (was 30) (was not demanded, but because why not).

Full list of changes is available here:
https://github.com/adventuregamestudio/ags/blob/master/Changes.txt

SMF spam blocked by CleanTalk