Idea: IrrCutscene (editor, scripts, and player class)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
Josh1billion
Posts: 125
Joined: Thu Dec 11, 2008 9:50 pm
Location: Wisconsin
Contact:

Idea: IrrCutscene (editor, scripts, and player class)

Post by Josh1billion »

Hey guys,

Here's an idea I have for a simple interface for creating and playing cutscenes. I'm already fairly sure I'm going to create this for my current project, but I'm curious to gauge how interested anyone else might be in using it if I were to release it publicly. If there's any interest, I'll be willing to release it open-source as well (which would be my first open-source project in over half a decade, woohoo 8)).

The goal is a simple but flexible way of quickly and easily creating cutscenes, and then being able to load and play them in any Irrlicht game with ease.

Components
IrrCutscene would be comprised of three parts, shown in this diagram:

Image

IrrCutscene Editor: an application that provides a visual interface for creating .cut scripts. Ideally, it will also allow you to "play" those scripts from within the application so that you can preview your cutscenes without having to run your actual game to test them out.

.cut files: the script files generated by the IrrCutscene Editor. These are text files, not binary, so you can open them up and edit them by hand if you want (and then even re-load them into the editor with no problems if you desire to do so).

IrrCutscenePlayer: a class that you copy into your game project. The code you use in your game to load a cutscene would be something like this:

Code: Select all

// the "start cutscene" code.  place this whenever you want the cutscene to initialize
IrrCutscenePlayer * cutscene = new IrrCutscenePlayer("mycutscene.cut", sceneManager);
cutscene->startPlaying();

// the "tick" code.  place this wherever your game logic goes
cutscene->tick(delta);
if (!cutscene->playing()) { // cutscene is over, so let your game know to load the next level or whatever }
Functionalities
The cutscene scripts will have a variety of functions available to them, and given the open-source nature of the IrrCutscenePlayer class, you'll be able to (fairly easily) add new functions if you wish.

The premade functions will be divided into five different components (maybe more):
- camera : controls the camera's position and target
- nodes : add/remove scene nodes, set their positions/animations/rotations, tell them to move to a point, etc.
- sound : play sound or music, optionally linked to a 3D position
- delay : delay the script from progressing to the next action until: specific time (ex: 3.5 seconds), node stops moving, camera stops moving, key is pressed, etc.
- message : something that not everyone will use. This will be for displaying RPG-like dialogue boxes (example).
www.JoshForde.com

Latest release: Super Orbulite World.
In development: Season of Dreams and others
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Nice Idea! I was thinking of something very similar... I'm too limited right now to implement anything until I learn how to code properly in C++. That something I really would like to integrate inside a game editor.

Would be nice to have a timeline, so that you could position in time exactly the elements...
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

I think it may turn much more complicated than you may be planning at first. I`ll need to work on sth similar myself, hanging from ages in my todo list, but still have tons of other, more important work to do. Anyway, it`ll be interesting to see what you`ll came up with. :wink:
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

Looks awesome! Hang on in!!!
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

When I was on the 'murmur' competition which was about doing a demo with no user input, I made a script for 3Dsmax which export the current scene camera animation to a file. Then with a class you could load and play the camera animation, but it was pretty simple. However if someone is interested I can share this script/class.
Also I think it should be easier to use a scripting library like Lua or gameMonkey to handle what you want to do if you start to do advanced stuff.
Bate
Posts: 364
Joined: Sun Nov 01, 2009 11:39 pm
Location: Germany

Post by Bate »

stefbuet wrote:However if someone is interested I can share this script/class.
I would very much like to have a look. :)
Never take advice from someone who likes to give advice, so take my advice and don't take it.
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

I too... but probably not now... when i get sober aganin :D
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

Bate wrote:I would very much like to have a look. :)
Me too please... :P
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
grumpymonkey
Posts: 222
Joined: Mon Jan 19, 2009 10:03 pm
Location: Miami, Florida
Contact:

Post by grumpymonkey »

I was thinking of making something like this, but I ran into a problem....I couldn't think of an appropriate way to save the information :(
- Do I just record node positions and frame numbers?
- Do I record node and joint positions?
- Do I record primitives such as paths and waypoints for movement?
- Do I prerender the scene and create methods for showing the video file?

Although my project was a failure it did cause me to make an awesome clock/timing class. Lets me create multiple timers, constant beepers, counters and use units such as miliseconds, seconds, minutes, hours. If you want I can let you see the source.

but If you can pull it off I would definitely use it :)

on another note, I noticed that the file size could grow exponentially depending on the length of your scene...Its not such a big deal but it could get annoying sometimes.
Image
fmx

Post by fmx »

grumpymonkey wrote: - Do I just record node positions and frame numbers?
- Do I record node and joint positions?
- Do I record primitives such as paths and waypoints for movement?
- Do I prerender the scene and create methods for showing the video file?
There is no need to go too low-level with it, all the information could easily be saved to an XML style format.

All that needs to be saved is Node positions, rotations and scales at specific timepoints, alongside arbitary parameters specific to that node (for camera node it would be position and target, for animating node it would be frame loop ranges, for particles it would the emitter properties, etc)

Its more of a high-level scripting system than anything else

I wouldn't use it personally though (just as I dont use the .IRR format, ascii makes for bloated files) but it would be very useful in the long run to have some kind of default cutscene/scripting framework in irrlicht
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

:evil: I've looked everywhere I think I've lost my sources :evil:
The only way to get it back is to ask thespecial1 however he's not anymore using Irrlicht cuz he switched to Ogre so... :cry: However I'll continue searching.
Josh1billion
Posts: 125
Joined: Thu Dec 11, 2008 9:50 pm
Location: Wisconsin
Contact:

Post by Josh1billion »

Thanks for the input, everyone. I don't think I'll start on it right away (I have plenty of other stuff I need to do before then), but I'll let you know when I do.
www.JoshForde.com

Latest release: Super Orbulite World.
In development: Season of Dreams and others
Brainsaw
Posts: 1241
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

I have something similar added to the IrrOde wrapper. Well ... it's not a cutscene thing, but it could be advanced to that. It's a recording function, although it's really brute force. It saves the position of every moved node every simulation step. Produces quite big replay files, but it works. You can check the IrrOdeCar demo of my wrapper. Hit "F2" during simulation to start recording and "F2" again to stop and save it, after that just launch the IrrOdeRePlayer application. It loads the replay file and starts playing it, there is a FPS camera included. I've been thinking about storing camera positions as well which would create cutscenes.
Image
Dustbin::Games on the web: https://www.dustbin-online.de/
grumpymonkey
Posts: 222
Joined: Mon Jan 19, 2009 10:03 pm
Location: Miami, Florida
Contact:

Post by grumpymonkey »

oh yeah and I was thinking of calling mine irrFlik cuz you know, movies..
Image
Post Reply