Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (604)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Fake 3d effect?  (Read 5592 times)
0 Members and 1 Guest are viewing this topic.
Offline baenor

Senior Newbie





« Posted 2013-03-13 15:12:39 »

Hi guys...
After i made a multiplayer 2d shooter watched from above, i want to make another game that is far better than the first.
Essentially i want to make something like shown on the video below:
http://www.youtube.com/watch?v=yT6lGRfXBWQ

how to archieve that fake 3d effect?
And which library is the best to work on a simil-isometric view like that one on the video or like GTA2?
Offline heezel

Junior Devvie


Medals: 7



« Reply #1 - Posted 2013-03-13 15:21:44 »

bad news for you... only thing that's fake (or trying to look like 3d) are billboards on trees, and probably the ground and shadows
Offline baenor

Senior Newbie





« Reply #2 - Posted 2013-03-13 15:25:24 »

so that game shown on the video is 3d?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline heezel

Junior Devvie


Medals: 7



« Reply #3 - Posted 2013-03-13 15:33:44 »

to create an real looking fake 3d effect like that in that video you would need tousands of prerendered sprites for each object at different camera angles, which would probably overload memory if these sprites had to be at medium resolution, and I don't think Java2D is that great at managing memory. Most of old games like Diablo I and II, Age of Empires I and II used fake 3d effects, they created 3D models animated them and rendered their frames into 2D sprites which were used in game.
Offline StonePickaxes

JGO Coder


Medals: 4
Projects: 2


Nathan Kramber


« Reply #4 - Posted 2013-03-13 15:35:00 »

so that game shown on the video is 3d?

It's pretty impractical to try to do 3D rendering in Java2D (hence the name). If you want to do a top-down style 3D game (like GTA 1 and 2) then I would recommend using LibGDX. It sounds like you are looking for a library that will do that style of rendering work for you, but you won't find one. You will still have to program your own model loader, your own renderer, your own collision, etc, etc. A library like LibGDX is your best bet.

However, unless you are really experienced in 2D rendering and collision, I would recommend sticking with 2D for the time being. Try and see if you can get the game you are thinking of working in 2 dimensions first, then worry about the third. Trying to dive in and do 3D right off the bat is just asking for failure.

Hope this helps.

Check out my website!
Offline baenor

Senior Newbie





« Reply #5 - Posted 2013-03-13 15:39:34 »

thanks for the replies...
I already was looking on LibGDX and it looks also pretty simple to use.
But why do i have to make my own methods? Doesn't libGdx have it? I've seen for example that there is already a orthographic camera coded...



and what about MonkeyEngine? I'm not alone and i could use the help of my brother that is really good on drawing...
Offline StonePickaxes

JGO Coder


Medals: 4
Projects: 2


Nathan Kramber


« Reply #6 - Posted 2013-03-13 15:41:13 »

thanks for the replies...
I already was looking on LibGDX and it looks also pretty simple to use.
But why do i have to make my own methods? Doesn't libGdx have it? I've seen for example that there is already a orthographic camera coded...



and what about MonkeyEngine? I'm not alone and i could use the help of my brother that is really good on drawing...

I've never used JME, but if that's what you want to try, go for it. There is no perfect solution, no definitive answer to your question. Just try different things and see what works for you.

Check out my website!
Offline baenor

Senior Newbie





« Reply #7 - Posted 2013-03-13 15:47:04 »

i have to understand...




A game like command and conquer tiberian sun is 2d or 3d?

Offline StonePickaxes

JGO Coder


Medals: 4
Projects: 2


Nathan Kramber


« Reply #8 - Posted 2013-03-13 15:50:07 »

A game like command and conquer tiberian sun is 2d or 3d?

I would say 2D.

Check out my website!
Offline baenor

Senior Newbie





« Reply #9 - Posted 2013-03-13 15:51:31 »

nice!
So if i want to make a game with that perspective...i should stick with libgdx and using the orthographic camera?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Oskuro

JGO Knight


Medals: 40
Exp: 6 years


Coding in Style


« Reply #10 - Posted 2013-03-13 17:46:29 »

Defining what is a "3D" or "2D" game is a complex issue that has been discussed many times.

What will really help you is to determine what you need each individual component to be.

Do you need 3d graphics?
Do you need 3d gameplay?

You can mix and match both, having a purely 2d gameplay (like super mario) with fully 3d graphics (like in, for example, Super Smash Brothers Brawl).

You could have 3d gameplay with 2d sprites and effects, like in the original GTA games.

Find out what you want to do to determine what you need to do it.

Offline baenor

Senior Newbie





« Reply #11 - Posted 2013-03-13 18:14:20 »

Defining what is a "3D" or "2D" game is a complex issue that has been discussed many times.

What will really help you is to determine what you need each individual component to be.

Do you need 3d graphics?
Do you need 3d gameplay?

You can mix and match both, having a purely 2d gameplay (like super mario) with fully 3d graphics (like in, for example, Super Smash Brothers Brawl).

You could have 3d gameplay with 2d sprites and effects, like in the original GTA games.

Find out what you want to do to determine what you need to do it.


that's it
i want 3d gameplay with 2d sprites and effects....how to archieve it? i'm TOTALLY new to it
Offline opiop65

JGO Kernel


Medals: 161
Projects: 7
Exp: 4 years


JumpButton Studios


« Reply #12 - Posted 2013-03-13 20:08:24 »

*achieve* not archieve. And to answer your question, you just have to research and do it. You will probably fail the first time, it happens to the best of us. Just re-write the game and try to do things different. I don't have any experience with the kind of game you want to program, but I would imagine its either a bunch of 2D sprites that are textured to look 3D, or its actually 3D with 2D sprites. If its 3D, I imagine you would want to lock the rotation of the game so you can't rotate the tiles around the 'y' axis. Then you would want to translate the tiles along a vertical line to achieve the 3D effect. However, you still will use 2D tiles. Unless you go 3D with the tiles, which might be a bit much; you would have to load the tiles as models and I imagine it wouldn't be very efficient.
I may be completely wrong, I've never created a game like that, but that's how I would start!

Offline baenor

Senior Newbie





« Reply #13 - Posted 2013-03-13 20:12:28 »

*achieve* not archieve. And to answer your question, you just have to research and do it. You will probably fail the first time, it happens to the best of us. Just re-write the game and try to do things different. I don't have any experience with the kind of game you want to program, but I would imagine its either a bunch of 2D sprites that are textured to look 3D, or its actually 3D with 2D sprites. If its 3D, I imagine you would want to lock the rotation of the game so you can't rotate the tiles around the 'y' axis. Then you would want to translate the tiles along a vertical line to achieve the 3D effect. However, you still will use 2D tiles. Unless you go 3D with the tiles, which might be a bit much; you would have to load the tiles as models and I imagine it wouldn't be very efficient.
I may be completely wrong, I've never created a game like that, but that's how I would start!

sorry not english Smiley...thanks for the correction. I appreciate your advice!
I dont like doing things by tentatives...i like studyng the theory first and then applyng to reduce time

so i'm looking for someone that can give me a solid advice or tutorial to start with!
Offline opiop65

JGO Kernel


Medals: 161
Projects: 7
Exp: 4 years


JumpButton Studios


« Reply #14 - Posted 2013-03-13 20:15:27 »

Ah I see. I work completely opposite of you! I hate research... but I would really recommend just getting into it. There's no real special way to create the effect you want, everyone does it different. Programming is all about problem solving and creating your own solutions, and I think this is the perfect example. Try a google search or two, gather some info and then just try to make your own. Otherwise, you'll end up researching forever and never starting. Good luck!

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 81
Projects: 15


★★★★★


« Reply #15 - Posted 2013-03-13 20:46:56 »

i have to understand...

A game like command and conquer tiberian sun is 2d or 3d?
Tiberian Sun used voxels for its 3d, so the engine is a bit of a hybrid between 2d and 3d.
Offline Oskuro

JGO Knight


Medals: 40
Exp: 6 years


Coding in Style


« Reply #16 - Posted 2013-03-14 11:31:16 »

i want 3d gameplay with 2d sprites and effects....how to archieve it?

Just think of how you'd represent every game object on a piece of graph paper. In fact, get some graph paper and start drawing different scenes from your game.

If a single sheet of paper is enough, then the game's data model is 2D. If you need more sheets of paper for different heights (and think hard if you *need* them or can fake it in the same sheet) then you have a 3D data model.


Afterwards, read up on 2d and 3d Matrices, which will be the first data structure you'll probably use to represent your game world (Resulting in a tile-based map).

Finally you can jump to arbitrary coordinates within your gameworld, although that'll probably only be for moving objects, keeping static scenery in a grid is rather useful.


Read through these forums, there's plenty of information about all these topics, made by people better at explaining it all than me.  Wink

Offline opiop65

JGO Kernel


Medals: 161
Projects: 7
Exp: 4 years


JumpButton Studios


« Reply #17 - Posted 2013-03-15 20:29:28 »

Quote
If a single sheet of paper is enough, then the game's data model is 2D. If you need more sheets of paper for different heights (and think hard if you *need* them or can fake it in the same sheet) then you have a 3D data model.

Love that explanation, never thought of doing it that way, but I definitely will do it when I finally move onto another game!

Offline sproket

Junior Devvie


Medals: 1



« Reply #18 - Posted 2013-04-08 19:44:11 »

Grab a copy of Developing games in Java. http://www.brackeen.com/javagamebook/  Or check out his sample code. He implements a full 3d toolkit under Java2d - and it performs stunningly well. Smiley

Offline matheus23

JGO Kernel


Medals: 114
Projects: 3


You think about my Avatar right now!


« Reply #19 - Posted 2013-04-08 19:47:53 »

Grab a copy of Developing games in Java. http://www.brackeen.com/javagamebook/  Or check out his sample code. He implements a full 3d toolkit under Java2d - and it performs stunningly well. Smiley

Oh thank you for that link! Awesome stuff he created :O Just looked through the 'Game scripting' example. Nice...

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Nundkai

Junior Newbie


Medals: 1



« Reply #20 - Posted 2013-06-29 19:51:43 »

Hello,

let me start by apologizing for reviving an old post as the very first thing I do on this forum.
However, I am the creator of the little youtube video linked to in the first post, and so I've also created the program itself.
The reason I joined this site and the reason I am writing this post is because of some of the information given in this thread, which I think is wrong. Especially the posts by Heezel, suggesting my video uses some other method than Java2D to realize the fake 3D effect.

The program is written entirely in Java2D. ENTIRELY.
This means the program does in fact NOT contain ANY 3d elements, by the official meaning of 3d (hence the effect is called 'fake 3d').

Instead the effect is achieved by calculating screen-space points from world-space points. These world-space points can then have a height (contrary to 2d games), which changes their screen-space point based on the distance from the center of the screen and the height of the camera. The total conversion for each point is maybe 4 operations (operations, not lines of code, it's all in one line). The effect is in no way impressive mathematically, but it is impressive in its simplicity and effectiveness. (I do not claim to be the sole creator of this effect, it was just so easy I came up with it on my own.)

The resulting screen-space points are then connected with eachother via a java Polygon, and given a gradient color in the direction the wall is facing.

All you have to do next is determine when NOT to draw a given polygon, and in which order to draw the remaining polygons, and you have a proper sense of depth.

This fake 3D effect is very limited, mostly because Java2D supports no way of properly "rasterizing" (don't know the official term here Tongue ) a texture to a polygon. This is why I only use gradients and lines for the 3d effects in the video.

Concluding I would like to say that this is not an attempt to glorify my Java2D skills, this video is 2 years old and I've since switched to greener pastures. However I don't think misinformation should go unnoticed, especially when proper information is very limited in quantity and quality.

Thank you for reading, I hope any (future) fake 3d enthousiasts can benefit from my intervention in this thread.

PS:Please stop telling people 3d is hard. Instead tell them how to start doing 3d in the easiest way possible, then they can try and see how hard it is and then decide for themselves. I used to be scared shitless of programming and 3d in particular because of how hard it was advertised to be everywhere on the internet. Now all I can think of is how much better my knowledge of 3d graphics and programming would be if I would've started earlier in my life.
I understand where these statementsare coming from, and if you have never programmed before its certainly sub-optimal to start writing a physics engine, but 3d is different. Thinking about 3d isnt hard at all, 3d is what you live in. The problem is the way 3d graphics are handled in engines, which usually isn't simple because of the underlying complexity in 3d.
So don't tell people 3d is hard, just point them to the easy 3d! (Examples? Game Maker/Java3D make for easy switches from 2d. Even OpenGL is easy, using the fixed function pipeline and some tutorials you basically never have to do ANY mathematics).

edits: spelling, grammar
Offline Oskuro

JGO Knight


Medals: 40
Exp: 6 years


Coding in Style


« Reply #21 - Posted 2013-06-29 22:56:35 »

@Nundkai Your video looks great, very memorable visual style.

Funny how, even when I posted on this thread, I missed the discussion on whether the video was 3d or not.

A simple example of a similar technique I think is this Java4k entry: GTA4k

A 3d perspective can be faked via polygons drawn to simulate the depth, even when no real depth exists.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (36 views)
2014-12-15 09:26:44

Mr.CodeIt (29 views)
2014-12-14 19:50:38

BurntPizza (61 views)
2014-12-09 22:41:13

BurntPizza (98 views)
2014-12-08 04:46:31

JscottyBieshaar (58 views)
2014-12-05 12:39:02

SHC (74 views)
2014-12-03 16:27:13

CopyableCougar4 (76 views)
2014-11-29 21:32:03

toopeicgaming1999 (136 views)
2014-11-26 15:22:04

toopeicgaming1999 (127 views)
2014-11-26 15:20:36

toopeicgaming1999 (37 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!