Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (569)
Games in Android Showcase (154)
games submitted by our members
Games in WIP (618)
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 ... 68
1  Discussions / General Discussions / Re: Where can I find fast spatial querying? on: 2015-04-16 07:42:48
Googling "java <name of data structure>" and maybe even "site:github.com" seems to do well...
Another term sometimes used is "spatial index"

What specifically do you need?
2  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-15 22:04:57
Today's simulation because I was bored: [extremely] crude n-body-like:

Click to Play

Click to Play

Click to Play
3  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Animation + Delta Time? on: 2015-04-15 02:02:05
I didn't pick this up earlier but you CANNOT compare strings with ==. They are immutable objects, and must be compared with <someStringObject>.equals(<anotherString>).

For clarity, immutability isn't why you can't use == on Strings for equality. It's because string (and most datatypes) equivalence is not object identity (pointer equivalence).

Just be glad this isn't completely insane like in JS: https://dorey.github.io/JavaScript-Equality-Table/unified/  http://stackoverflow.com/a/359509
4  Game Development / Newbie & Debugging Questions / Re: Rotation Problem on: 2015-04-14 02:27:50
No biggie, but he did say "I am rotating a 2d array of tiles" etc.  Pointing
5  Game Development / Newbie & Debugging Questions / Re: Rotation Problem on: 2015-04-14 02:05:47
Are this.rx etc. floats or is that integer division? The fact that you are rounding x1, y1 but then truncating the also possibly truncated results might be hiding some of your error.
And catching AIOOBE is nasty.
6  Game Development / Newbie & Debugging Questions / Re: Rotation Problem on: 2015-04-14 02:00:56
@BurntPizza Game.get return the tile located at the coordinates specified

Well yeah, but it appears to be taking floats. Does it round, or floor? etc.
7  Game Development / Newbie & Debugging Questions / Re: Rotation Problem on: 2015-04-14 01:57:11
Yeah, that would be way better.
8  Game Development / Newbie & Debugging Questions / Re: Rotation Problem on: 2015-04-14 01:42:26
You'd probably want to change the texture filter on the sprite or apply some sort of anti-aliasing (don't know how though).

It's not texturing, he's moving the tile data around, not an image.


It is aliasing though. You'll probably need to do some kind of error accumulation like in brensenham. Your tile positions are being rounded into the wrong locations.

A crappier "I don't want to think about it" solution could be something like

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
placeTile(t, spot) 
    if spot already occupied
        add [t, spot] to open list
    else
        place t in spot

// after all placements attempted, resolve

for [t, spot] in open list
    place t in unoccupied spot closest to where t was 'supposed' to have gone (spot)


Would probably work but is terrible. Also needs a nearest-neighbor-search friendly data structure.
(Technically you would also have to check conflicts to see "who is closer to being right," not just "who got there first," but meh)


EDIT: what (code) is Game.get()?
9  Game Development / Game Play & Game Design / Re: Theming Custom Game GUI Components on: 2015-04-13 20:21:51
For further reference, that's called MVC (or one of it's derivations like MVP, depending on how you slice it).
10  Game Development / Newbie & Debugging Questions / Re: [Solved] Setting a boolean once in a infinite loop? on: 2015-04-13 20:08:07
The way you have it there's already multiple if statements devoted to it...
11  Discussions / General Discussions / Re: Hiring a Java developer on: 2015-04-13 05:26:17
You could try/have a look at http://www.reddit.com/r/gamedevclassifieds/

Mention the "consulting/a few hours" bit up front, "hiring a Java developer" could mean anything.
12  Game Development / Newbie & Debugging Questions / Re: Setting a boolean once in a infinite loop? on: 2015-04-13 01:42:36
Either use isJustPressed or a listener.

https://github.com/libgdx/libgdx/wiki/Event-handling
13  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Creating menu. Button madness? on: 2015-04-10 23:57:01
Javadocs: see All Known Implementing Classes: http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/scenes/scene2d/EventListener.html

You probably want InputListener, override enter() and/or exit().
14  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Creating menu. Button madness? on: 2015-04-10 15:08:21
No it's not correct, the overridden method is called instead of the original, not after. This is the behavior of all classes.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
public class Anon {
   
   public static void main(String[] args) {
      new Anon() {
         @Override
         public void method() {
            System.out.println("World");
         }
      }.method();
   }
   
   public void method() {
      System.out.println("Hello");
   }
}


Quote
World

If you want to call the original method (if it has an implementation), use super.method().
15  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Creating menu. Button madness? on: 2015-04-09 22:06:10
Look up "anonymous class." It's somewhat troubling if you haven't run into them before.

The new ...() {...} is creating a new class (that has no name) (and an instance of it) which in your case overrides the changed method in its superclass/interface, ChangeListener.

And yes, you should generally use some kind of layout manager instead of hardcoded positions: https://github.com/libgdx/libgdx/wiki/Table
16  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-09 07:31:35
Apparently this is what happens when I open FL at 3am: https://soundcloud.com/zen-flux/3am-something
The distant thunder outside actually goes along quite well...
17  Discussions / General Discussions / Re: Blinking text in libGDX after specified event on: 2015-04-08 21:54:42
If it's a label then it's an Actor, which has setVisible() or setColor() to make it invisible. You could even tween the fade to zero alpha and back via Actions.
18  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-08 16:02:16
It was appended to the RPC thread.
19  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2015-04-07 20:46:13
Hmm, sounds tricky. But yeah, if you're not using a heap/priorityqueue for A*, then there is almost certainly room for improvement right there.
20  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2015-04-07 19:58:02
@Rayvolution I don't know if it would be applicable, but have you looked into faster pathing algorithms like JPS?

http://en.wikipedia.org/wiki/Jump_point_search
http://zerowidth.com/2013/05/05/jump-point-search-explained.html
http://gamedevelopment.tutsplus.com/tutorials/how-to-speed-up-a-pathfinding-with-the-jump-point-search-algorithm--gamedev-5818
21  Game Development / Shared Code / Re: Possible spline substitute: Sigmoid function on: 2015-04-07 03:26:53
And it's probably better, I know. I chose logistic as the basis.
22  Discussions / General Discussions / Re: Does Internet cost matter to you? on: 2015-04-07 00:50:53
I could even believe in you, OP, but when you said you were going to use Java, I lost all my faith.

And I'm not saying this because I hate Java; instead, it is because I have a very large experience with Java (3 years and a half), and I KNOW that this is impossible. Just, impossible.

And, even if you used a low-level language or JNI, I'm still pretty sure this is impossible. You are probably just a kid saying things you'll never do to gain attention.

Why is it impossible? It's immensely impractical, but not impossible (aside from the 70-80% statistic).
23  Game Development / Shared Code / Re: Possible spline substitute: Sigmoid function on: 2015-04-07 00:20:47
(non-optimized, specialized, etc) parametric interpretation on t ∈ [0, 1] in case someone doesn't want to have to rearrange it:

1  
2  
3  
4  
public static Point2D.Double sigmoidInterp(double t, Point p1, Point p2, double s) {
    double x = (1 - t) * p1.getX() + t * p2.getX(); // lerp
    return new Point2D.Double(x, p1.y + (p2.y - p1.y) / (1 + Math.exp(-s * (t - .5))));
}
24  Game Development / Newbie & Debugging Questions / Re: Questions about creating a level editor. on: 2015-04-06 22:57:34
Don't even use separate jars, just have all the code in the same place, with the editor classes removed by a build script. Run the editor from the IDE. All code modifications are now simultaneous in game and editor, as they are the same codebase. Could also technically automate the level-reformatter in the script as well, but that's approaching or past the 'not worthwhile' threshold.
25  Game Development / Shared Code / Possible spline substitute: Sigmoid function on: 2015-04-06 22:11:24
I found myself thinking about those pretty cable-like lines often used in node editors:
(e.g. Blender)


Now, they're almost certainly implemented via some kind of spline, but for some probably masochistic reason I realized they looked a lot like a sigmoid curve.

It's probably been [derived?] before, but this is what I came up with: (excuse the crappy TeX output)



Where f(x) is the curve between points (X1, Y1) and (X2, Y2) and s is a number probably somewhere between 10 and 20, which I will call 'slack.'
Play with it in the desmos link to see exactly what it does. I could probably refine the equation to handle lower values of slack better, but meh.

https://www.desmos.com/calculator/bd1v5ylpth

Someone might actually find this useful, or at least be now enlightened with the Sigmoid function.

Demo: http://pastebin.java-gaming.org/3f49244562010

Click to Play
26  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-06 18:52:25
Think your controls are fluid? Think again!
I read a nice run-down of what goes into a good player controller, the article is about 3D space, but a fair bit would also apply to 2D platformers:
http://et1337.com/2015/04/03/poor-mans-character-controller/

At the bottom are other good links to "poor man's X" articles. (Especially the analytics one. Do it.)
27  Discussions / General Discussions / Re: Detecting what letters or numbers are drawn in a picture? on: 2015-04-06 02:30:59
Look up OCR.

The second half of this talk (watch the whole thing though) demonstrates some character recognition via neural network: https://www.youtube.com/watch?v=QJ1qgCr09j8
28  Game Development / Newbie & Debugging Questions / Re: Getting the Mouse pos in 3D World on: 2015-04-03 18:34:04
This is 'unprojection' or 'ray picking.' Use those terms with some google-fu.
29  Game Development / Newbie & Debugging Questions / Re: OpenSimplex Noise producing extremely noisy results on: 2015-04-03 18:32:15
Lower the frequency.

eval(x * f, y * f)  where f the frequency. If it was 1, then there's your problem.
30  Java Game APIs & Engines / Java 2D / Re: RadialGradientPaint problem on: 2015-04-03 16:16:17
Now all I need to do is make it take less than 25ms per frame to draw them all :-(

Baking things into BufferedImages is how I do J2D when I need relative speed.
Pages: [1] 2 3 ... 68
 
Riven (23 views)
2015-04-16 10:48:47

Duke0200 (36 views)
2015-04-16 01:59:01

Fairy Tailz (27 views)
2015-04-14 20:13:12

Riven (29 views)
2015-04-12 21:36:37

bus hotdog (46 views)
2015-04-10 02:39:32

CopyableCougar4 (47 views)
2015-04-10 00:51:04

BurntPizza (46 views)
2015-04-06 22:06:58

ags1 (51 views)
2015-04-02 10:58:48

Riven (49 views)
2015-04-01 18:27:05

ags1 (66 views)
2015-03-31 10:55:12
How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

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
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!