Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3
1  Game Development / Newbie & Debugging Questions / Re: [libgdx] Mixing Orthogonal and Perpective Camera? on: 2014-08-28 19:01:14
Oh right okay, I understand. It really depends on what you want to do - I've never played GTA 2, so I wouldn't know if this would work, but drawing all the 2d first as a 'background' then drawing your 3d assets on top would probably work. Just change the camera projection between drawing, I thiiiink that might work:P

If you want your 3d assets to actually go under, or through, the 2D though, You need to render the 2D onto a texture and put that on a 3D plane, maybe?

Not really too sure on this, changing the camera projection should work as far as I know though ^^
2  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Building Mechanics and AI < on: 2014-08-28 18:38:08
Wow
'A bunch' being the understatement of the century;)

That's amazing! How long did it take?? Have you considered procedurally generating them?
3  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Building Mechanics and AI < on: 2014-08-28 18:28:43
In the map editor, when you place a tile, although that tile it stored in a square grid, it smoothly joins to adjacent tiles, it doesn't look like a box:P

I'm just wondering how you did it. It looks like each tile has a procedurally generated texture, because when I'm drawing it seems to switch between them, but i'm not sure. Looks awesome anyway:P
4  Game Development / Newbie & Debugging Questions / Re: [libgdx] Mixing Orthogonal and Perpective Camera? on: 2014-08-28 18:08:48
How does your game look currently? is it a platformer, or is it top down? I don't understand what kind of 3d element you'd want to add to a 2d game:3
5  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Building Mechanics and AI < on: 2014-08-28 17:27:13
Hey man, this game looks incredible^^

If you don't mind me asking, how did you do the tiles? More specifically, get them to almost but not quite join up together, rather than just being squares? Look really sweet:P

Downloaded the game, will be playing it tonight:P
6  Game Development / Newbie & Debugging Questions / Re: Ordering draw calls for alpha blending on: 2014-07-06 15:06:56
Hm, okay. I guess I should abandon this then - I was going to have all of the terrain above a certain height translucent, so that you could not only see a 'cross section' of the terrain but also the full shape of the terrain.
7  Game Development / Newbie & Debugging Questions / Re: Ordering draw calls for alpha blending on: 2014-07-05 17:29:45
But how could you sort it back to front if half the vertices of 1 poly are behind, and the other half are in front?
8  Game Development / Newbie & Debugging Questions / Re: Ordering draw calls for alpha blending on: 2014-07-05 17:17:33
But the point is, do i need to order every draw call, or just the order in which the VBOs are drawn?
9  Game Development / Newbie & Debugging Questions / Re: Ordering draw calls for alpha blending on: 2014-07-05 13:32:01
Just wondering if anyone had any experience with it, before I jump in and do something:P
10  Game Development / Newbie & Debugging Questions / Re: Drawing Graphics on: 2014-07-05 12:18:44
Are you using the basic java graphics libraries? java.awt, JFrames and the like?

I assume you are (as no other library was mentioned).

This is how I used to do it:
Create a class called DrawGame or something. Make this extend Canvas (I can't remember which package this belongs to, but you could google it, or, if using eclipse, use ctrl+shift+O to automatically import it).

The DrawGame class will be where you do all of your drawing.
To prevent tearing, you need to double or triple buffer your graphics. To do this, add a member variable to DrawGame of type 'BufferStrategy'.

In DrawGame's constructor, call 'createBufferStrategy(2);' to create a buffer strategy for the canvas.
next, assign the BufferStrategy member variable to 'getBufferStrategy()'

When you want to draw anything, simply call 'getDrawGraphics()' on the BufferStrategy variable, and store this value in a Graphics object.

After you finish drawing anything, call show() on the strategy and dispose() on the graphics object.

After creating your JFrame, add an instance of DrawGame to it.

To further illustrate this, here is an example class which will draw a square -

http://pastebin.java-gaming.org/e3dee740a0a13

It's pretty dirty code though.
Have fun:)

11  Game Development / Newbie & Debugging Questions / Ordering draw calls for alpha blending on: 2014-07-05 12:01:02
Hey!

I recently ran into a problem where having multiple calls to opengl to draw translucent geometry produced some funky results. I googled it, and I believe the problem has something to do with having to order the draw calls from back to front.

I was curious; how should I go about doing this?

My game features an infinite world, split into chunks. Each chunk is 1 VBO. I can order the VBOs from back to front no problem. But will this fix the problem,? Or do I need to order the draw calls within the VBO too? Wouldn't that be quite awkward to do, especially if you have a face that has 2 vertices behind another face, but 2 vertices in front of that same face?

I'm a little puzzled if I have to be honest. The only thing I know is that the weird alpha drawing only happens between chunks. This leads me to believe I only need to order the separate VBOs rather than the inner calls to openGL to draw the faces...

Anyway, thanks:P
12  Discussions / Miscellaneous Topics / Re: Looking for a good host on: 2014-07-03 15:38:14
Linode is awesome (Y)

In fact I believe this website runs off of linode:P

Not sure how suitable it is for gaming. I like it though - you have full control over everything!
13  Game Development / Newbie & Debugging Questions / Re: How to delay somthing without stopping the gameloop? on: 2014-07-03 15:33:51
replace the while with an if, and place the block inside your game loop -

while(!endFlag)
{
   //Game loop goes here


   if (alive == false)
   {
      timer ++;
      if(timer > 10)
      {
         handler.NextLevel();
         timer = 0;
      }
   }
}

The reason the while loop froze your game loop, is because whilst you were looping around inside the alive==false loop, you never updated anything else of the game. Which means nothing got drawn or updated - causing everything to freeze.Smiley

Bear in mind though, that code will make the timer wait for 10 frames. Which is about a 6th of a second, assuming your game is running at 60fps - you probably won't notice the delay. Consider setting it to something higher, like 60.
14  Game Development / Newbie & Debugging Questions / Re: Transparency in LWJGL on: 2014-06-24 20:56:20
Oh, I didn't understand your answer. I wasn't asking about textures; rather coloured vertices with an alpha value. I do believe in this case, blending is the answer.Smiley
15  Game Development / Newbie & Debugging Questions / Re: Transparency in LWJGL on: 2014-06-24 19:01:42
I didn't find a solution, I realised that I didn't actually need an answer in the first place, I could get by without:P (for now)
16  Game Development / Newbie & Debugging Questions / Re: Transparency in LWJGL on: 2014-06-24 17:31:49
Hm, thanks:) I don't think I need it after all, actually:P I found a way around it:)
17  Game Development / Newbie & Debugging Questions / Transparency in LWJGL on: 2014-06-24 12:43:02
Hello, again!._.

So, I've been playing with transparency in my geometry, and what I *want* is for a face to be transparent at a value of about 0.2 or something. However, if I set multiple faces to 0.2, sometimes they overlap, and create a 0.4 alpha value (or something like that, I'm not sure how they add together).

I need the first face to be 0.2 alpha, and any other non opaque face after that to be completely invisible. Is that possible?
18  Game Development / Performance Tuning / Re: Yet another voxel engine on: 2014-06-24 12:40:07
Pretty darn sure that fps count is broken;)
19  Game Development / Game Mechanics / Re: Vector4f on: 2014-06-23 22:09:17
Sweet, thanks. I always wondered:P
20  Game Development / Game Mechanics / Vector4f on: 2014-06-23 20:58:24
Hey

In LWJGL, You have Vector2f (or others for doubles, ints etc),  Vector3f, then Vector4f

For the life of me, I can't fathom what you'd need the 4th value for?
21  Discussions / General Discussions / Re: What's with unorganized code? on: 2014-06-23 18:25:20
Also, in your 'troint' class, why is there public member variables but also functions for encapsulation? Isn't the point of encapsulation to make sure that values are only set in a certain way? Maybe I'm wrong.
22  Game Development / Newbie & Debugging Questions / Re: When and when not to use VBOs on: 2014-06-23 17:53:18
Ah, I didn't realise you could just update them 0.0

Thanks.
23  Game Development / Newbie & Debugging Questions / When and when not to use VBOs on: 2014-06-23 17:42:30
Hey

I feel like I'm asking questions in excess at this point, so sorry in advance, but:

When drawing dynamic entities, like models loaded from an external file with animations, is it still best to create a VBO every frame?? I would have thought the overhead to be greater than the overhead for immediate rendering.

What if I'm just rendering a simple cube which moves quickly around the scene? That would involve creating a VBO almost every frame just for 24 vertices. It just doesn't seem worth it.

Performance wise, what should I use and when?
24  Game Development / Newbie & Debugging Questions / Re: RTS Selecting units on: 2014-06-23 17:13:49
^Yes, whilst reading through I became aware of that problem. Instead of using glUnProject, then checking which units were selected in that rectangle, I am now just using glProject, as you suggested.  Thanks:)
25  Discussions / General Discussions / Re: What's with unorganized code? on: 2014-06-23 17:04:39
^I know, I'm aware it's more widely done on the same line, was really just wondering why.

It's interesting to read how many code conventions there are though, it's quite surprising
26  Game Development / Newbie & Debugging Questions / Re: RTS Selecting units on: 2014-06-23 16:32:14
<3

Thank you so much, this is exactly what I needed!
27  Discussions / General Discussions / Re: What's with unorganized code? on: 2014-06-23 16:19:43
On a partially related topic
How do you all do your curly braces? I prefer

for (int i = 0; i < 10; i ++)
{
}

but some people have the { brace afterwards:

for (int i = 0; i < 10; i ++){

}

28  Game Development / Newbie & Debugging Questions / Re: RTS Selecting units on: 2014-06-23 12:25:22
But how do I get that rectangle if the world is 3D but the input is 2D?

Also, what if I could rotate the view? I'd quite like to include this.
29  Game Development / Newbie & Debugging Questions / RTS Selecting units on: 2014-06-23 11:36:39
Hey:)

So, I'm working on an RTS, and I'm currently thinking about how to go about boxing units. I think the idea is that I get the point on the screen where the mouse has clicked, then create a ray into the 3D world from that, and intersect it with the terrain.

I do this 4 times with each corner of the box, to get an area on the terrain that I'm selecting.

The problem is, where do I go from here? Do I check which units fall within this area? That would be quite messy, especially if a corner of the box lands over on the other side of a hill and another corner hits the hill...

Doing my own research, I've come across 2 methods I could use - gluUnproject and 'picking'
using gluUnproject I can create a ray from my mouse position.
'picking' converts everything on the screen into a 2d image, with different colours used for different things. You then check which colours are inside the box, and select those units.

I'm thinking that picking would be the best way to go about this, but I've heard it's quite slow. Does anyone have any experience with the two? Implementing one of these is going to be more than a few hours of work, as this is completely new territory for me, so I'd rather not have to redo it:P

I hope I've explained this well enough, thanks:)
30  Discussions / Jobs and Resumes / Re: Skill set for an average Java Job on: 2014-06-23 09:39:01
I don't know about any of the things you listed, but sqlite (similar to mysql I believe, but stored in 1 file) was incredibly easy for me to pick up.
My point being that you could probably pick these other things up relatively easily, but it's gonna mean nothing to nobody because you haven't had like 20 years experience with it or whateverD:
Pages: [1] 2 3
 

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 (29 views)
2014-12-15 09:26:44

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

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

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

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

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

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

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

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

toopeicgaming1999 (30 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!