As in:
Code: Select all
Table1 = { 1, 2 }
Table2 = {1, 2, 3, 4, 5... 100}
That does it actually go through every item to see there are items, or is it able to simply check reserved memory space for Table2 to figure out how many items there are?
To give more details about the situation is that I have pathfinding that is currently checking 90 steps away at max, this is in case source is on one edge of map, and target is on other side of map.
However, I was thinking that since this situation is very unlikely, I could maybe stop checking after 70 steps already, and in case it results in no target at all, then it could simply pick one of the targets at random, since i do keep the targets in table, so I could use TableItems() to get the amount of potential targets, and then just randomly pick one of them and take a direct line towards it. This could significantly improve the speed in these rare situations and might not affect the play experience much, making it more possible to work on Amigas.