Discord
Login
Community
DARK THEME

Choice of scripting languages

Hi, I just stumbled across micro studio and it looks refreshingly different and interesting.

Can you please tell me when it comes to exporting your game, is there a difference in speed according to the scripting language used to create the game?

Does micro studio compile the exports, and do the games render with the GPU or the CPU ?

Oh, and if using Python, does that include pygame scripting ?

Appreciate your comments - thanks.

I didn’t notice any difference in application speed when exporting microScript and/or JavaScript. I haven’t used others, I don’t know

Thanks for your reply. In that case it seems like microScript gets converted to Javascript.

MicroStudio has 3 languages available -- MicroScript (version 2) It's very easy to learn. Good error communication from the MicroStudio environment.

There are also versions of MicroScript version 1.0 and MicroScript Transpiler to JavaScript.

  • python - I haven't written anything in this language, so there is no information

  • Javascript - the only limitations I found when writing in this language are the inability to import libraries (you cannot use the words import and export). I managed to transfer the libraries to MicroStudio 2 without using import and export (PIXI 2.5.0 and THREE) - so if you try hard, it's possible.

Debugging code in this language is a nightmare. MicroStudio does not display any error information. The only way to write in this language is to have a very good knowledge of JavaScript and to test whether the code still works after each change. And of course looking in the browser console.

MicroScript 2.0 and Python run about 100 times slower than the same code in JavaScript. But mostly it doesn't matter.

https://microstudio.io/gilles/perf/ - you click to add sprites

https://microstudio.dev/i/Skaruts/ms2_speed_test/

https://microstudio.dev/i/Skaruts/python_speed_test/

https://microstudio.dev/i/Skaruts/js_speed_test/

I once compared how fast the language works in Godot 3 compared to MicroScript.

for loop (let i = 0; i<100000000;i++){ count += 1}

it worked just as fast in Godot as in MicroScript.

You can choose which graphics library will be responsible for presenting graphics. There are 3 basic libraries

  • default - easy to use, no access to shaders
  • PIXI - 2D library you have full control over the screen and can add shaders
  • BABYLON - 3D library - the graphics processor will display the models.

Browse the Explore section >> you will see MicroStudio's capabilities and users.

"Matter.js" and "CANNON.js" for physical simulations are also available.

https://microstudio.dev/i/gilles/matterjstest/


When you choose MicroScript 2, you can combine your code with JavaScript - expanding the possibilities available. For example, if the speed of MicroScript is too low, you write critical parts of the code in JavaScript.

Thank you very much for such a comprehensive reply.

If anyone else has some input, please reply.

Loginus, wow, there is still a difference, but without such tests it is sometimes difficult to notice.

What about MicroScript 2.0 test without using javascript? Is the result the same or is there a difference?

@Romero You will notice the difference when the code has to perform a lot of operations (JavaScript will be much faster).

For graphic display operations this is less visible (Javascript will be 2 times faster).

This code shows the speed difference for the same code (logically identical).

MicroScript 2 - 80 ms - 15 FPS

init = function()
end

update = function()
end

draw = function()
  start = system.time()
  screen.clear()
  for i = 1 to 10000
    screen.drawSprite( 'icon', 
      random.next() * screen.width - screen.width/2,
      random.next() * screen.height - screen.height/2, 16, 16
      )
  end
  stop = system.time()
  print( (stop - start ) + ".ms" + " FPS = " + system.fps)
end

Javascript - 30 ms .. 40 ms - 25 FPS

init = function() {
}

update = function() {
}

draw = function() {
  start = system.time()
  screen.clear()
  for ( let i = 1; i < 10000; i+=1 ){
    screen.drawSprite( 'icon', 
      Math.random()* screen.width  - screen.width/2,
      Math.random()* screen.height  - screen.height/2, 16, 16
      );
  };
  stop = system.time()
  print( (stop - start ) + ".ms" + " FPS = " + system.fps)
  
}

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community