Not logged inGosu Forums
Forum back to Help Search Register Login
Up Topic Gosu / Gosu Exchange / Playing some sort of cutscene in games
- - By chase4926 Date 2012-08-17 01:44
Another competition is coming up (,
and this time I'm going to amp my game up a notch. I've a few ideas on
how to do some sort of hacky-custom-filetypey cutscenes, but how would
you guys go about this sort of thing?
Parent - By Maverick Date 2012-08-17 05:40
I'd leave most of the entity actions up to several functions:
define move(direction dir) { if(dir == LEFT) then x--; ... }
define jump(velocity v) { ... }

the same with GUI functions:
define promptTextBox(String message, int scrollSpeed) { ... }
define promotTextBoxQuestion(String message, String[] questions, int scrollSpeed) { .... }

Then use some form of executing those functions. An easier way (in the long run) would to create your own small form of scripting:
[Somewhere in cutscene1.txt]:
Player: Move LEFT > do 3 times
Player: Jump
Wait for Value < Player: GetIsStanding
GUI: Prompt "You're the chosen one!" 20

You'd have to register these values in your code like so:
ScriptHandler.registerCallback("Player", playerObject);
ScriptHandler.getCallback("Player").setCommand("Move", 1, Player.move); // where 1 is the amount of parameters.

Creating your own scripting could get complicated. It might be easier to use existing scripting languages like LUA.

It really depends how complex you want things.
Parent - - By Spooner Date 2012-08-17 15:22
For my cutscene in Zed and Ginger, I mostly used programmatic movement of the normal game objects, but I played all that movement and recorded the mouse position, each frame, for the movement of Zed as an energy cloud. Doing it that way made synchronising the complex movements significantly simpler.

Since you are using Ruby (or, at least, you have used Ruby in stuff before), you might have all the movement info in a YAML file, which you could read in and convert into actual movements of each sprite (just need to have move_x, move_y, angle, object_id, etc in the file in a big array of arrays).

Beyond that, you'd really need to know what you wanted to achieve before more advice could be forthcoming :)
Parent - - By chase4926 Date 2012-08-19 00:05
As far as using YAML goes, it's completely out of question. YAML load calls take a significant amount of time compared to Marshal load calls, since YAML is designed to be human-readable. No, I'd probably make a cutscene-maker type thing which saves the finished product into a array (frames) of hashes (pixel points => color). Working on this now actually.
Parent - By Spooner Date 2012-08-19 00:12
YAML is only too slow if it is too slow for what you need it for. Most of the time it is plenty fast enough and the additional speed of Marshal is irrelevant. I agree that Marshal makes a great deal more sense if you are storing a significant amount of data in it, so it might be appropriate in this case; really depends how much info you are storing for your cut-scene.
Parent - - By Dahrkael Date 2012-08-19 09:29
so you are making a video codec? :D
Parent - By chase4926 Date 2012-08-20 00:12
I guess it could kinda be seen as that. :P
Parent - By Spooner Date 2012-08-20 00:43
I considered playing movies with Ashton, then realised that I'd need some way of playing them that is cross-platform. Not insurmountable, but then I realised I had no real capacity to create decent movies (that wouldn't be just as easily made in-game) so gave up as fast as the idea got into my head :D
Up Topic Gosu / Gosu Exchange / Playing some sort of cutscene in games

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill