TheEternalCitizens / mudlet-integration

A mudlet integration for The Eternal City
GNU General Public License v2.0
3 stars 0 forks source link

mudlet mapper, pathfinding #141

Open davewiththenicehat opened 4 years ago

davewiththenicehat commented 4 years ago

@DaveWithTheNiceHat We have a way to assume exits in a direction based on distance? I’m mapping out the swamp and it’d be nice if it just connected the diagonal exits since they’re mostly all 80x80. Else I need to walk in triangles a million times over. DaveWithTheNiceHatToday at 1:39 PM Maybe some kind of mode to set when working solely with rooms that are the exact same distance apart? herdiasToday at 1:40 PM Also I have a VERY rudimentary toggle to adjust speed walk time if I’m in a large area. I’m sure you or Pat could do better but it’s what I got with my kid coder pants on. :smile: Yeah. I realized we need a catch to build a river too for the grasslands/swamps/RV areas where the border is a river you can’t move into. DaveWithTheNiceHatToday at 1:41 PM Speed walk's issue is that it has to be sent as a single command. Sending one command for each movement will trigger the once a second wall locking player's out of their commands. Or their commands will break speed walk. I was wondering about the rivers also... It would be nice to have a blue room there... Going back a step if we are limited to a very small number of people willing to map a method to not need to do the diagonal exits would be helpful. I am not totally sure it is possible. I think it is though. For certain it is not possible in an area with rooms of different sizes. It would cut the forests and grasslands map time by 66% herdiasToday at 1:45 PM I built a digBot so he's just been trucking along digging holes mapping swamps. but only getting the north/south exits. DaveWithTheNiceHatToday at 1:45 PM Aren't the swamps dangerous? herdiasToday at 1:46 PM my dude can fight. Though I almost killed myself cause i forgot about quicksand. :smile: DaveWithTheNiceHatToday at 1:46 PM crawl direction? herdiasToday at 1:47 PM was up to my neck before I realized DaveWithTheNiceHatToday at 1:47 PM am I remembering correctly? herdiasToday at 1:47 PM swim DaveWithTheNiceHatToday at 1:47 PM swim... herdiasToday at 1:47 PM I just have it shut off the trigger set and let me handle it. probably could be more robust. DaveWithTheNiceHatToday at 1:48 PM The screen echo is not very human friendly. It is a very gentle notification. herdiasToday at 1:48 PM /longwalk if longwalk then longwalk = false cecho("Long walk off!") else longwalk = true cecho("Long walk on!") end function doSpeedWalk() if longwalk then speedwalk(table.concat(speedWalkDir, ";"),false,4) else speedwalk(table.concat(speedWalkDir, ";"),false,1.1) end end That's what I'm doing to make sure I speedwalk properly. But I have to toggle it. DaveWithTheNiceHatToday at 1:55 PM If we know how size affects the room we can get the room's weight for speed walking. Speed walk is fine for bots for example. If 4 is the max we can assume it is 1 second for each 20 in size. I divide the size by 10 to be compatible with the mudlet mapper. So weight = size / 2 weight = weight + .01 Should I store that weight? herdiasToday at 2:04 PM I tried 3.1 and got hung up if it lagged. I put it at 4 to account for that. So somewhere between 3.1-4. is the sweet spot for 80x80s DaveWithTheNiceHatToday at 2:05 PM 3.1 should work for rooms of size 60? If you have a slow character does it take longer? Another method would be to calculate the path with each movement that the fail message appears. Assuming this is for bots or someone willing to work through the command per second limit... herdiasToday at 2:13 PM Pat suggested adding an “exitScript” in the userData. DaveWithTheNiceHatToday at 2:15 PM Contains a function for movement in the room? herdiasToday at 2:15 PM setRoomUserData(roomid, "exitScript"..roomid,"movestop=1;tempTimer(3,[[moveStop=nil;speedWalkPath = roomsToWalk;doSpeedWalk()]],1)") DaveWithTheNiceHatToday at 2:16 PM Right, That was movement is calculated per room. Take one step wait. the timer time. Why not just use weight? It is built in. herdiasToday at 2:20 PM Weight doesn't work like that. Already asked in mudlet discord and attempted to use it. Weight only effects the pathfinder. So if a room is set to 3 it'll actively avoid it but if it's unavoidable it's still gonna spam commands at that regular 1.1 and mess up the path. DaveWithTheNiceHatToday at 2:21 PM O got it. Many of the built in functions assume a good deal. So weight will help find the fastest path, and should be recorded. It will not help with waiting in the room before moving. herdiasToday at 2:23 PM Yeah we definately should be adding weight to the room automatically if we can. for the rooms with RT's Patrick aka patd31988Today at 2:24 PM Weight is used in A DaveWithTheNiceHatToday at 2:24 PM It will assist fastest path finding. If that is all it does. Patrick aka patd31988Today at 2:24 PM but not for room specific pauses DaveWithTheNiceHatToday at 2:24 PM What is A? herdiasToday at 2:25 PM the pathfinder DaveWithTheNiceHatToday at 2:25 PM It would help find the fastest path to have room weight. It will not help with delaying in a room before sending a movement command? herdiasToday at 2:26 PM correct DaveWithTheNiceHatToday at 2:27 PM What is the concern of storing weight? herdiasToday at 2:27 PM unless you can figure out a way to pull roomWeight and have that set to the tempTimer time. DaveWithTheNiceHatToday at 2:28 PM Storing it just so it finds the fastest path. Not even planning to use it. In a function manually. Just let the pathfinder use it to find the fastest path. Patrick aka patd31988Today at 2:28 PM You should totally do weight herdiasToday at 2:28 PM Room weight is really useful. Patrick aka patd31988Today at 2:28 PM It default to 1 you should try to set the weight to the room movement roundtime DaveWithTheNiceHatToday at 2:29 PM weight = room size? Because we know it is tied to room size, but not specific details. Patrick aka patd31988Today at 2:29 PM I don't think anything goes higher than 3? any that have 2? herdiasToday at 2:29 PM Like say the shortest path from point a to b is through a 5k TCR hunting ground. Bad news bears on speedwalk. Patrick aka patd31988Today at 2:29 PM @DaveWithTheNiceHat I think so @herdias Also that herdiasToday at 2:30 PM Room weight is to actively avoid an area if it's the shortest point from A to B. For examples like above. Patrick aka patd31988Today at 2:30 PM You could set the room weight, and then when you set the exit script, set the timer to be equal to the weight (if less than like 5 or something) So we can still put high values for hunting grounds DaveWithTheNiceHatToday at 2:32 PM Give hunting grounds a higher weight? herdiasToday at 2:32 PM Depends. What if you -want- to move through that zone. DaveWithTheNiceHatToday at 2:33 PM I don't want to lock them. Because I want people to be able to get out of hunting grounds easily. herdiasToday at 2:33 PM But I personally wouldn't speedwalk in a hunting ground. DaveWithTheNiceHatToday at 2:33 PM If I lock a room in the mapper the pathfinder will not use that room. Patrick aka patd31988Today at 2:33 PM @herdias If you just add 100 to the rooms you'd have to specifically click IN the hunting ground and then you'd have no possible path but to it DaveWithTheNiceHatToday at 2:34 PM Ooo right. Patrick aka patd31988Today at 2:34 PM Forcing you to go THROUGH a hunting ground is harder, and not a v1 feature DaveWithTheNiceHatToday at 2:34 PM So it is not locked. People can walk out of the ground, but they will not walk in or through it via an dospeedwalk. So it allows new people to avoid travent. Patrick aka patd31988Today at 2:35 PM Exactly. Just setting a high weight will force them around it unless explicitiy clicking INTO it DaveWithTheNiceHatToday at 2:36 PM What if we added the room's danger rating to weight? I know it is rare, but it may avoid someone going into a more dangerous area to get to safety. Patrick aka patd31988Today at 2:37 PM Actually thats perfect Then you just need to set danger on the places we want to avoid DaveWithTheNiceHatToday at 2:37 PM So room with weight of 1508, path finder is not taking that one unless it has to... Patrick aka patd31988Today at 2:37 PM bingo DaveWithTheNiceHatToday at 2:37 PM Danger is recorder with the danger command. So it is built in already. I am going to copy and paste this into an issue so we don't forget the details.

davewiththenicehat commented 4 years ago

Patrick aka patd31988Today at 2:39 PM Room weight should be something like Roundtime +danger where roundtime is calculated by (probably the room size?) how big is the largest square? 40x40? and that is 3 seconds? DaveWithTheNiceHatToday at 2:40 PM round time is the great mystery :slight_smile: I have no idea. herdias do you have an idea of room round times? herdiasToday at 2:41 PM ~3-4 seconds there's no NLB message DaveWithTheNiceHatToday at 2:41 PM I know that when I use the multi walk command walk e 3 w 4 It takes 4 seconds on anything larger than size 10. herdiasToday at 2:42 PM I was walking fine -most- the time with 3.1 on speedwalker but not always. 4 could be sluggish but safe. DaveWithTheNiceHatToday at 2:43 PM So the movement function for anyone wanting to use the faster speedwalk method. It could use getRoomUserData(id, "size") Maybe make the script a single function, so it is set for all rooms. If we need to update it in the future, there is not userData troubles with the faster speed walk function. herdiasToday at 2:46 PM This is going ridiculously slow. This is roughly 10 hours of work. (But I'm also digging.)

DaveWithTheNiceHatToday at 2:46 PM For example setRoomUserData(roomid, "exitScript"..roomid,"movestop=1;tempTimer(3,[[moveStop=nil;speedWalkPath = roomsToWalk;doSpeedWalk()]],1)") Could be `setRoomUserData(roomid, "fasterFastWalk") function fasterFastWalk return "exitScript"..roomid,"movestop=1;tempTimer(3,[[moveStop=nil;speedWalkPath = roomsToWalk;doSpeedWalk()]],1)" end 34 seconds per room. Right? When digging. Patrick aka patd31988Today at 2:47 PM YEs herdiasToday at 2:47 PM It takes me 17 seconds to dig with a trowel. DaveWithTheNiceHatToday at 2:48 PM Trowel is a fucking backhoe Patrick aka patd31988Today at 2:49 PM Do we currently record size? DaveWithTheNiceHatToday at 2:49 PM I think I do already. Either way I had planned to. Partially for this reason. Patrick aka patd31988Today at 2:50 PM Yeah, just have a mapping from size to 1 or 3 DaveWithTheNiceHatToday at 2:50 PM Than for the many unknown reason in the future. Size is not stored yet. I will add it on.