Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old May 29, 2017, 16:29   #61
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,385
Donated: $40
Pete Mack is on a distinguished road
1920x1280, but that's deceptive: physically, it's pretty small, and vertical real estate is actually pretty limited. (it's like most tablets.)
Pete Mack is offline   Reply With Quote
Old May 29, 2017, 21:11   #62
Gwarl
Knight
 
Join Date: Jan 2017
Posts: 749
Gwarl is on a distinguished road
So get this: the terminal emulator I was using is maintained by people from Microsoft because they use it in visual studio code. But I've been experimenting with the no longer maintained project it was forked from, and that one doesn't have any weird scrolling issues and recognises the proper escape codes for numpad keys. Even when they're working on stuff under MIT license they can't avoid adding weird bugs.

So I'm pulling out a lot of wires but when things are back up they should be much improved.
Gwarl is offline   Reply With Quote
Old May 30, 2017, 21:55   #63
Gwarl
Knight
 
Join Date: Jan 2017
Posts: 749
Gwarl is on a distinguished road
Okay, it's back up. No chatroom yet but the weird scrolling issues should be fixed or at least reduced. Shiftrunning is now possible, but you need to 'load pref file' runlock.prf from the options menu. Numlock toggles autorun and with autorun off you can still shiftrun.

I'd appreciate bug reports because as far as I know everything should be working just fine.

Last edited by Gwarl; May 30, 2017 at 22:35.
Gwarl is offline   Reply With Quote
Old June 1, 2017, 18:43   #64
Gwarl
Knight
 
Join Date: Jan 2017
Posts: 749
Gwarl is on a distinguished road
Haven't had much time to work on this last few days, but I just updated the Angband nightly build - I've taken 4.0.5 off the menu, the dev version will simply be 'Angband' until 4.1 hits the streets.

t4nk - I will try and get essential features (chat, accessible file dumps, .prf uploads, and recording while I'm at it) done over this weekend so I can be ready to start collaborating on a new UI come the 4th, but I can't make any promises. Anything you might want to know in the meantime, please ask.

Edit: hold on, latest build isn't working..

I think the addition of the 'cursed' object broke the limits on the number of objects (557 whereas 556 is max). I've removed hard biscuits from the game so it runs, but I think a better solution would be removing Grond/Massive Iron Crown since they're generated from artifact.txt now rather than object.txt (I think?)

Double edit: that didn't work, oh dear. Service will be interrupted.

Triple edit: I solved the problem and it had nothing to do with the lastest build, but hard biscuits are still temporarily absent

Last edited by Gwarl; June 1, 2017 at 19:47.
Gwarl is offline   Reply With Quote
Old June 1, 2017, 23:23   #65
t4nk
Swordsman
 
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
Quote:
Originally Posted by Gwarl View Post
t4nk - I will try and get essential features (chat, accessible file dumps, .prf uploads, and recording while I'm at it) done over this weekend so I can be ready to start collaborating on a new UI come the 4th, but I can't make any promises. Anything you might want to know in the meantime, please ask.
It's all for fun, so just do it whenever it seems fun to you
We should probably discuss the protocol. JSON seems to be the natural choice. One thing to note is that in graphics mode each grid has foreground (e.g., a monster tile) and background (floor tile) and I think there was some desire for even more tiles per grid (well, that depends on whether you want to support graphics...). Any ideas? On the C side, any kind of output is fine, so it's basically should be what is more convenient to you.
t4nk is offline   Reply With Quote
Old June 2, 2017, 00:08   #66
Gwarl
Knight
 
Join Date: Jan 2017
Posts: 749
Gwarl is on a distinguished road
Quote:
Originally Posted by t4nk View Post
It's all for fun, so just do it whenever it seems fun to you
We should probably discuss the protocol. JSON seems to be the natural choice. One thing to note is that in graphics mode each grid has foreground (e.g., a monster tile) and background (floor tile) and I think there was some desire for even more tiles per grid (well, that depends on whether you want to support graphics...). Any ideas? On the C side, any kind of output is fine, so it's basically should be what is more convenient to you.
Well, I'd like to use as much as possible of what I already wrote, which was designed explicitly to support graphics - including wall decals and monster equipment, which angband doesn't have. The whole thing is built inside an HTML canvas, I'd be using pictures of text characters at first to bridge the gap, and then include angband's tilesets.

It parses out mouse clicks and keypresses into a "verb/qualifier" form, i.e. move north, get 2 (pickup 2nd item on the floor), use 4, drop 3 etc, but in this case it might make more sense to turn mouseclicks into keypress equivalents and leave keypresses as keypresses. It would also accept things like "moveto (x,y)" which angband does allow for mouse clicks but there's no keypress equivalent to transmit the instruction as. (Edit: on second thoughts, things like 'show me my inventory' 'show me my equipment' 'display monster recall' should probably all be done clientside without disturbing the backend process, so maybe a 1-1 correspondence of keystrokes to commands wouldn't be the best idea)

In return, it asks the backend for a JSON string including player stats/inventory/equipment a list of all visible monsters, a string of digits respresenting wall/floor/unknown/staircase (I didn't even get round to having doors), and more JSON listing the animations to perform once the data had been received before updating the screen - but again, angband wouldn't support this. I had to go through all the relevant functions and add lines of code to record the directions of movement and such for everything I wanted to animate. Projectile animations (bolts/arrows etc) should be doable though I'd think?

The biggest thing it lacks that angband would require is popup menus.

I'm rather excited. I'm sure I can put together something better than DCSS webtiles. We can package it into a standalone executable for offline play too. (Or a standalone executable for online play! Or, best of all, a standalone executable for offline play which opens a socket and streams outputs for public consumption)

Last edited by Gwarl; June 2, 2017 at 00:20.
Gwarl is offline   Reply With Quote
Old June 2, 2017, 04:47   #67
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,841
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by Gwarl View Post
I'm rather excited. I'm sure I can put together something better than DCSS webtiles. We can package it into a standalone executable for offline play too. (Or a standalone executable for online play! Or, best of all, a standalone executable for offline play which opens a socket and streams outputs for public consumption)
I'm glad you're thinking along these lines. One of the issues with the webserver as is is that, as screens have got bigger, most *band players have adjusted to using their whole screen with a big area of dungeon and lots of subwindows. Being able to combine that with server play would be amazing. I know regrettably little about how Mangband and PWMangband severs work, but having a look at those might be helpful.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old June 2, 2017, 12:48   #68
t4nk
Swordsman
 
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
So, this is how ui works in angbands (mostly using vanilla as an example):

At the beginning, there was one "term". It's still there, that's where the main map is drawn. It's a terminal emulator kind of thing; its purpose is to prepare text (and only text; graphics are a hack added later) that a frontend (stuff like main-gcu.c, main-x11.c, etc) can display. Internally, it is two arrays of wchar_t and two arrays of ints.
One array of wchar_t is the characters to display, and one corresponding ("parallel") array of ints is their colors.
Later, people added graphics; when graphics are enabled, the array of wchar_t is the y (row) coordinates of the tile (on the tileset) + 128 (that is, if the y coordinate is, say, 2 - the term will recieve wchar_t 130). The array of ints is the x coordinates, encoded similarly (also with 128 added). That is for foreground tile.
The other two arrays of wchar_t and int are used for background tiles (floor), in the similar manner, and only with graphics (in text mode background is always black).
Note that displaying graphics is problematic, because the main, original term still has to display text; for example, sidebar, or messages line, or various popup menus (inventory, spells, etc). So Angband uses a hack; graphics are stretched or shrinked to fit some multiple of font size.

Later, people added several more terms that can display inventory, equipment, monster list and other things. Some frontends create additional windows when those terms are used, others (gcu and sdl) display those in main window.

What all that means (among other things) is that a frontend has no idea what it is actually displaying; it just draws some text or graphics somewhere on the screen. In particular, the frontend can't tell whether it's displaying a monster list or whatever.

Quote:
Originally Posted by Gwarl View Post
Well, I'd like to use as much as possible of what I already wrote, which was designed explicitly to support graphics - including wall decals and monster equipment, which angband doesn't have. The whole thing is built inside an HTML canvas, I'd be using pictures of text characters at first to bridge the gap, and then include angband's tilesets.
In principle, it's probably possible to "decompose" the main term in the frontend (so as not to try to fit tiles into text grids). The problem is with popup menus... That is also doable, in principle... meh, let's just do text first.

Quote:
(Edit: on second thoughts, things like 'show me my inventory' 'show me my equipment' 'display monster recall' should probably all be done clientside without disturbing the backend process, so maybe a 1-1 correspondence of keystrokes to commands wouldn't be the best idea)
Hm, maintaining information about inventory, monster list and other stuff on the client side would be difficult, and unportable between variants - they all do it differently, and the term package only knows text, it doesn't understand what the text is actually saying.

Quote:
Projectile animations (bolts/arrows etc) should be doable though I'd think?
Probably only in Vanilla.

Quote:
The biggest thing it lacks that angband would require is popup menus.
Well, you could do it like Angband itself does - draw it over the main term When the popup goes away, the entire term is redrawn, to restore previous contents. "True" popups are also doable, I think (that would require some changes to ui-term.c).

Quote:
I'm rather excited. I'm sure I can put together something better than DCSS webtiles. We can package it into a standalone executable for offline play too. (Or a standalone executable for online play! Or, best of all, a standalone executable for offline play which opens a socket and streams outputs for public consumption)
Let's do it Let's start small - only text, simple things first.

I'm envisioning something like that - the frontend takes strings that represent commands (perhaps utf8-encoded? or maybe as hex strings, like "010264"?) - and outputs JSON, like so, maybe: "{ "term": 1, "portion": "sidebar", "position": [1, 1], "length": 12, "content": [ (some stuff) ] }".
t4nk is offline   Reply With Quote
Old June 2, 2017, 15:26   #69
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,385
Donated: $40
Pete Mack is on a distinguished road
@t4nk--efficiency matters here. You really want to keep updates in as few packets as possible.
Term with a set of tuples {x,y,l,c,t} (x,y, length, color, text)
If you use words for the tuples, most of the message will be metadata, as most color deltas are only 1 letter long.
Pete Mack is offline   Reply With Quote
Old June 2, 2017, 18:14   #70
Gwarl
Knight
 
Join Date: Jan 2017
Posts: 749
Gwarl is on a distinguished road
Yeah I think I might be talking past you

What I would want would work something like a mud/text adventure as far as the C side of it goes, except utterly unintelligible to a human. Have a prompt, enter a command, recieve JSON.

But the player wouldn't be exposed to that interface at all, instead I'd have a series of scripts converting mouseclicks and keypresses into the commands to enter into the prompt, then parse out the JSON data into a JS object sent as a parameter to the functions which actually render the output to the screen.

So you could get a minimap where each tile can be 3 pixels wide instead of a whole character. Visible monsters would be an array of monster id's and a handful of ints representing fractional health and status effects - nothing to stop me loading information from angband datafiles to eschew the need for color information and text descriptions. In fact I've already written functions to parse angband .txt files into JSON.

So you're no longer looking at a term structure at all - just encoded strings to provide an essentially seperate program with the necessary information to constitute an interface. So our tasks would be entirely seperate, we would just need to agree on the formats for inputs and outputs.

Hold on a minute while I figure out how to configure my server to provide two sites with different backend frameworks for their respective domain names and I'll show you what I mean.
Gwarl 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


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


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