• My next project: Randomly Generated TV
    19 replies, posted
After finishing my [URL="https://play.google.com/store/apps/details?id=com.berkin.moistbanana&hl=en"]random story generator[/URL], I started thinking of more ambitious projects and my focus fell upon generating visual media (within reason). I like to randomly generate things that are hilariously nonsensical, but have some kind of structure. I want to expand upon this some more. So, here is my next idea: Randomized TV shows. Here is how I would do this: 1. Load a list of outlines. Outlines describe scenes (shows/commercials/etc). Each outline points to scripts and templates into which a random number generator fills empty slots with random events, dialogue, and miscellaneous environmental factors. 2. Randomly pick an outline and load its assets. An entry point would be defined in a "root" script for that outline that gives the generator a starting point for randomizing the scene. 3. From the root script, create a basic 3D scene. Fill it with randomized props that follow a basic set of rules (filter props to certain themes, i.e. strip club, hospital, bomb shelter...) 4. Create a set of characters and generate "state objects" for each of them. The state objects will describe the traits and conditions of each person, which can be used to influence behavior to a degree. 5. Generate a steady stream of randomized events and dialogue using a set of patterns. The number of events per scene should also be random, and this will determine how long the scene is. 6. Display the scene to the user and use a TTS engine to generate speech. 7. Upon scene transition, repeat from step 2. All this time, the screen will display the progressing scenes to the user. But to make it more interesting, I have also taken time synchronization into consideration. After all, if I'm generating TV shows, everyone should get the same channels! To seed the generator, I would take a fixed point in time (let's say January 1, 1970) and subtract this from the user's current time rounded to the nearest hour or so. (This will insure that each time zone is separate). I would then take the difference in milliseconds and seed the generator with it, resulting in the same output for users watching in the same time zone, assuming they have their clocks set correctly. I understand I would be utilizing a lot of prefabricated sounds/art assets for the scenes, but some of these can be randomized to a certain degree. Music could be randomized completely, as this would make it sound insane to match the shows. Visuals could be randomly scaled, rotated, and otherwise distorted in bizarre ways. Sound effects could have pitch variances and some could be backwards. The more random, the better. Okay, so that's a lot of stuff I have to do. But I think it would be rewarding and highly entertaining to see the end result. I am highly interested in turning this into a community project, so I'm posting this with the following questions for you guys: • What features would you like to see in this program? • Which aspects of the generator should I focus most on to make it as entertaining as possible? • Would anybody like to contribute graphical/audio assets? Everyone who does will be listed in the program's credits. (I could also incorporate these into "credits" on the randomized shows...) Also, please let me know if you would like to help with the actual code. I would love to get as much talent as possible involved with the project's development. [IMG]http://i.imgur.com/QUdI0Nb.png[/IMG] [B][URL="https://github.com/TheBerkin/RNGTV"]Follow the project on GitHub[/URL][/B] [B][URL="http://berkin.svbtle.com/"]RNGTV Development Blog[/URL][/B]
Sorta like 'The Movies'?
[QUOTE=supersnail11;43589533]Sorta like 'The Movies'?[/QUOTE] Except you have no control over what happens. It's all automated.
Oh man this is a brilliant idea, I can't wait to see where it goes I think if you broke down common genres into the core elements (sitcoms, police procedurals, etc.) and guided the events along those it would be much better than plain randomness Most of the real shows are just wacky situations thrown onto a framework anyways
[QUOTE=ZenX2;43590370]Oh man this is a brilliant idea, I can't wait to see where it goes I think if you broke down common genres into the core elements (sitcoms, police procedurals, etc.) and guided the events along those it would be much better than plain randomness Most of the real shows are just wacky situations thrown onto a framework anyways[/QUOTE] That is precisely the plan >:) [editline]19th January 2014[/editline] Made a simple logo. [IMG]http://i.imgur.com/QUdI0Nb.png[/IMG] I might get a start on a GUI tomorrow. I'm most likely using DX9 for the scene rendering in the prototype.
Amazing idea. I really love the time-based random seed to synchronize the shows. An idea would be to silently simulate certain times in advance and track the events as text to generate a program guide of some sort.
[QUOTE=Berkin;43590515]That is precisely the plan >:) [editline]19th January 2014[/editline] Made a simple logo. [IMG]http://i.imgur.com/QUdI0Nb.png[/IMG] I might get a start on a GUI tomorrow. I'm most likely using DX9 for the scene rendering in the prototype.[/QUOTE] You considered using OpenGL (OpenTK) or MonoGame, using DX makes supporting anything other than Windows hard.
[QUOTE=ben1066;43594488]You considered using OpenGL (OpenTK) or MonoGame, using DX makes supporting anything other than Windows hard.[/QUOTE] You do have a point, though I have barely touched OpenTK or OpenGL in general before. The main reason for that is that I find it a lot more confusing to work with than DirectX. However, I would like to be able to make this a multi-platform app, so I will look into it for everyone's benefit. [editline]19th January 2014[/editline] [QUOTE=Dienes;43592057]Amazing idea. I really love the time-based random seed to synchronize the shows. An idea would be to silently simulate certain times in advance and track the events as text to generate a program guide of some sort.[/QUOTE] I thought about that, too. What I could do is sample time by larger intervals (months, years) and use those numbers to seed a hierarchy of RNG's from which it will be possible to make multiple episodes of the same show.
[QUOTE=Berkin;43595461]You do have a point, though I have barely touched OpenTK or OpenGL in general before. The main reason for that is that I find it a lot more confusing to work with than DirectX. However, I would like to be able to make this a multi-platform app, so I will look into it for everyone's benefit.[/QUOTE] [URL="http://duriansoftware.com/joe/An-intro-to-modern-OpenGL.-Chapter-1:-The-Graphics-Pipeline.html"]Read this[/URL] :) [QUOTE=Berkin;43595461]I thought about that, too. What I could do is sample time by larger intervals (months, years) and use those numbers to seed a hierarchy of RNG's from which it will be possible to make multiple episodes of the same show.[/QUOTE] A neat way to do this: • Take the week or whatever and hash it in some way. Possibly jam the current hour % number of hours in a week in as well, to decide on the show (so shows recur every week). Use it to seed a PRNG. • Use the RNG to generate broad things, such as title, genre (show framework e.g. quiz show, horror movie), cast, stylistic things such as colour palette. • Suppose today is the nth week of the quarter, week of the month or something, take n numbers out of the RNG. Keep the nth, hash it, and use it to reseed the RNG. • Use this new episode-specific seed to generate the details of the episode, like the actual plot, the dialogue or exactly what people are wearing. That way it's completely deterministic with respect to time, shows have a regular recurring schedule, and episodes of a show are thematically similar. To generate a programme guide you just have to pretend that it's now some time in the future, then generate the first seed (the show seed) and use that to generate the title. Or something.
Yes, this is exactly what I had in mind! I think I'll make the shows change on a yearly basis, and use the current year to seed each set of shows. I could even go as far as making each show have its own "summary" and each episode have its own "synopsis". I'm currently running into a couple of other design problems, though: • TTS engines are hard to find for .NET. I want something that isn't restricted to just "Microsoft Anna", and something I can easily change the pitch and gender of between characters. eSpeak looks like what I need, but it has no existing .NET wrapper, and I can't seem to find the library DLL for it anywhere. • Controlling character movement and physical interaction could be difficult. I need to design a good way to automate this without sacrificing too much diversity in behavior. What would be the best approach to this?
This may be a bit far out, but have you considered using [URL="http://unity3d.com/pages/create-games?gclid=CPTsw-aZi7wCFZLKtAodGSAAyA"]Unity[/URL]? That will take most of the rendering out of your hands, and it's already massively cross platform. It will also ease up your content pipeline (getting models and textures into your app). The built in character controllers should make it super easy for you to add scripted movement and things. You can download eSpeak from this page: [URL="http://espeak.sourceforge.net/download.html"](click on eSpeak for Windows)[/URL].
[QUOTE=r0b0tsquid;43596877]This may be a bit far out, but have you considered using [url=http://unity3d.com/pages/create-games?gclid=CPTsw-aZi7wCFZLKtAodGSAAyA]Unity[/url]? That will take most of the rendering out of your hands, and it's already massively cross platform. It will also ease up your content pipeline (getting models and textures into your app). The built in character controllers should make it super easy for you to add scripted movement and things. You can download eSpeak from this page: [url=http://espeak.sourceforge.net/download.html](click on eSpeak for Windows)[/url].[/QUOTE] Unity was something I considered, and admittedly I am pretty drawn to its C# support and scene editor. It would enable me to embed the app into webpages too, which would be awesome. The idea of learning an entirely new framework is a bit daunting, though. I have been working with Visual Studio and WinForms for many years, so it's a medium I am more comfortable using. About the eSpeak download: I already tried it and it doesn't include libespeak.dll, which is the library I need to interface with the engine from my code. I googled it, but all I found were those shady DLL download sites. I am obviously missing something here.
You'll probably have to build it from source then...
I'm checking out the SteamTTS source code. It uses a library called FonixTalk that has all the functions I need. I'll try setting up all the P/Invoke stuff and see how it goes. [editline]20th January 2014[/editline] I can't seem to get it working correctly. I keep getting an "unbalanced stack" error.
Why not use [URL="http://facepunch.com/showthread.php?t=1323522&highlight=DECTalk"]DECTalk[/URL] instead?
[QUOTE=Berkin;43597245]Unity was something I considered, and admittedly I am pretty drawn to its C# support and scene editor. It would enable me to embed the app into webpages too, which would be awesome. The idea of learning an entirely new framework is a bit daunting, though. I have been working with Visual Studio and WinForms for many years, so it's a medium I am more comfortable using.[/QUOTE] Unity is very easy to pick up. I managed to pick up and use Unity for the very first time during a 48h game jam. I made a 3D car racing game.
[QUOTE=Vilusia;43603785]Why not use [URL="http://facepunch.com/showthread.php?t=1323522&highlight=DECTalk"]DECTalk[/URL] instead?[/QUOTE] This is awesome, I can't find a library for its TTS engine, though.
I think I found the original SDK and docs! I'm going to try writing a wrapper for it. Edit: I did it.
I love you berkin, you are an amazing programmer
And 10 projects later you just discovered, that you have made "imagination" module for AI.
Sorry, you need to Log In to post a reply to this thread.