BerryBots forums

Re: Caught some bugs
Page 1 of 1

Author:  Voidious [ Mon Feb 24, 2014 12:48 am ]
Post subject:  Re: Caught some bugs

Here's the original post, which I accidentally deleted:
Hi Void,

I came across some small bugs and improvements but couldn't find a dedicated topic or function on for bugreports and feature requests so here are a couple:

- If I have some new ship-code I want to test and I already have a battle running (or paused) with the ship in question using old code I can press restart to load the code. But if there is a compile-time error in the new code the client crashes. Run-time errors are handled properly though.
I recreated it using just a single bot (but also happens with more) on the "empty" stage. The crash doesn't seem to be related to what the compile error actually was or what the shipcode looked like.

- Second bug is that the print() function doesn't seem to accept multiple arguments. It only prints the first argument and the rest is ignored. I also noticed that it doesn't trigger the __tostring event on tables if it is defined. Does this have something to do with LuaJit?

- And now a request: It would be nice to have a function in the DebugGfx module that returns how many more of a certain type of graphic can be drawn before reaching the limit.
Also, it might make more sense to have a global limit shared by all graphic types (#circle + #line + ... <= limit). If I've drawn 4096 lines but no circles I can't make more lines. I can make more circles so apparently there is more cpu time left to draw but still my lines-budget is used up. It's not that big of a deal though since 4096 is more than enough for most purposes :)
(and maybe I should stop drawing gradients with a rectangle for every point to fill the entire screen XD)


PS: I'm on windows 7

Cool, thanks for the reports! I'll take a look at them this week sometime.

I've overridden "print" because I need to do a couple things with it - save to replay data, and print to either output consoles or STDERR, depending on the platform. So I may need to do something additional to make it observe __tostring like the original implementation. Also I didn't think it could take multiple arguments, but if it can I will definitely implement that too.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group