Showing posts with label game. Show all posts
Showing posts with label game. Show all posts

2010-11-16

Blue Dragon - XBox 360


Well, that was fun. Learned a few things too.

1. Mesh data stored in the XBox 360 is identical to all other formats that you expect in a high end graphics application; Specifically, large VA/IA arrays and a nicely formed VAO with a geometry shader system for handling matrix weighting/radial basis. No surprises.

2. Textures are still DXT1-5 style blocking, but arranged differently in memory. Uncompressed normal maps.

3. Meshes seemed to average ~10k polygons, and have ~170 bones apiece. Level of complexity requires on-GPU processing; may have special hardware for this, like OpenGL 3.0 or DX 11.

I like the style for this game. Internally, it's fun and NPR; high enough resolution to some really cool animations. It was hard to find a lot of information about it though.

Also, I found out my older ripping technology had a bug; and now all of my models are 100% spot on with weights, which means it's identical to the in game data for just about everything else I have. Which is really neat, now I can learn a whole lot about how Monster Hunter 3 animated their creatures so well, and how poorly some other games did the same thing

It's like having the coolest action figure collection ever!


-Z

2010-10-20

Zoning

It has been a long time since I posted.

I've become far more proficient at modeling in blender.

Also, I've improved the DXML format to the point where it writes C/C++ code automatically, and is far more stable, fast and simple. In fact, DXML seems to be my new "does everything" format, because unlike XML or other bullshit standards, it's lexically simple and forces you to write better file formats. Which, it turns out, are directly C-struct translatable. Also, it has less possibility of confusion or errors due to it's very strict nature; and as a result, makes you far more intelligent.
The downside is slightly larger files, but when you are dealing with a text file, you want it to be comprehensible, not efficient. DXML files are built for comprehension and logical structure. They're perfect!

Also, the TED format has been getting a lot of attention and improving, I've added scripting to animations, so now attack animations can contain code (lua) so that punch animation can mean something.

Also, I embedded Lua into my programs, now I can script (safely, mind you) so extensibility is fast simple and external; allows for a lot of flexibility, and as all you truly experience programmers know, a script is only as powerful as the core that drives it. In this case, core handles a lot of things normal engines like Unity, Blender, Torque, and many others do NOT handle. No surprise; you're supposed to extend those engines in C/C++ code anyways. Most of them are also not built for magnitude/scaling either.

So, with all these improvements, the focus has been on scene management; ted files provide a vast array of graphical and animation data; they also now provide zoning information, which is used to reduce collision requirements and provide an effective scene graph that can be non-spatial (a critical requirement for adventure clone!)

Here's a rough idea of what "zones" and "zplanes" mean, in terms of blender; In text, a zone is a axis aligned bounding box (AABB) that contains a list of objects that intersect it, and a list of other zones that intersect it. A Zplane contains a reference to two Zones, and a position and matrix, used for culling.



Until next update! Maybe we'll get a video of some in-game action.

-Z

2010-03-06

Dream - Terahertz Sono-wave gaming machine

Summary:

Goathouse, me, and some of my other friends were at some drunk party, it seemed like we were in Canada and the bars were really slow, so it was about 5:30 am, and we drove to this gaming place that had been raved about (~2030, but we're still in our 20's). This huge gaming place has a large TeraHertz gaming server that linked you into the game with both mouse, keyboard, and a brain-link (looked like a plastic necklace) to allow the game to read your input before you actually make it. It didn't "put you in the game" but it was as close as is physically possible (you were still sitting down staring at a screen (4k screen))

Details:

I don't remember much about the party, except brien, john, jay, zach, kelly, adam, and probably everyone else were drinking a lot, I had too much already so I was on the floor (as usual); Somehow our drunken mobility decided we should play games since the only two chicks present were dumb. We had all heard about this new "synthesis" gaming experience, and somehow we all drove there.
When we got there, it was this big decorated building in white, with lots of industrial pipe decor, something right out of universal studios or something. After going though a regular queuing line (not many people there at 5:30am) we entered, and inside was a large guest room and a initiator room, full of computers (from a yet-nonexistent company; they were *nix though). Inside there were the two guys responsible for training people to use the machines, some regular fat unix looking dude (beard, scraggly, glasses) and a more normal dude. (no chicks in the VR business, save for Nisha, which was the goth-type; she worked in the server room. cute!) Well, we all took our places, and they talked to us about safety, how the device worked, and what the hardware was; meanwhile Supreme Commander 3 or something played on our monitors, showing us what possibility the games interface had. We were all given a necklace that laced over the shoulders like a seatbelt, so it could monitor our heart and safely disconnect us if things go too intense. There was also this V-shaped plastic thing that we wore on our necks, that connected to the VR interface fort (some sort of SATA looking connection). This device was responsible for reading our brain waves; and giving the game the appropriate data stream.
So, after getting lectured about problems we might encounter, and how to shut off the device (apparently, some people can't handle being "in" the game) we were moved into the next room once the previous group was finished.
The next room was all black, save for the soft glow of many high resolution computer monitors (4096x4096 displays, at least 25 inches wide). Each computer station was put behind a plexiglass wall, which contained the tera-server, running inside a bath of liquid nitrogen. the thing was the size of a van, and goth chick was constantly checking it every 15 minutes (in a suit :( ). The room had a tall ceiling too, was cool as well. Well, we each sat down, had 15 seconds to connect to the game then WHAM

IT started off as Unreal Tournament Tera-Edition; And we were all running around in a familiar setting blasting eachother with familiar weapons. It looked great, all the monitors were 3D, and the gameplay was fluid as always. However, what was happening was the brain reader was calibrating; by using a known experience, it can use that as the heuristic to generate the 'next best' scenario, and get used to your mind. Eventually, I no longer needed to use the keyboard or mouse to control my character, but had hands ready just in case. The unreal part was fine, but I ran away from the fight, wondering just what kind of virtual world this was. Apparently, just around the corner for unreal world was medieval world; a place full of Dragon-Age type shit; swords, magic, magicians, plague, dragons. All the generic stuff. The seamless transition was really something else, I just ran in there, fully armed in unreal tournament gear, and began running around the town shooting down guards. Eventually the game adapted, and it took away my gear (Unfair Use Justification Award) so I was now a peasant trying to stop a feudal government. Along the way, one of the AI people helped me out, and don't get me wrong, the AI was as real as another person in this game. IT could talk, interact, think and do all by itself. Gone are t he days of state based AI, now we have true organic processors that act alive (in a scarily realistic way). So, we and this other peasant start sneaking around, picking off guards using our knowledge of tactic; The AI player copied me and learned really fast; We eventually snuck our way into the armory, and found a treasure vault. Meanwhile, some other unreal players ran by outside, just continuing to fight eachother ignoring they were messing up medieval world. So, after stealing lots of money (the game felt real now, you know how that works when you get "into" a game) we tried to escape, but the guards were on us. WE could run faster though, and escaped outside and got to the top of the buildings quickly. The guards were real hesitant to follow us (soled shoes suck on mud roofs); so clambering onto the roofs we could see for miles; the entire kingdom of medieval world; the border of Jurassic world across a small river, the b order to jungle world up north, the "dead sea" (the admins told us the world did not wrap; it terminated and anyone going into or above the dead sea would be eaten ala Spore.) And the unreal world, with projectiles constantly going AWOL like fireworks. There was only one dragon in the air, but it didn't seem interested in what we were doing. So, after jumping around from roof to roof (the medieval buildings were 50+ ft tall, and made of very thick mud and concrete, supposedly a game design decision) I found that there was a giant golden cannon hidden atop a tower that we could get to, so after clambering around (I found a diamond, +5000 points) I aladdin'd my way down to the ground, still running from guards, pushing people away. The guards stopped taking interest in me, as my AI friend had got upitsnacthed by that flying lizard. They were busy, so I ran over to the cannon, and once I managed to get to the top via lots of hardcore mario platforming, I got a LEVEL SELECT. Which, I could preview any area I wanted, to see what there was in this unbelievably huge world to explore.
From memory, There was Unreal world, Jurassic World, Medieval World, Jungle World, Ice world, Air world (high skyscrapers & scaffolds), Slug world, Fusion world, Food world, Random world, Dark world, and quite a few others. Each world had it's own creatures, people, and AI's to interact with. The game was essentially 0-consequence real life; Everything could be interacted with, and it would change somewhat as you would expect. If you "died", you could respawn or chillax for a bit. The game kept track of your lives, score, and modified each by each region as needed, so it was unfair that I found that diamond (putting me ~4600 points over the top unreal player), but that's why it was there. Exploring was always a reward, but it wasn't always immediately obvious HOW you would be rewarded. Fights were as realistic as the zone employed; it could be RL fighting (as in medieval world) or game fighting (unreal world) or even turn based MMO style. Everyone that was local lan was playing in the same server, if we'd have cooperated it coulda been amazing.

Then, before I could select a new world, our time was up. Shaking myself to consciousness, apparently me and Zach were the only two really affected by the system, so we had to sit in a waiting room for an extra 5 minutes while we recuperated. (the machine can raise your brain temperature; so this is somewhat dangerous to do, especially if you get into it) WE talked about what we did, Zach went up north and conquered an entire north pole civilization using necromancer powers; murdering stupid elves and christmasy things. Sounded like fun! After a while one of the employees came by and offered us jobs, because we were able to actually interface with the system and do things most people couldn't. We declined for the moment, and the dream ended because some noises coming from the living room woke me up.

If a picture is worth 1000 words, and this game was running at 240FPS, for 15 minutes, then how many words would I need to describe what I just lived through? (hint: 60*15*240*1000) Unfortunately, I'm not into wasting my time describing the emotional and graphical details of the dreams; You'll just have to know that whatever it was is more vivid and amazing than anything you're used too. You'd have to travel to world to even get close to experiencing these kinds of wonders. And trust me, as anyone who has "been there" knows; Pictures, movies and games can't even get close. Being there is really something else.

-Z

P.S. There was some cool fanservice in the game I didn't mention. ;)

2010-01-31

Dream; Final Fantasty 6 - 2

Summary:

A high res remix of FF6 with a improved battle system, extended more in depth plot, and a lot of additional new features.

Details:

So, I put in my game blu-ray disc, to see what all the buzz was about with this final fantasy 3/6 TWO controversy; Having enjoyed the hell out of the first FF6, I was really skeptical about the remix. To my surprise, it both exceeded my expectations and blew my mind with awesomeness.
A lot of it is really fuzzy in memory, but Kevka was a lot mroe seriously evil in this one, and the plot was changed to match up with the more recent final fantasy's; The idea of 'magic' being used to dominate and ultimately destroy the world was still there, and espers were still there, but holy shit they are scary as hell in high res. Also,  the espers are a lot more interactive, not merely quest items; They do actually converse, follow you around and make suggestions depending on how you treat them. Naturally once you kill an esper, it only exists as a spirit, so they cannot do anything until you summon them, which always costs 1 HP + some amount of MP. The battle system was vastly improved, implementing a mixture of both real time fighting and strategic turn based trickery; Also all done in glorious 3D. You had the option to command classically, where actions were mere dice rolls, or you could switch to Star Ocean mode, and stop-time fight all at once, OR you could keep the 'Neo' mode, where it was classical turn based, but each action had *you* play it out, so if you said 'Sabin -> Pummel' then you have to run in with Sabin, and mash buttons or do some sort of mini-game. Sometimes, basic attacks are just running and aiming correctly; which means doing so gives you far more options to have critical attacks, since WHERE you hit an enemy determines that, but only in Neo mode (IE using a sword against the neck = critical hit)
The graphics were photo-realistic photon ray traced HDR Spherical Harmonics ambient occlusion self shadowing ect. goodness. It was amazingly pretty to look at, all of the objects had absurd levels of detail, when you put it in star ocean mode and paused, you could move around the battlefield to look at all the detail of the characters and monsters, seeing every little scar, emotion, item, scrap of clothing, was crazy! Kinda like the first time you discovered link wore earrings in Ocarina of Time.
So, now we have a excellent combat system, an amazing visual presentation, and the traditional orchestral music but this time with less music; Most of the game takes place in an 'ambient' environment, only when you do something that requires a beat, or a induced emotion is there a musical score. This adds greatly to the emotional and immersive impact of the game; For example, walking through a town sounds like a town, but stopping at a shop to do mundane purchasing pops up the lively 'shop' music, and it all blended acoustically together, forming a seamless transition. Lots of the environment was interactive, pots, crates, bushes could be examined or broken; Obviously sometimes with consequences; Most of the time you wouldn't really find anything either; Exploring was well emphasized, there were still invisible walls, but they were there only to help you, and eventually dissapear if you push on them long enough. Though, trying to walk off a cliff, your character stops youl, not a wall. They don't want to jump in lava, spikes, acid, death.
The controls meshed well with a PS3 remote. Was very intuitive for an RPG.
So the plot! Because that's what was so awesome about FF6, is how you got drawn into the world by the story. This is where I'll likely make mistakes; because I didn;t even get past the first part of the game, since I only played it for about 6 hours.
I remember being 'Setzer' in a team with Edgar, Cloud (wtF? musta been gau), Celes, Terra, and Relm (who is an adult this time around, if I could draw you a picture of her she'd get instant cult fame), and we were walking around some town, stocking up before attempting to infiltrated on of the larger magitek ships that had been docked in port. The world was torn, there were multiple powers fighting for supreme control of the magitek and espers, and there was of course the resistance that aimed to stop them from killing the planet/espers. That's what you do, and the first part was just going from town to town, fighting monsters (another note, monsters are very dynamic in Neo mode; They have a lot of specialized attacks and depending on the monster, you can indirectly tame/lure them depending. IE, I would have Setzer try and bait them with food, then Cloud critical them when they got close. Earning me a 'Evil' ranking most of the time, but hey, times are tough. I'm sure the game will cause that to backfire on me later, for being evil to so many of a specific enemy I'll probably run into a much larger one that kicks my ass)
So, eventually, after a lot of fighting and killing magitek guards, we found a drawbridge, and had to solve a physics puzzle with an open ended solution. WE srewed it up, so we had to find a boat and cross the moat; didn;t work, we ended up swimming into the sewer pipes of the ship (if it HAD worked, we would have saved a lot of time & got some cool items)
So now we're in the bowels of this really large, iron rusty colored monster, it was insanely large, larger than the superbowl; it had lots of smoothed out high tech looking cooridors, and the platforms above this sluice, which Terra figured out was 'cooling' their magitek reactor, which contained an esper, we eventually got cloud to ninja us a guard so we could take their weapons; The room we were in was about 35 ft tall, the bottom half had a hemispherical cutout that was full of hte sluice we were hiding in, and was really dark. The top half had cutout platforms nad rooms, lots of scientists in white walking around, and guards with white and red symbols. They looked a lot like the ones from FF6, mind you. so we split up, and each took some positions to try and get intel on where the reactor was. Most of the girls took labcoats and became 'scientists' and the guys took on casual appearances (there was a entire city in this ship, after all.) After some espionage, we got really unlucky, and Kevka showed up. Kevka, in this stage of the game, looked a LOT like sephiroth, but with a much crazier grin all the time, and was tall, but did not yet reach feather in hat stage. He was becoming mad with power, but hadn't completely lost it. Well, Kevka has a few bodyguards, and was actually being pretty personable, hitting people he didn't know on the shoulder, really hard and laughing about 'How's the Day' or something like that, knocking them down and just laughing about it. Was quite fitting. Apparently, Cloud got pissed off and confronted him...
So suddenly, boss mode happened.
Boss mode is really different; If you confront a boss OUT of character, this special mode comes up, where time is slowed down a lot, and you get all these new special gauges; Because if you were to actually defeat kevka at this point, it would probably mess up the game, the game makes sure to give you a damn good challenge. When a boss fight occurs, your teammates can suddenly join the 'battle sphere' which is a large area surrounding the boss. Joining it gives you your command queue;
Once the fight starts, everyting happens in REAL time, but slowed down about 10 times; so you can see everyone attacking at once; thinking quickly is the only way to survive. Kefva had a revolver like the joker, and luckily missed cloud but killed two people in the immediate area (battles don't "transport" you somewhere else, you exist in the world at all times, so your fights can fuck up the world!) cloud tried to hit him but got stabbed in the gut (Kevka had armor on under his white suit) so he backed off; Kevka ended the fight by default, so we couldn;t fight him. Apparently, he had no idea who we were, and was actually delighted we tried to kill him. Something about "I haven't seen such fire in a long time! Cecil, get this man to the recuiting station!" And just continue on, laughing manically after hitting shocked cloud on the shoulder, knocking him down. Kevka's bodyguards never entered the fight, indicating they knew you were no match.

There is so much detail in this dream, but I can't really remember all of it. Point is, if it was written out correctly, I sure hope that someone makes a RPG like it. Woudl be awesome.

-Z

2010-01-29

Picking, Mouse Projections, Screen to Ray

 The Problem:

When the user clicks on the 2D screen, how do we know in 3D coordinates where they actually clicked, so we can select the object they clicked on?

The Solution:

Obviously a simple geometric / linear algebra problem. It is commonly done by querying the graphics card for the projection, modelview, and viewport. I despise asking the card for anything, as it should be a one way pipe. (minus CUDA, which is still new).

Our special case is, if we know how we constructed the projection matrix, we can easily invert the process to convert a screen ray into world coordinates. Then we can make those world coordinates relative to our "camera" matrix, and you can then perform a ray to scene collision detection;

This is also called "picking", "selection", and has a variety of other names. I highly reccomend never using any method but your own geometric methods, since you can't rely on this type of functionality to be consistent, without ensuring your own code is.

In layman terms, "You can click things in 3D" / "What you see is what you get"

The orange dot is the actual 3D position of the Ray -> AABB intersection
(A Ray is defined by a point and a direction, a AABB is a axis aligned bounding box, so it has a minimum position and a maximum position, or a center and a half-size for each axis)



Here's some code snippet:

class matrix
{
    public:

    //+X = left, +Y = up, +Z = forward
    float Xx, Xy, Xz, Xw;    //Order from spec; Colum major 0..16. Have to transpose all the mathematics (internally)
    float Yx, Yy, Yz, Yw;
    float Zx, Zy, Zz, Zw;
    float x, y, z, w;

    ...


void mingl::matrix::frustum_get_ray( int umouse_x, int umouse_y, int window_w, int window_h, float distnear, float distfar, float fovangle, float & Rx, float & Ry, float & Rz, float & Rdx, float & Rdy, float & Rdz )
{

    float scrn_x =  (float)(2*umouse_x - window_w) / ((float)window_w);
    float scrn_y =  -(float)(2*umouse_y - window_h) / ((float)window_h);

    float td_dx, td_dy;

    float td_tan = tan( fovangle * (M_PI/360.0f) );

    if( window_w > window_h ){

        td_dx = td_tan * scrn_x * ((float)window_w/(float)window_h);
        td_dy = td_tan * scrn_y;
    }else{

        td_dx = td_tan * scrn_x;
        td_dy = td_tan * scrn_y * ((float)window_h/(float)window_w);
    }

    //Generate points on the projection viewport
    float p1[3] = { td_dx*distnear, td_dy*distnear, distnear };
    float p2[3] = { td_dx*distfar, td_dy*distfar, distfar };
    float dv[3] = { (p2[0] - p1[0]), (p2[1] - p1[1]), (p2[2] - p1[2]) };

    //Note this is a specialized "To Global" operation (because of the inversion on axes)
    //Ray does not start from center of camera.
    Rx = x - Zx * p1[2] + Xx * p1[0] + Yx * p1[1];
    Ry = y - Zy * p1[2] + Xy * p1[0] + Yy * p1[1];
    Rz = z - Zz * p1[2] + Xz * p1[0] + Yz * p1[1];

    //note the conversion.
    Rdx = -Zx * dv[2] + Xx * dv[0] + Yx * dv[1];
    Rdy = -Zy * dv[2] + Xy * dv[0] + Yy * dv[1];
    Rdz = -Zz * dv[2] + Xz * dv[0] + Yz * dv[1];
}
 From reading that code, you'll notice the projection matrix is defined by:

    //3D projection matrix via symmetrical frustum; the most common projection.
    float fov = 60.0;
    float aspect = 1.0;
    float unear = 0.125;
    float ufar = 1024.0;

    float top = tan(fov*0.00872664625997f) * unear;    //0.00872665f = pi / 360 = (pi / 180) * 0.5
    if( (window_h > 0) && (window_w > 0) ){

        if( window_w > window_h ){

            aspect = float(window_w)/float(window_h);
            projection.frustum( aspect * -top, aspect * top, -top, top, unear, ufar );
        }else{

            aspect = float(window_h)/float(window_w);
            projection.frustum( -top, top, aspect * -top,aspect * top, unear, ufar );
        }
    }


void mingl::matrix::frustum( float ul, float ur, float ub, float ut, float un, float uf )
{
    float dx = (ur-ul);
    float dy = (ut-ub);
    float dz = (uf-un);
    dx = (dx <= 0) ? 1.0 : dx;
    dy = (dy <= 0) ? 1.0 : dy;
    dz = (dz <= 0) ? 1.0 : dz;

    identity();

    Xx = (2.0*un)/dx;
    Yy = (2.0*un)/dy;
    Xz = (ur + ul)/dx;
    Yz = (ut + ub)/dy;
    Zz = -(uf + un)/dz;
    Zw = -1.0;
    z = -(2.0*uf*un)/dz;
    w = 0;


Works beautifully! Onward with my megaman project.

-Z