Ace Rimmer wrote:When I say 'not in that order', I mean I was doing both things (getting 'new' unit data and placing in tables, and searching those tables in the same tick)....I assumed the startlongtask/yieldlongtask would allow both functions (getnewdata/searchvisibleunits) at the same time without issues.

Yeah, doing that could potentially cause a whole load of problems. The only time it's safe to simultaneously operate multiple tasks on the same set of data (i.e. a table) is if the tasks are only reading values, otherwise you could end up deleting a value in one task while the other is about to try read from it.

This is assuming data is passed-by-reference. I haven't checked but arguments in Lua are most likely passed-by-value so this shouldn't be the exact kind of thing to worry about as each task would be working on it's own copy of data. However, if you're using global variables then you would very easily hit this problem, which is why you should avoid using them. For example don't do:

Two possible solutions. First, make sure your update and read tasks are executed sequentially (nice and easy). Second, implement channels which would allow parallel tasks to pass information between each other (tricky and could lead to blocking as a task would have to wait for communication from the channel).

While not entirely relevant it may help to read about ACID to highlight some of the issues, in particular, the bit about isolation.

Uplink help: Check out the Guide or FAQ.
Latest Uplink patch is v1.55.

Ok, you two have been really helpful and using tables is much, much faster. I still can't get beyond it hanging though, which I believe is due to "invalid" units (units that drop off of radar), and destroyed units. I will be attempting to correct my tables to be units as suggested. I still have a large deficit of knowledge in the table area.

That's a scan of my territory, it draws a box around my territory and then scans every single point in the territory, that get's me several thousand points which I then add to a heap and select a few of the points to put silos and airbases on.

Version 17 is the latest version. It's odd that it only runs with 6 players, do you have a really fast computer?

GENERATION 22:The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

Hey, Joshua is on a bit of a backburner during the exam period so I'm not really looking for other programmers at the moment. However, feel free to checkout the code and make your own bot based on Joshua

GENERATION 22:The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

Dammit! It's all poptart911's fault! He sent me a message about Joshua, and now I'm back to work on it. As before, I'm spending less time actually building Joshua and more time building useful Lua libraries, I just completed the basic version of a query system (inspired by LINQ from C#, for those who know what that's all about).