This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
lucasm's profile picture

Game obliterates turtles from time to time.

Started by lucasm, 09 June 2013 - 03:51 PM
lucasm #1
Posted 09 June 2013 - 05:51 PM
This has happened 3 times to me now, and the last time it ate a lot. Sometimes, not sure when, the game freaks out. All turtles stop responding. If you right click on them, nothing happens. When you reload the game, all turtles that are in this state that you managed to click on are replaced with default turtle (no modem or tool) and the ones you don't click on, just vanish. The last time this happened, it took out 5 satellite, 8 miners, and a farmer. This only seemed to effect turtles with tools/modem attached. I have a chain of turtles that have no tools/peripherals for my sorting system, and they didn't seem to see the bug.

I don't see this issue very often, as I said this is only the third time, and see the issue on multiple saves.

I am running on Win8 64bit and have latest 1.5.2 MC and 1.5.3 CC, though I saw this the first time on the previous version.

Thanks,
Luke
Lyqyd #2
Posted 10 June 2013 - 10:52 AM
Split into new topic.

Is there a specific thing you're doing that is common to the saves this happens on? A specific program? Crashes?
Bomb Bloke #3
Posted 10 June 2013 - 11:14 AM
Well this sounds familiar…

I'm on a somewhat older version (CC 1.5 with MC 1.4.7) and run my game via a local server so's stuff can process when I'm not around (I assume you're playing SSP), but have run into a nasty little bug where any use of the rednet or modem APIs may entirely freeze up the whole server.

If I happen to be connected to it at the time, I'll get behaviour much like you report - unable to interact with my turtle (followed by an eventual "end of stream" and boot from the server if I stick around long enough). If I'm not connected then I simply can't connect. Either way, all server logging stops, and when I restart it my turtle has either reset to a "basic" turtle with no add-ons or been deleted outright.

My code sends maybe a few messages a minute, and on average stalled my server every few hours using just one turtle. Once I switched from the rednet API to the modem API the time frame extended to "days", but random crashes are random, so make of that what you will (I can tell you more messages lead to faster crashes). For now I've just stopped using modems.

I'd gotten the impression this was fixed in later releases (each other report was met with a "fixed in next update" response), so it may be your issue is unrelated. Are your satellites also turtles? Best I can make out, regular CC computers shouldn't trigger the version of the problem I'm seeing.

I guess my main question is, what happens if, when your turtles stop moving, you keep the game running? Can you interact with other blocks - eg, mine stuff? Does it crash out if you keep waiting long enough?
lucasm #4
Posted 10 June 2013 - 05:35 PM
<p>Thanks for the information. The problem is exactly as you describe, though I have not waited around long enough to see if it crashes. I will do that next time and see if I can gather some more information. The turtles that seem to hit this bug are only ones that are in motion (fw, up, or down). Turning doesn't seem to make a difference. My sorting system, which has > 50 turtles, did not have one failure, and they were definitely active during the last crash. According to my logs, the only ones that were nuked were ones that were changing position.

Thanks for the info about rednet, though I don't use that API. I wrote my own wrapper around the modem api. Ther

Thanks for the information. The problem is exactly as you describe, though I have not waited around long enough to see if it crashes. I will do that next time and see if I can gather some more information. The turtles that seem to hit this bug are only ones that are in motion (fw, up, or down). Turning doesn't seem to make a difference. My sorting system, which has > 50 turtles, did not have one failure, and they were definitely active during the last crash. According to my logs, the only ones that were nuked were ones that were changing position.

Thanks for the info about rednet, though I don't use that API. I wrote my own wrapper around the modem api. There should not have been any traffic going over the network unless a turtle was just coming online (or rebooted) and it did a GPS handshake. They will all have the modem channels open, but none should be sending packets.

I am not sure if they are related, but I seem to see that dynamic tables created at runtime cause memory GC contention overtime. I am not sure how garbage collection works in the CC os's so I am not sure what to expect. My codes will create tables to describe the bucket of state information for my state machine, and when I moved these to be "pooled" so that I reused the tables, I gained hours of stability.
Bomb Bloke #5
Posted 10 June 2013 - 06:33 PM
Hmm. I send them as serialised tables as strings over rednet, a process that'd create new tables on receipt, but otherwise declare 'em once and leave it at that. My turtle also moves nearly constantly.

The server control panel shows RAM usage going up and down by about a megabyte every few seconds or so while in its "stalled" state, but absolutely no activity other then that. Average tick speed etc locks on whatever value it was at when the freeze occured.

I guess if you're only using your modem interfaces on boot, close the ports once you're done with them and leave them closed, see if that makes a difference.

I'm a little confused about your "satellites". Again, are they also turtles? Are they moving?

It's worth mentioning that before I switched to a LAN server, under SSP I once triggered some game crashes while playing with video settings (really didn't seem to like OpenGL for some reason). This didn't cause my turtle to freeze, as such, but rather just crashed the game; though the results were much the same and the turtle turned into a "default" model. It seems anything that crashes the game has the potential to mess with moving turtles, it's just a question of what's triggering it for you - it could be one of the static turtles triggering it or something entirely unrelated to CC.
lucasm #6
Posted 10 June 2013 - 07:30 PM
Yes, the satellites are turtles that can be repositioned once I move from a region. They will also come back home from time to time to refuel (though it is VERY VERY rare). I can't really disable the modem on any of my devices. While I don't require it for primary activity beyond boot, I do need it for other features that I have. One example is emergency recall which I can broadcast out and make everyone or an individual turtle come back home. At one point I had a heartbeat in the code, but found that I was just wasting cycles and an explicit ping/pong on user demand was more efficient and worked just as well for what I needed.
Bomb Bloke #7
Posted 11 June 2013 - 04:29 AM
It may be worth modifying that system so that you can selectively shut groups of turtles down, or just have them close their ports. Quitting/reloading would then be all it took to get them back online, if you sent those signals during a given session.

Once you've got a method to easily shut down your fleet, you can concentrate on reproducing the issue without interference. Maybe set up just a couple of turtles and have them spam table creations or modem transmits.

Getting a thread dump per one of the threads I linked earlier would be worthwhile.