@flyasd1 That's great! It is now so obvious when i look at it, don't know why i didn't realised the output. Thanks for letting me know about the engine code, I wasn't aware you can view it, still learning.
Posts made by Raul
-
RE: Understanding the result of Room.serializePath()
-
RE: Understanding the result of Room.serializePath()
@jbyoshi Yes, that's true, In the end I realised that I don't need to work with the raw data. I was just confused when i looked at it and thought i need to fully understand it if I want to make use of it.
-
Understanding the result of Room.serializePath()
Hello, So I finally decided to write my own path algorithm for the creeps, but I am having trouble understanding what does Room.serializePath return. I understand that it should return the following value format XXYYDDDDDDDDDD... But in my case XX and YY look like some random point around the start position.
E.g. Room.serializePath(new RoomPosition(25, 25, "E33N45").findPathTo(new RoomPosition(25, 24, "E33N45"))) 25241 //Go TOP
Room.serializePath(new RoomPosition(25, 25, "E33N45").findPathTo(new RoomPosition(25, 23, "E33N45"))) 242482 //Go TOP-LEFT TOP-RIGHT
Room.serializePath(new RoomPosition(25, 25, "E33N45").findPathTo(new RoomPosition(25, 22, "E33N45"))) 2524111 //GO TOP TOP TOP
Room.serializePath(new RoomPosition(25, 25, "E33N45").findPathTo(new RoomPosition(25, 21, "E33N45"))) 24248112 //GO LEFT-RIGHT TOP TOP TOP-RIGHT
I understand the DDDDDDD values, but I expected XXYY to be the start location, but it is not. Am I missing something obvious here? Note: the path in my example is formed of plain terrain.