Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Miniwindows ➜ Displaying doors on Mapper, and drawing images for room (for shops, forges, etc)

Displaying doors on Mapper, and drawing images for room (for shops, forges, etc)

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2  3  4 

Posted by Death   (55 posts)  Bio
Date Reply #45 on Fri 05 Apr 2019 12:23 AM (UTC)

Amended on Fri 05 Apr 2019 12:28 AM (UTC) by Death

Message
Hey Nick,


All I've gotta say is WOW, looks like a lot of work you helped me with.

Thank you!


I'm not to keen on the blinking aspect of it, but meh. My friend said there might be a good way to do this.
Let me know if this makes sense to you.


Quote:
Dentin techs: ok anyway regarding your mapper problem, you hold all the rooms in an array or linked list, and give each room structure a 32 or 64 bit integer called "last_seen_pass_index". When you want to do the mapping, you just index through the array, and when you find a room that doesn't have the current pass index, you set the pass index, map it, then map its sub rooms
Dentin techs: if it does have the current pass index, you just return and do nothing
Dentin techs: outside of the array of rooms, you have an index that's just a counter. Starts at zero. When you want to run the map, you increment the external counter, then run the map algorithm. When you want to run the map again, increment the external counter, and run the mapper again
Dentin techs: its self synchronizing and guarantees a total complexity order of N*M, where N is the room count and M is the average exit count, but its actually better than that because of both disconnected graphs and fast return from already mapped objects
Dentin techs: anyway, super simple, super fast, roughly linear order, no reason for anything to slow down unless you're just doing a shit job of it
Dentin techs: its a pretty standard algorithm for doing this sort of thing repetitively
Dentin techs: cuts out a lot of the initialization steps that this sorts of preloaded computations require, does minimal touch based on orthogonal spaces, etc






Does that sound like something that's hard to implement, makes sense, or might be better?

Go easy on me, I'm a newbie and I'm not a coding god like you guys so I don't understand stuff like this.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #46 on Fri 05 Apr 2019 05:58 AM (UTC)
Message
I would try my suggestion first and see what you think. What he describes would, I think, still involve pauses or there would be no point to doing it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Death   (55 posts)  Bio
Date Reply #47 on Fri 05 Apr 2019 03:30 PM (UTC)
Message
Hey Nick,

I appreciate the effort greatly.

Is it possible to not make the refresh as obvious? (the apparent blink every time you move)


That seems to take away from the whole immersive experience imo.


I'll be working on making it work today and tomorrow and I'll get back to you when I break something. xD

I appreciate the daily response so very much.

Cheers
Top

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #48 on Fri 05 Apr 2019 05:46 PM (UTC)

Amended on Fri 05 Apr 2019 05:50 PM (UTC) by Fiendish

Message
Quote:
Is it possible to not make the refresh as obvious? (the apparent blink every time you move)

Obviously that would require either drawing the border details first instead of last or re-drawing them after every update.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #49 on Fri 05 Apr 2019 09:34 PM (UTC)
Message

The border details aren’t drawn after each update. The pause is inside an inner loop which draws the rooms. What you need to do is copy/paste the border stuff to be before the drawing loop. I didn’t want to do that in my example because it would have been a lot of changes which would obscure the important part.

What it used to do is:

  • Make the miniwindow
  • Populate it with all of the rooms (which were visible and inside the depth range)
  • Draw the border (in case one of the room square overlapped the border)
  • Draw the area name, help button and so on

Now this sequence didn’t matter if it all got shown at once, and it meant that I didn’t accidentally have glitches at the border.

However with the new method the border was copy/pasted to above the room drawing (so it doesn’t flicker) and also done again afterwards in case the rooms overlap it. You could copy/paste (or cut/paste) the other stuff like the help button, area name, room name, etc. to be before the rooms are drawn. That should reduce the flickering.

That should help. However you can’t really have both:

  • Completely flicker-free
  • Stop and check if there is more input from the MUD

I don’t think any other optimizations will work. Since the issue applies when you are moving, you can’t just cache existing drawing, as the map can be drawn completely differently after moving a single room, depending on how the “room walker” finds rooms.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


119,618 views.

This is page 4, subject is 4 pages long:  [Previous page]  1  2  3  4 

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.