RME icon indicating copy to clipboard operation
RME copied to clipboard

[WIP] Refactoring commands' declaration & documentation

Open acs-l opened this issue 7 years ago • 2 comments

So, let's begin with a simple thing. Generating all commands + validate them at the start of the game is a terrible idea. I'm sorry to come after all this refactoring to say that.

The fact that you need to validate each parameter is against what Ruby is. Even it's a good idea to tell people why a command fails, it's really heavy to perform these on every call. It should be just a debug tool which can be invoked when needed.

We already have complains that RME would alter the game's performance. We don't need something to worsen this.

But the global idea is cool. What we could need is to generate a clean "RME.rb" from your work which will not be doc related (makers don't care about generating doc, it's already online). On a other side, players which will play the game don't care about why the game is crashing : we should let the game crash as usual when playing outside the TEST/DEBUG mode.

It's cool to see that you worked something to allow us to translate easily the documentation.

Now, if you need help to apply those changes I'm here. @xvw @grrim If you agree or not, feel free to comment.

BastienDuplessier avatar Jul 29 '18 16:07 BastienDuplessier

Actually, the commands are generated at the start of the game (only once) and then the validation process is called each time a command is called (multiple times). That's even more performance-consuming than what you said 😅.

As there is already a pre-processing step when the RME.rb script is delivered, I might as well add one step to statically generate each command instead of definying them dynamically. I'll add such a publishing step (removing the documentation, statically generating commands. removing parameters' validation) once I'm done with the whole refactoring.

Thanks for your directions and advices 😃 !

acs-l avatar Jul 29 '18 19:07 acs-l