Navi Menu
main blog files profquotes Zygote Asylum contact link junk

19day

2005-11-13

Asylum Dev journal update

Filed under: Asylum — 19day @ 22:37:07

I’ve been making inching progress toward my new engine, if you can call it that, there’s still nothing. Really, what I’ve been doing is playing around seeing if the underlying capabilities are easily usable so that I might port my existing engine. I’m still going to have to rewrite a lot of it since the old code depended on a wrapper that won’t exist anymore, but I’ll just write my own wrappers to expose the functionality I need to those ported areas.

I’m going with C++ under visual studio .NET’s IDE, with DirectX 9, but it’s still being quite a chore. I managed to adapt the video rendering to a texture example from the SDK without too much trouble, unlike my previous .NET adventures in the same area. But of course, having taken that step forward, I move a step back.

I tried to see if MP3’s would work ‘out of the box’ without needing to do too much. I stole my MP3Music class from Asylum’s old code base and plugged it in and took a look at it to see what I had done, as it was just an adaptation of the movie player in the old code base which just happened to work. Well, it turns out that it was very nearly what was already in the shiny new video code, except it just took the file and built the render graph completely, rather than what the video to texture example was doing, which was, confusingly, adding input and output filters, and then asking DirectShow to fill in the rest, which didn’t seem to save anything, but whatever.

Anyway, tried playing an MP3, didn’t work… hmm, well, I guess that was to be expected, hey, I’ll just put an MP3 file in my call that renders to a texture, wonder if it will handle that without crashing. Nope, conked out there too.. hmm, always the same problem, all the helper threads spawned by GraphBuilder’s Render function were exiting with error code 0×2, and finally the main program would exit with the same problem. Odd, 0×2, accoriding to the DX error lookup utility, was File Not Found… but earlier checks already present in the routine assured me that the file existed… and then I tried it, rather futily, from the executable rather than starting it through the IDE, and it played. Wha?

This problem only presented itself whenever running through the IDE, debug or release builds, but worked properly through the executables themselves. The interweb was of no help, I tried lots of searches to no avail. The best I was able to come up with myself through debugging was that for some reason, the graph automatically built by the graph builder was wrong under the IDE but fine under the exe alone. It was also able to run as long as the debugger wasn’t attached, either in Debug or Release mode.

I tried a few things futily, was playing with just building the filter myself in Graph Edit and then doing it in code, but in the end I decided that it would probably be best to let the builder do the work (try the filters until one works). I decided to try OGG format, knowing it was a friendly MP3ish thing, converted a test file, and it seems to run file with the graph filters attempts, in all methods. So for now, OGG is what I’m going to use.

Funny that movies haven’t given me this problem, as they are more complex, oh well.

I’ve also just received a new book that I ordered, Game Coding: Complete, Second Edition by M. McShaffrey. I’m both impressed and dissapointed, but I guess I should have read the fine print on the recommendations of the book. It’s really good in the sense that it talks about a lot of high level stuff that is interesting if I was trying to make a breakneck speed game (which asylum isn’t, but might be handy later on) and on how to handle yourself if you were working on a grand project as part of a company. Unfortunately, I thought there would be more actual code, with specific utility in mind. But this is a general game programming book, and not a directx one, so I can only blame myself. It has enough good stuff to keep me occupied for some time, but it won’t be a replacement for the message boards I’ve grown to loathe. I wanted a better resource for the problems seen and sometimes half solved on game programming or directx forums. This book isn’t it, but it covers lots of things I wouldn’t have anticipated needing to do, like rolling my own memory manager, and also tries to get me to do things I still resist against but should do for proper coding, like separating the game logic from the input logic, for example.

Anyway, so at least, for now, progress is being made. All I need to do is write a sprite class (or wrap the existing one on offer from the SDK to give me better functionality) and then I can port some of my crap over. But I think I should give a lot of it a rewrite, since some of the fundamental stuff, like “View” representation is really sucky.

But that means rewriting the View Editor, which is a task I think I’ll put off for a little while.

2005-11-09

Not really a dev journal update, as no progress is made

Filed under: Asylum, General — 19day @ 02:00:24

Holy crap, what a waste of a weekend. Well, some of it was wasted sleeping, but lots was also wasted trying to get the half baked mess known as Managed DirectX to work.

Well, perhaps that’s too harsh, it’s the AudioVideoPlayer that’s the shambles. The rest of managed direct3d is actually quite nice, but it hides a lot… perhaps too much, and it renders almost all information you can get online useless, since it’s very difficult to even convert from unsafe C++ direct-directx code to managed, since usually the person giving help is using a bit of trickery which is perfectly legit in the unsafe world, but doesn’t have an analog (that I know of, that is) in managed. And there is very little online help on managed stuff anyway.

But all I needed, really, other than basic direct3d functionality for a 2d engine, was the ability to play movies onto a texture. AudioVideoPlayer is the class for it, it’s about all it can do, and it can’t even manage it. It’s like a car that won’t start… what’s the point in having it, and then thrashing it with a branch (ala Basil Fawlty). It’s actually quite an adventure to get working at all, the demo seems to work fine, but if you mess with it even a little bit, it can break. But here’s what I’ve found (and other sources on the net can back this up)… you can’t use the same object to play different movies.. every time you open a new movie, you just leak megs of memory. Okay, that’s fine, dispose the object and make a new one each time.. right? Wrong, at least for me, it just causes (sort of randomly) a null reference exception, reportedly on the line that says “videoTexture = null”, which is amusing.. but it is actually occuring in the annals of the dll which gives us the lovely functionality.

So the choice, leak horribly and let the thing run for a while, or don’t leak and crash in a minute. Of course, the option is to just do away with the whole thing. The implementation is broken, hasn’t been fixed in years (people were complaining about this in 2003), directShow is off the table for the most part. I’m sure managed directx would have been okay for Zygote, but I needed movie playing ability or else it was a showstopper.

So the show stopped. And I was back to square one (being my original codebase for asylum, running on DirectDraw 7 wrapped in CDX). It works fine, but why would I want to change it?

Well, a few reasons. The CDX hides a lot of stuff away, making it hard to do anything unsupported by the wrapper. I could examine the wrapper, and I have to some extent (enough to get the sprite thing to work properly), but being a wrapper, it handles a lot of stuff, and it’s all just there, with workarounds and stuff all over. It works nice, but I don’t learn a lot from staring at the code, and further, it’s direct draw, and you’re supposed to use direct3d now (I don’t know why MS wouldn’t just keep the interfaces but just link it up into appropriate direct3d calls to fake it up… oh well, guess that was an exercise for the reader), so I’m not very motivated to learn directdraw at all.

Secondly, being directdraw, and not updated for a while, it has virtually nothing useful that you might want to do to a sprite. Hell, DirectQB had more functions built in :P If you want to rotate or zoom a surface, you have to write it yourself. Now, I’ve done this, but it was damn slower than the CDX one, but the CDX rotozoom doesn’t preserve aliasing so your colour keys go kaput. Also, the alpha blending routines, that would have come in handy a few times, are nearly useless for anything you want to run more than 5 frames per second. Of course, it’s all done in code, so it’s almost destined to be slow.. that’s why they made things hardware accelerated, but as directdraw was never updated, it’s now standard to use direct3d to fake up a 2d engine, and all that alpha blending and rotating and anything else you would want to do, comes free and fast since drawing triangles (say, 2 to make a quad) and texturing them (with, say, a sprite) with an alpha channel (to knock out the stuff you don’t want), is part of the purpose of the card, and exactly the type of stuff I want.

I’ve been okay so far on my current codebase, and really, so far, nothing I’ve done strictly requires the extra functionality, but it would be very nice to have, since I’ve tossed some pretty but unnecessary things due to this, and will probably want such things in future.

So after the managed directx attempt, I fell back to square one, but now I’m trying again, but on another board. I guess another question is, why would I want to try managed directx at all, you wimpy loser, c’mon, managed is a four letter word, etc etc. Well, I wanted to learn a bit of C# as I went (and realize that I don’t really like, heh, I fall into my C++ knowledge and go wtf whenever C# does something I don’t like), and since I didn’t need crazy power in my game (think turn based 2D game) that the overhead by the managed code was more than fair to be able to use direct3d without a lot of messing about with, in my view, crazy-code. Looking at unmanaged directX code gives me a headache, but that’s because I’m mostly unfamiliar with it. I’m actually not very familiar with COM stuff, so that gets me a lot too.

So Managed DirectX seemed like a good option, but screw it, the damn thing don’t work (huck-yuck). So I’ve been looking at the C++ SDK for DirectX 9 (I’ve also got the VB.NET and C# versions). Anyway, they have a directx 9 video texture renderer in the directshow samples, and it seems to work very nicely. I’m a little familiar with directshow since I needed to make enhancements to the cdx movie player which wraps directshow a very little bit. So I figure if I learn enough of it, I should be able to wrap it into something a little less intimidating (and I think it’s already wrapped in the example code, which doesn’t bode particularly well), and move on.

Direct3D shouldn’t be too bad once I get past the setup, enumerating, initialization, restoration, rendering and releasing… err, well, the code is all in caps, but at least I know what it *should* be up to since I’ve already played with managed directx which basically does the same stuff but in nicer speak. And my openGL knowledge should be of some limited use, if only to get the set up for the 2d working the way I want. I got something interesting going on the managed attempt, so I can just port that when I have a framework set up. DirectX also provides a sprite class which might be useful, although I might want to do it myself to learn.

Not sure why I posted all this,.. it was mainly to vent about the managed audiovideoplayer being a pain. ugh, oh well, might as well learn how to use the fast directx for when I want to port zygote, since then I’ll want all the speed I can get (to cover my other inefficiencies, heh)

2005-11-03

Asylum Dev journal update

Filed under: Asylum — 19day @ 19:05:12

Ugh, I keep debating what to do about Asylum. Right now it’s on fairly shaky ground with VC6, using DirectDraw with a nice wrapper called CDX on which development has fallen silent. But there are a lot of things I would want to have work, which I don’t really know how to do myself, and if I did (since I know somewhat what would need to be done to make them work) it would be too slow. Like, I’d like to be able to rotate a sprite. You can’t do that with direct draw, CDX does something close, but it uses a filtering mechanism that produces anti-aliased edges, which is usually good, but then it applies the colour keying, which is a single colour (I think I could fudge it up to use a range, but it would be annoying) and regardless it doesn’t work very well. Nor does the alpha blending, hideously slow.

So the idea is moving on up to something a little more clean, but could quite easily be as slow, or slower. Managed DirectX in C# works well enough, at least the demo’s do, and I think I’d have access to everything I need. So no worries about memory crap, and I could use DirectX, er, directly. I’m not really good with Windows/COM nonsense and it’s very flakey to me. But since I took CS488 (Graphics) I have a grip on 3D programming, which is easily adaptable to a 2D game, and I get the benefits of fast rotation, scaling, blending, nearly without thinking.

But, of course, that would mean, essentially, a rewrite. Which isn’t actually too bad, since I’m not far into this project, most of it was infrastructure, which is the stuff that has to be rewritten. I dunno, then I would be bound to the CLR, which isn’t something I want (ViewEdit is fine cause it’s just a tool for me) but it’s not like the .NET Framework is installed with XP, which means my audience will have shrunk.

I could remain in VC6 with DirectX and use Direct3D to get everything I want… but DirectDraw alone is messy, I dunno if I could stand Direct3D. More research is clearly indicated.

2005-10-30

Asylum Dev journal update

Filed under: Asylum — 19day @ 23:35:15

I suck. It’s been so long since an update, and over two years since the last release, wow… university really sucked the life out of me, and work has left me a little too tired, but I’m determined to start up one of my projects again. The options were working on Asylum, or on Zygote, and as I don’t think I’m ready to deal with porting a heavily unix codebase to windows for the larger casual download market, or to find windows versions of the libraries I’m hooked into, nor do I feel like working on an intelligent sperm game at this time.

So I’m focussing on Asylum… not sure if I’m going to do the code rewrite for managed DirectX on C#. I would lose the use of my wrapper (CDX, makes DirectX on VC6 bearable, but it isn’t being updated anymore, and I certainly don’t feel like rewriting it for Managed DirectX on a .NET language) plus I don’t know how fast it would all be. But if I rewrote it to get away from Direct Draw and use Direct3D methods for a 2D game, I could take advantage of a lot of faster stuff, so it might be worth doing. Anyway, for the moment I’m working on stuff on the existing codebase, and working on ideas for another demo.

2005-10-16

Version 1.1 of Timedshutdown

Filed under: General — 19day @ 20:06:49

Chris found a few bugs in the first release, and while I fixed them I made number of changes. A couple of the most notable ones are a change to using ListView’s so you can sort the window and process entries, and a rudementary “ProcessWatcher” so that as windows and processes are started and ended the windows update automagically, but it’s not perfect (and not really completely tested, heh)

Anyway, here it is again:
files section
Timed Shut Down executable
shot 1 shot 2 shot 3

2005-10-05

Timed Shutdown

Filed under: General — 19day @ 21:10:48

Been working on a little program the past while, see the files section. I call it, excitingly, Timed Shutdown. It started as just a little window that could count down seconds until it shut down my DVD player on the computer, to keep it from spinning at the menu and keeping me from sleeping with irritating music.

Now it’s a proggy that can terminate any window, process, or logoff, restart or shutdown the computer itself. Can optionally have the program self-terminate (no real reason not to really) and have the screensaver come on.
files section
Timed Shut Down executable
shot 1 shot 2 shot 3

Anyway, just a handy utility for me that has been way overdeveloped (except… still doesn’t send email yet… hmmmmmm) and I put it online and the source too. Written in VB.NET so you’ll need the bloated framework, unfortunately. Was thinking of backporting it to VB6 but I’m just that too much lazy.

Now I need something else to occupy my time… been thinking of working on Asylum again, but my last decision was porting it to C# to benefit from managed DirectX, but as Nintendo has patented a key aspect of the game, I’m suddenly lacking in interest in continuing.

Also been thinking of porting zygote to windows, but I dunno, I’d have to figure out how to get OpenGL working on windows, and probably rewrite half the libraries we got in cs488 and totally hack things up majorly. But it’s still the more likely project… just need the will.

And the time

2005-09-01

Captcha

Filed under: General — 19day @ 22:11:38

I just added a captcha to the comments section. It used to be that I had to moderate every comment that was posted, because the word list, no matter how much I added to it, wouldn’t catch them very well, and I lowered the URL content to 1 without needing moderation, but the spams sometimes only use 1, so I lowered it to 0, or basically, I moderate all the time, and it was a bit confusing for some people, since it didn’t even tell you (I put in a message myself, but alas)

So I got a library to do it.. well, I didn’t like the image it generated, so I took another library, and then tore it apart, keeping only bits of it, then shoved it in the shell of the first. There are some unfortunate weaknesses of the current system, so I might go back and essentially rewrite the whole thing, but for the moment, let’s see if it’s sufficient.

You can comment away.

I’d also like to note that for some reason my Bandwidth Bandits post has been very popular for this, 33 spam comments in 5 days for that, pretty much out of the blue (in terms of particular focus, I get sprinkings).. and all that for what I think is a virtually unknown blog, alas. I feel sorry for those who say things of worth.

2005-08-30

Our Tsunami

Filed under: General — 19day @ 10:50:12

Usually I like to steer clear of political things in this blog too, but something I read recently really grinds my gears.

There is a hurricane having gone on, still going on, not sure, in New Orleans, the storm itself is lovingly called Katrina. What really irked me was a quote from some mayor in the area, and then reprinted in CNN in bold as if it was an important quote.

‘This is our tsunami’ he says…

The article then goes on to explain the reference… “referring to the December 26, 2004, tsunami that killed more than 226,000 people in the Indian Ocean region.” At the top of the article it says the deathtoll, as it stands, is 55, likely to rise…

Is it going to rise by 225945 more people? Or is having 55 forward moving industrious clever U.S’ians die simply worth 226,000 backward poor etc. etc. people who died in the actual newsworthy event?

I wonder if anyone else finds that invocation offensive.

Edit:
Now they’ve invoked Hiroshima
“I can only imagine that this is what Hiroshima looked like 60 years ago,” (login required, use BugMeNot)

Yes, I understand that it’s a horrible situation, and compared with everything being fine, that hurricane has made this very much less fine. But they just keep comparing their situations to ones much much worse, I dunno, find it arrogant.

Edit2:

Another aspect I don’t like about the coverage that goes on with these types of things is you get 2 or 3 stories related to the actual event, and then at least one about “Canadian’s may be victims” and “Canadian found safe” and such, I mean, sure, *maybe* it’s of interest, but it’s still sort of an us vs. them in the face of a disaster. “No canadian’s were harmed by god’s randomly exploding people, phew, that’s good, in other news, all other nations are dead, meh” Anyway, I think this will be my last rant on this, heh.

When people die, it’s usually not a good thing (I am not in favor of immortality though), but I don’t see any reason to quantify it other than by the obvious methods, it’s not a contest. I’d say it’s the fault of the media, but the quotes were media-generated.. but they were media-focussed, so maybe they are at fault, okay, that’s fine with me. I’d rather focus my blame on larger institutions that individuals, it’s less tiring :P

Edit3:

Nope, not my last rant, just wanted to throw this in.

Very last words, ‘Brown “remains focused on helping Americans through the worst natural disaster in history,” FEMA said.’ It’s nitpicky, but I’ll still dock them karma for not saying ‘their’ worst natural disaster in history. I don’t beleive they can possibly mean that the splash they had can compare to other natural disasters in history, but given all of the above, I wouldn’t put it past them.

2005-08-29

Zulieka

Filed under: General — 19day @ 21:37:19

I don’t normally do this, nor did I want this blog to be one of *those* blogs that just links to a bunch of things (not that there’s anything wrong with that, I find those interesting sometimes too), but there’s a blog I’ve been following rather consistently (consistently being slightly more often than totally randomly, as it is with most of the blogs, journals, and friend’s sites that I know of)

I’m following the blog of Zulieka and it’s of that which I speak. At first, I read it from a link from a blog I got to from a link and so on and so forth, all the way back to the highly controversial beginning of the universe. I stayed at first, rather admittedly, because it was 9 parts interesting, and 1 part a girl who very occasionally would take revealing pictures of herself (as seems to be the style lately). Well, moreover, that’s why I stopped, but one reads too, and there was an interesting story there.

Then the story changed to a girl who suddenly discovered she was pregnant, which itself was interesting, as I’ve never been close to such a story, and from all tell it wasn’t entirely planned either. But now it’s the story of a girl who’s given birth to a girl of her own, and it’s touching to hear about her pained breastfeeding and horrible fears about things happening to her baby.. er, if all that can be considered touching, because it all comes back to something she herself wrote: “It’s a nightmare to love a human this much”, the rational versus the instinctive.

It’s like how I see when my female friends, one of them in particular, she sees a baby or toddlers running around, being annoying as toddlers are, she goes into a sort of Maternamode, very slightly. And that type of thing nearly puts me in Paternamode, if even slighter. Odd that, since a child tends not to do that directly (as my annoying toddler remark indicates). Oh well…. I’m sure Nature, in her infinite wisdom, is working on it.

« Newer PostsOlder Posts »

Powered by WordPress


Page by 19day (S.B.H.)
Everything here is property of 19day productions, unless it isn't, and cannot be claimed by anyone else regardless, sort of like a copyright, but in many more words.
Last modified: September 07 2009 18:21:00.
Valid XHTML 1.0! Valid CSS! CWH Get Firefox