The One Man MMO Project
I've spent quite a bit of time the last couple weeks piecing bits of different articles together to figure out how to implement normal mapping in the Lair Engine. The problem I encountered is that there is a huge variation in the methods and terminology used for normal mapping. This makes it a very confusing topic for non-math-lovers like myself. So here I'm going to explain the three common techniques for normal mapping for the mathematically uninclined.
Read 23052 more bytes... (4 comments)
Thursday morning it occurred to me that today would mark the 4 year anniversary of the start of my work on The Imperial Realm :: Miranda which made me think, "it's about time I put up some real, unretouched in-game screenshots."
[Waiting out the Sandstorm]
[Immovable Object, Meet The Irresistible Force]
I love the sand storm effect! Sometimes I park the camera under a ridge and watch the sand blow over my head. Getting all those particles interacting with the terrain at a decent frame rate was tough.
These screenshots show The Wasteland, one of several biomes in the game. It is hot, white sand, and rock and nothing lives there except some curious flowers. Anything you can see in the screenshots you can go to with no immersion-breaking load screens.
You may have noticed the second shot borrows a note from Oblivion. I loved the shots of Jack motorcycling between buried ships in a post-apocalyptic wasteland. If the final game reminds you a bit of Iceland, Oblivion and Prometheus are why.
I've been experimenting with the UI quite a bit. It's funny playing other peoples' RTS games now, because if they don't have WASD screen scrolling it drives me crazy. You'll notice that the first screenshot has no UI in it. After playing Skyrim, I kind of appreciate the no-hud aesthetic so right now the hud only appears if you hold down a key. I am going to make it react intelligently to ingame events, so if a new enemy comes in range, the minimap will appear. If a friend comes online, a little notification will appear for a moment. I'm not sure how this will work out yet - I suspect many players will just lock the HUD onscreen and go from there. Playtesting will tell.
One thing I discovered while taking these screenshots is that Alt-Printscreen is terrible in an OpenGL full-screen. I was trying to catch an image that gave an idea of what the moving screen looks like so timing had to be precise. As it turns out, Alt-Printscreen takes a screenshot of when you switched to the app not when you press Alt-Printscreen. So about 30 minutes of frustrating attempts to get a good result ended in me downloading Fraps which worked perfectly and also saved me the step of pasting the screenshot into Gimp.
Contemplating the length of time I've been working on this game, I spent a few minutes this week looking at other indie games with long gestations. Phil Fish spent five years on Fez and had a pretty tough time of it, although he admits that a lot of that is his own doing. I think I'm a bit more like his programmer - reasonably well balanced. Having a family really helps with balance. There's a nice piece on the difficulties of making of Fez at Gamasutra. I also read that Jonathan Blow spent three years and $200,000 of his own money on Braid. That makes me feel a bit better since I haven't spent nearly that much yet.
The game has come a long way from its first screenshot.
[First ever screenshot of MMO-1 (as it was known as on January 15, 2010)]
Read more... (0 comments)
Here is a good example of why multithreading is hard. I have a Thread class which all of my different threads derive from. The two interesting methods are:
void Thread::Run( void )
Now whenever I want a new thread, I derive a class from Thread, create a ThreadProcedure within the new class to do what it needs to do, then have some code like this:
HttpGetThread* workerThread = new HttpGetThread( this, host, port );
Now you'd think, that should be fine, so what's the problem? The problem is that once in a very long while, instead of the derived class' ThreadProcedure method running, the base class' ThreadProcedure (as shown above) would run! I put a breakpoint in Thread::ThreadProcedure and looking at the __vfptr I could see that it did indeed point to Thread::ThreadProcedure, not HttpGetThread::ThreadProcedure. But that's just crazy!
Read 1644 more bytes... (0 comments)
I can't remember the last time I had to spend any time finding a memory stomp. This was not always the case -- I have spent many an hour with data breakpoints. Man was I happy when those finally started working on the Wii. Today I thought I'd share a couple little things I use to eliminate overflows in my code.
Read 2561 more bytes... (2 comments)
I always hated working on games that didn't have a working debug build. On some the framerate was too low. Some didn't even build. There was always one real reason for it: somebody in charge didn't think it was worth having a running debug build. But the cost of a broken debug build is a huge increase in bugfixing time. Debugging a non-debug build results in misleading values in your debugging windows, bad callstacks, and heavy reliance on static analysis of trace output to figure out what has gone wrong. In short: it has a huge cost in developer time.
Read 5477 more bytes... (0 comments)
I've been stuck on this for a week, so I'm putting it out as a Friday puzzle challenge. Can you tell me what I'm doing wrong?
I added the normal mapping code from Followup: Normal Mapping Without Precomputed Tangents. I have other normal mapping code which uses the usual method of passing the tangent vector with the vertex data and that works great. There's no vertex shader code on The Tenth Planet, so I had to figure that out myself.
The problem I have is that if I use the normal from perturb_normal, the lighting rotates with the model so it is always the same side of the model that is lit (beautifully) no matter how the model is oriented relative to the light source. If I light the model with the interpolated vertex normal I get smooth n dot l lighting which works as expected.
Read 8363 more bytes... (1 comments)
In my quest to increase draw distance, I needed to find a way to reduce the number of triangles in my terrain block meshes from 7938 to something much smaller but that still retained the overall shape of the original block. I found lots of algorithms for decimating (reducing the number of triangles in) meshes but nothing specific to terrain meshes.
Read 8978 more bytes... (0 comments)
I read this post on AltDevBlogADay which made me decide to finally post this:
I was approached by a fresh-faced rep from Hansoft at Game Developers Conference a couple years ago. She asked me if I used project management tools, and after replying that I used their software, she was really excited and asked me what I thought of it. I told her I had never seen a product so thoroughly designed to make people feel bad about their work. She stared at me blank faced, then handed over one of every tchotchke they had in their booth.
The toys didn't make me feel any better about Hansoft. Do you have a happy team? Hansoft may well drive it into the ground.
Read 3167 more bytes... (1 comments)
I spent a couple hours reading pages of Google results trying to figure this out last night. There are a lot of people who seem to have problems with this. The pictures are all reasonably clear, but the implementations are quite variable for a non-math guy. Here's the resulting vector code which seems to be good. Maybe this'll help someone. Note that you can replace Vector3 with Vector2 and this will work for 2D lines.
p1 and p2 are points on a line. DistancePointLine returns the perpendicular distance p3 is from that line. It returns true if p3 is perpendicular to the line segment from p1 to p2, false if not. It also returns the distance from the infinite line going through p1 and p2 (because I found that more helpful.)
IntersectionPointLine returns the point on the infinite line that runs through p1 and p2 that is perpendicular to p3. Some variations of IntersectionPointLine return either p1 or p2 as the intersection point if p3 is not within p1 to p2 (u is out of range 0.0-1.0) which would give the distance to a point which is on the line segment, but in this case it is no longer the perpendicular distance. If this is what you want, in IntersectionPointLine return p1 if i < 0.0 and p2 if u > 1.0. That wasn't helpful in my case (I'm using this to decimate meshes) hence the code below finds the perpendicular distance from the infinite line.
Here is the C++ code:
bool Geometry::DistancePointLine( const Vector3& p3, const Vector3& p1, const Vector3& p2, float32 *distance )
Read more... (1 comments)
I was talking to an artist buddy on the weekend about post effects. I wanted to add a heat refraction effect for my hottest biome, and we got to talking about what other post effects I might want to consider. There are a ton of possible post effects, but as a non-artist, I'm often unsure as to whether they're really worth the effort of implementing. Color Correction came up as very worthwhile, and as it turns out, it is super easy to use (even for the artistically challenged.)
[To test Color Correction, I made the world sepia (not final art.)]
Read 3097 more bytes... (1 comments)
Three Normal Mapping Techniques Explained For the Mathematically Uninclined - 2013-11-27 23:52:18 (4 comments)
Crossposted to gamasutra.com with some additional comments.
Friday Puzzle Challenge - 2013-11-27 02:18:10 (1 comments)
Don't use this shader code. I figured this all out, you can read the details at onemanmmo.com
Three Normal Mapping Techniques Explained For the Mathematically Uninclined - 2013-11-25 18:08:17 (4 comments)
Skimmed that too fast :P Thanks for sharing.
Three Normal Mapping Techniques Explained For the Mathematically Uninclined - 2013-11-25 17:15:50 (4 comments)
Yes, that's method 3 above ;-) Normal Mapping Without Precomputed Tangents
Three Normal Mapping Techniques Explained For the Mathematically Uninclined - 2013-11-25 14:13:10 (4 comments)
Once you figured out the problem with rotating light, were you able to get it working without the precomputed tangents?
Copyright (C)2009-2013 onemanmmo.com. All Rights Reserved