Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Development (http://angband.oook.cz/forum/forumdisplay.php?f=10)
-   -   Experimental webserver (http://angband.oook.cz/forum/showthread.php?t=8378)

Gwarl May 7, 2017 21:00

Experimental webserver
 
Okay I know I have two threads already but for the sake of having a releveant title here's a new one.

I've set up a server where you can login and play angband or an available variant online:

http://angband.live/

The code for the server is here:

https://github.com/OwenGHB/angband-webclient

It's still very much in an experimental stage. It isn't pretty yet but you can play angband on it.

Features I'm going to add soon are spectating, recording, and watching recorded games. I want to add simple per-game chatrooms where spectators can comment on live games. Then there are long term plans I have - I'll keep the thread updated as I go.

Pull requests etc welcome.

Estie May 7, 2017 22:46

So how do i create an account ? :)

Gwarl May 7, 2017 23:47

Hitting register once gives the 'confirm password' field, if you hit register again and the passwords match you get an account. It's surprisingly hard to make login forms that aren't horribly confusing - I know this one needs work, I just thought I'd send it live rightaway rather than waiting to get everything perfect.

bio_hazard May 9, 2017 02:55

Cool- Angband worked (via Firefox on OSX if it matters). It feels a little slower than normal but not too horrible. I'll have to figure out the commands- tried to quit and ended up closing out my whole browser lol.

Definitely excited to try Pos- I haven't played yet because of the whole osx thing.

Gwarl May 9, 2017 12:50

Quote:

Originally Posted by bio_hazard (Post 120628)
Cool- Angband worked (via Firefox on OSX if it matters). It feels a little slower than normal but not too horrible. I'll have to figure out the commands- tried to quit and ended up closing out my whole browser lol.

Definitely excited to try Pos- I haven't played yet because of the whole osx thing.

The angband process is actually running on the remote server so there will be latency depending on your connection (the server is in Europe). This means it will be straightforward to add spectating facilities.

Although now I think about it if angband were compiled directly into wasm one could serve up binaries to be run on the client and then open a socket to the server to share the output between users, which would alleviate the cpu load on the server. It would not be quite as secure against cheating but that probably isn't a huge concern. I might try that at some point, but this works for now and I need to build interfaces for the site anyway.

And yeah, making it easy to try new variants without hunting them down and compiling them was a big motivation behind doing this. The setup process for each variant is slightly different though. I'll start adding more in one by one, Sil is a high priority but it's particularly difficult to work with and will need me to make a few changes to the code to get the directory/save file handling more in line with other variants.

It would be nice to eventually get the entire angband plus repository compiled and available to play.

Gwarl May 17, 2017 20:23

Spectating games is now possible (the list of live games is somewhat buggy), but will be more fun after I add a chat box - possibly embedding the irc channel. Code changes are on github. In no particular order the other things to do next are updating poschengband to the latest version, adding routines to get, compile and replace the latest version of the V development branch, use ttyrec for recording games, and provide links to download character dumps. Expanding the list of variants would also be nice (NPP and ToME 2.4.~ are at the top of the list. No Sil yet, sorry).

After all that, I'll add a game mode to use a current competition savefile/variant, hopefully by the time the next one comes around.

Gwarl May 23, 2017 22:16

The site is back up at a new address:
http://angband.live
Includes an extra variant, the development branch of V, and a live borg

Nick May 23, 2017 23:27

Quote:

Originally Posted by Gwarl (Post 121089)
The site is back up at a new address:
http://angband.live
Includes an extra variant, the development branch of V, and a live borg

Excellent.

One slight issue with the borg - when I first go to it, the sidebar doesn't show (or sometimes shows partially and with some other stuff in it), then after a while it appears and is all good after that.

Gwarl May 23, 2017 23:49

Quote:

Originally Posted by Nick (Post 121092)
Excellent.

One slight issue with the borg - when I first go to it, the sidebar doesn't show (or sometimes shows partially and with some other stuff in it), then after a while it appears and is all good after that.

Yeah, it happens when spectating any game and I know why. When things happen on the screen in angband, it only modifies the characters which have changed, and when you spectate you're getting updates, but not the set of characters that are leftover which the player can see. I tried caching outputs but that slowed things down considerably. Then I tried using a hack and sending the player a single command to hit ^R when a spectator connected - but the libraries I'm using for the terminal emulator aren't very well documented and I'm not sure how to send it escape sequences and although angband will recognise the characters ^R as a refresh screen command it could be disruptive to a player or the borg. I'm pondering how best to solve it. I might just have been caching frames badly.

Next is working on an inline chat (the borg might get an alice style chatbot), recording games and providing links to character/screen dumps etc.

Estie May 24, 2017 00:14

No way to display borg equipment and other stats ?

Gwarl May 24, 2017 00:22

Quote:

Originally Posted by Estie (Post 121094)
No way to display borg equipment and other stats ?

There should be 3 other panels, but I think I might have accidentally deleted the .prf file. I'll take another look at it tomorrow but I want to just leave this borg run a little while and see how it is in the morning. There's no routine yet for automatically starting/restarting the borg. Eventually there'll be a metaborg, who manages a small family of borgs, adjusting their borg.txt files and monitoring their performance. Although it would probably be more helpful to see what parts of the borg could be recycled for a new borg that will play 4.1

Estie May 24, 2017 01:09

Quote:

Originally Posted by Gwarl (Post 121095)
There should be 3 other panels, but I think I might have accidentally deleted the .prf file. I'll take another look at it tomorrow but I want to just leave this borg run a little while and see how it is in the morning. There's no routine yet for automatically starting/restarting the borg. Eventually there'll be a metaborg, who manages a small family of borgs, adjusting their borg.txt files and monitoring their performance. Although it would probably be more helpful to see what parts of the borg could be recycled for a new borg that will play 4.1

Oh and while youre at it, please please make it use randarts! I want to see some silly equipment, and what better way to fish for it that having a tireless borg working.

Pete Mack May 24, 2017 02:52

This is great! I forgot how lousy a player the Borg is. Just saw it melee a red jelly. :/ (And no, it's not a HT.) Playing CL27, DL9.

Pete Mack May 24, 2017 03:00

Gwarl--what version of angband is it? If it's a new one, can you post the updated source to the Borg? It'd be fun to work on strategy. I've always been put off by working on the mechanics.
Edit:
Never mind. I see above. (3.0.x)

Estie May 24, 2017 03:01

Kobold warrior. It hasnt died yet, so thats something.

Pete Mack May 24, 2017 03:54

HE rogue. Very hard to stay alive because of the delay.

The equipment list is scrolling to the next line. Stats panel gets crushed. I fixed it by turning off terminal 2.

Estie May 24, 2017 04:06

Watching you! Omg, why is the chat not working yet.

Edit: Noo, dont buy that shortsword!!! :D


Edit2: Easterling warrior :(

Pete Mack May 24, 2017 04:48

Well, died to paralysis--from cursed boots. Somehow failed to note the first time paralysis kicked in. Very hard to play this way; so easy to make mistakes.

Estie May 24, 2017 05:05

For some reason, I cant map running to shift-numpad. Currently its .<dir>, but I am really used to pressing shift-<dir>.

Gwarl May 24, 2017 09:12

Quote:

Originally Posted by Pete Mack (Post 121104)
Gwarl--what version of angband is it? If it's a new one, can you post the updated source to the Borg? It'd be fun to work on strategy. I've always been put off by working on the mechanics.
Edit:
Never mind. I see above. (3.0.x)

It's 3.4.1, running the APWborg.

wrt running, shift running seems impossible on the GCU port. I could hack together a script for the browser to simulate shift+running, but angband-wise I've written runlock.prf, which uses numlock to toggle between always-run and always-walk. I'll upload it any moment now.

Gwarl May 24, 2017 10:46

Quote:

Originally Posted by Pete Mack (Post 121103)
This is great! I forgot how lousy a player the Borg is. Just saw it melee a red jelly. :/ (And no, it's not a HT.) Playing CL27, DL9.

CL29 now and still DL9. I'm sure it was going deeper than this earlier. I'm fairly sure it's refusing to dive for a lack of seeInvis.

Unfortunately the method for reconnecting to the borg and issuing it commands isn't working and I can't fix it without restarting the webserver, which will then forget the process ID. Short of uploading runlock.prf there aren't a lot of modifications I can make, so the next updates will come in once I have a batch of them ready and/or the borg dies/wins (though that one might take a while).

Estie May 24, 2017 13:14

For movement, direction keys do nothing and numpad only works when numlock is toggled on. Mapping anything doesnt work as trying to specify a number pad key instead specifies only the escape key.

I have tried loading runlock.prf in options "=", "l"oad and am getting a confirmation message but it doesnt seem to change the behaviour.

Edit: typo

Gwarl May 24, 2017 13:47

Quote:

Originally Posted by Estie (Post 121115)
For movement, direction keys do nothing and numpad only works when numlock is toggled on. Mapping anything doesnt work as trying to specify a number pad key instead specifies only the escape key.

I have tried loading runlock.prf in options "=", "l"oad and am getting a confirmation message but it doesnt seem to change the behaviour.

Edit: typo

Yeah, I just noticed this behaviour and I think I'm going to need to set up a hack on the javascript side of things to get easy running. I tested the runlock thing over a real terminal, I think it's the terminal emulator sending an '[Escape]' keypress instead of escape codes for home/end/arrow keys. (For some reason, numpad9 and numpad3 work however)

Small but significant bugs that will take a lot of work to fix.

I'm going to leave things up as they are for the rest of the day and then pull it offline again tomorrow to fix things. I'm fairly sure the site can be seaworthy by the time the next competition comes along though.

With regards to anyone experiencing lag; I can only imagine the issue is geographic distance (the server is in europe and there's no perceptible latency when I play), which means the fix would be getting another server, and nothing I can fix with code.

wobbly May 24, 2017 17:56

Nice. Slow but playable for me. Getting used to the interface takes a bit, but getting there.

Ironman gnome priest, whether it's alive or dead in the next few seconds, we'll see. I didn't manage to afford a weapon but then again 2.1 for a whip is not much better then 1 for my fists.

Edit: Ug was playing just fine, tabbed across in firefox, now can't get it back to responding to keypresses
Edit2: 2 seperate firefoxes seems to work ok, do keymaps not work?
Edit3: Haha died to cloning & hasting a crow. What you get for using wonder as your only damage source. Anyway was fun to look at.

Gwarl May 24, 2017 18:05

Quote:

Originally Posted by wobbly (Post 121123)
Nice. Slow but playable for me. Getting used to the interface takes a bit, but getting there.

Ironman gnome priest, whether it's alive or dead in the next few seconds, we'll see. I didn't manage to afford a weapon but then again 2.1 for a whip is not much better then 1 for my fists.

Edit: Ug was playing just fine, tabbed across in firefox, now can't get it back to responding to keypresses

You need to 'focus' on the 'terminal' element on the page. i.e click on it as you would a text box you were typing into.

Keymaps have been working okay for me, but not all keypresses actually make it through to angband unadulterated. You can see what's up by using 'Query keymap'

wobbly May 24, 2017 18:20

Thanks, will give it another go sometime. I'm tempted to try poscheng, my biggest reluctance is that poscheng's squelch system is going to be annoying if I can't upload my own pickpref file

Gwarl May 24, 2017 18:35

Quote:

Originally Posted by wobbly (Post 121126)
Thanks, will give it another go sometime. I'm tempted to try poscheng, my biggest reluctance is that poscheng's squelch system is going to be annoying if I can't upload my own pickpref file

That will be coming in the next update.

For now though: the borg found SeeInvis! She's diving!

Estie May 24, 2017 18:58

My guess is the long sword is Elvagil.

Gwarl May 24, 2017 19:01

Yeah, I need to add more display columns. I could probably get rid of that box on the right , though I need to make screen space somewhere for a chat box.

Edit: you were right, it's elvagil. Enough room in the inventory panel to see it when she switched it out for the lucerne hammer of slay dragon.

wobbly May 24, 2017 19:33

3rd attempt & with some care starting to get of the mark. With equipment in subwindow 2 it wraps around the screen, so my item weights partially obscure the character stats on the left sidebar

Gwarl May 24, 2017 19:39

Sorry for the bugs but thanks for playing :) need to fill up that scoreboard

Estie May 24, 2017 20:11

Warrior, dlvl5 (2-9): Wrath of God.

Estie May 24, 2017 20:22

I cant map my rest keys, I use and shift-thereof on my german keyboard but the game seems to see them all as the same.

It is really hard to play without my shortcuts.

Gwarl May 24, 2017 20:44

I think the band-aid solution is going to be implementing macros (since they'll behave more like macros than keymaps) on the client side. I'll look into different terminal emulators because this one has a few issues, but I might end up having to more or less write my own - at which point I may as well be writing an angband-specific frontend in javascript (which I plan on eventually doing).

I'll try and have in-browser macros done by the 11th.

Estie May 24, 2017 20:47

This is a great thing youre doing, just to be clear. Constant error messages on my part may sound like I am only complaining, so I had to mention this.

Estie May 24, 2017 20:49

Borg is wielding Barukkheled now ? I think that was the artifact broad axe.

Gwarl May 24, 2017 20:56

Well I would like it to be playable - it's only useful if people use it, and if it's too tedious/annoying, they won't. So feedback is helpful, but so is encouragement.

I don't think it can get to the point where it's as convenient to play as a real local installation of angband, but I do hope to reduce the negatives to the point where they don't outweigh the positives. When I played DCSS a lot I started using the offline client, and found the browser interface horrible but I eventually switched because of the competitive/social element of online play, and I want to do the same for Angband.

Estie May 24, 2017 21:06

Quote:

Originally Posted by Gwarl (Post 121146)
Well I would like it to be playable - it's only useful if people use it, and if it's too tedious/annoying, they won't. So feedback is helpful, but so is encouragement.

I don't think it can get to the point where it's as convenient to play as a real local installation of angband, but I do hope to reduce the negatives to the point where they don't outweigh the positives. When I played DCSS a lot I started using the offline client, and found the browser interface horrible but I eventually switched because of the competitive/social element of online play, and I want to do the same for Angband.

Yeah. The first thing to do to achieve that is to get the chat going (:

Estie May 24, 2017 22:45

Balli Stonehand now, I assume. Was that the one with +3 con ? I think one axe had ESP, too, was it Hurin ?

He has 800 hp, +10 speed, res poison, pconf pblind but is bumbling about on lvl ~30. What is he missing to go deeper ? Permanent source of ESP ?

Pete Mack May 24, 2017 23:14

Tried watching the borg again today. The screen is scrolling improperly every time the character moves off the current map vertically. There's junk covering essentially the entire screen. Problem is browser-independent.

Gwarl May 24, 2017 23:59

Quote:

Originally Posted by Estie (Post 121152)
Balli Stonehand now, I assume. Was that the one with +3 con ? I think one axe had ESP, too, was it Hurin ?

He has 800 hp, +10 speed, res poison, pconf pblind but is bumbling about on lvl ~30. What is he missing to go deeper ? Permanent source of ESP ?

Yeah I think it's got stonehand right now. Just found Hurin though. I think it wants to be CL40 before it goes any deeper.

Re: the scrolling, I've noticed, and I intend to fix it, but I'm not entirely sure how - whether I'm going to need to adapt the curses frontend slightly to run properly in this context, or whether I'm going to have to adapt the JS terminal emulator to run properly.

My priorities for this thing now are features (chat/recorded games/links to character dumps/option to upload .prf files), then bugs. wrt bugs, first thing I'm going to do is try to hack together single keypress running/resting, then the bugs with spectating come next.

I will confess to having spent a large part of the day when I could have been coding/fixing things watching the borg instead, I've never run one before and it's fascinating.

wobbly May 25, 2017 12:10

I've seen it say clvl < dlvl down the bottom, great way to never make it past dlvl 50. Watching Estie play for a bit was interesting. What was with the whole <, >, <, > thing? Level feelings or something else?

Gwarl May 25, 2017 12:21

Well, the borg finally died:

http://angband.oook.cz/ladder-show.php?id=20784

I really thought she was going to make it.

Don't know what was going on with the sscreen really because of the scrolling issues.

I'm going to switch it off for a bit today while I work on things. Such as limiting the need for me to switch it off while I work on things. Hopefully I'll have it back up tonight with chatrooms.

Estie May 25, 2017 17:51

Quote:

Originally Posted by wobbly (Post 121161)
I've seen it say clvl < dlvl down the bottom, great way to never make it past dlvl 50. Watching Estie play for a bit was interesting. What was with the whole <, >, <, > thing? Level feelings or something else?

I didnt play much, mostly trying to get a comfortable interface (and failing). But yes, when there is no good item feeling I tend to use the stairs asap.

Pete Mack May 25, 2017 17:53

The Borg has three flaws it makes frequently:
1. It does a bad job of controlling sight lines. It should keep the number of monsters in LOS to one or two. Instead it lets a whole hallway of monsters use ball spells/breaths/curses.
2. It does not treat stat drains with the respect they deserve.
3. It goes out of it's way to fight no-ROI monsters (like Greater Balrogs for example.)

Estie May 25, 2017 18:36

I have once seen the Borg fight Faegwath with a sling of accuracy and magic shots (not on the server, some years ago). Needless to say that didnt go well.

The ROI status of monsters has dropped dramatically compared to older versions. There was a time where you could expect an artifact or 2 from killing a demon pit, but drop quality has been reduced (not sure when or by what measure exactly). This is most notable with D, but also U.

I believe it treats LOS situations okish, but doesnt take asleep monsters into the equation, so bad things happen when suddenly monsters wake up.
But it doesnt use simple standard routines like waiting around a corner for monsters to approach in single file. This most basic of LOS tricks would improve its performance greatly.

Gwarl May 25, 2017 19:33

It's back up, but without any visible changes. Going to be experimenting a bit on a dummy copy.

Edit fixed the vertical scrolling issue afaict. css issue.

Estie May 26, 2017 05:30

I have (again) tried to get the Borg working on my computer, but Angband 3.4.1 crashes on startup (after character creation), and so does the Borg.

Can this be a 64 bit thing ?

t4nk May 26, 2017 08:38

Hey, I watched borg a little - looks great!

Quote:

I might end up having to more or less write my own - at which point I may as well be writing an angband-specific frontend in javascript (which I plan on eventually doing).
If you decide to do it, I would be interested in doing the C part (or in helping you to do it, if you want to write C yourself... angband's ui is, um, kind of mindblowing :))

Gwarl May 26, 2017 14:05

Quote:

Originally Posted by t4nk (Post 121181)
Hey, I watched borg a little - looks great!


If you decide to do it, I would be interested in doing the C part (or in helping you to do it, if you want to write C yourself... angband's ui is, um, kind of mindblowing :))

I already wrote an interface for playing a roguelike with javascript, with mouse support, graphics and a few animations/special effects (my lightning bolts were rather pretty). It's fairly agnostic about how the game logic works in that while it does expect the associated game logic backend to send outputs in a certain format, one could specify another format and leave most functions unchanged.

If you could prepare a frontend with a given mapping of input strings/ints etc to game commands, and then serialize outputs in a sensible way (JSON is convenient but I wouldn't send visible/known terrain that way, probably an octal number), I could then do all the parsing and drawing to the screen with javascript. This could maybe even be still a pty? Like playing angband on a console, type in a code that describes the command you want to send to the game, console echoes serialized gibberish representing updates to known information. The client then still reads/writes to a pty running an angband process the way it's done at the moment, except the rendering is done in the client rather than through curses.

That would be pretty fantastic IMO, shall we discuss here or email?

t4nk May 26, 2017 16:05

Quote:

Originally Posted by Gwarl (Post 121182)
I already wrote an interface for playing a roguelike with javascript, with mouse support, graphics and a few animations/special effects (my lightning bolts were rather pretty). It's fairly agnostic about how the game logic works in that while it does expect the associated game logic backend to send outputs in a certain format, one could specify another format and leave most functions unchanged.

Great. I think we can even get Vanilla to use your effects (Vanilla Angband has very sensible event driven architecture).

Quote:

If you could prepare a frontend with a given mapping of input strings/ints etc to game commands, and then serialize outputs in a sensible way (JSON is convenient but I wouldn't send visible/known terrain that way, probably an octal number), I could then do all the parsing and drawing to the screen with javascript.
Sounds like a plan. Different variants would probably require slightly different frontends (at least stuff like Poschengband, that forked off Vanilla 20+ years ago). But they all use Angband's good old term package (written by Ben Harrison, if I'm not mistaken), so the differences should be minimal.

Quote:

This could maybe even be still a pty? Like playing angband on a console, type in a code that describes the command you want to send to the game, console echoes serialized gibberish representing updates to known information. The client then still reads/writes to a pty running an angband process the way it's done at the moment, except the rendering is done in the client rather than through curses.
Yes, that sound very good.

Quote:

That would be pretty fantastic IMO, shall we discuss here or email?
You can contact me at t4nk074 at openmailbox dot org, but I think it would be better to discuss most things here (on this forum) - this stuff might be of interest to other people!
Tell you what, I'll have quite a bit of free time starting at 4th of June, so I can begin working on the new frontend then.

Estie May 28, 2017 05:07

My warrior died to Vecna, I made a dump, but I dont understand how I can access it.

Gwarl May 28, 2017 12:04

Hey, watched you play for a bit yesterday. As far as the dump goes.. that's weird.

So I was looking through the user directories to find the file.

It doesn't exist? And nor do my dumps? All the /user/ folders are somehow empty?

But nevertheless you can see your dump here:

http://angband.live/user/Estie/master/Estie.txt

Which like I say makes no sense because according to my ftp client /public/user/Estie is an empty folder. Hmm.

Estie May 28, 2017 13:48

I have have to say I am not going to play on the server anymore. Between inability to configure keys, delay and a different colour code it is just too painfull. I have to strain my eyes to "read" the screen and am getting a headache after prolongued play, and everything is taking about 3 times as long.

Gwarl May 28, 2017 14:04

Quote:

Originally Posted by Estie (Post 121223)
I have have to say I am not going to play on the server anymore. Between inability to configure keys, delay and a different colour code it is just too painfull. I have to strain my eyes to "read" the screen and am getting a headache after prolongued play, and everything is taking about 3 times as long.

Can I persuade you to at least keep checking the thread for updates? I should be able to fix most of that, eventually.

Estie May 28, 2017 15:08

Quote:

Originally Posted by Gwarl (Post 121225)
Can I persuade you to at least keep checking the thread for updates? I should be able to fix most of that, eventually.

No worries, I am of course going to follow. Its just that right now I need to recover :)

Gwarl May 29, 2017 00:55

Just set a high score to beat: http://angband.oook.cz/ladder-show.php?id=20794

Now I can get back to working on it. I'll be playing all my games online now to encourage myself to fix things.

Gwarl May 29, 2017 13:33

Starting to think I should be compiling angband into wasm so the executable runs client side and the role of the server is limited to receiving/broadcasting tty streams. You could even put that in an embedded browser so it's just angband wrapped up in a new frontend with built in livestreaming. That's the only way I can think of to solve the latency problem with software.

Gwarl May 29, 2017 14:27

Also since I am not great with the css side of things but I'm fairly sure that's what was screwing up the display, I'm just going to work on the assumption that everyones monitor is 1366x768. If anyone has a smaller monitor like 1024x768 let me know so I can try and handle that case. I'm not going to get into 'responsive design' just yet but supporting slightly smaller screens is probably only twice the work so I'm willing to do it if there's demand for it.

takkaria May 29, 2017 15:48

Quote:

Originally Posted by Gwarl (Post 121236)
Also since I am not great with the css side of things but I'm fairly sure that's what was screwing up the display, I'm just going to work on the assumption that everyones monitor is 1366x768. If anyone has a smaller monitor like 1024x768 let me know so I can try and handle that case. I'm not going to get into 'responsive design' just yet but supporting slightly smaller screens is probably only twice the work so I'm willing to do it if there's demand for it.

I think it's worth supporting 1280x768, not least because my laptop is 1280 wide :)

Pete Mack May 29, 2017 16:29

1920x1280, but that's deceptive: physically, it's pretty small, and vertical real estate is actually pretty limited. (it's like most tablets.)

Gwarl May 29, 2017 21:11

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 May 30, 2017 21:55

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.

Gwarl June 1, 2017 18:43

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

t4nk June 1, 2017 23:23

Quote:

Originally Posted by Gwarl (Post 121332)
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.

Gwarl June 2, 2017 00:08

Quote:

Originally Posted by t4nk (Post 121338)
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)

Nick June 2, 2017 04:47

Quote:

Originally Posted by Gwarl (Post 121344)
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.

t4nk June 2, 2017 12:48

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 (Post 121344)
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) ] }".

Pete Mack June 2, 2017 15:26

@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.

Gwarl June 2, 2017 18:14

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.

t4nk June 2, 2017 18:38

So you're saying that you'd rather work with more structured information than term stuff (with the latter being colored text, supposed to be displayed as is)?

Gwarl June 2, 2017 19:10

Right. I guess, having read all of this, all of the current frontends work with the term structure, so I guess you would be replacing that. Would that be significantly more difficult?

t4nk June 2, 2017 19:48

Quote:

Originally Posted by Gwarl (Post 121366)
Right. I guess, having read all of this, all of the current frontends work with the term structure, so I guess you would be replacing that. Would that be significantly more difficult?

Hm. I'd say it's doable for Vanilla. Its ui is big and has a surprizing number of features, but a lot of that is something that could be or should be done on the client side :) lets see
Code:

ui-birth.c - birth process
ui-command.c - various small commands, like html chardump
ui-context.c - mouse commands, the "enter" menu
ui-curse.c - curses menus (in game curses, not ncurses :))
ui-death.c - displayed when char dies
ui-display.c - all kinds of stuff; sidebar, animations, subwindows control
ui-event.c - mostly converting keypresses to and from human readable text
ui-game.c - main loop and associated stuff
ui-help.c - help reader
ui-history.c - player history
ui-init.c - just a couple functions
ui-input.c - input stuff
ui-keymap.c - keymaps
ui-knowledge.c - the '~' command. also messages reader
ui-map.c - map control, convering game data to text. also the 'M' command
ui-menu.c - menu stuff. all of ui uses it to display various menus
ui-mon-list.c - monster list
ui-mon-lore.c - monster recall
ui-object.c - inventory, equpment, quiver stuff; item ignore
ui-obj-list.c - object list
ui-options.c - game options (the '=' command)
ui-output.c - various helper functions, related to printing things
ui-player.c - the 'C' command
ui-prefs.c - parsing pref files
ui-score.c - game score
ui-signals.c - useless
ui-spell.c - casting magics
ui-store.c - buying and selling
ui-target.c - targeting (when firing, throwing, casting etc). horrible spaghetti :)

As you see, a lot of that really belongs to the client, and if you want... :)

But, the problem is, everything above term interface is very different among Angband's variants, and it is Vanilla that is actually the easiest to deal with (because of the effort undertaken some years ago to separate its ui and game logic). In other variants, the ui is very deeply entangled with the rest of the game; they also all do things differently; basically, each additional variant would require writing a lot of variant-specific C code. And writing that will be more difficult than for Angband.

Gwarl June 2, 2017 20:29

I'm content to do this just for Vanilla. There's a lot to cover in that list, but it's doable.

I should mention I'm intending to make something based around graphical tiles and a mouse-driven interface first of all. I know, this is not the best way to play, but it's friendlier to newbies. And we already have very good ways to play with a keyboard and a text display.

Derakon June 2, 2017 20:31

Quote:

Originally Posted by Gwarl (Post 121366)
Right. I guess, having read all of this, all of the current frontends work with the term structure, so I guess you would be replacing that. Would that be significantly more difficult?

You'll need a standard way to convey to the frontend the semantics of what you want to show it, so that instead of doing "display an o here" you say "there's an orc at (24, 33)". And you need to do that for every single thing that gets shown to the user. So yes, it's significantly more difficult. But it's also the right way to do things.

It may be worth looking at NPPAngband's Qt port, as well as at Pyrel's modular frontends.

t4nk June 3, 2017 17:56

Quote:

Originally Posted by Gwarl (Post 121369)
I'm content to do this just for Vanilla. There's a lot to cover in that list, but it's doable.

Let's do it then!

Quote:

Originally Posted by Gwarl (Post 121369)
I should mention I'm intending to make something based around graphical tiles and a mouse-driven interface first of all. I know, this is not the best way to play

Well, I always thought tiles are better than text anyway :) (I just don't like Angband's tilesets).
As for mouse, there is already substantial support for it, although, IMO, insifficient los (radius 1 at the beginning of the game) makes playing with the mouse annoying.

Gwarl June 5, 2017 16:51

Hi t4nk I've reuploaded my initial efforts (what I'll be building on) at http://gwarl.xyz/

Started a new thread here where we can discuss things in excruciating detail.

Gwarl June 5, 2017 18:35

Everyone: Angband is now invoked with the -mgcu -- -b option, so you get a single large screen with no subpanels. Let me know if this is okay? I plan to add options at some to choose how many terms you get but I'm trying to address complaints.

To recap, visual artifacts have been almost fixed, shift running is now possible and I've increased the visible playing area.

I'm late with implementing chat but it's on it's way.

Pete Mack June 5, 2017 19:48

That helps. One other thing: can you turn off ctl-S ctrl-Q behavior? It is hugely annoying to run into that when you are accustomed to using them for keymaps.

Gwarl June 6, 2017 14:10

Quote:

Originally Posted by Pete Mack (Post 121471)
That helps. One other thing: can you turn off ctl-S ctrl-Q behavior? It is hugely annoying to run into that when you are accustomed to using them for keymaps.

I'll look into disabling the process signals but I'm unsure if I'll be able to free up the control sequences for game commands.

HugoTheGreat2011 June 7, 2017 01:14

Any chance of getting PosChengband 6.1.0 incorporated into this along with chat implentation? ...So that I can have you spectators watch me in real-time? ;)

MITZE June 7, 2017 01:28

Quote:

Originally Posted by HugoTheGreat2011 (Post 121493)
Any chance of getting PosChengband 6.1.0 incorporated into this along with chat implentation? ...So that I can have you spectators watch me in real-time? ;)

PosChengband v6.1.0 is on there already, Hugo; the only thing that's missing is a chat function so we can all yell at you proper!

HugoTheGreat2011 June 7, 2017 03:55

Quote:

Originally Posted by MITZE (Post 121494)
PosChengband v6.1.0 is on there already, Hugo; the only thing that's missing is a chat function so we can all yell at you proper!

So, I now have a clvl 36 Tonberry Skillmaster in progress...How do I load it from outside the webserver?

MITZE June 7, 2017 04:37

Quote:

Originally Posted by HugoTheGreat2011 (Post 121497)
So, I now have a clvl 36 Tonberry Skillmaster in progress...How do I load it from outside the webserver?

If you're asking if you can play a thus far offline character on the webserver: I don't think it works like that.

As far as I know, characters need to be created on the webserver to be played there. You might want to check with Gwarl about that, though.

HugoTheGreat2011 June 7, 2017 05:04

Sounds like webserver-created PosChengband savefiles stay there and cannot be exported offline right? What about .HTML chardumps, etc.?

Hey, I did a test drive with Gwarl's site. HOW do I know if anyone is spectating? Or HOW do I spectate?

I found a problem - so, I started up an in-webserver character named "Hugo's Mercy" a Hasty Tonberry Skillmaster. Well, I was doing fine until I click outside of the window to do something. When I get back, the game freezes! I can't move. And I can't save either! I didn't lose any significant progress anyways.

Gwarl June 7, 2017 12:00

Hey, a few answers:

As it stands, you can get screendumps and char dumps by URL - so if you name your char dump Hugo.txt, you could find it at angband.live/user/Hugo/poschengband/Hugo.txt - there will be download links provided to all your own dumps later, and probably .prf uploads too.

There's no facility for uploading/downloading savefiles, and I'm not convinced that there should be (encourages savescumming and compromises highscore integrity), but if you attach a savefile as an upload here I'll copy it over your savefile, just this once.

When there is a live game, it will show up in a list to anyone not currently playing. You can check if you're live by opening the site again in a new tab, you should be able to then spectate yourself, but not be able to play from the spectating window. Usually there's a borg running but the current borg is struggling not to get caught in loops. (Edit: started a new borg you can check spectating by watching him)

As for the thing freezing when you look away - I'm aware of this, and I know what's happening, but I don't yet know why, or how to fix it. In fact your savefile exists, but looks to be from the very start of the game - if you did more than take a few steps I'm afraid your progress has been lost. (But according to my experiments, you don't in fact lose your progress). The solution - if the game is taking more than a few seconds to respond after tabbing away, just reload the page and start up again. In the case of poschengband you might get a message about deleting old temporal files - type 'y'. I acknowledge this is annoying and I will try and fix it - because it's annoying.

There's no way yet to know if you're being spectated. That will be a part of chat when I (finally!) add it.

t4nk June 7, 2017 21:40

Gwarl
I am sorry. Because of completely unforeseen circumstances I'm not having any free time. Some things happened that take all my time and energy and I'm afraid I won't be able to work on the web ui for angband.
I regret that I made false promises and couldn't deliver. I still want to do that, but at the moment that's impossible, and I don't know when the situation will get better. It will at least take several months (for some undefined definition of "several") and at most - I have no idea. At least one of us will probably lose interest in angband by then...
Again, I'm sorry. My only defence is that I really intended to write the new frontend, and didn't see my current situation coming.

Gwarl June 8, 2017 00:05

No worries. I heard a rumour there was more to life than angband and I guess that happened to you - but it should still be here when you come back. Good luck in your endeavours.

HugoTheGreat2011 June 8, 2017 01:10

Running (Shift + Directional Key) doesn't work in the webserver's PosChengband. Another potential problem is the lag.

Gwarl June 8, 2017 12:14

For reasons not entirely clear to me it seems like the shiftrunning hack I put together for vanilla isn't going to work for PCB. I hope this isn't a dealbreaker - I got quite used to hitting . then the direction before I came up with a fix for vanilla (it is on the numpad after all). I'll put figuring out a hack that will work for PCB on my list of things to do.

Lag isn't something I can solve with software - the server is located in Europe, and while I can play without noticeable lag here I have heard this a lot from people further away.

Derakon June 8, 2017 16:51

Quote:

Originally Posted by Gwarl (Post 121529)
Lag isn't something I can solve with software - the server is located in Europe, and while I can play without noticeable lag here I have heard this a lot from people further away.

If you were really ambitious, you could split the server into a globally-distributed set of game servers sharing a common backend. Players would get the closest server, and spectators would get the backend (and concomitant lag). Put it up on AppEngine or something and you should be able to scale automatically to cope with high load, too!

I'm sure that's a perfectly reasonable project to work on in your spare time for no pay. :) And not at all overengineering.

Gwarl June 9, 2017 23:21

Chat is in! Just about. You need to be logged in to see it. It's pretty rudimentary right now - there's one room and no list of users etc, but it's actually a frontend to an irc server so we can have all that. There are also mysterious server crashes for reasons I can't discern, so be careful with that and try not to break anything.

I've made some progress getting Sil to fit the mold and it should be available to play soon.

I will also say that while individual tasks are always easier than I would expect fitting it all together is more difficult than I nonetheless continue to expect. Easy access to char dumps and recorded games are next on the agenda.

How to tell if you've crashed the server: if you type something into the chat, and don't see your own message displayed back to you, please stop doing that and reload the page. The server will reboot itself on a crash, but it's still not a very nice thing to do.

Consider the current implementation of chat to be 'it might work, if you're lucky and the tides are right'

Pete Mack June 10, 2017 00:57

What happened to the Borg? I haven't been able to watch it in recent builds.

Pete Mack June 10, 2017 01:37

Grrr. Died to a dark elven sorcerer, entirely because it was purple instead of light red. These colors are not user friendly.

HugoTheGreat2011 June 10, 2017 02:50

The webserver colors for PosChengband are a big off also

Edit - Sorry, I meant to say "The webserver colors for PosChengband are a bit off also"...NOT "a big off"....

MITZE June 11, 2017 00:51

Bug?
 
Just created a profile and started a Angband character; kobold warrior, and apparently I know about amulets of adornment, rings of protection, and rings of reckless attacks from birth. Is this something that should be happening?

Estie June 11, 2017 00:59

Quote:

Originally Posted by MITZE (Post 121617)
Just created a profile and started a Angband character; kobold warrior, and apparently I know about amulets of adornment, rings of protection, and rings of reckless attacks from birth. Is this something that should be happening?

No thats all right. Amulets of adornment do nothing, and the other 2 give boni to AC, to hit, to damage which are known because basic items have it. You just happened to find the known mods first.

There was a time when you didnt know that your starting dagger was (+0, +0) and instead it was (??). That was weird; this way is better.

Pete Mack June 11, 2017 01:13

Yeah, it'd be possible that (+0,+0) would not trigger the ?? flag and initially just show as a dagger (1d4). But the mele and armor bonuses are just too easy to figure out to make it worthwhile. Literally the first monster you hit (or hits you.) Brands are essentially as easy of course, but it's no effort to make them work as normal.

Gwarl June 11, 2017 12:18

Yes that's as expected - the version of Vanilla angband installed on the server is a development build from about a week ago, and the ID game has changed since 4.0.5

Gwarl June 11, 2017 15:40

Okay I think I've fixed the issues with the sockets timing out - feel free to tab away and come back. Chat should be working too but bear in mind it's the crudest implementation imaginable - the irc backend has been done away with for now, but it will come back.


All times are GMT +1. The time now is 20:52.

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