Advertisement

[java] diablo 2 in opengl

Started by November 08, 2000 03:00 PM
8 comments, last by overlord 24 years, 2 months ago
i just wanna know if diablo 2 could be programmed with opengl, and if so, what would be the performance?... and what would you use 3d models or textured quads? sorry for my english, its not my primary language... and im new to opengl too
First, Diablo 2 is a 2D rendered game. OpenGL is 3D rendering system, so although you can use OpenGL there is really no reason to do so. Use a simpler graphics library if you just need 2D graphics.

And performance; it really depends on several factors, but given that Diablo 2 is 2D you can make it run faster using a 2D library.

Use OpenGL for 3D games only. OpenGL is good for 3D games and they run at a high performance - if you are good at using it.

Jacob Marner
Jacob Marner, M.Sc.Console Programmer, Deadline Games
Advertisement
Diablo II will utilize a 3D accelerator if you want it to. This allows much prettier eye candy and better effects.

3D hardware is not only for 3D. By using pre-transformed and lit vertices, you can render any type fo view, including 2D isometric or tiled. There is no reason why OpenGL cannot be used to make a game like Diablo II. Diablo II supported Direct3D and Glide, why not OpenGL? It is just as capable.


Steve ''Sly'' Williams
Tools Developer
Krome Studios
Steve 'Sly' Williams  Monkey Wrangler  Krome Studios
turbo game development with Borland compilers
i have read that opengl can be used to draw 2d graphics, and you can use texture quads and drawpixel or something like that, but i think the textures have a restriction in size of power of 2, and drawpixel is something slow... am i wrong?... then what do you think its the best way to make something like diablo with opengl?
OpenGL can be used to render 2D views but I just think that it is not very suited for it. It doesn''t even ensure that you get better performance. I would prefer DirectDraw any day.

Take Baldur''s Gate 2 for instance. When running that in OpenGL mode with my nVidia GeForce 256 the framerate fell to below 5, while without 3D it was well above the 30. (700Mhz Athlon machine for the record).

I haven''t played Diablo 2 but have just seen screenshots, at it seems that if openGL is used it must be for making 3D spells. OpenGL is only an advantage if you need at least some 3D. No 3D, no advantage. OpenGL Tetris? Nah.

When OpenGL is given some 2D to draw it is actually textured surfaces that it draws. No matter what you say this must be slower than using hardware that has 2D graphics acceleration.

Jacob Marner
Jacob Marner, M.Sc.Console Programmer, Deadline Games
then you think making 3d models of all sprites of diablo 2 or baldurs gate will be ok?...
what will be the performance of that games?...
are there any example of a 3d rpg with the style of d2 or bg2?

oh, and thanks for your answers...

the point is: im a beginner, and i like opengl more than d3d or directdraw, so i wanna know if a can use it to make something like the games i have talked before
Advertisement
quote: Original post by overlord
then you think making 3d models of all sprites of diablo 2 or baldurs gate will be ok?...
what will be the performance of that games?...
are there any example of a 3d rpg with the style of d2 or bg2?


will be ok? If you mean that it is possible then yes. And if I think it is a good idea then yes, assuming that you want to use openGL. Using openGL for 2D is a waste of a powerful system. But again - using 3D models is more work for you, so it really up to you to deside.

And again, the performance can be very good, but it depends on how good you are a programming openGL. OpenGL, is a 3D interface. If you want more work done for you from the beginning you should use a complete 3D engine.

And about d3d and directdraw. d3d is somewhat complex, but DirectDraw is actually quite simple to use - simpler than OpenGL - mainly because openGL is for 3D and directdraw for 2D. Alternatively, you can use Java2D (this is a java forum, you know).

But if you intend to mix 2D and 3D you should use something 3D like openGL. You can also place 2D sprites in a 3D world without problems (like in Doom).

And examples? This depends on what you mean with "playing style" bg2 and d2 are quite different. If you just mean something RPG like, then Deux Ex or Vampire - The masquarade are good examples.

Jacob Marner
Jacob Marner, M.Sc.Console Programmer, Deadline Games
I think I know what you mean, like actually having the models be 3d instead of created with a 3d engine then rendered in sprites (like all those games, Starcraft, Warcraft, C&C series, etc..)

I think (but I''m not 100% sure on this) that Total Annihilation was a 3d game from a fixed camera position of top-down. I know the units were pre-rendered in 3d but were they converted to sprites like all the other games? That I don''t know. I was under the impression that they werent so in that case opengl could have been used there.

True though that this isn''t an rpg but rts.

As for making games like that well as Jacob said, it''s your decision but it''ll be harder. If you''re a beginner you should really start looking into an easier type of game. Instead of attempting a 3d game just yet, I''ve been making a Final Fantasy 1 clone which is strictly 2d but it''s easier.

Either way, good luck,
Smoo
Is Java 2D part of the current Java release?
"do you like my helmut?"-yoghurt
Diablo uses the 3d card mostly for the non 3d features such as alpha blending, and some other effects. 3d cards and API''s don''t just do 3d, they have a lot of other features that are useful for both 2d and 3d. In the case of the parallax effect they probably are using 3d objects, where each layer is a seperate object. No it isn''t used for the spells. Also with some cards it makes the colors a lot better, Diablo has a bizzarre color system. All the source images are in 256 colors to save disk space, though they do not share a single pallette. Then in the game they get promoted up to true color, and they are shaded and tinted as need be. So each frame is constructed with lots of colors and then before it is sent off the frame is brought down to 256 colors again. So what you see is 256 colors but each frame has a different pallette. It can lead to things being kind of ugly and dithered looking. If you have a 3d card the process might change depending on the features your card has, in some cases I think the screen might display more than 256.

This topic is closed to new replies.

Advertisement