zaimoni / Cataclysm

A post-apocalyptic roguelike. New features relative to C:Whales are scheduled for after 0.2.0, the savefile breaking release.
http://www.bay12forums.com/smf/index.php?topic=174897
Other
26 stars 3 forks source link

larger console size #91

Open hirdrac opened 4 years ago

hirdrac commented 4 years ago

Would like to make changes to the current hard-coded display sizes:

zaimoni commented 4 years ago

1) Windows default would have to react to tiles vs non-tiles mode (it is already very wide with 16x16 tiles) The configuration points I anticipated when setting up ui.h are VIEW and PANELX (with minimum values current values). I would accept converting these two to options with explicitly checked minimum values.

1a) VIEW has to be an odd number. I don't want to mess with trying to define what "centered" means on a square with even sides.

2) I would expect the new option enum values to be added "just before" NUM_OPTION_KEYS in option.h. (Fonts are special snowflakes, at this time; their editing UI would be "strange" even after implementation.) Other implementation details should be calculated from their meaning (e.g., they are OPTTYPE_INT). Macros wrapping read-only access methods to the values represented by VIEW and PANELX would be acceptable as a backward-compatibility measure to minimize code churn when wiring in. The only method of writing the values in-game should be the options screen. If altering font-size current triggers screen resize currently, altering these values should also trigger screen resize.

3) The layout of all screens would have to be converted to automatically respond to the values named in ui.h (this is part of why I extracted that header in the first place). This is not explicitly known to be the case currently (I have adjusted things piecemeal but no systematic conversion). The trunk would be in Przybylski's Star status (potentially unplayable, release not allowed) as long as this verification was incomplete after the options had started being wired in.

3a) The above alignment subtask may need an explicit checklist, readable by everyone involved.

zaimoni commented 4 years ago

Current maximum VIEW is 121 [ ((MAPSIZE/2)SEE)2+1 ]; any larger can try to read terrain grids that are not in the reality bubble.

zaimoni commented 4 years ago

I've started a commit series for explicitly checking that the SEE, SEEX, and SEEY constants are being used strictly for submap coordinate conversion. (these currently have the same numerical value as VIEW_CENTER . This re-specification is required, to do the changeover in a trunk-safe fashion).

I'm not sure this is important enough to actively adjust the a priori release window (Oct 1 - Nov 30) for 0.2.4 .

zaimoni commented 4 years ago

Internal checklists for this: all uses of SEE are thought to be accurate (i.e, actually reference the submap structure, not the view radius, technological teleportation range, etc.) C:Whales' SEEX and SEEY are not verified, as of time of commenting.

I'll need to keep an eye on instability from introducing std::function. (besides reports of gratuitous value-copying and RAM allocation behind the scenes, Franci's test drivers have seen some awesome miscompiles.)

zaimoni commented 4 years ago

Having some problems obtaining legible checklists from Visual Studio (my primary view is the symbol-search results; cut-pasting "unsorts" them and thus isn't a good option for building a public checklist).

Internal checklists for the automatic layout setup (so that wiring in configuration for VIEW and PANELX "just works").

Constant UI element dimensions may belong in ui.h, especially if they influence many window layouts (like the minimap UI).

Left to my own devices, the above is the order I will schedule these checklists in. I'm generally going through the Visual Studio search results in alphabetical order.

Regarding patches based on the above checklists:

Note that the SEE constant family is acceptable when actually working with the submaps (e.g., any expression involving MAPSIZE is working with the reality bubble and can be left alone for this purpose). Only code concerned with screen display has to switch to VIEW_CENTER from the SEE constant family, to avoid breaking. Game mechanics should not be using the SEE constant family (but the fact they are defined that way in C:Whales should be documented inline, in case that becomes relevant for e.g. game balance.)

zaimoni commented 4 years ago

Internal checklists "completed" re SEEX/SEEY two days ago. Plan is to split daily time budget between the newwin calls (again, working in alphabetical file order) and technical issues exposed by those commits (currently, buildout of add_item with rvalue reference signature)

zaimoni commented 4 years ago

Checklist re newwin calls is messy. Went ahead and mirrored this : https://github.com/zaimoni/Cataclysm/wiki/Checkpoint:-newwin-call-audit-(which-ones-will-break-on-introducing-resizable-screen) .

zaimoni commented 3 years ago

Checklist re newwin calls is done. I'm going to tolerate https://github.com/zaimoni/Cataclysm/issues/105 , as C:Whales had the same breakage.

I need to know whether game::intro() has any chance of working on ncurses. The corresponding fix for the in-house curses simulation, looks like

hirdrac commented 3 years ago
zaimoni commented 3 years ago

I.e., current game.cpp/intro() is simply invalid starting just before the while loop, which is inherited from C:Whales (it assumes resizing would be viable).

If the results for getmaxx(stdscr) and getmaxy(stdscr) from initscr are "as large as feasible", then defaulting the dimensions based on that should be fine. The naive approach for that for catacurse.cpp had a critical failure : tiles stopped loading.

zaimoni commented 3 years ago

Finally got the in-house curses simulation to "behave" on the most recent push.