I am the biggest dork ever.
I am the biggest dork ever.
I’ve known, with only some vague understanding, what a quadtree is for some time. I knew that it was a way of partitioning data in a scene so that you could easily ignore data not within a certain viewing volume. I also knew that it was based around the concept of dividing your scene into quadrants until you couldn’t divide the scene any further. Beyond that, the details have always been elusive.
But today I was sitting in the lab reading a ray-tracing paper - which, by the way, is in no way related to the work I should be doing. The paper mentioned the use of a uniform grid. This grid is basically a fixed number of nodes that divide a scene, and each node contains a pointer to geometry within that node. Rendering a node essentially means rendering the geometry pointed to within the node. I nodded and thought, “Okay, sounds pretty normal, although not as extravagant as some of the structures used in ray-tracing.”
And then I thought, “Wait, this might help out my senior project. If I use this uniform grid idea and apply it to our simulation, I can probably reduce the processing time by quite a bit.” I started drawing up some diagrams and thinking of calculations and realizing that the structure would take our O(n^2) algorithm down to, potentially, O(n) (although this is admittedly only in the best case). In the worst case, there is some slowdown, but not enough to noticeably change the performance. Thus, I concluded that I had done good, and proceeded to tell Zach about genius.
And then I stared at the diagram, and mid-message to Zach, I realized that I could adapt this structure to be a quadtree with just a few simple modifications. I continued doing some drawings and logically thinking about data structures and realized - yes - I had just come up with an implementation for the quadtree. What had originally been something to increase the performance of some calculations could now help out rendering. I was quite proud.
So here’s how you do a quadtree:
First, take your entire scene geometry, and find a square that bounds it all. The square will probably lay along the z axis depending on how your geometry is setup. This first box is your root node. Now, create four children nodes. Each child node is one of the quadrants of your root node. Now subdivide these four child nodes into four more child nodes. Keep going until your child nodes are as small as you want them to be. Don’t make them too small, or else you’ll lose your performance gain. The optimal size depends on your application.
Now go through your geometry, triangle-by-triangle, and find out which leaf node the triangle rests in. Setup a pointer so that the leaf node now points to the triangle. There are two things you can do if a triangle falls in more than one different nodes - either repeat the triangle or split it. If the triangle is small, repeating it is probably fine. If it’s big, though, it’s probably a good idea to split it. Once you’ve done this with all your geometry, your quadtree is complete. Obviously, given the time it takes to add a triangle, you don’t want to go about rebuilding this quadtree each frame - it works better with fixed geometry such as terrain.
Now when you go about rendering, use the subdivision to your advantage. If the root node does not fall into the viewing frustum, toss the whole thing out and you’re finished. Otherwise, start checking nodes. If a node is not within the frustum, none of its children are, so you can discard all that geometry. Depending on your scene, this could be quite a lot. If the node is within the frustum, check its children. Keep checking/discarding children until you’ve gotten down to the lowest level. Now draw the geometry that’s being pointed to.
That’s pretty much everything. Depending on the scene, this could give you quite a huge benefit in rendering performance. It could also be used for collision detection, although I believe we’re going to opt for using a uniform grid since the time it takes to build such a grid is much less than that of a quadtree.
I hope you learned something.
Don’t even get me started on Octtrees.
You’ll notice a new section on the site dedicated to my research on shaders. Enjoy.
Shocking first bullet!
Dear Chromium Developers,
Do you know what you get when you say this: *((double*)(&swapped)) ?
You get what is already stored in the variable ’swapped.’
In other words, the statement ‘return *((double*)(&swapped));’ can be shortened to ‘return swapped;’.
I hope you will consider this in future software you write that, ironically, won’t compile on Linux.
I thought this page on writing image filters was amazingly interesting. In short, the document says that many image filters can be specified in terms of a convolution kernel - a square matrix that specifies the weights of neighboring pixels used to determine the value (or convolution) of a specific pixel. This means that you can use the same exact code to do emboss, noise reduction, edge detection, sharpening, and many other filters. The only thing that changes is hte kernel.
The article talks about image filtering in terms of vertex/pixel shaders, which are small programs that rewrite how a graphics accelerator will treat 3D data. They’re used in pretty much any modern game, and there are some excellent things you can acheive. I can’t wait to research further.
I wish you were a little taller.
I completed Wild Arms Alter Code F last night. For the most part, I was pleased. They kept closely to the source material, changing the script heavily but not modifying how the original progresses. The gameplay had some marked blemishes, most notably when they would set you out into the world with no indication of what to do next. For instance, to progress beyond one point, I had to go read an obscure book in a basement, talk to a librarian, go to a location you only visit for twelve seconds prior, and use the ID card the librarian gave me. Unless you completely combed the library prior, you had no idea that what you needed would be down there. And then there were the puzzles that had unclear goals, or the password-protected rooms where you literally had to guess the password to move forward. These weren’t too bad in the beginning, but near the end of the game things go downhill. The battles were actually pretty challenging, but the random encounters were only annoying. Especially one type of enemy, which did no damage and would completely reset the battle when you got close to winning. If you put those (major) flaws aside, though, you’re left with a fun game packed with nostalgia.
Time for lunch.
Today is a good day. The weather is nice, work is only two hours long, AND most likely won’t ever have to sit through a mind-numbing Japanese lecture again! A better class decided to be offered this semester, Video Game Programming. It’s essentially the next step from my OpenGL class last year, only I hopefully won’t slack off all semester. I know I never mentioned my relatively old disdain for Japanese class, but it has been there, growing in size, since semester 2 of the material. We got more work and less learning per day and I didn’t agree with it, so now that this class is offered, I figured it would be a perfect time to drop it and get the new one.
Brian recently asked me if I wanted to go play Badminton with him and I said yes. Best. Decision. Ever. I think I am addicted, tonight will be my third night in a row playing. I hope to play tomorrow as well. The game is really fun and quite easy to pick up. It is a good time.
Mario and Luigi:Partners in Time is amazing, as should be expected by this series of games. Though not as funny as the original, Super Star Saga, the battle system got a slight overhaul with the addition of Bros. items and more complex timing on all of the attacks. Now you have 4 characters( Baby Mario piggy-backed on Mario and the same for the Luigis ), which means you have 4 buttons to hit in time and order to pull of the good damage. It makes the battle system a lot better. Bros. Items rock for the same reason, they remind me of the Star power-spells you get from the audience to cast big spells. The variation of keypresses isn’t as nice in this one, but it works well with the DS. My only gripe with game, as is my gripe with all DS games, is that it doesn’t use the freaking stylus. What’s the point in advertising a gimmick and never using it? Oh well, the game is still pretty and uses the 2 screens in a good way. Oh, and they brought Fawful back. That was a great move on their part.
I recently stopping playing WoW, but I think that is going to change soon. My brother wants to start up an MMO, and I suggested that one. We’ll see how that goes.
“I have boredom. Hmm? Guests? Now I have… FURY!!!” ~ Fawful
I loved the original Wild Arms. It had a certain charm that made it very fun despite being rather primitive technically. I don’t recall it being particularly successful in the States, and it’s probably the absolute last RPG I expected to see ever remade. When I saw that they had in fact made a remake, I took notice. I’ve been watching the game with a critical eye, focusing especially on how it measures up to its predecessor. Thus far, I’m quite pleased.
Graphically, the game is nothing amazing. There are FMV sequences, but those are little better than the gameplay graphics. The character designs stay true to the originals, although Boomerang seems heavily modified. The music of this game really shines. There are faithful recreations of the old classic tracks, including the lovely world theme. Sadly Zed’s and Calamity Janes’s themes were bastardized. This would be unforgivable if Boomerang’s theme didn’t kick it old-school in a big way. The battle system has been revamped but not drastically. Just some simplifications and alterations in a few places that I barely noticed, and they didn’t really hurt anything. The world map benefits from Wild Arms 3’s Migrant System, which allows me to skip battles if I’ve progressed far enough that those battles would be worthless. Unfortunately, it also suffers from the same game’s Radar system, which is deplorable on a good day.
The GameStop employee that sold me the game told me the creators completely changed the story. He was full of crap. The game very faithfully retells the same story of the first. The script has been rewritten. There are no glaring flaws here, but a few of the characters seem a little different. Events all happen in their appropriate order (I’ve been checking the Wild Arms 1 FAQ to be sure) with the rare new event tossed in. Dungeons have been recreated and you get Tools in a different order, but there is no problem aside from some not-quite-stellar puzzle design. Really, though, everything is as it should be.
I’m quite pleased with the game. It’s inspired a lovely bit of nostalgia, and anyone who was a fan of its predecessor should grab a copy.
WE ROX0R YOU AND THEN WE ROFL.
I went ahead and picked up Mario Golf and Skies of Arcadia along with a few extra controllers and the Serenity DVD. And I bought some non-dorky stuff. Yea.
Mario Golf vastly disappoints. I was hoping for something Kirby Golf-ish, with crazy and varied gameplay as is usually the case with each Mario game. Instead, I got a bland, underdeveloped golf simulation. I’m really hoping Mario Tennis, Mario Baseball, and Super Mario Strikers (Mario Soccer) aren’t like this. But until they drop below $50 a piece, I’m not even considering buying them.
Skies of Arcadia is a little better, but so far only a little. It’s clearly a Dreamcast game ported to the Cube, which isn’t necessarily a bad thing, but it shows. The battles are painfully dull, and I cringe every time I see that screen wipe associated with a random encounter. Otherwise, I haven’t played it enough to provide an adequate review.
Serenity is, of course, awesome. A keen observer will notice that the cinematography and lighting are both different than how Firefly handled things (thus losing some of the feel), but if that’s the only critique I have, I consider that a win. It has, of course, been criticized for not being accessible to people who haven’t seen Firefly. This is true to some degree, and my heartfelt sympathies are extended to those who have not seen the series.
I watched Cruel Intentions the other day with Rebekah, because I had never actually seen the entire movie. My… God. I’m at a loss for words. I can’t really tell you anything about the movie without completely destroying the integrity - the infinitesimally small bit we have left - of this site. I can’t recommend it with a clean conscious, but I do recommend that if you see it, stay out of earshot of anyone with authority over you in any fashion. I can only fathom what Rebekah’s mother thought. There are two sequels, which I don’t think anyone knows about. Friday I’m going to see if Rebekah wants to rent them both and have a Cruel Intentions marathon, thus completing my descent into shamelessness and ruining all my dignity and honor. Should be fun.
Oh, I also watched the first ten minutes of Hangmen. Um, yea. I didn’t make it past ten minutes for a reason. Really, the only reason I’m telling you this is because somewhere, I’m hoping someone sees movies solely because I say not to see them, and I expect that sitting through Hangmen will blow that person’s brain up.
I’ve been reading. Terry Pratchett stuff, which should surprise no one. Although I think I’m finished with him for a while. His books are good and come highly recommended, but now that I’ve read twelve of them, I think I’m ready for something more substantial. Ender’s Game, and perhaps the Ender trilogy (I think it stops at three, but I could be wrong), sound good. I’m also going to be ordering a few technical books, because I really want to hit the graphics development hard again.
I too, got Fire Emblem. I agree with Brian on that one. The game is standard TBS fair. That is my favorite genre, however, so I love the game. I have two gripes with it, however. One is the uncalled for amounts of text I am forced to read in between battles, by now all games should have full voice. Xenosaga can do it, so can everyone else. The other gripe is its ease. The game has never really ever been a challenge. They start you out with a ripped tank who kills every attack and never gets hit. One of the key things about the Fire Emblem series is that when a unit dies they real-life die. You can’t bring them back minus resetting and starting the battle over. This should add a bit of intensity to unit placement. The AI is smart enough to attack sure-kills like mages and priests, but not smart enough to stand back when they are definately going to miss and die. I’ve had enemies with a 0% chance to hit attack a unit of mine when I had a 100% chance to hit twice in a row for lethal damage. I think that needs some work. I like the game, though, but it is barely something to write home about.
I also got Metroid: Pinball, Mario and Luigi: Partners in Time, and Advance Wars: Dual Strike for Christmas. I’ve only played Metroid so far, because it is the only one I can play for a half and hour and put down. I am looking foward to going to college and playing them at work, however. The DS is looking more like a system and less like a gimmicky paperweight finally. I also bought Super Mario Advance 4: Super Mario Bros. 3 for the GBA the other day. Since I have a GBA player for my cube, it is really awesome to replay that game, too. They added some endgame features too. Makes the completest in my jump for joy.
I finally decided to pick up The Legend of Zelda collecter’s cut edition that I have been drooling over for a while now. This little GC game pack comes with The Legend of Zelda, The Legend of Zelda 2: The Adventures of Link, The Legend of Zelda: Ocarina of Time, and The Legend of Zelda: Majora’s Mask. Mind you that I at one time owned all of these games for their original systems, but have long since traded them in. I actually own a GC-ready version of the original and OoT. I really bought it for Majora’s Mask and Link. Dan and I beat Link in one night( minus the last dungeon, old video games are freaking hard ) and started Majora’s Mask. I will probably try to complete that one before I go back to college.
So in conclusion, I have gotten a lot of game for Christmas and played a lot of games over break.