New answers tagged

0

High Level Languages Turn Into Assembly Languages I think you're overestimating the difficulty of building a high level language to provide to your players, you can quite easily build an interpreter to your simple bot scripting language that compiles down to a bytecode that runs on a virtual machine you can advance in fixed intervals in parallel with other ...


2

What you are trying to do is far outside the usual use-case of off-the-shelf script engines. Scripting engines use lots of optimization tricks to run code as fast as they can. But that means the programmer can not know for sure how fast code will actually run. The runtime behavior could also change when you install some minor update to the scripting engine. ...


1

Whenever I read a question like this I really love to cite some basic rule I've read on the internet years ago (and it's still true): The client is in the hands of the enemy. So whatever you do: If you think players might change it to cheat, don't provide that part of the code in the first place. While code obfuscation might be a tiny step towards this ...


1

You shouldn't waste any resources on obfuscating your code in the first place. You work is protected by copyright. When anyone steals it, just call your lawyer and sue them. Changing it so much that it can no longer be traced back to your work would be more work than writing it from scratch in the first place, so nobody will do that. On the other hand, ...


2

Don't obfuscate the names or interfaces required by the scripting system; that way the scripts still bind to the correct types and functions and whatever by name. If you need the code for those methods to be obfuscated, have the implementations of the scripting functions themselves call other set of internal implementations which can be obfuscated.


0

Reduce and Simplify Lua Usage Think long and hard about every instance where you use Lua over C++, understand why the flexibility of an interpreted script is more valuable than writing C++, why waste a precious context switch from C++ to Lua if you don't actually gain anything for it? Is it easier to tweak it in a Lua script than in C++, is your ...


2

I think part of the problem (which also caused me to misinterpret the question at first) is the lual_dofile() calls. This sounds like all scripts are always loaded in the same global state, overwriting each other, so loading/parsing causes a significant overhead. Instead, I'd suggest you use lua_newthread() to create a separated context once per script ...


0

You can load the asset bundle. Load a randomly selected object from that bundle and get a reference to it and then unload the asset bundle to conserve memory. This how ever means that you will have to load the asset bundle every time you have a new object. So a so called pooling system might be what you need. I will explain the steps. 1.Load the asset ...



Top 50 recent answers are included