Game Development Community

dev|Pro Game Development Curriculum

New project ,Voxel Terrain , life and Twitch.TV

by Bill Vee · 10/22/2013 (6:08 pm) · 8 comments

I took a little time off from a lot of things for a while and now I think I can start working on game programming again.
While I was off I started watching a lot of TwitchTV and found it very relaxing.
As I was surfing the Twitch site for something to watch I stumbled across there SDK to integrate broadcasting directly into a game engine.
After about a week of messing around with the SDK I got it to work with T3D.
You can see some in-game broadcasts I made from withing the T3D engine Here.

I decided to prototype a game mechanic that I think will be pretty fun to play.
It basically is vehicle only type play using my custom destructible Voxel terrain.
I am very early in the prototyping but it is coming along.
Recent Broadcast

I will likely broadcast more on Twitch as I develop the game features.

#1
10/23/2013 (3:56 am)
So you got Twitch to auto record within T3D? like Fraps etc.?

That could be pretty useful.
#2
10/23/2013 (4:27 am)
Super cool! Can't wait to see more of this.
#3
10/23/2013 (6:34 am)
@David - Not like Fraps , more like Xsplit. I capture frames and send them directly to TwitchTV for rebroadcast. Fraps captures frames and saves it to your hard disk. Also Fraps tends to decrease your FPS while it is recording, due to a quirk of the way I capture frames the FPS appear to increase. They actually stay pretty much the same but T3D adjusts the main process tick because it expects any capturing of the backbuffer to incur a performance cost. Not so much the actual capture of the backbuffer that can cause a FPS drop as what you do with it. In most cases in T3D this involves saving the captured frame to disk which I don't do.
#4
10/23/2013 (12:06 pm)
Never heard of TwitchTV until now, thanks for bringing me something new. Good luck with project!
#5
10/25/2013 (3:36 am)
ok, so TwitchTV records it on the fly? or am I totally getting this wrong Lol
#6
10/25/2013 (4:12 am)
@David- Yes it records on the fly but thats not Twitch's primary role.
Twitch rebroadcasts your video stream in near realtime to anyone wanting to view what you are doing. Twitch is almost exclusively video game related streaming. Twitch also has the ability to side load your stream to Youtube after you have finished streaming.

#7
10/27/2013 (7:40 am)
@Bill Vee, soo can you modify the recording code to save to disk as well?
The video recording currently in T3D takes up a lot of resources.
#8
10/28/2013 (7:29 am)
@Lukas - Unfortunately no or more accurately not by me . The way the built in video capture works needs a code review. I think there is a logic failure built into the system. The reason the theora encoder appears to chug when you record is it adjusts the main tick time based off of how fast the frames are being encoded. This is why when you record using the theora encoder it appears you are getting a horrible frame rate but when you playback the captured video it appears to run at normal speed. What it is doing is making the encoder lossless on the frames, which means that if you set it to capture 20 frames per second it will adjust the tickrate to ensure that 20 frames of "game time" is recorded every "in game" second. The fact the theora encoder can be threaded helps very little when the main thread is adjusting itself to accommodate the encoder thread.

There are 3 things that cause the theora encoder to be slow.
1 The actual encoding that compresses the images.
2 The fact that your saving it to the hard drive.
3 The encoder is frame lossless and effects the main tick rate.

1 is not as bad as 2.
The hard drive runs at a snails pace compared to everything else.

3 is the big hangup, the encoder is going to get its 20 frames per in-game second regardless of the impact on your frame rate.

The reason that my Twitch encoder has a minimal impact on the system is it avoids all 3 of the above problems.
1 the Twitch encoder still has to compress the image but it doesn't tell the main tick to slow down while it is doing that.

2 I am not accessing the hardrive as part of the encoding process.
The slowest piece of hardware involved is the network connection.

3 The Twitch encoder is lossy by nature. Meaning if I send it to many frames a second it simple starts dropping frames from the encoder buffer.