Sunday, June 29, 2008

Throwing LUA out the window

After spending a week on this problem and even taking a day off from work friday to try to fix the memory leak frequently crashing the server, it seems I cannot overcome this with the current mechanic. I have tried many things, even refactored some of the code but...

Each LUA call from .NET seems to leak memory. I spent a lot of time testing various cases and it all comes down to LUA in the end. And since there's now about a hundred NPCs in the game doing calls about every seconds to LUA each... I guess it's just too much to ask from the library I'm using. Without telling about the random errors that pop from time to time for no apparent reason.

That doesn't mean LUA with .NET (using LUAInterface) isn't good. It just mean that it's not good for my project. It's just frustrating that I noticed this problem so late, just when I was finally ready to release. But with previously little NPCs in the game and no daily testers I guess that was the best I could do.

I did a quick test with dynamically compiled .NET code and that will be what I will replace the LUA AI scripting with. My knowledge of VB.NET is far more better than my knowledge of LUA and I won't have to use a third party library to accomplish this.

So what does it means? First, no "official" release yet... I'll probably shut the current instance of the game for those that already created an account there since the server isn't stable anyway. Tomorrow it's a holiday here so I'll work all day long to get the new AI engine running and at least have some basic AI running. My objective is to have the new system running this weekend with almost all AI operational.

It of course means I'll have to recode every AI. If anyone know of a good LUA -> VB.NET converter, that would be helpful...


Maple said...

Just give me a heads-up on what you need done, and I'll give you a hand rewriting the NPCs.

Don't think I've disappeared completely. My mind has been elsewhere lately.

Over00 said...

oh the "no daily tester" comment wasn't directed at you. I received almost a dozen beta application when I asked for help and most never created an account and the rest logged once or twice without leaving any feedback.

I was expecting this though. Most people have their other projects going on so... Just find it weird that some were quite enthusiast but didn't even sent me back a mail telling me at least something like "urgg, that's terrible". Anyway, no big surprise there.

The few comments I received comes from random people that found the game through google/yahoo and have left comment using the logout screen. Hopefully, those were enough to point me that the server was really too unstable and that's when I noticed the memory leak problem.