If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
I'm just throwing this out there for people that are better than me to tell me how bad it is.
Take batching by textures to the next level and batch again from a texture batch by lightstyle. So like faces in a texture batch that have no animated lights will be together and all the animated light faces from that same group will have their own batch.
The reason is a few fold
1) with all faces that do not have an animated lightstyle segregated I end up with a pool of "only animated" lightmaps and I don't have to consider the whole damn map every time I animate a light
2) those animated batches could be PVS'ed harder than the flat stuff and I could actually get rid of large chunks of batches that are not in view.
ex: floor_1 is visible in the leaf you are in so ALL of floor_1 is rendered, but floor_1 with animated light is not visible in this leaf so no animated floor_1's are rendered (gist)
SOMAFM has 30 streaming stations and I just added them all with (b)ack, (n)ext controls. There is still no UI and nothing to indicate which station you are listening to but all the stations work and skipping through them is very very clean. In other words hopping from one station to the next is virtually instant... like pressing a preset button on a regular radio.
I think I'm going to bite the bullet and put in full .pls support. That way someone could download or make a pls for whatever stations they want and simply dump it in the game folder... or maybe engine folder. As far as a UI goes. I think I am going to completely avoid it until I get to dealing with mobile devices. Pressing B or N to cycle stations works well and spacebar to stop/play is also convenient. The whole thing is wired to where, if you back, next or stop the entire stream (good, bad or ugly) is completely destroyed and a new stream is created so, it's basically impossible to have a fatal crash cause everything except play is a full reset.
I chose SOMAFM cause the music is "different" (ie not popular or radio) and there are absolutely no commercials. Not even a station identification. I actually miss the station identification though.
Musique Agent Sucret - SOMA FM (in a beautiful girl voice with a very thick french accent)
not "correct" though. Obviously I should start by split("Version=").pop(), learn something and then split on the rest of those keywords and any other keywords a specific version supports. The above script gets the job done fast and in any Version=2 case properly. I've downloaded like 200 pls's...they are all version 2 so....
Done. Drop any version 2 .pls file in playlists.zip and it gets added to the available stations. Currently, I have all 33 channels of SOMAFM as default but a user could delete/replace any/all of that with whatever stations they want.
The next step is to open up playlists from stuff like WMP. That way even your local music can be used as a station.
mouse+LMB:freelook
Left/Right: strafe left or right
Up/Down: move forward or backward
Spacebar: Play/Stop music - whichever one is the opposite of its current state
N: next station
B: previous station
e1m1 is hardcoded by filename into the engine so... you can't switch the map. Well, you can switch the map, just not in this port at this time. You also have no way of knowing what station you are listening to. There are 33 of them. It is absolutely possible for you to dump your own .pls in the playlist folder and have it added to the queue. You can get .pls files by going to shoutcast.com and clicking the download button (next to the play button) for the station you want.
pressing N or B a lot and fast ain't gonna break shit. Also, I know my sky is only the solid layer. For some reason my sky shader doesn't work in AS3 (which is nutty cause the shader language was written by adobe) so I disabled it. Apparently I am going to have to reconsider the shader entirely. The Haxe version works. This link is not to a haxe version.
almost ALL OF IT is a variation on the first station you hear. Some of it's slower, some of it is faster but, it's all the same shit (basically and with very little exception). I'm telling you this so you don't waste time looking for a rock or jazz or metal etc... station. If you want that go get a pls and ignore my default stations. You can delete any/all of the pls's. Just don't delete the playlists.zip and obviously, make sure you put your pls in the playlists.zip.
I got the idea for this when I realized I'm just one guy building an engine and a game. I am cheating and letting already established radio stations provide the soundtrack, instead of having to make all the music myself. Which is also why I need to parse WMP playlists. I'll give the user so many ways to get music that they'll forget I was supposed to make the music.
EDIT!
It's been brought to my attention that you can easily switch the map. Just go get a map, rename it e1m1.bsp and overwrite the e1m1.bsp in test.zip. Note that whereas my engine does properly parse BSP2 and 2PSB the current map limit constants are too low to let 2psb or bsp2 load. So, can you load a bsp2 or 2psb? Sure, as long as it falls within bsp29 limits...lol. So, you can load every bsp2 or 2psb that used the format for no good reason. :laughing: so like, none of them or so.
I made a really subtle notification that tells you what station you are on. If anybody is interested the link is below. Aside from the notification and me suppressing the stats window for this build, it is no different than the last link I posted.
For those that are curious about the notification but don't want to download stuff to check it out
when you hit space(as play), back or next - a little message like the one at the top of the image appears and immediately starts fading away. The data is simply the Title data from the pls. It's readable for less than 2 seconds.
agreed. this is my favorite thread at the moment. some real juicy shit here. I like seeing what you're doing with haXe. I know i said i would jump into haXe forever ago but real life won't slow the fuck down. pretty neat to see what someone else is doing with it for the time being.
I started this project in flash and I wrote the proof of concept code
I restarted this project in Haxe and wrote much better code based on the proof of concept code
I came back to flash to port my better haxe code over and in the process I added a shoutcast player, upgraded the content manager even more than the haxe way and "scribbled down" some other ideas in the code
This is currently flash.
EDIT: ooooh riiiight..but it's an .exe. Yeah, that's just AIR/Flash wrapped in an exe. It's still just flash. I do it like that so nobody has to install AIR to check out my thing. If it was haxe all that META/mime/Adobe AIR shit would be replaced with a couple .dlls
The next step, after I stop doing stuff in the flash version, is to go to haxe and upgrade that script to match the additions to the flash one. Then I'll make stuff happen in haxe and eventually go back to flash to port my changes on and on and on. It has to be like this or I will never finish. Haxe and flash are different enough to be the "other" language I'm doing something in. I've always tried to keep more than one language to work in. That was the only appeal web programming had for me html,css,php,sql,js there was always another language to do some work in. I even switched to hta just so jscript,bat,vbscript and a number of other languages could be used. When you spend the time to learn a shit load of languages it's nice to be able to use as many and whichever that you want.
Now, I know that Haxe makes flash ports and I know that often they even get better performance. I am an AS3 programmer (if I'm choosing my "default" language). I want my flash port to be written by me, not a compiler. Also, by going back and forth like this, stuff I messed up that I can't figure out in HaXe, I end up figuring out in AS3 and then I just port that back over to haxe. All this "port" talk is by hand. No scripts, macros, none of that.
I am however not finished porting the haxe version to AS3. My Haxe engine does a bunch of other stuff that my flash one doesn't do yet. Like replacement textures, working sky shader, normal maps...other stuff.
Oh BTW... I made my player class a completely independent package. It now handles all of it's business internally (ie KeyDown events, the info field, etc..) now you just put an instance on the stage and if there is any music to play, it'll play it. I also reworked the transition for the info field. It now changes from almost white to a bright red while it fades out. It is never shown as a bright red due to how much it has faded at that point but, it adds 1 more second to readable time. The transition (mostly) means that at some point before it fades, no matter what your background is, you will be able to read it. My transition is really smooth.
This is all it takes to add the entire shoutcast player to any project
Code:
//playlist
if (ImportManager.getPlsCount() > 0)
{ _ip = new Player(stage);
addChild(_ip.infoField)
}
"ImportManager" is just "ContentManager" renamed since I have ExportManager now, too.
@agreed. this is my favorite thread at the moment. some real juicy shit here
Thank you.
edit:
Windows Media Player playlists are gonna be a breeze to parse. It's xml. My content manager already uploads xml as an instance of xml. I just need to add .wpl to the extensions list and explain like 10 keywords.
It's a done deal. wpl files are now supported. The wpls that Windows Media Player creates need to be opened and have all paths changed to absolute full system paths but, other than that, local music is now supported. The same super simple info panel that gives station details, flashes the song title (actually the filename minus path and extension) when the songs change. My text in that image is at about half fade/transition. It turns a deep blood red and disappears.
I made the less-than and greater-than keys the previous/next buttons for wpl playlists. My stream player worked out the box for playing local mp3s. I didn't have to do anything but explain to the player the difference between a pls (one address and title to play) and an wpl (many addresses and titles to play). You can mix and match wpl and pls all day long in the playlists.zip.
I don't intend to post any more versions of my project for a while BUT, I had those 2 halfway done versions (playlist wise) hanging out so, I wanted to wipe them off the slate with a more complete version. All links have been changed to the one above.
WHat does this version actually do?
1) Listen to streaming radio via pls files. You can download these easily from shoutcast.com by clicking the download button which is next to the play button for the station you want.
2) Listen to your own local music via wpl files. You have to edit the file to have absolute full system paths. (ie ..\..\somefolder - is only true for WinMedPlayer you have to give my engine paths that are true) OR put my engine in the same directory as Windows Media Player o.O lol.
3) get a little fadey color transitioning notification of song/station as these things change. Blink and you miss it.
controls
N - next PLAYLIST
B - previous PLAYLIST
< - previous SONG (wpl only...obviously)
> - next SONG (wpl only)
SPACEBAR - stop/play
How do I change the map?
rename any bsp29 version map to "e1m1.bsp" and dump it in test.zip. Overwrite? yes.
How do I add playlists
dump any version 2 .pls or any .wpl in playlists.zip. ALL files found in playlist.zip are added to the queue. My player figures it all out.
Can I delete playlists?
Yes, but do not delete playlists.zip because I have not told my engine yet to not care if it isn't there
Are you going to make this better?
My engine? Of course. The player? probably not. I'm not trying to build a full featured media player. I just wanted my engine to have some music features beyond game audio. That's why I stuck all the controls on the keyboard. I also wanted to do something that I have never heard of in a quake engine. To my knowledge, quake engines dont do streaming audio or parse media player playlist files. And you have to ask yourself, why not? It was 100% of dead simple to get this working. A trip through the mpeg layer 3 specs and a couple of 5 or 6 line parsers to gather playlist data. Actually the wpl parser can hardly be called a parser at all. Most of the code is just checking that xml tags actually exist before it tries to get data from it. If I dump the checks, this is what the "parser" would be.
ugly and directly to the point. It's more work parsing the filename out of the path than anything regarding the entire rest of the playlist.
Can I load files other than mp3 and mp3 streams?
NO. It is possible but currently I only wrote an mp3 parser. If you try and stick anything other than an mp3 in, it is going to try and parse it as an mp3 cause my player doesn't know about any other format.
Comment