jgabaut/helapordo

[FEATURE] Full screen utilization

Closed this issue · 5 comments

Is your feature request related to a problem? Please describe.
After starting, helapordo is only using partial screen.

Describe the solution you'd like
I wish if it utilize all available screen on current terminal.

Describe alternatives you've considered
I am zooming in to make it bigger. Couldn't really think of an alternative for this issue.

Additional context

  • Am i the only one with partial screen size utilization? I am not sure.
  • If so should i open it as a bug report?

2024-125-Sat-May_04-07:27:31_PM

  • Did i miss an option to use full-screen?
  • Sorry if this is already implemented.

To achieve something close to what you mean, you should mess with your terminal's settings on font size.

A quick way I do this on my terminal is with Ctrl + '+' (and Ctrl + '-' to scale down) but I'm sure this may be different for different terminals.

To elaborate on this, there's currently no way to scale the UI alignments for the game, as all spacings are hardcoded and not using any relative dimensioning with regards to the whole terminal screen.

While an interesting addition, I am afraid this would prove hard to get a "nice" feeling since we're ultimately messing with char cells, not real pixels, and we are sometimes rendering actual glyphs on that (any printable character) that we would have no way to "draw" to more than one cell meaningfully.

Moreover, it's relevant to note that sprites4curses is also not offering any rendering scaling abilities for now (at least, for the nurses build, more on this later) for the animations API.

This is because each "pixel" being a single char cell, and realistically not requiring a large amount of cells on screen (at least for now, see later part about minimum size required, but than could change... Unlikely) makes it kinda difficult to meaningfully scale them considering the roundings needed.

What I mean is that I feel it makes some sense to let the scaling be handled by the font size, if we make sure to account for that in our bounds.

Currently, the game uses some loose logic around the expected default size for a new terminal (80,24) with some hardcoded minimum it will require.

Anything above that is simply accepted as it won't interfere.

About sprites4curses, the support for animation scaling is present when using the raylib backend. But, right now, that's only used for the very WIP demo of the raylib build, which you may try out if you want.
Not relevant to this issue, but that build will certainty receive more love in the future.

Let me know how you feel about using the terminal font size, and if you feel something could be done about the text alignments.

To achieve something close to what you mean, you should mess with your terminal's settings on font size.
A quick way I do this on my terminal is with Ctrl + '+' (and Ctrl + '-' to scale down) but I'm sure this may be different for different terminals.

Understood. Thank you for the fast response. I am doing the same for zooming in.

Let me know how you feel about using the terminal font size, and if you feel something could be done about the text alignments.

Font size works but brother height to width ratio is making it look bad. So, i thought it would be best to involve you. Seems like we are already doing what's best and changes wouldn't be that easy. Most of things you shared went over my head but i got the general idea. I will google to fill in the gaps just for curiosity.

Closing this. I will keep using zoom in and zoom out to find the sweet spot for my terminal.

Font size works but brother height to width ratio is making it look bad

I'm sorry, I really didn't get what you meant here. Would you help me understand it?

Closing this. I will keep using zoom in and zoom out to find the sweet spot for my terminal.

Using more than one cell per each character is not really doable.
Using a lot of cells (raising the minimum accepted terminal dimensions) could maybe allow some level of figlet to be used instead of real character being printed for text...

I'm sure it's one of the most likely-to-be-requested functionalities, but sadly there isn't really a way to achieve this in terminal. I doubt there's a way for curses to control how big the terminal cells are.

On a side note, I'd suggest you to check out the WIP raylib build of the game. It has fullscreen and dynamic scaling, so by seeing the animations on there, you might get what I mean better (that ncurses can't scale the cells dimensions at will, afaik).

So, all in all:

-This could be added, but the effort to refactor most draw functions to use dynamic layouts is significant. Plus, there would still be no way to scale the text size (one cell per char), and the size of each cell is external to ncurses control afaik, which would influence the menuing and also the animations.

didn't get what you meant here. Would you help me understand it?

By Height to Width ratio i meant map is more vertical then horizontal.

Currently, the game uses some loose logic around the expected default size for a new terminal (80,24) with some hardcoded minimum it will require.

Where can i change this in my personal repo. I would try (24, 80) rather than (80, 24).

I tried increasing & decreasing font size like this:
2024-128-Tue-May_07-04:18:16_AM

Is it possible for map to be in the center?

EDIT:

On a side note, I'd suggest you to check out the WIP raylib build of the game. It has fullscreen and dynamic scaling, so by seeing the animations on there, you might get what I mean better (that ncurses can't scale the cells dimensions at will, afaik).

Okay, i will try it. Thank you.

By Height to Width ratio i meant map is more vertical then horizontal.

I'm not sure if you mean the render of the map.

As a -possible- related note, the ratio of height/width for a single cell is not 1 (they are not squares), so that will naturally be reflected on how a drawn square (say, a 10x10) looks in terminal (it will look clearly more high that wide).

Where can i change this in my personal repo. I would try (24, 80) rather than (80, 24).

I was talking about the check on minimum needed size.

As per your zooming, I think you're overdoing it. There's some balance to be had between zooming and resizing the window.

Try this: start a new terminal, and see that the warning for the game in a 80x24 suggests just a slight vertical enlargement.

Game drawn area is something like 80x28.

So, whenever you're using zoom, currently, if you want to keep the expected "everything is visible" look, you don't want to drop below that size for rendered cells.
Zooming too much and going below 80x28 should make the game go back to the warning, but checking terminal size on each frame is kinda nasty.

Once again, this thing is already implemented in raylib build, where it's much easier to have per-frame logic and also the resizing is handled better. This, however, is not relevant for the ncurses build.

@khushal-banks
Centering the map, I think would be doable. If you want to try to mess with this, go for it.

Here you can find where the Gamescreen for a given execution is created. If you want to dive into the docs, I'd recommend the Pages link.