🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

is it possible to render a 2D scene from the side?

Started by
10 comments, last by Ravyne 15 years, 5 months ago
Quote: Original post by solinent
you could try making a bunch of polygons that represent raised portions of your 2d maps. Then simply render a 1 x width image with opengl from the position of the viewer.
The OP insists that there are no "raised portions" of the 2D maps, that it is actually a 2D world (which I have a hard time getting my head around conceptually... I think the OP is confused about what I was trying to say).


Advertisement
What smitty is getting at, is that if you have a 2D overhead view and representation that the gameworld works on, some things in that world have "height" even if they are just flat 2D bitmaps -- Bushes, blocks, houses...

what you can do is give these objects some kind of 2D outline similar (or possibly identical) to their collision data. then, you can project that 2D representation into 1 dimension in exactly the same fashion as we project 3D representations into 2 dimensions for 3D games. You can also allow an object to be transparent or even semi-transparent with suitable processing.

This would accomplish the same thing as ray-casting. I'm not sure which method would be more efficient, but they should be functionally equivalent.

You'll also want to thing about what type of data you want to encode into your vision buffer. Rather than pure color, you probably want to think about encoding a handle to the viewed object, it's distance from the viewer (think z-buffer), and other useful data.

It seems like the point of this all is to make the AI seem more physically grounded than those which typically rely on "inside information" that the program knows (but which the AI entity should not). So you may want to think about allowing an AI entity to "tag" viewed objects with what it knows about it, and then allowing them to track these objects. For example, an AI entity is confronted with two enemies, it watches it's AI comrade inflict damage upon one of them... based on this it might decide to attack the other enemy, keeping it busy, or to team up on the weakened enemy in order to dispatch it quickly and gang up on the other afterward.

When it comes to things like an enemy's last-known position, you would have to combine the AI entities view, acquired knowledge, and "inate knowlege" (eg - classical path-finding) of the geometry of the area in order to reason about where a viewed object may have gone after disappearing from sight.

It would be a pretty cool system, implemented correctly. It always did annoy me back in the day when an enemy would know my location, even though I was on the other side of a tall wall, just because I had passed within some magic distance of him.

throw table_exception("(? ???)? ? ???");

This topic is closed to new replies.

Advertisement