Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (290)
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 4
1  Game Development / Performance Tuning / Re: Anyone else here get a major kick out of refactoring and optimizing regularly? on: 2013-05-20 10:56:40
It means that you run your actual application on top of a profiler so that you will have an idea of where to optimize.

I generally use that in my native binaries though.  I don't know how to do that in java but there's probably an switch to turn on profiling.
2  Game Development / Performance Tuning / Re: Anyone else here get a major kick out of refactoring and optimizing regularly? on: 2013-05-20 07:49:37
Profile your code.  Though I have no idea how to do that in java.
3  Game Development / Shared Code / Re: Entreri 1.7 Released (Entity-Component Framework) on: 2013-05-19 16:21:17
Nice job!

4  Java Game APIs & Engines / OpenGL Development / Re: Texturing a sphere, creating a cube map - the proper way? on: 2013-05-18 16:44:04
Spheres are quadric shapes which means they can be generated by its bands and rings.

Say number od bands id 20, x or s is:

2pi/20 * texture repeat number.

I forgot the parametric equation for a sphere but it's something like:

1  
2  
3  
x = sin(p) * cos(t)
y = sin(p) * sin(t)
z = cos(p)


That 2pi above is your p and t.

Sample here:

rel.phatcode.net/junk.php?id=55


Sorry using phone to post.
5  Game Development / Newbie & Debugging Questions / Re: Checking collision between a Shap and a Rectangle on: 2013-05-18 16:31:21
Fix the link?

Sorry using phone right now.
6  Game Development / Newbie & Debugging Questions / Re: Checking collision between a Shap and a Rectangle on: 2013-05-18 16:07:35
SAT.

back2basic.phatcode.net/?Issue_%231:2D_Convex_Polygon_Collision_using_SAT

Also, because your shapes are just rotated boxes, you can optimize it further by projecting 1/2 of the edges.
7  Game Development / Performance Tuning / Re: FPS problems in LWJGL on: 2013-05-18 10:15:52
Are you rebuilding vbos each frame?

Hard to help without seeing code.
8  Game Development / Newbie & Debugging Questions / Re: Need help with flickering and timestep problem in my game on: 2013-05-16 16:34:30
Why not use both? You could run your logic framebased while only updating at 60 fps.

9  Game Development / Newbie & Debugging Questions / Re: Tween functions? on: 2013-05-16 16:22:47
Well then: splines.  3rd order Hermite is a nice easy starting point.

This.

Specifically catmull-rom.
10  Game Development / Newbie & Debugging Questions / Re: How do i generate triangles from points on a plane? (in 3D) on: 2013-05-15 02:35:50
Delaunay's is a pretty good algo.  There are other algos you might want to try like seidels to generate voronoi diagrams.

If you just want a convex hull, I used grahams.

I have some code here but google would probably give you better examples in java since mine is in another language.
11  Game Development / Newbie & Debugging Questions / Re: libGDX - renderer lag on: 2013-05-11 19:54:37
Its a simple 'using delta time equals jitter problem'
I kinda dont like delta time and try to avoid it because of this
Our latest game does a low pass filter over a coupke of collected delta times and so on

My advice: either make sure you have a rock solud framerate,  which is good anyway; or read up on delta timing / time steps in video games

Speaking of which, I only have this problems in windows using java.

I have the same java code that jitters like crap on my windows desktop while running smooth as silk on an android device.

Uses the same fixed timestep mechanism and the same codebase.  Android version uses ogl es and pc version uses lwjgl.

The same delta-timing mechanism used in both freebasic and c++ runs smooth.
12  Game Development / Newbie & Debugging Questions / Re: LWJGL - Draw section of texture on: 2013-05-11 08:07:59
I have 3 laptops I use constantly and they don't even support 2.x.

My 2.x compatible desktop died due to air saltiness from where I live.

The only way I could do shaders nowadays is from my droid phone which sadly drains a lot of battery and heats the crap out off my phone.


What's wrong with learning both pipelines?
13  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Getting started with 2d physics system of shapes connected with "springs"? on: 2013-05-09 15:52:30
I used to do springs via hooke's law.

I'm not sure but I believe it's F = -kx.

x is the 1d distance
k is a constant
F is the force

Be careful though since spring physics tend to explode with minimal changes.

I'll try to find my old c++ spring simulator( doesn't use sqrt too.

Or you could go ahead and google "hugo elias"  he's got a nice article in regard to that.
14  Game Development / Performance Tuning / Re: Using software rendering instead of GPU rendering? on: 2013-05-09 04:33:50
There are some things that are easier to do in software( probably more effecient too).  Like swirling background I did on this gfx effect.

rel.phatcode.net/junk.php?id=142

15  Game Development / Newbie & Debugging Questions / Re: Finding nearest objects on: 2013-05-06 02:32:16
It's called a "sweep and prune" collision.  Limited to aabbs and very fast. requires a little sorting in realtime too.
16  Game Development / Newbie & Debugging Questions / Re: [Final Decision] LWJGL or LIBGDX on: 2013-05-03 08:32:46
The OP could just try both and decide for himself.


Btw, fixed function is still used on some consoles so learning it would not be a waste. IMHO.

Some people who come here from other languages (and had made complete games) most likely have a working opengl framework they coded themselves and porting it to another language should be trivial at best(though) I must admit lwjgl does not always conform to the standard opengl prototypes)
17  Java Game APIs & Engines / OpenGL Development / Re: Translating OBJ Models on: 2013-05-02 13:10:17
Store your objects in local space and move by transforming your objects via a matrix transform.
18  Game Development / Newbie & Debugging Questions / Re: Mixing light-weight (Swing) and heavy-weight (AWT) components? on: 2013-05-01 14:26:40
Learning stuff in java2d is a useless tool. Sure maybe you get better at coding but that comes with any form of coding.

And thanks for the correction but I think I got the point across.  Wink


Useless in what sense?  It I already used it to help my nephew with his java projects.

Granted it's not as fast as ogl but they also say the sane with c++ vs. java.  If I listened to them then I wouldn't be here learning java and having fun coding in it.


@cookie: I usually don't get really enamored whether I use a certain design pattern.  Just code what you think is "natural" and patterns would take care of themselves.
19  Game Development / Performance Tuning / Re: Optimizing a QuadTree for enormous maps on: 2013-04-30 18:20:50
Relminator, OK, is there example code or pseudocode out there for using a K-D Tree to store regions?  It seems like a pretty large divergence from the way K-D Trees are presented around the web.  Handling dynamic entities that are moving in and out of tree nodes frequently and overlapping multiple nodes is a problem that I don't immediately see the solution to.

Riven, if my question annoys you, you can go somewhere else.  Trees are used for collision detection in professional games, this is not a purely academic question, and optimization of such trees is a problem that has been well studied, I just can't find the publications that discuss that optimization.  Asking how best to optimize a spatial tree is a perfectly on-topic question for this forum.  You don't know the answer and rather than just not comment, you insist that I shouldn't want to know the answer myself.


The quadtree and octree example I posted above has a basic source on how to store data at the nodes. That's also the way how to store data on a kd tree.

Riven's posts are actually good ideas.   Your entities are dynamic(moving) every frame.  While quadtrees are fast at querying where an entity is, building it in realtime will take a veeeery long time.

His suggestion of using grids for moving entities us the best posted so far.

Btw, building a kd-tree in realtime is also very slow.
20  Game Development / Performance Tuning / Re: Optimizing a QuadTree for enormous maps on: 2013-04-30 17:59:25
@Cartel: That's why I posted a kdtree.  Kdtrees are "balanced" quadtrees.
21  Game Development / Performance Tuning / Re: Optimizing a QuadTree for enormous maps on: 2013-04-30 17:51:48
various flavors of k-d trees can be nice.  But you really can't make sweeping statements like this about any data-structure without a ton of details.  Why a kd-tree instead of say a vantage-point tree?  Or a non-region quad-tree?


I did not make a sweeping statement. I just gave him what I thought is a better data structure.  I've never heard of a vantage point tree.


@cartel: For simplicity, I just put a any region intersected by the node.  You will have duplicates this way but it's not much of a bottleneck.  Just don't make your regions overly big as to intersect more than 2 nodes on non-corner intersections.
22  Game Development / Performance Tuning / Re: Optimizing a QuadTree for enormous maps on: 2013-04-30 17:25:08
Quote
So I'll reiterate my question: How best to
optimize a quadtree for large numbers of
dynamic rectangular entities arranged in
an uneven distribution across a vast
space, beyond the simple textbook
implementation presented around the
web?
Quote


You shoul not use quadtrees or grids for this.  A better solution is a kdtree.

Quadtrees are almost useless in this case since they're unbalanced.  It's not much harder to code a kdtree (2 child nodes) if you already can code a quadtree.
23  Game Development / Performance Tuning / Re: Optimizing a QuadTree for enormous maps on: 2013-04-30 16:52:21
If your game level data is made of just axis aligned tiles, you don't need quadtrees or grids to selectively render viewable tiles.

For dynamic entities, grids should be better. Quadtrees are fast to traverse but slow to make.

I've never used quadtrees for entity to entity collidions. Quadtrees shine when you want to collide a moving entity against a static level.

Everything useful in a quadtree are in its leaves. Non-leaf nodes are only there for traversal.

I've come across an article at gamedev.net about infinite terrains that is quite good it was used on a ps2 flight game.  Forgot the link though.


Quadtree demo:

rel.phatcode.net/junk.php?id=89


Octree renderer:

rel.phatcode.net/junk.php?id=88

A visual tutorial of how these things are made:

rel.phatcode.net/index.php?action=contents&item=Tutorials

Scroll down. Sorry I'm using a phone to post this. Hard to get links.
24  Game Development / Newbie & Debugging Questions / Re: Mixing light-weight (Swing) and heavy-weight (AWT) components? on: 2013-04-30 16:19:45
The only reason to do java2d for games these days it's fun learning it(at least for me).

By fun you mean like taking nutcrackers to ones testies. *whisper* Masochist *whisper*

Learning a new thing is always fun.  The more you know the more tools you have at your disposal.

BTW, it's testes(try gonads for a change).
25  Game Development / Game Mechanics / Re: Creating a Specific Collision Area on a Larger Sprite on: 2013-04-30 07:05:00
Depending on your needs, the solution posted by davedes is fast and good enough(I used something like that on my nintendo ds game called "bubble fight ds").

You could also use aabb or sat or a combination of them all.
26  Java Game APIs & Engines / Java Sound & OpenAL / Re: Cant get background music to work? on: 2013-04-28 10:27:21
Have you tried tinysound? Not as good as openal but better than anything I tried.
27  Game Development / Newbie & Debugging Questions / Re: Mixing light-weight (Swing) and heavy-weight (AWT) components? on: 2013-04-28 04:11:11
Thank you :-)
My goal is to make a simple, very basic tetris-like game, but it should have a solid, efficient fundament which can be used to build more complex 2D games. I used OpenGL many years ago and have never used it since then, so I think it would be quite hard to implement. Most people don't recommend to use OpenGL for 2D, some do, but I don't have enough experience to evaluate the pros and cons. I also haven't found any tutorials on 2D OpenGL games in Java.
Doesn't Java2D use OpenGL under the hood? OS window managers are also 2D, but sometimes based on OpenGL.

Actually, most people would recommend opngl.  Once you get past the boilerplate code, everything should be a breeze and if you use libgdx, boilerplate code is handled by libgdx for you.

The only reason to do java2d for games these days it's fun learning it(at least for me).
28  Game Development / Newbie & Debugging Questions / Re: Why use VBOs/VAOs/FBOs/etc? on: 2013-04-28 04:02:24
You can't do that in a 2d scene since you always have to draw from back to front.
No you don't.  Any cases where you might choose to render back-to-front are identical in 2D and 3D (say transparency and you don't want to be fancy about it).
Isn't that the whole issue at hand? In 2D you're expected to have every sprite nicely translucent at the edges, whereas in 3D you can get away with your typical antialiasing, defining shapes not by transparant pixels in sprites but by geometry.

That's the single reason good 2D games are prone to be suffering from overdraw, caused by mandatory back-to-front rendering.

This and the fact that you can upload static models on the gpu then optimize rendering further by using strips.  2d scenes are usually done with tris and vertex arrays.
29  Game Development / Newbie & Debugging Questions / Re: Why use VBOs/VAOs/FBOs/etc? on: 2013-04-27 17:15:25
With the same amount of fragments, 2d should be slower than 3d.
I sample 5 textures, transform normals from tangent space to object space and write to two RGBA16F textures per pixel. 3D games usually require much more complex shaders, much more bandwidth (in the case of deferred shading), more anti-aliasing and higher screen resolutions. Even with early-Z optimizations, we still get massive overdraw for lighting and post-processing.
,

The same amount of "simple" non-transformed fragments.
30  Discussions / General Discussions / Re: Cross Language Game Tutorial on: 2013-04-27 16:49:16
Nice site!

Wouldn't frame skipping produce stutter in games when your framerate is lower than intended?
Pages: [1] 2 3 4
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars and Titan!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (65 views)
2013-05-17 21:29:12

alaslipknot (74 views)
2013-05-16 21:24:48

gouessej (105 views)
2013-05-16 00:53:38

gouessej (102 views)
2013-05-16 00:17:58

theagentd (112 views)
2013-05-15 15:01:13

theagentd (102 views)
2013-05-15 15:00:54

StreetDoggy (147 views)
2013-05-14 15:56:26

kutucuk (169 views)
2013-05-12 17:10:36

kutucuk (168 views)
2013-05-12 15:36:09

UnluckyDevil (177 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.176 seconds with 20 queries.