Posted 17 May 2013 - 03:47 PM
First, let me say how much fun I have had playing with this mod. It's a real game changer for me and brought new life and inspiration to the game for me… At first the language didn't appeal to me, but as I got into Tables and the work queue, it started to grow on me. Anyways, on with the suggestions/issues. First, the issues… Issue #1 I have found that the file system apis, even writing a single number to a file (so like 8-24 bytes) can cause crashes randomly. This is because sometimes the file system API's can take longer than the allowed time for returning back to the work queue, so the program is crashed because it didn't yield. This is painful, because when this occurs, the file handles are left open and access to them is denied until a reboot. This carries over to more than just the programs I write. I have found with just using the edit program to edit a file. if the save operation fails because of the yield problem, the files are only partially written and you loose data with no way to recover it (unless you were wise and keep a backup on a disk in a chest). Issue #2. I believe i am seeing work queue stalls, and I am curious is this is just a limit of the number of cycles available each game tick? It seems that when I exceed some threshold (one I have not been able to identify yet), that my codes seem to stall at times. Its almost like the computer queues total aggregate event count is too large, so only some computers get execution cycles? This is just mere speculation at this point, debugging and proving it are a bit hard because when I add logging to the mix to test it, it changes the timing and I don't see the issue (just everything is slower). Suggestion #1, the ability to see the work queue depth on the os object. I use the work queue in my codes to provide a completion model, so parts of the code may queue several events during the processing of another event. It would nice to know the queue depth so I can make optimizations to the program. Suggestion #2, System/Kernel type API objects. I feel that one thing is missing from the OS, and that is the ability to create system level APIs. IE, an API table that is globally scoped. For example, if one program calls a function or changes the state of that api (say location tracking for turtles which holds the x,y,z,f locally), those changes would be present in the next program run. I equate this to a kernel mode driver in modern operating systems. Suggestion #3, providing a built in logging/tracing system for debugging. It would be super useful if turtles/computers could call log.write(…) and it would write to a global log file for the save (not on the disk of the turtle/computer). Or maybe a peripheral that can be attached that will spew out data to an in game monitor or in-game chat. I wrote my own that writes to the local computer disk, but it is pretty easy to hit the yield issue or fill up the virtual disk. Suggestion #4, Fuel consumption knob rather than a Boolean. I love the concept of burning fuel to get results, but I think the fuel consumption rate is too low and leaves the game a little unbalanced, so I would like the ability to decrease the efficiency. One thing that might level it is to increase the amount of fuel required by a percentage, say 10%, for every 4 air blocks directly below it. Suggestion #5, WRT wireless modems, again, I love this concept, but I think that the abilities it gives are too great for the cost. The communications distance is too big when in orbit (top of the world) IMO. I think it is a good end size, but I believe it should be harder to achieve getting max distance out of a modem. For example, perhaps you must power the computer on two sides to boost the power (this would require 3 turtles to be sent into orbit, one for modem, others to boost the power). Another idea I had was while sitting directly over a Beacon (in the beam of light) the distance could be increased (as well as maybe a mitigation for weather effects). Suggestion #6. Add a method to the OS object or a peripheral that allows for the persistence of a single string/table value. I totally agree that computers should not retain callstacks/state when the game is restarted, but I think the ability to "tag" or track a small bit a data would be super useful. I have written a small bit of code that saves my state key (a single string) to a file and can reloaded it and resume duties, but to maintain that I must read/write this file constantly, which can sometimes lead to the issue #1. What I suggest is an OS feature that allows for the tracking of this state in memory, but can ensure the value is persisted and reloaded when the game is reloaded. This suggestion is mostly a reaction to the fact that I see issues when I have to use the FS apis aggressively. There are many ways to achieve this goal I think, but I think the most balanced approach might be an NVRAM peripheral that could be used in place of a crafting table on turtles (or just attached to computers). Suggestion #7, Async Turtle events. In my programs, I have replaced the Turtle api with my own that adds a "begin" function. This function just calls the native function directly without waiting for the turtle_response event. I do this to enable overlapped operations to happen. For example, when I invoke a movement like "forward", I call the begin function to dispatch the turtle movement, but at the same time, also post an event to triggers the calculation of the next move. – Thanks