Seabass's Scripting Engine

Discussion in 'Marketplace' started by Seabass (The Human), Feb 26, 2018.

  1. Seabass (The Human)

    Seabass (The Human) Member

    Jun 20, 2016


    As of now I've implemented a few key features that I feel really make this mini-engine stand out.
    • Live reloading of cutscenes upon file edits, this means you don't have to restart your game to make changes to a scene
    • Sprites are referred to through the Game Maker project instead of loaded externally
    • The ability to pause a scripts execution via wait()
    • Executing user created GML scripts and passing in arguments to said scripts
    • Error reporting that doesn’t stop the game
    • No DLLs means that the engine can be used on any platform
    • Modify and read global variables from GML
    • Built-in text functions including string splitting
    • Proper documentation of all provided functions and the framework (only partially done but here's a link to it:

    Here's an example of a script created for the engine:

    Why would I use this instead of GML for animations/cutscenes?
    It supports any GM game and provides an easy way to create cutscenes on the fly. With live reloading there is no need to restart your game to make changes. It can even be used alongside normal gameplay. For example you may want a character to shake and then swing a weapon, produces an attack object. Using the script_execute() function in the external scripts you can absolutely do that. This prevents you from having to spend hours on a simple scene or animation.



    Scripting Syntax, click below for a peek at it.
    The syntax for scripting within this system is very simple and follows a very basic layout.


    Scripts are split up into parts. Each part contains a set of functions that are executed top to bottom. While this may seem very limited at face value it does allow for fast and simple code with little to no knowledge of programming.

    Here’s an example of a script that creates a character, moves them to the screen, waits two seconds, and then fades the character away.

    actor_create ( seabass, 0, 320, spr_character_seabass )
    actor_move ( seabass, 360, 320, 4 )
    wait ( 2 )
    actor_fade ( seabass, 0.05, 1 )

    Brackets [ ]
    You should keep an eye out for [ ]. These indicate that a function as optional arguments. An optional argument means you do NOT have to include those arguments for the function to work.
    Generally functions that include these have been done this way because you can still set these values later with other functions. This helps to prevent lines of code becoming too long.

    Quotation Marks “ “
    Quotation marks are parsed as strings meaning if you do, “I am a dog”, the compiler will see it as I am a dog. Without the quotation marks the compiler would read it as Iamadog. This is extremely important when working with text boxes.

    Speed comparison
    actor_create(jisselle, -100, 720, spr_character_jisselle_idle) --> 126
    actor_move_lerp(jisselle, 280, 720, 0.2) --> 67
    wait(1) --> 20
    actor_flash(jisselle,255,0,0,1,1,0.0125) --> 72
    actor_sprite_change(jisselle,spr_character_jisselle_angry) --> 76
    actor_shake(jisselle, 5, -1) --> 43
    wait(0.1) --> 68
    actor_shake(jisselle, 4, -1) --> 37
    wait(0.1) --> 21
    actor_shake(jisselle, 3, -1) --> 37
    wait(0.1) --> 15
    actor_shake(jisselle, 2, -1) --> 38

    actor_create(jisselle, -100, 720, spr_character_jisselle_idle) --> 95
    actor_move_lerp(jisselle, 280, 720, 0.2) --> 54
    wait(1) --> 14
    actor_flash(jisselle,255,0,0,1,1,0.0125) --> 55
    actor_sprite_change(jisselle,spr_character_jisselle_angry) --> 44
    actor_shake(jisselle, 5, -1) --> 36
    wait(0.1) --> 13
    actor_shake(jisselle, 4, -1) --> 28
    wait(0.1) --> 10
    actor_shake(jisselle, 3, -1) --> 28
    wait(0.1) --> 10
    actor_shake(jisselle, 2, -1) --> 27

    Non-YYC YYC
    126 95
    67 54
    20 14
    72 55
    76 44
    43 36
    68 13
    37 28
    21 10
    37 28
    15 10
    38 27

    Average function time (Non-YYC)
    51.66 microseconds or 0.05 milliseconds

    Average function time (YYC)
    34.50 microseconds or 0.03 milliseconds

    In a 60 fps game, you could call approximately 333 of these script functions per frame in non-YYC (VM) and up to 555 in YYC. These benchmarks were done on my system which may not be a fair comparison to the average user but should be within a 50% margin of accuracy for most users.

    Of course you shouldn't need to call more than 50 functions per step and I'll slowly be optimizing this system as time goes by.

    If you'd like to take part in testing this engine out prior to it becoming more publicly available, you can find more here:

    *Update an hour or so later*, just made the whole system 25%~ faster.
    Last edited: Mar 1, 2018
  2. Seabass (The Human)

    Seabass (The Human) Member

    Jun 20, 2016
    I've updated the post to include syntax information and I've updated the feature list.

    I hope to get a public demo/asset out in the next week. So far the system is very capable but lacking a handful of useful functions. Here's what there is so far.

    actor_create ( name, x, y, sprite )
    actor_move_lerp ( name, x, y, speed )
    actor_move ( name, x, y, speed )
    actor_fade ( name, fade_speed, fade_alpha )
    actor_alpha ( name, alpha )
    actor_scale ( name, x_scale, y_scale )
    actor_shake ( name, shake_strength, shake_time )
    actor_sprite_change ( name, sprite )
    actor_flash ( name, color_red, color_green, color_blue, alpha, time, speed )
    actor_color ( name, color_red, color_green, color_blue, alpha )
    actor_delete ( name )
    text_create ( name, x, y, sprite, font, [fill_type], [width_limit], [horizontal alignment], [vertical alignment], [vertical separation], [text] )
    text_offset ( name, text_x, text_y )
    wait ( seconds )
    jump_to ( part )
    global_variable_set ( name, value )
    if_global_variable_= ( name, value, part )
    if_global_variable_! ( name, value, part )
    if_global_variable_< ( name, value, part )
    !if_global_variable_> ( name, value, part )
    if_global_variable_<= ( name, value, part )
    !if_global_variable_>= ( name, value, part )
    script_execute ( script, arguments )

    While you could definitely use the system in its current state, I'd like to make it more robust first and provide a larger framework for early users.
    Last edited: Feb 27, 2018
  3. Seabass (The Human)

    Seabass (The Human) Member

    Jun 20, 2016
    This tool has received a few additional improvements including scene changing functions!
  4. Felixsg

    Felixsg Member

    Aug 3, 2017
  5. Seabass (The Human)

    Seabass (The Human) Member

    Jun 20, 2016
    I took it down from the store. But I sell it privately!
  6. Samuel Venable

    Samuel Venable Time Killer

    Sep 13, 2016
    Why do you sell it privately? Isn't that a little odd since it will effect your number of sales? :p
  7. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Apr 13, 2016
    You'll need to fix the link otherwise I'll have to remove the topic. This is the Marketplace forum, and so only assets on the Marketplace can go here... Nothing to stop you posting (or having the topic moved) into the "Made With GameMaker" section of the forum though.
  8. Seabass (The Human)

    Seabass (The Human) Member

    Jun 20, 2016
    @Samuel Venable You're hilarious if you think people purchase tools like this from the marketplace. xD It certainly does not affect my sales because over the course of the engines life-time it got one sale. However it is something I'm more or less licensing now.
    @Nocturne You can remove it.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice