Changing game resolution with Tumbleweed template

Started by DiegoHolt, Fri 13/09/2024 01:07:09

Previous topic - Next topic

DiegoHolt

Hello, sorry to start another post but I still don't know how to delete these things.

An image is worth a thousand words, right? So, here is my problem:



I can't figure out where to change the size assigned to the text in the dialog box. Can't find any clear number in the CustomDialogGui script of the 'thumbleweed' template game.

There is supposed to be FOUR dialog options, and the arrow should be on the far right of the box, but as you can see it's all packed up like if the resolution was still 320x200

The actual resolution is 1280x800

I'm surprised that no one had this issue before, since I've searched the forum and found nothing about it.

Please, I need some of your wisdom here.

Many, many thanks in advance!

DiegoHolt

Alright, this is what I've got so far...



I'm slowly getting there, but I think I hit a wall now beacause I can't find any other line of code to modify to try and see...   :-\

Crimson Wizard

Frankly, this looks like either a mistake in the template, or that you are not using it correctly, because normally one would expect it to rearrange dialog automatically depending on game's resolution and/or size of the dialog gui.

I'd advise to report this to the template's author, either in the template's forum thread:
https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/template-tumbleweed-verbs-1-4/
or in the template's repository here:
https://github.com/dkrey/ags_tumbleweed/issues


On a side note, this topic's title is bad, because it's not specific. This may make it harder for other people to find it if they have similar issues with this template. It could be "Changing game resolution with Tumbleweed template", for example.

eri0o

You have to use CustomDialogGui. DialogGuiOptions[option] attribute to set the options. I don't know how did you change the size there in the dialog but the correct way is to use the options. You can either directly set the size there or set the minimum and maximum for either or both width and height and turn on the width and height calculation by setting them to 1 - 0 turns them off to revert to manual calculation.

I guess that a picture isn't worth a thousands words alone, sometimes you need to show the code of what you did.

(I wrote a more detailed explanation before but the forums ate my answer...)

DiegoHolt

@Crimson Wizard Thanks for taking your time to reply!

I'm new to AGS and until now I was just fooling around with a 320x200 game just to learn the basics.

But now I'm trying to start a new project with a higher resolution. So what I've done is changing it to 1280x800 as soon as I started this new game. Then I've realized that the GUIS were still the same size, but also the text on them. So I tried messing with the code in the CustomDialogGui to resize the text in the dialog box, but as you can see I had no success.

Obviously, this is not the way to do it but since my English does not include much technical terms it's hard for me to find exactly what I need.

DiegoHolt

Quote from: eri0o on Fri 13/09/2024 19:45:52I guess that a picture isn't worth a thousands words alone, sometimes you need to show the code of what you did.

I didn't do any code, just changed some numbers in the CustomDialogGui, like this for example:

Code: ags
void getRowCount(static CustomDialogGui, int width)
{ 
  int i, j, k = 1, temp_height; 
  bool first_call=false;
  
  j = 5;  //NUMERO DE OPCIONES DE DIALOGO VISIBLE (DEL 0 EN ADELANTE)
  if ( CDG_options.scroll_from ==0) {
    CDG_options.scroll_from =1;      
    first_call = true;
  }
  i = CDG_options.scroll_from;

As you can see, I put a comment next to it just to remind me where it was. The only change I did was the "j = 5;" and frankly, I have no idea what that is. I assumed that changing a number here and there would do something, and it did. But I'm obviously a rookie and have no idea of what I'm doing.

Also, I changed this to set the size of the dialog box:

Code: ags
  //Position of GUI
  //info.X = xpos ;
  //info.Y = ypos ;
  info.X = 0;
  info.Y = 580;
  
  //Size of GUI
  //info.Width  = CDG_options.gui_width ;
  //info.Height = CDG_options.gui_height;
  info.Width = 1280;
  info.Height = 220;

Now, I'm dealing with this that you just said:

QuoteYou can either directly set the size there or set the minimum and maximum for either or both width and height and turn on the width and height calculation by setting them to 1 - 0 turns them off to revert to manual calculation.

But again, I have no idea where to look exactly...

Crimson Wizard

So, if we look at this code:

Code: ags
//Size of GUI
//info.Width  = CDG_options.gui_width ;
//info.Height = CDG_options.gui_height;

you can see that this module was taking GUI sizes from CDG_options. CDG_options is actually what you should be changing instead, because these CDG_options may be used elsewhere, in multiple places.

CDG_options are configuration for this module. This template comes with the documentation, and I wonder if this is explained there:
https://github.com/adventuregamestudio/ags-manual/wiki/Tumbleweed

I suggest reverting all your changes to the template code, and instead search the documentation for how you configure it.

EDIT: no , looking quickly through the manual, it does not mention configuration. That's a dissapointment.

Crimson Wizard

#7
So, after quickly looking through the template script, apparently this is how you configure the dialog options:
https://github.com/dkrey/ags_tumbleweed/blob/master/CustomDialogGui.ash


You need to have this somewhere in global script, in "game_start" function perhaps:
Code: ags
CustomDialogGui.DialogGuiOptions[ OPTION_ID ] = value;

where OPTION_ID is one of the options from the eDialogGuiOptions list.

For example:
Code: ags
CustomDialogGui.DialogGuiOptions[ eDialogGui_gui_width ] = Screen.Width;
CustomDialogGui.DialogGuiOptions[ eDialogGui_gui_height ] = Screen.Height;
and so on.

That should affect the whole module, and likely get you better results.


Overall, I must say this, it's a very bad strategy to hack insides of a module, because there may be multiple connected things in it. You change it in one place, but it still not working in another, or just breaks. It's better to learn how module can be used from "outside", by calling its public functions.

DiegoHolt


@Crimson Wizard thank you very much! That was it!

Now I have to deal with the location of the dialog box, but that's not a problem since I think I can manage from here...

Again, thank you and thank you too @eri0o! Both of you have been very helpful!  :-D

Khris

As long as you're just starting off, I'd consider switching to 1280x720 instead of 800.
16:10 is a legacy resolution; most screens today are 16:9.

eri0o

@Khris I agree that 16:9 is more common specially tvs and desktops but 16:10 (and 3:2!!) made a come back in laptops in recent years. If you look around for laptops today there are several high ends that are going for huge 16inch screens with 16:10 resolution. My guess is they sell well for people working from home that write a lot of text.

Khris

@eri0o True, but this means a 16:10 monitor will show a 16:9 game in the "correct" resolution with narrow black borders at the top and bottom (like we're used to from watching movies anyway), while a 16:10 game on a 16:9 monitor will have bars on the sides and more importantly will be scaled down to fit vertically by a factor of 0.9. This sounds way worse than the former.

SMF spam blocked by CleanTalk