Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (M_D), 1,430 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
Act! (In-engine cutscene player and editor) #328718
06/14/10 20:22
06/14/10 20:22
Joined: Jul 2008
Posts: 223
Pittsburgh
The_Clyde Offline OP
Member
The_Clyde  Offline OP
Member

Joined: Jul 2008
Posts: 223
Pittsburgh
Hey everybody!

I've been working on a way to include in-engine cutscenes in Gamestudio games. So far the only sort of video capability has been the use of space-consuming movie files (FMVs). With the tool I am developing you'll be able to create and play animation sequences that are rendered in A7 and read from text files containing animation information- which are much smaller than AVI's and the like.

PROJECT STATUS:
Currently I have just gotten the playback code working!
Next task will be to begin the scene editor...

HOW THIS WORKS:
The playback code loads a text file containing the animation information.
The cornerstone of this information is a data structure I call a "Cue", like those you'd follow if you were a stage actor.
Inside of a Cue is

  • A WED entity name
  • Start and end vectors for position
  • Start and end angles
  • Start and end vectors for scale
  • An animation name
  • The number of times the animation loops during the Cue
  • The duration of the Cue

When a Cue is started, it will interpolate the parameters of the specified entity over time, ending after the given duration.

In order to allow multiple objects to start moving at once, Cues are contained in Keyframes. A Keyframe contains an array of Cues, and the start time of the Cues contained within.

A scene consists of an ordered list of Keyframes. When the total time passed in the scene has passed the start time of the next Keyframe in the list, all of the Cues inside that Keyframe are added to the group of active Cues. The active Cues are processed every frame and each is deleted after its duration has completed.

HOW TO USE THIS:
Since I still have to make the editor I'll just explain the sample program, sample scene, scene file format, and how to try out the playback functions in our own project.

The included program "test1.c" is actually just a few lines to load the level, load the scene, and then start the scene.

The sample scene will show a blue space rocket (from my retro contest entry) and Supercat, the player character from one of my older projects.
The rocket will first glide across the screen while spinning and shrinking. Then it drops straight down a bit- and then moves away from the camera while growing a little.
At the same time, Supercat will run from one side of the screen to the other- and then punch the air.


-File Format-
The first piece of information in the file is the number of keyframes in the scene, followed by a new line, and then all of the Keyframes.
The first line of a Keyframe starts with the start time of the keyframe- in sixteenths of a second from the start of the scene. After this is the number (N) of Cues in the Keyframe.
The next N lines are each a Cue.
Separated by spaces, the information goes as follows.

  • Start X, Y, and Z
  • End X, Y, and Z
  • Start Pan, Tilt, and Roll
  • End Pan, Tilt, and Roll
  • Start scale_x, scale_y, and scale_z
  • End scale_x, scale_y, and scale_z
  • Name of animation to play, or "none"
  • Number of times animation is to be looped
  • Duration of the Cue

Note that this order matches the listing above.
Also if the start and end values for a vector are all the same, or all set to 0, that vector will not be affected by this Cue. You can use this to have different Cues each affecting a different parameter of the same object, potentially at different rates.

Finally- the very last two Keyframes indicate when the scene ends. The end time of the second to last will be the end time of the scene, because as soon as it's loaded the *final* cue will take effect, because it is indicated by having both its start time and number of cues set to 0.
----------

To use the playback functions in your own project, you would simply include "drama.c" at the top of your code.

The commands are as follows:

loadScene(String filename) --> loads the scene from the given file into memory

playScene() --> plays the scene in memory

pauseScene() --> pauses playback of the playing scene

unpauseScene() --> resumes playback of the paused scene



AND AT LAST THE DOWNLOAD LINK
--Feel free to check out the program, and code and stuff grin
http://ifile.it/iam3k62/Act.zip

Re: Act! (In-engine cutscene player and editor) [Re: The_Clyde] #328719
06/14/10 20:40
06/14/10 20:40
Joined: Oct 2008
Posts: 51
Germany
C
CetiLiteC Offline
Junior Member
CetiLiteC  Offline
Junior Member
C

Joined: Oct 2008
Posts: 51
Germany
It's interesting and working so far I think. I'm looking forward to the editor...

Re: Act! (In-engine cutscene player and editor) [Re: CetiLiteC] #328721
06/14/10 21:01
06/14/10 21:01
Joined: Mar 2006
Posts: 2,252
Hummel Offline
Expert
Hummel  Offline
Expert

Joined: Mar 2006
Posts: 2,252
Animation and movement speed are both fps dependend. Thats a prob I also have had when I tried creating cutscenes...

Re: Act! (In-engine cutscene player and editor) [Re: Hummel] #328722
06/14/10 21:25
06/14/10 21:25
Joined: Jul 2008
Posts: 223
Pittsburgh
The_Clyde Offline OP
Member
The_Clyde  Offline OP
Member

Joined: Jul 2008
Posts: 223
Pittsburgh
Thats why I based everything on the ticks you get from time_frame... instead of on frame number- so its a bit strange that that happens? confused

Could you describe the specific problem you've been having?

Re: Act! (In-engine cutscene player and editor) [Re: The_Clyde] #328733
06/14/10 22:11
06/14/10 22:11
Joined: Mar 2006
Posts: 2,252
Hummel Offline
Expert
Hummel  Offline
Expert

Joined: Mar 2006
Posts: 2,252
try to limit the fps to something low and compare the behaviour

Re: Act! (In-engine cutscene player and editor) [Re: Hummel] #328738
06/14/10 22:42
06/14/10 22:42
Joined: Jul 2008
Posts: 223
Pittsburgh
The_Clyde Offline OP
Member
The_Clyde  Offline OP
Member

Joined: Jul 2008
Posts: 223
Pittsburgh
Tried different framerates and found what you were talking about- I can resolve this simply enough, though. I probably won't post a new version until I make the editor and I'll make sure to cover this by then!

Re: Act! (In-engine cutscene player and editor) [Re: The_Clyde] #328783
06/15/10 09:44
06/15/10 09:44
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
this is a very cool idea... hope you finish it!


~"I never let school interfere with my education"~
-Mark Twain
Re: Act! (In-engine cutscene player and editor) [Re: Germanunkol] #329548
06/21/10 04:59
06/21/10 04:59
Joined: Jul 2008
Posts: 223
Pittsburgh
The_Clyde Offline OP
Member
The_Clyde  Offline OP
Member

Joined: Jul 2008
Posts: 223
Pittsburgh
editor is basically working, though i still gotta add a couple of things before i can feel ok about posting a version laugh
should be ready for alpha release today or tomorrow!

EDIT: those things have been added
It'll see ya in the morning! wink

Last edited by The_Clyde; 06/21/10 09:07.
Re: Act! (In-engine cutscene player and editor) [Re: The_Clyde] #329673
06/21/10 20:20
06/21/10 20:20
Joined: Jul 2008
Posts: 223
Pittsburgh
The_Clyde Offline OP
Member
The_Clyde  Offline OP
Member

Joined: Jul 2008
Posts: 223
Pittsburgh
Okay heres what I've got of the editor so far-

It is completely capable of producing a cutscene including model animations, sounds, and camera movement. The only thing is that loading an existing scene, modifying it, and then saving it can be a bit wonky at this time.

http://www.clydeshaffer.com/clydeshaffer/downloadables/Act.zip

How to use this:

Open editor.c in SED and run it.
In the first dialog box that appears you choose a level file in which to create your scene.
In the second dialog box you can open an existing scene or click cancel to start from scratch.

The controls are a little weird so far- so I'll work on straightening them out later.
To move objects around on the XY plane (relative to the camera) just left-click and drag. If you hold down shift you will instead move objects around on the camera-relative YZ plane.

Right-clicking and dragging on objects will rotate them on their Z-axis (PAN)
Holding down shift and ctrl would rotate tilt and roll respectively.

Middle-clicking on an object will allow you to enter an animation name and then with the mousewheel you can scroll through the animation.

On the bottom of the screen is the timeline, measured in sixteenths of a second.
You can use the "U" and "I" buttons to scroll back and forth in time. "O" and "P" will scroll your view of the timeline.

To create a keyframe press K while an object is selected. This will create a cue for that object starting at the current time with its position recorded. Then you can move the object around and animate as you like as described above- and set the endpoint of the animation on the timeline with the "U" and "I" buttons.

When you are done positioning your object and time, press the space bar to confirm the cue.

If you hit S- you can create a sound cue by entering the sound filename. This will cause that sound to be triggered when playback reaches the current time.

If you have an object in the level with the WED name "CAMERA" you can also control the camera in the cutscene. With the camera object selected you can create keyframes for it just as any other object- but during playback the camera will be attached to this object.
Pressing "C" while editing will snap the camera object to your current view position.


Yes these controls are terrible :| so I will definitely be working on adding panels and other GUI elements to make the process much easier!

Re: Act! (In-engine cutscene player and editor) [Re: The_Clyde] #329687
06/21/10 22:42
06/21/10 22:42
Joined: Jul 2008
Posts: 223
Pittsburgh
The_Clyde Offline OP
Member
The_Clyde  Offline OP
Member

Joined: Jul 2008
Posts: 223
Pittsburgh
As some proof this system works- heres a quick example of (sort of) game with an integrated cutscene!

http://www.clydeshaffer.com/clydeshaffer/downloadables/WhatISaMan.zip

---------
Act I:
In which Warlock and Palace Guard discuss what a man is, and Palace Guard forgets his line for a moment! laugh

Page 1 of 4 1 2 3 4

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1