Welcome, Guest. Please login or register.
April 18, 2024, 03:50:15 PM

Login with username, password and session length

Search:     Advanced search
we're back, baby
*
Home Help Search Login Register
f13.net  |  f13.net General Forums  |  The Gaming Graveyard  |  Game Design/Development  |  Topic: Fun with Java 3D (hobby project update) 0 Members and 1 Guest are viewing this topic.
Pages: [1] Go Down Print
Author Topic: Fun with Java 3D (hobby project update)  (Read 4487 times)
Margalis
Terracotta Army
Posts: 12335


on: February 01, 2006, 01:13:32 AM

So, I ran into a rather large issue in my hobby project. I tried to make a fairly decent map and ran into 2 problems:

1: The drawing performance is crap
2: If you put a hill in the middle of a map, you can't see behind it. (Reminder: my game has a Tactics Ogre style map)

I was wondering about #2 for a while, then I realized that in every game I could think of the way they avoid this is the bottom part of the screen is always lower than the top part. High ground is always towards the top.

Now, I want my maps to be largely symmetrical, so that wasn't an option.

So I began looking into doing 3D stuff in Java. I spent a few hours looking into Java3D, it appears to be kind of crappy, with a bunch of scene-graph management garbage that I don't need (or want) and it lags behind OpenGL. I got bogged down trying to figure out how to move my eyepoint properly and said screw it.

Now I'm looking into JOGL, which is a very thin wrapper around OpenGL. It supports extensions, shader language, etc, and is really as thin as you can get. All the methods have the exact same names as OpenGL and it is not object oriented in any way. (Yes, that's a good thing in this case)

The demos are impressive - nice performance with real time shadows, dynamic lighting, etc. Plus I already know OpenGL. (Although it's been 5+ years since I've done anything with it)

So it looks like I'll be converting my sprite based map into a fully rotate-able 3D extravaganza.

vampirehipi23: I would enjoy a book written by a monkey and turned into a movie rather than this.
Roac
Terracotta Army
Posts: 3338


Reply #1 on: February 01, 2006, 06:38:23 AM

So, I ran into a rather large issue in my hobby project. I tried to make a fairly decent map and ran into 2 problems:

1: The drawing performance is crap
2: If you put a hill in the middle of a map, you can't see behind it. (Reminder: my game has a Tactics Ogre style map)

FYI, they avoid #2 by having the camera at an angle to the ground, and have every hill with a slope less than that angle, or else with a peak small enough so that it doesn't overlay with the tile behind it.  Another option is to allow rotation of the camera, and leave just enough of any figures poking up from behind a hill so that you know to rotate it.

-Roac
King of Ravens

"Young people who pretend to be wise to the ways of the world are mostly just cynics. Cynicism masquerades as wisdom, but it is the farthest thing from it. Because cynics don't learn anything. Because cynicism is a self-imposed blindness, a rejection of the world because we are afraid it will hurt us or disappoint us." -SC
Alkiera
Terracotta Army
Posts: 1556

The best part of SWG was the easy account cancellation process.


Reply #2 on: February 01, 2006, 01:56:19 PM

Glad to see this is still going on.

I myself tend to use OGL in my graphics projects, because I'm familiar with it from school.  But I tend to write in C/C++, so I don't need the special wrappers like Java does, nor any pre-conceived ideas of using some built-in graphics lib.

Alkiera

"[I could] become the world's preeminent MMO class action attorney.  I could be the lawyer EVEN AMBULANCE CHASERS LAUGH AT. " --Triforcer

Welcome to the internet. You have the right to remain silent. Anything you say can and will be used as evidence against you in a character assassination on Slashdot.
Margalis
Terracotta Army
Posts: 12335


Reply #3 on: February 01, 2006, 06:15:17 PM

JOGL is basically a very thin wrapper for OGL, it has a class classed "GL" that just has every GL method on it. It's not object oriented in any way.

It's funny because as I look at screenshots of isometric 2d tactics games, they all use the strategy of having the low ground at the bottom of the map, to avoid occlusion problems. Sometimes they do something sneaky like have a big pillar in the foreground but for the most part the topography is always high points towards the top.

I got as far as making 2 fairly distinct armies and an ok map. It has some water, two bridges, some hills, etc. It's pretty playable, although not very fun it does already take some strategy.

Army 1 has some splash damage ranged weapons and some flying crossbow guys, which have good offense if you can position them but have some negatives (splash damage hurts allies and ranged weapons have a minimum range req). The other side is pretty straightforward offense with no ranged attacks and less overall mobility. So the basic idea is player 1 tries to set up a fairly defensive position and control space while shooting from behind lines, while player 2 tries to break through.

vampirehipi23: I would enjoy a book written by a monkey and turned into a movie rather than this.
Kail
Terracotta Army
Posts: 2858


Reply #4 on: February 01, 2006, 06:44:22 PM

So it looks like I'll be converting my sprite based map into a fully rotate-able 3D extravaganza.

Stupid question:

Last I saw, your game was using (I believe) rectangular icons to represent the armies.  For the final, are you planning to stick with the rectangles, or do the units as sprites or polygons?
Margalis
Terracotta Army
Posts: 12335


Reply #5 on: February 01, 2006, 09:01:40 PM

Probably going to stick with the rectangles. It will just be 3D rectangles now. There is no way I can create sprites or 3D models in any large number.

vampirehipi23: I would enjoy a book written by a monkey and turned into a movie rather than this.
Alkiera
Terracotta Army
Posts: 1556

The best part of SWG was the easy account cancellation process.


Reply #6 on: February 02, 2006, 07:45:53 AM

Probably going to stick with the rectangles. It will just be 3D rectangles now. There is no way I can create sprites or 3D models in any large number.

Ah, 'Programmer Art'.   I'm well familiar with it.  I've made quite a bit of it, myself.

Alkiera

"[I could] become the world's preeminent MMO class action attorney.  I could be the lawyer EVEN AMBULANCE CHASERS LAUGH AT. " --Triforcer

Welcome to the internet. You have the right to remain silent. Anything you say can and will be used as evidence against you in a character assassination on Slashdot.
Hoax
Terracotta Army
Posts: 8110

l33t kiddie


Reply #7 on: February 02, 2006, 11:08:50 AM

/em signs up for beta

A nation consists of its laws. A nation does not consist of its situation at a given time. If an individual's morals are situational, then that individual is without morals. If a nation's laws are situational, that nation has no laws, and soon isn't a nation.
-William Gibson
Stephen Zepp
Developers
Posts: 1635

InstantAction


WWW
Reply #8 on: February 02, 2006, 11:45:34 AM

Are you diametrically opposed to using a game engine of any sort? T2D would be an amazing baseline to use for a game like this, and there are several tutorials already available for RTS style games that would adapt nicely. If you are moving to a different environment already, might make sense to take a look.

Rumors of War
HaemishM
Staff Emeritus
Posts: 42629

the Confederate flag underneath the stone in my class ring


WWW
Reply #9 on: February 02, 2006, 12:14:58 PM

I think he was doing this to try to learn Java.

Margalis
Terracotta Army
Posts: 12335


Reply #10 on: February 02, 2006, 04:28:10 PM

No, I know Java very well. It's my day job. I also know C/C++ and Torque. (I own a license, although I haven't looked at T2D much) I am not using T2D because I don't want to build on an existing engine. I want to write my own.

It would be faster to use T2D, and probably better as well, but this is a hobby project. I just like writing things from scratch.

vampirehipi23: I would enjoy a book written by a monkey and turned into a movie rather than this.
Stephen Zepp
Developers
Posts: 1635

InstantAction


WWW
Reply #11 on: February 02, 2006, 05:12:07 PM

No, I know Java very well. It's my day job. I also know C/C++ and Torque. (I own a license, although I haven't looked at T2D much) I am not using T2D because I don't want to build on an existing engine. I want to write my own.

It would be faster to use T2D, and probably better as well, but this is a hobby project. I just like writing things from scratch.

I seemed to remember you saying that, which is why I wanted to confirm!

The main reason I brought it up is that your work so far would make an excellent demo for T2D, and we're in the process of selecting the GDC demo's we want to present, so it made me want to ask!

Rumors of War
Margalis
Terracotta Army
Posts: 12335


Reply #12 on: February 02, 2006, 06:35:41 PM

The fact that all my artwork and sound effects are cribbed from various places would probably make that a bad idea anyway.

vampirehipi23: I would enjoy a book written by a monkey and turned into a movie rather than this.
Yegolev
Moderator
Posts: 24440

2/10 WOULD NOT INGEST


WWW
Reply #13 on: February 03, 2006, 01:56:48 PM

If it makes you feel better, I have been dissatisfied with the camera in every tactics game.  In my opinion, you could get away with the old four-position rotation scheme.

Why am I homeless?  Why do all you motherfuckers need homes is the real question.
They called it The Prayer, its answer was law
Mommy come back 'cause the water's all gone
Margalis
Terracotta Army
Posts: 12335


Reply #14 on: February 03, 2006, 08:51:13 PM

Four position rotation was actually exactly what I was thinking. I will probably do more so I can mess around on a debug level but as far as for the end user being able to swing around to one of 4 vantage points sounds fine, maybe with a bit of zooming as well. Especially if the underlying map is basically grid based, there really isn't any reason to view from more than 4 angles.

vampirehipi23: I would enjoy a book written by a monkey and turned into a movie rather than this.
Margalis
Terracotta Army
Posts: 12335


Reply #15 on: February 08, 2006, 12:23:37 AM

Random update: Sp JOGL seems pretty good. I know OpenGL but it's been 5+ years since I've done anything in it, but it is coming back to me.

I had a map in 2D before that had 3 levels with brick, water and grass. Now I have the same map in 3D with green, blue and grey blocks. It looks a bit funky because the normals on my bricks are weird and each brick face only has 2 triangles in it, so the shading looks a bit weird. (Rather than a smooth surface it looks like a bunch of individually lighted bricks thrown together)

I also have a rudimentary camera working, can zoom in and out and pan around.

In a couple of days I should have the map looking somewhat decent. Then I have to put the unit markers on the map again and then do all the 2d stuff like the cards and the battle screen, although I will probably change it to be more 3d-ish by having the two guys who are battle sort of turn and face each other a bit or something like that.

vampirehipi23: I would enjoy a book written by a monkey and turned into a movie rather than this.
Alkiera
Terracotta Army
Posts: 1556

The best part of SWG was the easy account cancellation process.


Reply #16 on: February 08, 2006, 07:28:12 AM

Random update: Sp JOGL seems pretty good. I know OpenGL but it's been 5+ years since I've done anything in it, but it is coming back to me.

I had a map in 2D before that had 3 levels with brick, water and grass. Now I have the same map in 3D with green, blue and grey blocks. It looks a bit funky because the normals on my bricks are weird and each brick face only has 2 triangles in it, so the shading looks a bit weird. (Rather than a smooth surface it looks like a bunch of individually lighted bricks thrown together)

I also have a rudimentary camera working, can zoom in and out and pan around.

In a couple of days I should have the map looking somewhat decent. Then I have to put the unit markers on the map again and then do all the 2d stuff like the cards and the battle screen, although I will probably change it to be more 3d-ish by having the two guys who are battle sort of turn and face each other a bit or something like that.

I always made blocks out of quads in OGL, instead of triangle pairs.  Quads are easier to texture, too, and might help with your lighting issue.

I also can't recommend using display lists for your blocks enough.  That way you define them once for each different block, and the video system only has once copy of the definition, no matter how many are actually on the screen.

Alkiera

"[I could] become the world's preeminent MMO class action attorney.  I could be the lawyer EVEN AMBULANCE CHASERS LAUGH AT. " --Triforcer

Welcome to the internet. You have the right to remain silent. Anything you say can and will be used as evidence against you in a character assassination on Slashdot.
Pages: [1] Go Up Print 
f13.net  |  f13.net General Forums  |  The Gaming Graveyard  |  Game Design/Development  |  Topic: Fun with Java 3D (hobby project update)  
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC