Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Theora as entity  (Read 3882 times)

0 Members and 1 Guest are viewing this topic.

Shagma

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 27
    • View Profile
Theora as entity
« on: January 14, 2009, 01:49:18 AM »

Hi! I have a question which I hope you can answer...
I still don't get the usage of theora videos as entities. I'm still a noob in the scripting language, so a very small tutorial on this would be really nice, specially since I couldn't find any in the forums or in the WME documentation.
to make it less than a tutorial, what I want to do is to have two background videos in a scene, one for the intro of the room (a prerendered camera movement of a 3d scenario), and then one that is looping forever, which goes right after the camera movement is done (so there's only one starting camera movement and then the place has only movement inside, and the actor can come in without worring about perspective)
I know I should probably use a fullscreen video of the intro with the "play.theora" method, and then the looping video as an entity. But is it possible that the transition looks smooth and unoticeable?
I know how to do the play.theora method, but i still don't get how to use a theora video as an entity script-wise. Could someone be so kind to show me how in a script? Like an example of what you gotta do to make an entity a looping theora video after a full screen video?

thank you, thank you, thank you
I promise my game won't dissapoint, it's looking really good :D
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Theora as entity
« Reply #1 on: January 14, 2009, 09:43:44 AM »

I suggest to first follow the small tutorial of wme docs and then read the online wme book by metamorphium to get a good idea of how wme works and then try more complex things. This will surely save you a lot of time and frustration, believe me ;)

Anyway, to answer you question, after you have placed an entity in SceneEdit you can use code that looks like this:

var MyLovelyEntity = Scene.LoadEntity("EntityName"); //this loads the entity to a var
MyLovelyEntity.PlayTheora(VideoName, Looping, AlphaImage); //this uses the entity to play a vide
Logged
fl*p

Shagma

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 27
    • View Profile
Re: Theora as entity
« Reply #2 on: January 14, 2009, 06:10:18 PM »

thank you man. I guess I'll have to do some serious reading :(
Logged

Shagma

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 27
    • View Profile
Re: Theora as entity
« Reply #3 on: January 15, 2009, 07:30:30 AM »

Well  I did some serious reading xD and now I got another problem. As I suspected, the transition from fullscreen theora to entity theora is not unnoticeable like it is in blade runner transitions. After the fullscreen theora there is two or three black frames til the scene comes with the background-entity theora. I was wondering if there is a way to fix this... it's rather small, but I really need a smooth transition. The thing is that my backgrounds are highly animated and very high quality (they are all prerendered in 3d, with particles, moving lights and stuff) so I can't really do a static background with a few sprites, cause all is moving, specially the lights... I really want to make the transition smooth... Is there a way? here's my code:

Code: WME Script
  1. Game.PlayTheora("scenes\room\cavernaintroLQ.ogg",false);
  2.  
  3. var video = Scene.GetNode("background");
  4. video.PlayTheora("scenes\room\cavernaloopLQ.ogg",true);
  5.  

As a side note... I'm a bit dissapointed of the theora quality... If I make a video with maximum bitrate at 1024x768 it doesn't play totally smooth (even in fullscreen theora) and quality is not perfect . As I lower the bitrate smoothness gets better but quality goes down and down. As i said there is lots of light movement... so compression is quite noticable, specially in dark areas. Weird thing is that windows media player plays high resolution Theora videos with maximum bitrate smoothly. Any advice here? Why does wintermute play theora videos slower than windows media player? (this happens both in windowed mode and fullscreen, even though in windowed mode I get about 2000 fps and fullscreen is 60)

Thank you.
« Last Edit: January 15, 2009, 08:47:20 AM by Jyujinkai »
Logged

Shagma

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 27
    • View Profile
Re: Theora as entity
« Reply #4 on: January 15, 2009, 07:36:41 AM »

I'm sorry about the theora quality thing. I forgot to tweak further in the ffdshow thing, I was just using maximum bitrate in the VLC converter.

Still, the fact tha WMplayer plays these videos smoothly and in wintermute it's kinda frameskipped puzzles me.
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Theora as entity
« Reply #5 on: January 15, 2009, 09:31:01 AM »

Quote
The thing is that my backgrounds are highly animated and very high quality (they are all prerendered in 3d, with particles, moving lights and stuff) so I can't really do a static background with a few sprites, cause all is moving, specially the lights... I really want to make the transition smooth... Is there a way?

Play the first fullscreen video as a video entity and not with Game.PlayTheora();
« Last Edit: January 15, 2009, 09:36:53 AM by odnorf »
Logged
fl*p
 

Page created in 0.021 seconds with 24 queries.