 |
The TinTin++ message board
|
 |
| View previous topic :: View next topic |
| Author |
Message |
Slysven
Joined: 10 Apr 2011 Posts: 254 Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK
|
Posted: Wed Oct 26, 2011 6:21 pm Post subject: Feature request: When an exit is not an exit. |
|
|
I've run into a slight difficulty, in the MUD I play, I've generated a second character with, amongst other differences to my first, a lower level of search capabilities. This means that some exits from some rooms that character CAN'T EVEN SEE THEM, let alone use them. What I need is a way to disable various links depending on which character I am playing.
Also in some games, and the one I play is no exception, some exits require say a key to open them - no key - no exit. Unfortunetly the route finding code would only work in these situations by deleting the unusable exits and only reinserting them as they become available. Constantly adding and removing the same exits from the map data seems counterproductive and given the way the ASCII vtmap is drawn can cause the map geometry to change if the rooms don't properly align without the particular link in place (a sign that you haven't got it laid out correctly...!)
To accomodate this information I believe we need to add TWO flags (for three different states) to the room exit flag field; I propose:
| Code: | #define EXIT_FLAG_LOCKED (1 << 1)
#define EXIT_FLAG_LOCKABLE (1 << 2) | The first means that the exit is NOT currently useable and can't be used during a #MAP RUN or #PATH RUN. This should be set by the user as required for each game character they are using (and set depending on what keys/knowledge they currently have.)
The second flag means that this exit could be secured, blocked, not useable or may require a command to open it and THAT the LOCKED flag should be considered. This flag can be set as the exit is found to have an open/closed state and ONLY applies to the exit in THAT direction (to cover particularly wierd situations eg. some in-game exits for instance could be traps that allow unhindered passage one way but passage the other way requires combat/money or a key!)
Currently the ASCII vtmap for a room symbol ABC with ALL exits looks like this:
| Code: | [ ]---[ ]---[ ]
| \ | / |
| \!|+/ |
[ ]---ABC---[ ]
| /-|?\ |
| / | \ |
[ ]---[ ]---[ ] ! is a recent add-on for special exits and ? for notes existing for that room (at least they are in my hacked version.) |
I propose that for an exit that can be closed, but is currently open the stroke that shows that exit gains a 90 cross stroke:
"|" becomes "+"
"/" and "\" become "X"
"-" becomes "+"
For the vertical ones, down currently "-" I gues would have to be "+" and up "+" changes to say "*".
For an exit that is not useable currently only the cross stroke should be shown:
"|" becomes "-"
"/" becomes "\"
"\" becomes "/"
"-" becomes "|" (also for the vertical down one)
"+" becomes "." (or centre dot if the font permits)
So the above graphic example with only the EXITS (not ENTRANCES) N, NE, W, SE and U locked and unusable and the remainding EXITS all lockable but open, we should have:
| Code: | [ ]---[ ]---[ ]
| \ | / |
| X!-.\ |
[ ]--+ABC|--[ ]
| X++?/ |
| / | \ |
[ ]---[ ]---[ ] | I agree it is not the prettiest display but that will depend on the font used and it is a bit cluttered because it is the worse possible case with everything possible for one room is shown which is very unlikely in practice.
The important thing thought is that the route finding code should use an exit either if the LOCKABLE flag is NOT set (as current maps don't have this flag they will automagically pass this requirement) or if that flag IS set then only if the LOCKED flag is NOT. |
|
| Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3274
|
Posted: Wed Oct 26, 2011 8:17 pm Post subject: |
|
|
I'm kind of wary of adding door support because there's no clean way to handle them.
You can set the exit command to open a door, which handles unlocked doors.
I'll add the 'avoid' exit flag to deal with locked or unusable exits. You can use the exit data field to customize the map for a specific character, for example:
| Code: |
#map exit e set {{locked}{0}{search}{12}}
#Map exit e get temp
#if {$temp[search] > 10}
{
#map exitflag e hide
}
|
To add data to an exit without erasing previous data:
| Code: |
#map exit w get temp
#map exit w set {$temp {whatever}{1}}
|
You can script tintin to go over all rooms, and each exit, and modify them on the go. |
|
| Back to top |
|
 |
Slysven
Joined: 10 Apr 2011 Posts: 254 Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK
|
Posted: Wed Oct 26, 2011 11:12 pm Post subject: |
|
|
Yes - I get you, an AVOID flag could be made to fit in with what I was thinking - the important thing is that the route finding algorithm doesn't try to use an exit that isn't availible...  |
|
| Back to top |
|
 |
Slysven
Joined: 10 Apr 2011 Posts: 254 Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK
|
Posted: Mon Oct 31, 2011 6:33 pm Post subject: |
|
|
I did a bit of rummaging around in my 2.00.7 hacked version to try and impliment this sort of thing but I came a cropper trying to understand the shortest path searching function - and how I could stop it using an exit that was blocked. I know that this has been replaced with new code that deals with a weighting factor to influence route selection when there is a choice in the 2.00.8 beta.
I got the impression that part of the 2.00.7 algorithm did some tracing of routes backwards and stored the length of the path to each room from the current room in the ses->map->room_list[vnum]->size variable. The thought crossed my mind is, if that is the case then how could I make it to handle a route that is only open one-way? More importantly, does the 2.00.8 deal correctly with this one-way situation?
I guess I am tempted to abandon the 2.00.7 code and adopt the 2.00.8 beta but in what ways will my map file be changed by the 2.00.8 that would be incompatible with the 2.00.7?
The EXIT_FLAG_AVOID will be ignored obviously, but existing data entered by the 2.00.8 version should be preserved if I have to go back to the 2.00.7 "stable" release. The roomweight attribute for each room - I'd probably add something into my existing "Frankensein" 2.00.7 just to preserve the data, though of course there is nothing there yet. Eventually I think I will use this to hold the 'Movement points' cost for each room - though I guess I will have to use the roomdata field to store that for different situations/characters and swap it as necessary.
Is there any other incompatiblities in the Map format?
Thanks Scandum, for the great work you are doing (I noted also the #MAP VNUM adoption and I look forward to the route search speed increases.)  |
|
| Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3274
|
Posted: Mon Oct 31, 2011 10:21 pm Post subject: |
|
|
I don't think either 2.00.7 or 2.00.8 backtracks.
EXIT_FLAG_AVOID should be working in the beta, but the code is already outdated, probably best to wait till I have a stable release if you want to stay in sync.
The weight setting is more so intended to avoid annoying rooms, without removing the ability to access those rooms if needed. I guess it'd be useful to set it to movement cost on MUDs where you constantly run out of movement.
I think the current format is:
R {vnum} {flags} {color} {Name} {Symbol} {Desc} {Area} {note} {terrain} {data} {weight} |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
TinTin++ Homepage
Powered by phpBB © 2001, 2002 phpBB Group
|