Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Variants

Reply
 
Thread Tools Display Modes
Old January 5, 2020, 10:26   #11
Dean Anderson
Adept
 
Join Date: Nov 2009
Posts: 157
Dean Anderson is on a distinguished road
Quote:
Originally Posted by Aszazin View Post
edit: oh, is there any way to get the font smaller and center the view on the player (I'm used to using shift+5 for that)?
The view is always centered on the player unless the player is near the edge of a level.

I'm not sure what you mean by getting the font smaller. If you go into the options screen from the menu, you can change the window size (and since the window is always 80x25 characters this will change the font size with it) or switch to fullscreen; and you can change the font to any monospaced font you have on your machine.

(You can also use 'b' and 'i' on the options screen to toggle bold and italic).
Dean Anderson is offline   Reply With Quote
Old January 6, 2020, 19:54   #12
Aszazin
Scout
 
Join Date: Jun 2018
Posts: 34
Aszazin is on a distinguished road
Quote:
Originally Posted by Dean Anderson View Post
(and since the window is always 80x25 characters this will change the font size with it)
Ok, I was meaning to get a larger view (to get more than 80x25 characters), but I see it's a design decision not to allow that.
Aszazin is offline   Reply With Quote
Old January 7, 2020, 09:36   #13
Dean Anderson
Adept
 
Join Date: Nov 2009
Posts: 157
Dean Anderson is on a distinguished road
Quote:
Originally Posted by Aszazin View Post
Ok, I was meaning to get a larger view (to get more than 80x25 characters), but I see it's a design decision not to allow that.
I have to admit that's not something I've ever tried. I know that some other Angband variants have "big screen" modes, but Cthangband never has.

The way the current system works is that the main window can be resized but is always clamped to a 16:9 aspect ratio - the standard ratio for widescreen monitors. That window is then split into a grid of cells, currently 80x25, each of which can hold a single character. I don't actually draw each cell myself - that's handled by the system because I use the WPF framework.

I just tell the WPF framework the size/position of each cell and what character (strictly speaking, what text - it could be more than one character but never is) it should contain and what colour that character should be, and the WPF framework takes care of drawing it using hardware acceleration and ClearType sub-pixel rendering to make it nice and smooth - so much clearer and smoother than using even anti-aliased bitmap fonts would be.

The system draws each character stretched in both directions independently to fit the size of the cell, so I don't even need to specify font size that I want to use.

What this means is that I just need to change the cell counts (they're generated at run-time, not design-time) to change the number of rows or columns on the screen. Of course, it's not quite that simple, since the actual game code draws things at various rows and columns, so just changing the screen size doesn't change where things are drawn.

Of course, what it also means is that the characters are stretched based on the number of rows and columns used.

As I said, I currently use an 80x25 display (because that's what the old console displays use). When that's combined with a 16:9 aspect ratio, it turns out that most fonts (not all monospaced fonts have the same character aspect ratio so it varies somewhat) are stretched vertically. For example, if you open Notepad and switch the font to Courier New and type some text then compare that with the Cthangband display using Courier New then each character on the Cthangband display will be a bit taller and narrower than the characters in Notepad are.

I've just had a bit of a play around changing the number of rows in the display to see what it looks like.

As mentioned above, an 80x25 display stretches the characters vertically.

I've not measured exactly (and again, it depends on the font being used) but it looks like something approaching 80x30 or 80x32 gives a font that's the least stretched.

I've tried up to 80x50, and that squashes the characters vertically (or if you like stretches them horizontally - it's all relative) by a ridiculous amount.

I might play around a bit more and see what is a good compromise between screen size, performance (although I don't think that will be much of an issue), and font stretching.
Dean Anderson is offline   Reply With Quote
Old January 7, 2020, 13:43   #14
Dean Anderson
Adept
 
Join Date: Nov 2009
Posts: 157
Dean Anderson is on a distinguished road
After some more experimentation, I think that if I were going to change the "resolution" of the screen, then some multiple of 8x3 seems to work best for characters being scaled correctly.

That would mean that 80x30 would work, or even 120x45 or 160x60.

Of course, increasing the screen size to either of the latter would have all sorts of knock-ons - not least that the characters would pretty damn small. I'm running at 1920x1080 on a 27" monitor, so what looks okay to me might be too small to be readable by someone on a lower resolution and smaller monitor.

This is going to require a lot of thought and playtesting before I commit to whether or not to make the change.
Dean Anderson is offline   Reply With Quote
Old January 7, 2020, 14:05   #15
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,736
Donated: $40
Pete Mack is on a distinguished road
The way other bands work is that the player sets the font size and the screen size, and the gfx engine determines the cell size from that--just enough to fit in decenders and ascenders.
Pete Mack is offline   Reply With Quote
Old January 7, 2020, 14:18   #16
Dean Anderson
Adept
 
Join Date: Nov 2009
Posts: 157
Dean Anderson is on a distinguished road
Surely the problem with that is that - as the developer - you don't know how big the screen is going to be, so you can't lay it out properly.

I mean if I know the screen is going to be 80x25 I can make maximum use of that space. On the other hand, if I know it's going to be (say) 80x30 then I know I've got an extra five lines that I can make use of.

And if it's something even bigger like 120x45 then I've got a whole forty column strip down the side that I can use to put things in.

But if the user decides the font and screen size I've no idea how much space I've got so all I can do is fill in the minimum and maybe make the main play area expand to fit.

But other than the play area expanding, the rest of the extra room would all be wasted - or, if the user makes the screen smaller, various stuff would fail to display.
Dean Anderson is offline   Reply With Quote
Old January 7, 2020, 20:33   #17
Aszazin
Scout
 
Join Date: Jun 2018
Posts: 34
Aszazin is on a distinguished road
The font in the current 80x25 display is at the big side for me on a 23" monitor, but it is okay and fine to play.

If there is any change to the display I would really like, it would be rather using a square font. Almost all bands use a rectangular font, which creates a false sight in distance. The (effective) distance vertical is different than the same in-game distance horizontal.

Although, enlarging the 80x25 display would for sure be not bad, as you require a Windows environment to play your variant. It is less likely it will be played on legacy small display computers. You might try to find the optimal size with a screen size varying from an avarage laptop up to a 27" display.
Aszazin is offline   Reply With Quote
Old January 7, 2020, 23:22   #18
Dean Anderson
Adept
 
Join Date: Nov 2009
Posts: 157
Dean Anderson is on a distinguished road
Quote:
Originally Posted by Aszazin View Post
If there is any change to the display I would really like, it would be rather using a square font. Almost all bands use a rectangular font, which creates a false sight in distance. The (effective) distance vertical is different than the same in-game distance horizontal.
The problem there is that while having a square cell size is ideal for making vertical and horizontal distances equal, most actual typefaces are designed to be taller than they are wide so forcing them to be square makes them look weirdly squashed or forces you to have unnaturally wide spaces between letters.
Dean Anderson is offline   Reply With Quote
Old January 8, 2020, 08:46   #19
Dean Anderson
Adept
 
Join Date: Nov 2009
Posts: 157
Dean Anderson is on a distinguished road
Okay, so last night I did some experimentation and it looks like if I'm sticking to a 16:9 aspect ratio then making the display 80x45 will result in exactly square cells.

I did some testing and while forcing the cells to be square clearly stretches the fonts horizontally, I think I managed to find a good compromise between wide characters and overly spaced out characters.

I also had a quick play around increasing the main game display to take advantage of the extra rows, and that's going to need some careful fiddling. The way the game works (and this is stuff that's not changed in 20 years) is that the size of dungeon levels is based on multiples of the screen size and the internal layout of dungeon levels is based on sub-units that divide up into the screen size neatly.

In the current game, those sub-units are 22x11 grid tiles, and the screen is 66x22 grids (i.e. 3x2 sub-units, which is why small levels tend to have 3x2 rooms, one room per sub-unit) - with the maximum dungeon size being 198x66 grids (i.e. 3x3 screens or 9x6 sub-units).

The question is: do I need the screen to be an exact multiple of a sub-unit? The only way I could do that with a 45 row display would be to have it 4 sub-units tall which would be 44 of the 45 rows. That would only leave a single row at the top of the screen for your messages and would leave no space at the bottom for status texts (e.g. depth, "poisoned", etc.)

And if I don't have the screen an exact multiple of a sub-unit (for example, if I have it 42 rows instead of 44, so I've got two rows at the bottom for status text), what knock-ons does that have? Currently, I've no idea.
Dean Anderson is offline   Reply With Quote
Old January 9, 2020, 21:22   #20
Aszazin
Scout
 
Join Date: Jun 2018
Posts: 34
Aszazin is on a distinguished road
Cool, you actually try stuff immediatly!

It's quite abstract what your are telling to me currently. I didn't have any idea there was such a relation between the display and the dungeon creation.

Quote:
The question is: do I need the screen to be an exact multiple of a sub-unit?
I'd say: no.
As Cthangband is a windows game, I'd de-couple the display from the dungeon creation. I guess it would create more options in the future to generate different kind of dungeons.
Aszazin is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Announce] Composband 7.1.2 release Gwarl Variants 12 September 4, 2019 12:01
Cthangband 6.1 Release Dean Anderson Variants 8 September 3, 2019 02:03
[Announce] Composband 7.1.1 release Gwarl Variants 15 June 3, 2019 10:29
[Announce] Cthangband 6.0 ("20th Anniversary Edition") Released Dean Anderson Variants 27 August 26, 2018 11:46
[Announce] Cthangband 5.0.0 Released Dean Anderson Variants 67 March 31, 2016 13:16


All times are GMT +1. The time now is 16:31.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.