Procedural Realms Ascii Map

Share your scripts and packages with other Mudlet users.
Post Reply
grrtt
Posts: 3
Joined: Tue Aug 15, 2023 12:48 pm

Procedural Realms Ascii Map

Post by grrtt »

Hi, I'm pretty new to MUDs and scripting for them, but I've been a long-time coder. I love procedural realms and Mudlet, but I recognized that the mudlet mapper was not the best view for this game. The game automatically keeps track of what areas you have seen and shows close-by enemies and resources, so I feel the build-in map (by typing "map") is the best we have. I wrote this script to replace the mapper and update a screen to show the built-in map every time you move.

INSTALLATION
This is my first mudlet package, so I don't know exactly how to make it work right, so you will have to make a few manual tweaks. First, install the procedural realms package. Then install this package. Then go to "scripts > PRS > prs-gui" and change line 455 from
Code: [show] | [select all] lua
GUI.mapper = GUI.mapper or Geyser.Mapper:new({
to
Code: [show] | [select all] lua
GUI.mapper = GUI.mapper or Geyser.MiniConsole:new({
you will also have to do a command when you are in-game. When you are loaded, do

Code: Select all

config roomparseable
. That makes the trigger run whenever you move.

Make sure to restart after these steps.

Updating the screen can be kind of slow, so if anyone knows how to make improvements please let me know! Particularly if someone can find out how to use replaceLine instead of clearing and appending to the screen that would be great!

Thanks and gl!
- grrtt

EDIT:
The ascii map is now being integrated into the development branch of PRS, please go there if you wanted to try it out
Last edited by grrtt on Mon Aug 21, 2023 4:57 pm, edited 1 time in total.

User avatar
demonnic
Posts: 886
Joined: Sat Dec 05, 2009 3:19 pm

Re: Procedural Realms Ascii Map

Post by demonnic »

Hmm, I've used the pattern of wiping and dumping lines to the map many times. Though usually I'll use a trigger chain rather than tempLineTrigger. I haven't had any issues with this being slow, even in situations where I'm receiving a ton of lines.

I may give it a try and see how it runs for me later. That being said I seem to recall Stack got the mudlet mapper working with Proc Realms

grrtt
Posts: 3
Joined: Tue Aug 15, 2023 12:48 pm

Re: Procedural Realms Ascii Map

Post by grrtt »

Oh okay! I just found tempLineTrigger on the forums for doing something similar. I'll look into doing a trigger chain!
And well it's not so much slow, just that when it refreshes, it flashes on the screen as it's clearing and appending the new lines. Do you think it would help with that issue?

I would think that replacing the line would help with the flashing and make it look smoother, but I couldn't get it to work. Let me know if you have any ideas, thanks!

User avatar
Stack
Posts: 10
Joined: Tue Feb 15, 2022 12:12 am
Location: Las Vegas, NV
Discord: Stack#4899
Contact:

Re: Procedural Realms Ascii Map

Post by Stack »

demonnic wrote:
Tue Aug 15, 2023 5:19 pm
That being said I seem to recall Stack got the mudlet mapper working with Proc Realms
Indeed. While I don't feel that Procedural Realms Script is necessarily mine in some way -- although I've certainly been the maintainer of the repo and responsible for generating releases, coordinating, etc the package that Grrtt is modifying here. The PRS package deftly uses GMCP to build the mudlet map file and works perfectly as intended thanks to blizzard, the game's admin himself, and Dalem who helped in reworking the core of the script when major changes occurred with the room numbering system some months ago.

There are open repo issues requesting both element of this script, (1) (Issue #49) adding the symbols to the existing package's mapper output as well as (Issue #90) help with adding the replication of particular dynamic, game-specific features that are present on the game's web client only. The latter involves continuously updating the ascii symbols for varied ranges surrounding the player. The game server does send GMCP symbol data on refresh for ~28 tiles at a time, and this is called the "minimap" that is displayed in-line with each room description but is not dynamic on the server, only the web-client implementation of the game. This map has been repeatedly requested as an addition to PRS, but no one has taken up the work.

However, what Grrtt is wanting is actually a different map yet another dynamic map available in a dynamic form on the game's web-client, but also statically on the game server itself by issuing the 'map' command. So, basically,

Code: Select all

send("map")
after every prompt or movement, although this is still not dynamic as in the game's ascii minimap because it is only updating on prompt (basically what Mudlet's included generic mapping script package does) or, in this case, reading results of the 'map' command on any movement. Queuing on prompt like the old generic mapping script would increase the dynamism of this 'map' spammer but would still not allow for realtime movement of NPC's, PC, and any user-altered GMCP environment data change as occurs on the game's VUE-based web client .

Grrtt - I'd discourage you from modifying the existing mapper of our package, and invite you to contribute to what we have been working toward. If collaboration is not something you're interested in and you're going to be making a derivative work of PRS, I'd encourage you not to use the miniconsole approach as you've done but rather the more flexible 'adjustable container' approach which we recently converted to in order to allow multi/alts to be run with PRS as miniconsoles previously broke such functionality. There's a number of other more technically related open issues (#94, #60, and #50) that you might be interested in considering w/r/t optimizing the gmcp mapping procedures for efficiency that have been raised by both you, @demonnic, and @Vadi previously, but that have not yet been tackled and I fear will be lost to regressive derivative works. We'd all very much enjoy and support your collaboration on the work here, Grrtt!

grrtt
Posts: 3
Joined: Tue Aug 15, 2023 12:48 pm

Re: Procedural Realms Ascii Map

Post by grrtt »

Hey Stack!
Yes, I'd love to collaborate and try to make things better together! I love coding, but as you can tell, am not very experienced in MUD scripting or how everything works all together. I hope it did not come off as I was trying to go rogue and make my own thing, this was just something I wanted and so I figured I would share it if anyone wanted an unstable work-in-progress patch for it. I'll look into making a pull request, but I fear my code is too unstable and untested for it to be officially accepted right now haha.

From what I saw, it looked like the miniconsole would be the best way to display it, and I kept it inside of the adjustable container it was in if that is what you are meaning. I will look into other ways it can be displayed though if having one disrupts players using alts.

Thank you for your support! I've also been wanting to create a "Quests" tab so we can see what quests are active, like the web client. I think this will be easier since the data is sent by GMCP. If no one else is working on that right now, I'd love to!

User avatar
Stack
Posts: 10
Joined: Tue Feb 15, 2022 12:12 am
Location: Las Vegas, NV
Discord: Stack#4899
Contact:

Re: Procedural Realms Ascii Map

Post by Stack »

If you submit a PR to the dev branch, people will help test it for you, etc before it gets merged into main. I can't remember which issue # is the quests tab, but there's a bunch of tabs we've envisioned and recorded as feat req issues, basically. Once the stats tab is finalized, I was thinking about moving onto the combat tab next. i'm not sure what sort of division of labor makes the most sense since I'm not a coder to begin with.

User avatar
SlySven
Posts: 1026
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Procedural Realms Ascii Map

Post by SlySven »

Am I correct in thinking that you are building up an ASCII art style map "image" in a window based on the rooms that the user/player has visited (and where they are currently located) rather than using the "native" mapper features of Mudlet.

If this is (sort of) the case there may be scope to actually use the latter but hide the rooms that the user has not yet seen and only reveal them (and add the entrances to/exits from them) as the player visits them. If that is of interest, PM me and I'll inform you of something that might be of interest but is (deliberately) not mentioned in the Wiki...

Post Reply