forum

The new SGL Tool (Beta) - Generate Storyboards

posted
Total Posts
61
Topic Starter
MoonShade
Peppy asked me/encouraged me a long long while ago to built SGL with C# so it can be built in osu! once it is somewhat usable in a productive environment. In this time, I almost finished the project, then lost interest and had lot of other things on the go and long story short, I now want this project to move forward again.
This project is somewhat related to my old SGL, but I built everything from scratch, changed the language a lot and used other technologies to built this tool, so I think a new topic for this is needed.

What is SGL and what can I do with it?
SGL means "Storyboard Generation Language", it's a programming language which only purpose it is to produce storyboard code - both simple storyboard but also very complicated ones. What's basically better about SGL than scripting everything by hand, well, I guess you can't write thousands lines of storyboard code all by yourself now, can you? Also it's very easy to change many parameters at once if you code wisely.






Alright, where can I find it?
  1. Download (Mirror #2)
  2. User Manual
  3. Source Code
  4. List of bugs and planned improvements

Can I have some pictures?
Sure.

Please feel free to use it, improve it and copy it under the terms of GPL 3.0

And now for the important part: I need people to help improve this tool by pointing out errors, saying what they would like to see implemented. If you come across an "Unexpected Exception" or other errors apart from your coding mistakes of course, please report that in this thread or via PM! I'm thankful for any feedback from you guys! If you think you know what this tool needs which isn't already implemented or planned, please tell me!

Also, if you have a great SGL script which you think needs sharing, post/PM.
And of couse you can write here or ask via PM for any questions you might have using this tool. I hope it will be useful :)

Known Issues that hopefully will be fixed in the next release:
  1. Support for Storyboard Loops (Done)
  2. Support for Sound Samples (Done)
  3. Compiler blocks UI
  4. Several Bugs, see Bug List
Loctav
This thread and tool definitely needs more attention and more support.
Moved to General Development, stickied.
Topic Starter
MoonShade
Wow thank you Loctav, I really appreciate it <3
p3n
jemhuntr
:o this is awesome stuff <3
[Luanny]
downloading now.
Topic Starter
MoonShade
Glad you all like it. The next release will contain all storyboard functions including loops and flips, autosaving functionality and hopefully an all new GUI :)


theowest
I've included your video in the tutorial project: t/109137 If you have any other tutorials, feel free to post them in that topic.
jemhuntr
please make an option to make it high-contrast (black bg, light font) because I type better that way. (or maybe just make all the colors customizable) oh well, keep up the good job
Scarlet Devil_old_1
Have my babies
palion
very cool! I look forward to this being integrated with osu
zinckingeye
love it for those who what to make SB via coding.... + points for you...
Zexous
ErunamoJAZZ
With the help of your program can do pretty cool things, like this: https://osu.ppy.sh/s/99420
I still want to do other stuff before write some suggestions.

Thx!! ;D
MillhioreF
This program is amazing, I love it!
The only thing I'd really like to see is array support. Right now it gets pretty messy if you want to generate a whole bunch of images (e.g. snowflakes) and then call functions with them later on in the code.
Trynchen
Wow, it looks realy nice ;)
Damnae
I've just finished a storyboard using this tool : http://osu.ppy.sh/s/112399.
Expect tons of snowflakes :p

Here is the current sgf file:
SPOILER
var time_part1_start = 1085;
var time_spinner_start = 10302;
var time_spinner_end = 11140;
var time_first_object = 11811;
var time_part1_end = 24213;
var time_part2 = 25219;
var time_part2_voice_a = 42984;
var time_part2_voice_b = 43654;
var time_part3 = 46671;
var time_part4_start = 57397;
var time_part4_1 = 62760;
var time_part4_2 = 65107;
var time_part4_3 = 65442;
var time_part4_4 = 68794;
var time_part4_end = 69800;
var time_chorus_start = 70805;
var time_chorus_end = 92258;
var time_part5 = 94939;
var time_part6 = 102984;
var time_outro = 113710;
var time_end = 121755;
var time_true_end = 124436;
var time_scorescreen = 125777;

function make_title_glow(t0, t1) {
var time_title_start = t0;
var time_title_end = t1;
var time_title_a = time_title_start + (time_title_end - time_title_start) / 4.0;
var time_title_b = time_title_start + 3 * (time_title_end - time_title_start) / 4.0;

var deg_to_rad = 3.14 / 180;

var ls1 = new Sprite("ls.png", Pass, CentreLeft);
ls1.color(time_title_start, time_title_end, 17,254,176, 173,255,95);
ls1.additive(time_title_start, time_title_end);
ls1.fade(time_title_start, time_title_a, 0, 0.7);
ls1.fade(time_title_b, time_title_end, 0.7, 0);
ls1.move(time_title_start, time_title_end, 0, 142, 0 + 50, 142);
ls1.rotate(time_title_start, time_title_end, -10 * deg_to_rad, 5 * deg_to_rad);
ls1.scale(2, time_title_start, time_title_end, 1, 2);

var ls2 = new Sprite("ls.png", Pass, CentreRight);
ls2.color(time_title_start, time_title_end, 255,88,100, 255,94,55);
ls2.additive(time_title_start, time_title_end);
ls2.flipH(time_title_start, time_title_end);
ls2.flipV(time_title_start, time_title_end);
ls2.fade(time_title_start, time_title_a, 0, 1);
ls2.fade(time_title_b, time_title_end, 1, 0);
ls2.move(time_title_start, time_title_end, 640, 120, 640 - 50, 120);
ls2.rotate(time_title_start, time_title_end, -10 * deg_to_rad, 5 * deg_to_rad);
ls2.scale(2, time_title_start, time_title_end, 1, 2);
}

function make_glow(t0, duration) {
var lf = new Sprite("g.png", Foreground, Centre);

var lf_t0 = t0;
var lf_t1 = t0 + duration / 4.0;
var lf_t2 = t0 + 3 * duration / 4.0;
var lf_t3 = t0 + duration;

var screen_width = 640;
var screen_height = 480;

var offset = 100;

var lf_x = rand(offset, screen_width - offset);
var lf_y = rand(offset, screen_height - offset);

var lf_size = rand(60, 120) / 100.0;
var lf_opacity = rand(40, 70) / 100.0;

var deg_to_rad = 3.14 / 180;
var angle = rand(0, 360) * deg_to_rad;

lf.rotate(lf_t0, lf_t3, angle, angle);
lf.scale(lf_t0, lf_t3, lf_size, lf_size * 1.5);
lf.move(lf_t0, lf_t3, lf_x, lf_y, lf_x, lf_y);
lf.fade(1, lf_t0, lf_t1, 0, lf_opacity);
lf.fade(2, lf_t2, lf_t3, lf_opacity, 0);
lf.additive(lf_t0, lf_t3);

if (rand(0, 1) == 1) {
lf.flipH(lf_t0, lf_t3);
}

if (rand(0, 1) == 1) {
lf.flipV(lf_t0, lf_t3);
}

var color = rand(0, 4);
if (color == 0) {
lf.color(lf_t0, lf_t3, 17,254,176, 17,254,176);

} else if (color == 1) {
lf.color(lf_t0, lf_t3, 173,255,95, 173,255,95);

} else if (color == 2) {
lf.color(lf_t0, lf_t3, 255,88,100, 255,88,100);

} else if (color == 3) {
lf.color(lf_t0, lf_t3, 255,94,55, 255,94,55);
}
}

function make_snowflake(t0, duration, fall_speed, pop_time) {
var pop_delay = 1005; // 3 beats for this song

var pops = false;
if (pop_time > 0 && t0 + duration > pop_time) {
duration = pop_time - t0;
pops = true;
}

var lf_t0 = t0;
var lf_t1 = t0 + duration / 4.0;
var lf_t2 = t0 + 3 * duration / 4.0;
var lf_t3 = t0 + duration;

// they should never take more than one second to appear
if (lf_t1 - lf_t0 > 1000) {
lf_t1 = lf_t0 + 1000;
}

var screen_width = 640 * (1366 / 1024.0);
var screen_height = 480;
var x_offset = -((screen_width / 2) - (640 / 2));
var y_offset = - (lf_t1 - lf_t0) / 1000 * fall_speed;

var lf_x = rand(0, screen_width) + x_offset;
var lf_y = rand(0, screen_height - y_offset) + y_offset;

var lf_x_end = lf_x;
var lf_y_end = lf_y + fall_speed * duration / 1000.0;

var lf_size = rand(10, 100) / 100.0;
var lf_opacity = rand(20, 80) / 100.0;

var lf = new Sprite("star2.png", Foreground, Centre);

var abs_fall_speed = fall_speed;
if (abs_fall_speed < 0) {
abs_fall_speed = -abs_fall_speed;
}
var speed_scale_multiplier = abs_fall_speed / 200.0;
if (speed_scale_multiplier < 1) {
speed_scale_multiplier = 1;
}
var grow_factor = 1.5;

lf.scaleVec(lf_t0, lf_t3, lf_size, lf_size * speed_scale_multiplier, lf_size * grow_factor, lf_size * grow_factor * speed_scale_multiplier);
lf.move(lf_t0, lf_t3, lf_x, lf_y, lf_x_end, lf_y_end);
lf.fade(lf_t0, lf_t1, 0, lf_opacity);

if (pops) {
lf.scaleVec(pop_time, pop_time + pop_delay / 3 / 4, lf_size * grow_factor, lf_size * grow_factor * speed_scale_multiplier, lf_size * grow_factor, lf_size * grow_factor);
lf.fade(pop_time, pop_time + pop_delay / 3, lf_opacity, 1);
lf.fade(pop_time + pop_delay / 3, pop_time + pop_delay, 1, 0);
lf.additive(lf_t0, lf_t3 + pop_delay);

} else {
lf.fade(lf_t2, lf_t3, lf_opacity, 0);
lf.additive(lf_t0, lf_t3);
}
}

function make_snowflakes(t0, t1, lf_count, lf_duration, lf_minimal_duration, lf_speed, pop_time) {
for (var i = 0; i < lf_count; i++) {
var lf_t0 = rand(t0, t1 - lf_minimal_duration);
var lf_real_duration = lf_duration * rand(50, 100) / 100.0;

if (pop_time == 0 && lf_t0 + lf_duration > t1) {
lf_real_duration = t1 - lf_t0;
}

make_snowflake(lf_t0, lf_real_duration, lf_speed * rand(80, 120) / 100.0, pop_time);
}
}

function make_snowflakes_every(t0, t1, delta, pop_time) {
var lf_t0 = t0;
while (lf_t0 < t1) {
make_snowflake(lf_t0, delta * 8, 0, pop_time);
lf_t0 = lf_t0 + delta;
}
}

function make_glow_every(t0, t1, delta, max_glow_count) {
var lf_t0 = t0;
while (lf_t0 < t1) {
make_glow(lf_t0, delta * max_glow_count);
lf_t0 = lf_t0 + delta;
}
}

// --- BACKGROUND

var bg_width = 1024;
var widescreen_scale = 1366 / 1024.0;
var bg = new Sprite("bg.jpg", Background, Centre);
bg.scale(640.0 / bg_width * widescreen_scale);
bg.fade(0, time_spinner_end, 0.2, 0.2);
bg.fade(time_spinner_end, time_first_object, 0.2, 1);
bg.fade(time_first_object, time_outro, 1, 1);
bg.fade(time_outro, time_end, 1, 0.6);
bg.color(time_outro, time_end, 255, 255, 255, 221, 231, 255);
bg.fade(time_end, time_true_end, 0.6, 0.2);
bg.fade(time_true_end, time_scorescreen, 0.2, 0);

// --- TITLE

make_title_glow(time_part1_start, time_part1_start + 6000);
make_title_glow(time_part5, time_part6);

// --- SNOWFLAKES

var start_offset = 500;

// slow snowflake part
make_snowflakes(time_part1_start - start_offset, time_part1_end, 50, 10000, 1000, 30, 0);

// + spinner
make_snowflakes(time_spinner_start, time_spinner_end + 200, 400, 200, 100, 0, 0);

// fast snowflake part
make_snowflakes(time_part2, time_part3, 120, 5000, 1000, 100, 0);

// + slowdown
make_snowflakes(time_part2_voice_a, time_part2_voice_b + 400, 200, 500, 400, -140, 0);

// + faster snowflakes
make_snowflakes(time_part2_voice_b, time_part3 + 400, 500, 500, 400, -500, 0);

// denser slow snowflake part
make_snowflakes(time_part3 - start_offset, time_part4_start, 200, 10000, 1000, 30, 0);

// lots of fast snowflake part
make_snowflakes(time_part4_start - start_offset, time_part4_2, 200, 5000, 1000, 140, 0);
make_snowflakes(time_part4_1 - start_offset, time_part4_3, 100, 5000, 1000, -100, 0);
make_snowflakes(time_part4_2 - start_offset, time_part4_4, 100, 2000, 800, -200, 0);
make_snowflakes(time_part4_3 - start_offset, time_part4_end, 100, 700, 0, -350, time_part4_end);
make_snowflakes(time_part4_4 - start_offset, time_part4_end, 200, 500, 0, -500, time_part4_end);

// chorus
make_glow_every(time_chorus_start, time_chorus_end, 1005, 4);

// outro
make_snowflakes_every(time_outro, time_end, (time_end - time_outro) / (6 * 4 * 4), 0);

// end part
make_snowflakes(time_end, time_true_end, 500, 400, 300, 0, 0);
make_snowflakes(time_end, time_scorescreen, 100, 2000, 500, 0, 0);

edit: I made a second one for this map https://osu.ppy.sh/s/112781, source code is in the map's thread.
edit: and a third https://osu.ppy.sh/s/122718.
raisana
Although I never compose storyboards, this language looks like a good :)
Jafem
I am new to storyboarding but is it worth it to use this program or just do the storyboarding manually?
Kytoxid

Peekii wrote:

I am new to storyboarding but is it worth it to use this program or just do the storyboarding manually?
It's good if you want to make effects that would require a lot of effort/coordination manually, like the snow particle effects in the OP. If you want just want to SB some lyrics or an image slideshow, manually will probably be more efficient.
ErunamoJAZZ

Peekii wrote:

I am new to storyboarding but is it worth it to use this program or just do the storyboarding manually?
lol, This is for "effects factory"( http://en.wikipedia.org/wiki/Factory_%2 ... concept%29 ). If you have not learned to do Storybards not understand what you're doing.
Learn first (using the editor), and if you ever need to do many effects together, use the SGL.
- Marco -
This is f****g awesome!
Hellgert
SGL take a long time to open,pls fix
DJNightmare
How do you add hitsound triggers? and how do add the Additive Blend Mode into the animation?
Deimos
Does anybody know, why I am unable the commands like ".flipH", ".flipV" or ".additive" in SGL Tool (Beta 1.1.002) ?
Do I have to update something?

Thanks for answers.
Damnae

Deimos wrote:

Does anybody know, why I am unable the commands like ".flipH", ".flipV" or ".additive" in SGL Tool (Beta 1.1.002) ?
Do I have to update something?

Thanks for answers.
These are in the source code but aren't available in the current downloadable version.
I've build a more recent version: http://puu.sh/8bmSK.zip, sources are here: https://github.com/Damnae/osu-sgl
Vathlauss
Neat!
Deimos

Damnae wrote:

Deimos wrote:

Does anybody know, why I am unable the commands like ".flipH", ".flipV" or ".additive" in SGL Tool (Beta 1.1.002) ?
Do I have to update something?

Thanks for answers.
These are in the source code but aren't available in the current downloadable version.
I've build a more recent version: http://puu.sh/8bmSK.zip, sources are here: https://github.com/Damnae/osu-sgl

Thank you very much.

But how I see, it's currently not possible to create some simply 3D-Rotation, I am right?
Damnae
You can do simple things that would look like 3d, but you can't load a 3d model using the sgl language yet.
And by simple I don't mean it would be simple to do, but that it would be simple shapes like a sphere or something.
ErunamoJAZZ
I think that SGL is not a good approach to a real and powerful scripting system.
SGL is good for simple users, who do not know much programming. But it is very restrictive.
I think it might be more helpful, write a library in any language that is easy, and general purpose. Thus, there would be no need to worry about a language compiler, only for the functionality to transform objects (Spliters or animations) to the language of SB.

Python or Ruby could be good candidates.
Damnae

ErunamoJAZZ wrote:

I think that SGL is not a good approach to a real and powerful scripting system.
SGL is good for simple users, who do not know much programming. But it is very restrictive.
I think it might be more helpful, write a library in any language that is easy, and general purpose. Thus, there would be no need to worry about a language compiler, only for the functionality to transform objects (Spliters or animations) to the language of SB.

Python or Ruby could be good candidates.
SGL is still programming. It's useful to get started if you don't want to install visual studio or something like that.
That "library" exists, it's the modified version of sgl I use to make storyboard in c#: https://github.com/Damnae/osu-sgl
ErunamoJAZZ

Damnae wrote:

SGL is still programming. It's useful to get started if you don't want to install visual studio or something like that.
That "library" exists, it's the modified version of sgl I use to make storyboard in c#: https://github.com/Damnae/osu-sgl
Of course. C# can be used, like you've done, and it's not a bad way.
Although my point is that: C# is not a scripting language.

This is something I thought since I made a simple SB with SGL long time ago (in this thread).
C# is an excellent object-oriented language, but it requires a whole development environment. However, a scripting language can be lighter, in the sense that it is powerful, without too many configurations.
From the day you did the epic SB in jonathan's mapset, I've been thinking to write a prototype for personal use, although I have not had the time (I've had a lot of work).
but anyway ... someday, maybe xD
Secretpipe
Looks difficult :c But I want learn
DingGGu
How to Make Midi Fighter for Osu-StoryBoard with SGL Tool easliy? (http://youtu.be/46QX2hTGwPs?t=44s)

anyone has good&nice idea?

i already have image source (i made it)
ErunamoJAZZ
this will be easy with a array or matrix var type... but sgl have not this type.
btw... you can see oficial colors in "Arcade Button LEDs" section: http://www.djtechtools.com/downloads/do ... RAKTOR.pdf

EDIT> Not have the array or matrix types, does not mean it is not possible, just you have to write more.
DJNightmare


Well, I did it...

This was caused by the creation of this
ErunamoJAZZ
code?
DJNightmare

ErunamoJAZZ wrote:

code?
Gone ;u;

Did not save QAQ
Topic Starter
MoonShade
Seeing that I don't do much about that project anymore but that there are people interested in new features, I encourage others to add missing features. I'm hereby providing some information that should help getting into the development:
  1. In order to understand how SGL works and modify the language to your needs, please read the following articles: [Link] - they use Java, but doing it in C# is really not that different. It will cover the base techniques I used to create the language and explain what Antlr is and what it does. There is also an example on how to add array support.
  2. Use Antlr Version 3.1.3 together with AntlrWorks 1.4 in order to compile antlr files. This is the latest version that supports the c#/.net 2.0 target, at least to my knowledge. You are also going to need the CSharp2 runtime for antlr.
  3. Here are two files which you're going to need in order to modify the language and generate the Parser and the TreeWalker in C# with the help of Antlr: [Link]
Xgor
The site is down :< It's much harder to work with it w/o seeing the docomentation
pandorawindy
why i cant open the user manual page .. wht is it ? Teach me how to use the SGL code ? and plz give me enable link..thx
Topic Starter
MoonShade
Sorry, I'll be looking into it ASAP.

As a temporary solution, please download this archive, in it you'll find the saved HTML pages from the user manual: http://puu.sh/bIZnK/7ffbd31258.rar
pandorawindy

MoonShade wrote:

Sorry, I'll be looking into it ASAP.

As a temporary solution, please download this archive, in it you'll find the saved HTML pages from the user manual: http://puu.sh/bIZnK/7ffbd31258.rar
thank you ! :)
YielShelion

MoonShade wrote:

Sorry, I'll be looking into it ASAP.

As a temporary solution, please download this archive, in it you'll find the saved HTML pages from the user manual: http://puu.sh/bIZnK/7ffbd31258.rar
Thanks a lot :3

Anyway can I have full class description such as : sprite.move(startTime, startTime + 3000, x, -50, x, 500)
like move, fade, scale, vector, flip, additive, because the website is down.

*EDIT*

The page "SGL Manual - 05 Create Own Functions.htm" is same as "SGL Manual - 06 Class Sprite Animation.htm" in the HTML user manual puush-ed by MoonShade.
Seems like the 6th pages is missing.
rhalp10
Nice !
Howl
Since the OP download links seem to not work, http://a.pomf.se/vifvtg.rar (the archive should have in it all the DLLs needed, in case it doesn't work tell me!)
Damnae
Or you can get an updated version there: https://github.com/Damnae/osu-sgl/releases
arviejhay
i will download this if i learn how to code lel
- Marco -
can someone reupload the user manual? ;w;
troke

marcostudios wrote:

can someone reupload the user manual? ;w;
here

MoonShade wrote:

Sorry, I'll be looking into it ASAP.

As a temporary solution, please download this archive, in it you'll find the saved HTML pages from the user manual: http://puu.sh/bIZnK/7ffbd31258.rar
show more
Please sign in to reply.

New reply