Last visit was: It is currently Sun Dec 09, 2018 11:12 pm


All times are UTC-05:00




Post new topic  Reply to topic  [ 19 posts ] 
Author Message
 Post subject: 2D Objects on a 3D map
PostPosted: Sat Dec 20, 2008 3:13 pm 
User avatar
 

Joined: Sun Feb 12, 2006 8:56 pm
Posts: 1019
Website: http://eddieringle.com
Location: Detroit, MI
UPDATE 8/16/2009: Decided to switch to C++, SDL, and CrissCross for the game, JOGL is not user-friendly at all.

-- Original post --
Yeah, I know what you people are thinking, a game in Java would be a horrible idea due to Java's performance, or lack thereof. But, I want to give it a shot, so I need a little help.

Who knows if I'll continue with this game or just drop it, but it'll be good experience either way.

Now, if anyone has played Runescape Classic, then you'll know what I am talking about when I explain what I need. Because a total 3D game right now is too much for just me to handle, I was thinking of creating a 3D map and using 2D sprites. My problems are as follows:
  • Creating a simple 3D map and being able to add/remove objects from it easily.
    Collision detecting between the 2D sprites and the 3D objects.
I'm guessing I'll have to write in-house tools for the map and pretty much everything else, but if anyone can help with this it'd be appreciated.

And once again, this is not a thread where I will be taught how slow Java is, I already know C++ is faster, but I want to try it in Java.

_________________
-- Eddie Ringle

Check out Elysian Shadows and consider backing us on Kickstarter!

====================================

Image


Last edited by eddieringle on Sun Aug 16, 2009 9:04 pm, edited 1 time in total.

Top
Offline   
 Post subject: Re: Writing a Java game, want to use a 3D map... so...
PostPosted: Mon Dec 22, 2008 5:14 pm 
Connoisseur of the Godawful
User avatar
 

Joined: Tue Mar 01, 2005 9:00 am
Posts: 456
ICQ: 286315965
Website: http://rabidtinker.mine.nu/
Yahoo Messenger: alistair_lynn
AOL: Agent_Vast@mac.com
Location: 127.0.0.1
To have good performance (read: more than 1 or so fps) you'll need to have some kind of space partioning. Judging by what you've said there, I recommend implementing the Quadtree structure. You should make your self very familiar with matrices and vectors from the linear algebra side, you'll find 4x4 matrices the most useful since these can represent any 3D transformation. Look up billboard geometries, which you'll find useful to display the 2D sprites within the 3D environment.

_________________
Alastair Lynn / Alumnus / Onlink Team


Top
Offline   
 Post subject: Re: Writing a Java game, want to use a 3D map... so...
PostPosted: Wed Dec 24, 2008 12:44 am 
User avatar
 

Joined: Mon Sep 22, 2008 9:51 am
Posts: 112
Quadtree? For 3D? No no, an Octree is the way to go here.

But I think your jumping in a little quick, I suggest you start with 2D then move up to 3D. 3D in Java is not a simple process, not that it really is in any language that can still call itself such.

Try a few simple AWT 2D games, I find a simple Tetris clone is a nice warm up as it is simple enough not to be annoying, but complex enough to cover all the ground. It gives you some good introduction into graphics buffering and game logic.

If Tetris is to much work for practice, Minesweeper is simpler on the game logic side of things. After you have those, then I can tell you almost all you will need to know to start on 3D in Java.

Also tackling a 3D game by yourself is a real chore, believe me I know. 2D is a great deal more simple. (Plus the math is thousands of times easier).

Your most likely to give up if you try jumping right into the 3D stuff. Really graphics is a pain, the actual game logic is a great deal more simple. Even getting things to behave correctly in a 3D environment can be painful, with the rotations and the eventual Gimbal lock if you don't use Quaternions. Not to mention the camera work assuming you don't use orthogonal or planar viewing angles.

If I had to give any advice it would be not to mix graphics and game logic together if you can avoid it. While its simpler in the short run to have the game logic directly call graphic functions, it can be far more difficult to debug.

_________________
Oh this and that.


Top
Offline   
 Post subject: Re: Writing a Java game, want to use a 3D map... so...
PostPosted: Wed Dec 24, 2008 9:15 am 
Connoisseur of the Godawful
User avatar
 

Joined: Tue Mar 01, 2005 9:00 am
Posts: 456
ICQ: 286315965
Website: http://rabidtinker.mine.nu/
Yahoo Messenger: alistair_lynn
AOL: Agent_Vast@mac.com
Location: 127.0.0.1
Quote:
Quadtree? For 3D? No no, an Octree is the way to go here.
Judging by what he's said so far, everything's going to be ground-aligned, therefore the vertical part isn't particularly problematic, so a Quadtree is the way to go, not an Octree. Believe me, I do know what I'm talking about.

_________________
Alastair Lynn / Alumnus / Onlink Team


Top
Offline   
 Post subject: Re: Writing a Java game, want to use a 3D map... so...
PostPosted: Wed Dec 24, 2008 9:21 am 
User avatar
 

Joined: Sun Feb 12, 2006 8:56 pm
Posts: 1019
Website: http://eddieringle.com
Location: Detroit, MI
Quote:
Quote:
Quadtree? For 3D? No no, an Octree is the way to go here.
Judging by what he's said so far, everything's going to be ground-aligned, therefore the vertical part isn't particularly problematic, so a Quadtree is the way to go, not an Octree. Believe me, I do know what I'm talking about.
I guess use Runescape as an example, as that's what I'm modeling it after.

_________________
-- Eddie Ringle

Check out Elysian Shadows and consider backing us on Kickstarter!

====================================

Image


Top
Offline   
 Post subject: Re: Writing a Java game, want to use a 3D map... so...
PostPosted: Wed Dec 24, 2008 12:37 pm 
User avatar
 

Joined: Mon Sep 22, 2008 9:51 am
Posts: 112
Quote:
Quote:
Quadtree? For 3D? No no, an Octree is the way to go here.
Judging by what he's said so far, everything's going to be ground-aligned, therefore the vertical part isn't particularly problematic, so a Quadtree is the way to go, not an Octree. Believe me, I do know what I'm talking about.
Oh, that, I was thinking more in the terms of raw 3D graphics. You use an Octree to partition the screen and not render things not on screen.

_________________
Oh this and that.


Top
Offline   
 Post subject: Re: Writing a Java game, want to use a 3D map... so...
PostPosted: Thu Dec 25, 2008 8:17 am 
Connoisseur of the Godawful
User avatar
 

Joined: Tue Mar 01, 2005 9:00 am
Posts: 456
ICQ: 286315965
Website: http://rabidtinker.mine.nu/
Yahoo Messenger: alistair_lynn
AOL: Agent_Vast@mac.com
Location: 127.0.0.1
Yes, same with a Quadtree.

_________________
Alastair Lynn / Alumnus / Onlink Team


Top
Offline   
 Post subject: Re: Writing a Java game, want to use a 3D map... so...
PostPosted: Thu Dec 25, 2008 11:10 am 
Just so you know, you brought this upon yourself. Dancefight.
User avatar
 

Joined: Tue Mar 01, 2005 9:00 am
Posts: 1262
Website: http://www.ferrousmoon.com/
Location: Places, doing things.
Except Quadtrees work better with 2D or 3D where Z isn't really a thing to worry oneself over.


Top
Offline   
 Post subject: Re: Writing a Java game, want to use a 3D map... so...
PostPosted: Thu Dec 25, 2008 8:33 pm 
Connoisseur of the Godawful
User avatar
 

Joined: Tue Mar 01, 2005 9:00 am
Posts: 456
ICQ: 286315965
Website: http://rabidtinker.mine.nu/
Yahoo Messenger: alistair_lynn
AOL: Agent_Vast@mac.com
Location: 127.0.0.1
And in this case, where the terrain is a simple heightmap and the actors are 2D sprites, we have one axis not to worry about (Y).

_________________
Alastair Lynn / Alumnus / Onlink Team


Top
Offline   
 Post subject: Re: Writing a Java game, want to use a 3D map... so...
PostPosted: Fri Dec 26, 2008 12:20 am 
User avatar
 

Joined: Mon Sep 22, 2008 9:51 am
Posts: 112
I don't want to argue about it. At this point its a losing battle anyway (I didn't do my homework on his example game).

I admit if it is fairly simple downward view, it won't turn out to bad, and might be faster, but if you have much camera tilt, its suicide. :/

By suicide, I mean it would probably be easier to have an octree, or face performance issues.

I still think he should try some 2D games first, to get a feel for the flow of writing a game. 3D can be fairly unforgiving to those who dive right into it.

_________________
Oh this and that.


Top
Offline   
 Post subject: Re: Writing a Java game, want to use a 3D map... so...
PostPosted: Fri Dec 26, 2008 10:12 am 
Connoisseur of the Godawful
User avatar
 

Joined: Tue Mar 01, 2005 9:00 am
Posts: 456
ICQ: 286315965
Website: http://rabidtinker.mine.nu/
Yahoo Messenger: alistair_lynn
AOL: Agent_Vast@mac.com
Location: 127.0.0.1
Camera tilt is dealt with by frustum culling rather than the actual scene graph structure.

_________________
Alastair Lynn / Alumnus / Onlink Team


Top
Offline   
 Post subject: Re: Writing a Java game, want to use a 3D map... so...
PostPosted: Sat Dec 27, 2008 8:52 am 
User avatar
 

Joined: Mon Sep 22, 2008 9:51 am
Posts: 112
Quote:
Camera tilt is dealt with by frustum culling rather than the actual scene graph structure.
Your right, I apologize.

_________________
Oh this and that.


Top
Offline   
 Post subject: Re: Writing a Java game, want to use a 3D map... so...
PostPosted: Fri Aug 14, 2009 9:26 am 
User avatar
 

Joined: Sun Feb 12, 2006 8:56 pm
Posts: 1019
Website: http://eddieringle.com
Location: Detroit, MI
Sorry to dig up an old post, but would all of this information still be accurate if I wanted to use 2d sprites and 3d buildings?

_________________
-- Eddie Ringle

Check out Elysian Shadows and consider backing us on Kickstarter!

====================================

Image


Top
Offline   
 Post subject: Re: Writing a Java game, want to use a 3D map... so...
PostPosted: Sat Aug 15, 2009 6:12 am 
User avatar
 

Joined: Tue Aug 11, 2009 11:20 am
Posts: 44
most likely and it seems a good way and would be the way I would do such a thing in java (not in c++ but java). One of the langs I know is java but I learned it as my first programming lang awhile a go so I can't help you more than just telling you it would be a good approach.

_________________
A programmer with dev cd. knows a lot of programming langs and can 3d model.


Top
Offline   
 Post subject: Re: Writing a Java game, want to use a 3D map... so...
PostPosted: Sat Aug 15, 2009 6:59 am 
User avatar
 

Joined: Sun Feb 12, 2006 8:56 pm
Posts: 1019
Website: http://eddieringle.com
Location: Detroit, MI
I think it'll be good for me to work on something in Java seeing as this sophomore year we will be working with Java. I'm also taking Web Design 1 & 2. :)

_________________
-- Eddie Ringle

Check out Elysian Shadows and consider backing us on Kickstarter!

====================================

Image


Top
Offline   
Display posts from previous:  Sort by  
Post new topic  Reply to topic

All times are UTC-05:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created by Miah with assistance from hyprnova