Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Theragil
Apprentice


Joined: 13 Feb 2004
Posts: 157
Location: USA

PostPosted: Tue Aug 24, 2004 6:08 pm   

Making the mapper choose paths based on circumstances
 
I am fairly sure that what I want isn't possible, but I've been surprised several times by how zMUD can do things I thought impossible, so it's worth asking.

Using the "cost" feature of the mapper I have configured the mapper to choose the best path with a remarkably high accuracy. It takes longer to cross water rooms, so I set their cost higher; thus, the mapper will cross a river if it's a long way to go around it, but go around it if it's not. So far, so good.

However, there are two circumstances in which the cost of water rooms is exactly the same as other rooms: first, when I'm flying, and second, when I'm using a magical means that lets me swim effortlessly. At those times, I'd like it if I could I could temporarily "turn off" using costs -- tell zMUD, "until I say otherwise, pretend all rooms (save "do not enter" rooms) cost 1". That way I wouldn't be going out of my way to avoid rooms that aren't really going to slow me down after all.

Even more impossible and more powerful would be a way to let me set a room's cost to be a variable, so I could change the variable. For instance, I'd set all my water room costs to @iWaterRoomCost and then set that variable to 10. Then I could set it to 1 when I'm flying. This would handle another situation: when I'm using a particular magical ability that lets me swim wonderfully fast, but makes me hopeless on dry land (like, going onto dry land can kill me). Just set @iHillsRoomCost to 9999, @iScrublandRoomCost to 9999, etc. and @iWaterRoomCost to 1, and I'll always choose the right path.

(That latter could be kludged up too. Allow me to set room costs of -1 to -20, and give me twenty places to specify a cost which those get turned into, and a way to set the cost. Not as nice as going through the existing variables, but might be a way to cram the same functionality into an existing database field defined as an integer or something.)

So, is there any way to make the mapper's path-finder adapt itself to situations like this (short of some ungodly routine that updates the entire map to change costs each time -- way too time-consuming!)?
Reply with quote
Theragil
Apprentice


Joined: 13 Feb 2004
Posts: 157
Location: USA

PostPosted: Tue Aug 24, 2004 6:10 pm   
 
Now that I think about it, the variables approach could handle a lot of other situations. Rooms that are safe at one time of year and deadly at another time of year... or that are safe until you get enemied to a city, then become deadly... so many possibilities.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Wed Aug 25, 2004 12:13 am   
 
Personally, I'd love this too. I'd like to be able to use functions (rather than dumb variables) in the room cost part of each room. This would enable me to have a variable that was set to the race I was playing and another variable which would have in it whether I was riding or not, and then I would put the NORIDE flag on rooms where I can ride, and the room cost function would take into account whether I was riding, what race I am if I'm not currently riding, the room type of the rooms in between my current position and where I want to get to, and whether these rooms are NORIDE (in which case they wouldn't gain the bonus they would gain if I was riding through them). Another use would be if I had a boat - then swim rooms should have a reduced cost also. It could even try and reduce the moves my mount spends too, so my mount doesn't tire, but that would the icing on the cake.

The only way I can see of doing this through, is essentially to make my own speedwalk script, that calculates the path itself based on these parameters and then sends it to zmud as a speedwalk path. It seems quite possible - if Vijilante is able to make a script that is able to link up rooms that are aligned, it must be possible to do, but I expect it would run a lot slower than zMUD Mapper's speedwalk calculator.
Reply with quote
Nydoc
Newbie


Joined: 02 Oct 2004
Posts: 3

PostPosted: Sat Oct 02, 2004 5:33 pm   
 
this was on another thread:

#LOOP %numrooms() {#IF (%roomcol( %mapvnum( %i)) = blue) {#CALL %roomcost( %mapvnum( %i), 1)}}
Reply with quote
Theragil
Apprentice


Joined: 13 Feb 2004
Posts: 157
Location: USA

PostPosted: Sat Oct 02, 2004 6:20 pm   
 
I considered that, but it's a bit expensive an operation to reconfigure my entire map of thousands of rooms every time I fly and land, isn't it?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Oct 02, 2004 6:55 pm   
 
Making changes to the mapper through COM/ODBC is really quick. And has been posted to these forums a few times do a search for
comcreate and map.mdb and I think you should come up with something workable. It will prolly require alot of work to get it to work the way you wan't it to and when I have time I might look into doing just that no promises though.
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net