ENIGMA Forums

General fluff => General ENIGMA => Topic started by: Goombert on April 01, 2014, 01:02:40 am

Title: Splash Functions
Post by: Goombert on April 01, 2014, 01:02:40 am
Well, I am at a point now where I could code in the splash functions in my free time, or I could just not do that, ever, at all, and leave them deprecated for ENIGMA. But why would I want to do this? Well for several reasons, but mainly.

1) YoYoGames designs functions very badly, that leave little room for abstraction.
2) The functions are basically just a salad of various API's, meaning it's not possible to build a game that for instance only uses splash_show_image without linking DirectShow, unless I move splash_show_video over into my DirectShow extension which is just messy including the splash settings variables all over the place, especially since some of the code has to go into the main Window handle callbacks
3) I have much better functions/implementations planned that are truly abstract, for instance, my already implemented video functions, and in future releases...
Code: (EDL) [Select]
surface_set_target(mysurface);
video_draw_frame(myvideo);
surface_reset_target();

Which we can also get running in OpenGL and on Linux, and *gasp* maybe even mobile! *crosses fingers*

Point is, I want to make a better, more powerful, and easy to learn and use design for video playback, HTML and webkit content, that I can not otherwise do by emulating YYG's shit. I don't even think many games used splash functions, because they were only existent in a single release of GM. Anyway, I want to hear you guys opinions on this.
Title: Re: Splash Functions
Post by: Darkstar2 on April 01, 2014, 02:00:21 am
lol - I guess you know in advance my take on YYG's laziness and stupidity, so that will save me at least 30 pages :P

Moving on, I like #3, if used properly one could make really interesting games / interactive games with cool
effects.

BTW, while the video is being rendered on a surface,
I assume its audio will also be played back right, (meaning audio/video) the same as the standard video playback right ?

I can't understand YYG, and their reasoning for removing said functions !  Many mobile games have cut scenes, video, etc. oh wait I do understand my bad, they are lazy as FUCK.  A function that competing software offers as a standard, basic function. Right :D

it's not such a bad thing that ENIGMA is not fully compatible with YoYoGames utter stupidity, providing
proper documentation is provided and examples, for the less advanced of us :D

Title: Re: Splash Functions
Post by: Goombert on April 01, 2014, 02:56:03 am
Quote from: Darkstar2
BTW, while the video is being rendered on a surface,
I assume its audio will also be played back right, (meaning audio/video) the same as the standard video playback right ?
Actually, yes and no, yes meaning you'll be able to control the videos audio streaming, yes as in I am making the function set powerful enough to not only allow you to render to surfaces and use them as textures but to also allow you to only use a few simple calls just to make a video, without having to render to a surface, thus the inclusion of video_play.
Some of the functions are already implemented and usable, I started adding them for TKG. The drag and drop actions also work, simply enable the DirectShow extension.
http://enigma-dev.org/docs/Wiki/Audio_and_Video_Functions

I'm also considering not doing the message_box functions, let me provide my reasons for that.

1) ENIGMA does not need to have a full-blown cross platform widget system, the users can do this themselves if REALLLLLY needed by hacking our widget system code, or they can make a Qt extension or wxWidgets extension, or w/e
2) I plan on gui_* functions that remove the need for draw_text for instance and will have most common controls for dialogs that can be easily styled and textured like Unity3D's.
3) I plan on overloading window functions to allow multiple window handling as well as window_create(), and *gasp* window_set_target

The purpose of window_set_target is of course to set the rendering target to another window you have created, this will allow you to custom render your dialogs easily, and then simply window_reset_target() to the main window.

You see the point is not to be lazy, just provide something much much better.
Title: Re: Splash Functions
Post by: time-killer-games on April 01, 2014, 04:11:52 am
Have you got this working on Linux yet? Or is that part still being worked on? Have you found a way to do this for Linux, but you just haven't implemented it fully yet? In any case I'm glad there's been some rapid progress on this! :D
Title: Re: Splash Functions
Post by: TheExDeus on April 01, 2014, 06:44:41 am
Quote
3) I have much better functions/implementations planned that are truly abstract, for instance, my already implemented video functions, and in future releases...
I like this a lot more. I have never used those splash functions in GM and I never will. But this would allow creating things a lot more useful.
But questions:
1) What API you plan to use for all of that?
2) If you use Windows API, how you plan to save it to GL texture? I guess it's possible, but might involve like 3 copies.. :(
3) Would this API allow loading from webcam? I use OpenCV daily in my work and I used it in my school as well where I used OpenCV to render to ENIGMA surface. I created a function called mat_get_texture() (or something to that) which changed OpenCV Mat class to GL texture. I am saying all this because OpenCV has a nice VideoCapture class where in the constructor you can input a filename to open a file (like .mpeg or something), you can input a link to open a stream (IP camera or anything else) or you can input a number and open a camera (web camera or any other camera connected to PC). I sadly don't know if anything like that is possible without OpenCV (because OpenCV IS BIG, it's like at least 3mb only for the main and video components). Just saying because inputting a webcam would really be fun in ENIGMA.

Quote
3) I plan on overloading window functions to allow multiple window handling as well as window_create(), and *gasp* window_set_target
They would be several GL windows? So you could render to all of them?
Title: Re: Splash Functions
Post by: Goombert on April 01, 2014, 11:12:56 am
Quote from: TKG
Have you got this working on Linux yet? Or is that part still being worked on? Have you found a way to do this for Linux, but you just haven't implemented it fully yet? In any case I'm glad there's been some rapid progress on this!
What working on Linux? Splash? No, this topic is about me not wanting to add them. If you meant video functions, no as I want to plan them out properly first and I need to get other things ready as well.

Quote from: ExDeus
1) What API you plan to use for all of that?
I didn't pick one for cross-platform, right now they only exist in DirectShow, and I haven't exactly worked out video_draw_frame() yet. I do know that playing it the default way in DirectShow is already hardware accelerated on Vista or later. I haven't looked into how you do it exactly yet. I may just give people a video_get_surface function, because DirectShow may actually just give you direct access to it's surface or it might not, I don't know.

Quote from: TheExDeus
Would this API allow loading from webcam?
I hadn't planned on it until you asked :P
But yes we can do that.
https://www.google.com/#q=webcam+directshow

Could OpenCV handle all of our Linux video stuff we need it to though?

Quote from: TheExDeus
They would be several GL windows? So you could render to all of them?
That's the idea yes, but with a window_get_main, only the main window will create its graphics context by default. After calling window_create you will also need to call window_create_graphics if you intend to render to the window. I haven't exactly thought out the implementation fully yet, but the purpose is basically to let you draw directly to the message window for custom dialogs instead of shitty message_box functions which limit how you use them. Also by not creating a graphics context by default on all newly created windows, will make it easier for developers who do want to create Win32 native widgets and the likes, or people who want to use GTK, etc.

This way the very least we can do is provide a properly abstract windowing system like SDL or Qt, etc.
Title: Re: Splash Functions
Post by: TheExDeus on April 01, 2014, 12:19:21 pm
Quote
Could OpenCV handle all of our Linux video stuff we need it to though?
It works on everything (also Android and IOS) and has basically the same interface in all of those places. But as I said, I am not sure how to implement it painlessly in ENIGMA, as OpenCV by default is extremely large. I originally had the idea of just making an OpenCV extension that came with compiled lib's for Windows and Linux, but if it was done that way, then we need to create an extension manager (web based or built-in LGM or whatever), because packing ENIGMA with all these functions that 1% of users will use is not a good idea. We need at least a page here on ENIGMA site with extensions and links to get them.
Title: Re: Splash Functions
Post by: time-killer-games on April 01, 2014, 03:12:52 pm
Quote
Could OpenCV handle all of our Linux video stuff we need it to though?
It works on everything (also Android and IOS) and has basically the same interface in all of those places. But as I said, I am not sure how to implement it painlessly in ENIGMA, as OpenCV by default is extremely large. I originally had the idea of just making an OpenCV extension that came with compiled lib's for Windows and Linux, but if it was done that way, then we need to create an extension manager (web based or built-in LGM or whatever), because packing ENIGMA with all these functions that 1% of users will use is not a good idea. We need at least a page here on ENIGMA site with extensions and links to get them.

You mean like an ENIGMA Extension, like what DirectShow is, or something different? I thought we didn't have to worry about our game exes getting bigger, because ENIGMA Extensions can be managed in LGM via the checkboxes in the ENIGMA settings window.

@Robert thanks for clearing that up :)
Title: Re: Splash Functions
Post by: TheExDeus on April 01, 2014, 04:19:19 pm
Quote
I thought we didn't have to worry about our game exes getting bigger, because ENIGMA Extensions can be managed in LGM via the checkboxes in the ENIGMA settings window.
That is true. But I meant ENIGMA itself getting bigger. The OpenCV2.4.6 I have on my PC now is 5.32mb in lib form (when checking the world lib - libopencv_world246.dll.a which is basically a superlib for easier distribution) and 23.2mb in dll's (which are required in my case because the libs are actually dynamic). I guess if you link to static libs then they would take about 20mb but require no dll's. This means ENIGMA's installation would grow like 30% just because of OpenCV.
And the .exe you compiled with ENIGMA with OpenCV extension enabled would also probably be like 25mb.
Title: Re: Splash Functions
Post by: Darkstar2 on April 01, 2014, 04:51:19 pm
Personally I don't mind ENIGMA being bigger, I mean most of us have big software on our computers, so a couple more MBs won't really harm :D

I think keeping compiled EXEs as small as possible is preferred, and is done quite well with ENIGMA.  With GameMakerStudio YYC even an empty project takes several MBs, how pathetic! :P

Of course 25MB+/- more for an EXE with OpenCV that can be significant for some, and its use would really have to be warranted, such as for big games that make good enough usage. 
Title: Re: Splash Functions
Post by: time-killer-games on April 01, 2014, 05:12:19 pm
@Harri: I don't mind enigma's size increasing, especially since that isn't that big IMHO but in the meantime, I wouldn't mind if you shared the extension separately. :) How stable is it ATM?