Top Mud Sites Forum

Top Mud Sites Forum (http://www.topmudsites.com/forums/index.php)
-   Advanced MUD Concepts (http://www.topmudsites.com/forums/forumdisplay.php?f=7)
-   -   Blind Spots (http://www.topmudsites.com/forums/showthread.php?t=81)

John 07-09-2006 12:40 AM

So how do you get rid of blind spots? An example is in a traditional mud you have 6 directions n, e, s, w, u, d. However With that you have four blind spots, which are
[code]
S = can see
B = blind spot so I can't see there.
P = Where the character is standing.
--------------
| B | S | B |
--------------
| S | P | S |
--------------
| B | S | B |
--------------
[/quote]That's easy fixed though, just add the directions ne, se, sw, nw so you can see in all of those blind spots. But let's say you want your player to be able to see 2 rooms away instead of just one, you then get more spots.
[code]
----------------------
| S | B | S | B | S |
----------------------
| B | S | S | S | B |
----------------------
| S | S | P | S | S |
----------------------
| B | S | S | S | B |
----------------------
| S | B | S | B | S |
----------------------
[/quote]Now if your character is on a deserted plains or something, there is no logical reason they can't turn in a full 360 degrees and see if someone is standing in any of those rooms. So how do you fix the problem of the PC not being able to see in those rooms? What code do you add?

KaVir 07-09-2006 05:02 AM

You'll have to fill in all the blind spots with something, otherwise you might end up with blanks where a room should be. Most muds that want a map like you describe will place their rooms on an x/y grid.

Amnon 07-09-2006 01:14 PM

If you're making your world room-based, you could have some problems: Main one is that rooms don't always point to where they logically should.

You could have five rooms, for example, that go:
Room A has an exit west leading to room B.
Room A has an exit north leading to room C.
Room B has an exit north leading to room D.
Room C has an exit west leading to room E.

So which room would you show as being northwest of you: room D or room E?

If your whole world is built in a way where this situation is not possible, then you'd have to set up an array (or list) of "view directions" similar to the exits (movement directions). Room A has a view west to room B, for example. Then, when someone looks inside room A, they see that room, and if that room has a view direction to room C, they'll also see that one... up to a certain range (Not a problem do to with a recursive function).

I don't think it'll work in a normal room-based world, and I agree with KaVir that you should consider an X/Y grid for that.

durt 07-24-2006 01:21 AM

You can use additional cardinal directions such as north northwest (nnw), east southeast (ESE), etc. The result would be

[code]

----------------------------
| S | NNW | S | NNE | S |
----------------------------
| WNW | S | S | S | ENE |
----------------------------
| S | S | P | S | S |
---------------------------
| WSW| S | S | S | ESE |
----------------------------
| S | SSW | S | SSE | S |
----------------------------
[/quote]

and no blind spots.

the_logos 07-24-2006 11:59 AM

Adding more directions is just a temporary fix and leads, if you want to expand the radius-of-sight, to requiring directions like north north north north north northwest, etc.

In a typical grid system, each room is assumed to be the same size (vs in a typical node-based room system where the room size in the world fiction may vary dramatically from 1 room = a closet to one room = section of forest). So, assign an arbitrary unit to the length and width of each room (say, 1), and then simply calculate if a given room's center is within the radius of line-of-sight that you want to use.

Or, hell, cheat and just make it a 'square' radius if you want. That makes it even more trivial to check.

--matt


All times are GMT -4. The time now is 11:49 PM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Top Mud Sites.com 2022