Merlz

Member

31

163 Neutral

• Rank
Member
1. Equation of a Square?

Here's another one, just for fun: abs(x) + abs(y) <= 1 Although this one is at 45 degrees rotation to the axis, it's of max radius 1 :-)
2. 8 Way Movement Via Mouse Control (2D Game)

remember to check for mousex=charx first, otherwise you could divide by zero
3. 3d-ize a bitmap with a height/displacement map

These are my suggestions: -make sure you have texture blending turned on. -to make lighting look less pixellated: set the normals yourself and use the average of all triangles indicent on a vertex. -to make it faster nicely: take 2*2 pixel blocks, average the height and position of all pixels with height > 0. Then do the same as you are now but with these points. You can use the resulting averaged x/y coords as texture map points too.
4. bitmap graphics to lines

Say I have a bitmapped picture, and I wanted to draw it with a device that is not a scanning device. The device has a constant brightness and slightly variable speed but changes direction quite slowly, so I have to plot a winding path around the bitmap image that will approximate the right exposure per-pixel. All obvious tricks like frequency transforms to obtain outline traces aside, how would I go about converting my bitmap image to a good path for said tracing device? Are there any good algorithms that I could use to do this? Any places I should look?
5. Real World Light Attenuation

Quote:Original post by Grasshopper Fog Factor = e^(-k*DistanceToCamera)/(DistanceToCamera*DistanceToCamera) that's close, but not quite right. The total lighting eqn (fog + light falloff) would be more like: lighting = e^(-k*DistanceToCamera)/(DistanceToLightSource*DistanceToLightSource) But normally, k is very small, so most engines approximate e^(-k*DistanceToCamera) with a straight line (or quadratic). The result is: lighting = k*DistanceToCamera /(DistanceToLightSource*DistanceToLightSource) Both OpenGL and DirectX should have functions for adjusting both the speed light intensity falls off, and the falloff due to the medium it travels in. Adjust for artistic effect :-)
6. 3d-ize a bitmap with a height/displacement map

If you don't lock the corners of your smaller quads to the sides of larger neighbours, you're gonna get lotsa nice big holes :) I'd suggest mapping each pixel (or every second pixel) as a vertex for now and optimising after you've got the whole heightmap thing working well (then at least you have a base example to compare quality to as well). It's an interesting idea though, I'd like to see some screenies of the rendered models made this way.
7. splitting 16bit to 2 x 8bit

yeah, not converting at all is smartest :)
8. The illusion of intelligence...

As humans, it suits our perceptions to anthropomorphize everything. The less "human" something is, the more distanced we will feel from it. Good game AI, therefore, has to give not the illusion of intelligence in general, but the illusion of HUMAN intelligence. Make it act like a person (regardless of the game - imagine an RTS AI that carried grudges), and you'll find players are only to willing to believe it is and forgive the illusion its faults.
9. My camera that slowly stops working.

try adding vVector.y to _wantView.y... just an intuitive hunch...
10. terrains in WoW

I think it's actually multitextured, tiled terrain type textures with blend levels set on vertices (and obviously very optimized). I could be wrong, but that's what it looks like. If not, then maybe there are textures blending between types that are tiled in between? (like 2d tiled games do...) If you look closely, you can see that the terrain repeats :-)
11. Real World Light Attenuation

Just to clear up terminology: attenuation through matter is the exponential decay formula you found; radiation from a point is the formula we use to calculate lighting normally. Attenuation usually refers to how much gets blocked, whereas radiation talks about how the light spreads out. For instance, lasers don't radiate outwards much so Lumens/dist^2 is a really bad approximation of how they work. Streetlights and our sun, on the other hand, behave properly (for the way we model light, anyway) and follow Lumens/dist^2. ( this is physics... I guess in graphics we can call radiation attenuation, but then it confuses real attenuation :) ) I think openGL has an exponential fog equation to simulate this attenuation effect too - if you ever do need it. IMO, it's prettier than linear fog, but it's much more expensive to calculate so games typically don't use it as much. In air and even water, the coefficient of decay is small enough that you'll only notice any effect over long distances, so we usually ignore it altogether in games. To see the effect in real life, have a look at how mountains in the far distance turn bluish ;)
12. splitting 16bit to 2 x 8bit

The only real way to do it mathematically is to use ints, mod, and divide. High byte: value/256 Low byte: value%256 As long as you're using integer values, that should do what you want.
13. question on dynamically increasing/decreasing the size of the map [how?]

please define "2d map". Do you mean an actual map, an array, some limiting values...?
14. Making a multiplayer game with physics feature

Your best bet is to figure out how to compare physics states simply. Maybe some kinda function that, say, adds all distances squared and compares them across the network? You need to establish that the objects on both sides are *roughly* equal, and work out which one is server if they need to resync.
15. Size of n mipmaps

IIRC, the limit of mipmaps (of any pixel size as long as they're reduced by the standard scaling)is < original image/3 (may want to look up to check...). just out of interest, why are you using 2^n+1 sizes?