Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (549)
Games in Android Showcase (137)
games submitted by our members
Games in WIP (594)
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 ... 61
1  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Using the same input key in a pause and play state on: 2015-01-27 01:20:03
Use an InputProcessor to capture input events instead of polling their state each frame.
2  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-26 23:50:15
I miss Project Wonderful and Ray's not-quite-a-perfect-loop-but-close-enough-to-annoy-you ad...

Not quite a full revolution, but a rayvolution!
3  Game Development / Performance Tuning / Re: Fast way to filter through data on: 2015-01-26 21:40:09
@Kevin

Unboxed:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
import java.util.Arrays;

public class Test {
   public static void main(String... args) {
     
      int[] numbers = new int[1024];
      int size = 0;
     
      for (int i = 0; i < 10000; i++) {
         int n = (int) (Math.random() * 150);
         
         if (size == numbers.length)
            numbers = Arrays.copyOf(numbers, numbers.length * 2);
         numbers[size++] = n;
      }
     
      System.out.println("Unfiltered size:" + size);
     
      int[] filteredNumbers =
            Arrays.stream(numbers).parallel()
                  .filter(t -> t >= 50 && t <= 100)
                  .toArray();
     
      System.out.println("Filtered size:" + filteredNumbers.length);
   }
}


EDIT: actually doesn't seem that much faster until ~1M elements.
4  Game Development / Performance Tuning / Re: Fast way to filter through data on: 2015-01-26 21:27:42
What methods have you tried? Simple loop (perhaps split over N threads) is about as good as it gets.
5  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-23 19:27:48
Yes.
I analyzed some of the contest data and it is very clustered, with some very outlying clusters far away from the main groups as well, so a bin would have been (ha) terrible.
Meanwhile the tree completes [non-exhaustive] containment queries on 10M points in ~0.015 ms, and I haven't spent any time optimizing node sizes, locality, etc.
6  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-22 21:38:39
tile-recursive-sort-loading is possible only after all data is known (correct ?). i'm following the implementation as described here : http://www-db.deis.unibo.it/courses/SI-LS/papers/Gut84.pdf which is a very dynamic r-tree version. adding and deleting on the fly is fast, but generates lower quality trees. figured, the tile-sorting algorithm can be applied here too (partially, not recursive, but sorting dimensions by perimeter), which gets close to the quadratic-quality at linear-time :O

You are correct. Sounds interesting, could you elaborate slightly? Is it competitive with R+/R* trees? Afaik the quadratic split isn't actually very good, although it is better than the linear split(s). The first picture looks quite performant though.
R* topological split looks about as good as STR while remaining dynamic: (if more expensive than simpler splits)

Wikipedia

Also nice pictures as usual  Pointing
7  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-22 02:54:56
How's the trackball? I always thought those were neat, but have never used one.
8  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-21 15:24:26
I made something similar for polygons (regions) rather than points which was just a simple 2D array of tiles. Would be interesting to see your algorithm working with overlapping regions too.
What do you plan to use your algorithm for?

Sounds like the good ol' Bin.
R-trees can be used for arbitrary shapes as well, both storage and queries, the two types of queries most suited to them is intersection/containment (given shape S, what objects in the tree intersect it?) and k-nearest neighbors.
http://en.wikipedia.org/wiki/R-tree

I'm entering a contest which requires fast spatial queries; I deemed R-trees the way to go.
Now to port it to C...  persecutioncomplex
9  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-21 05:34:04
Been prototyping an R-tree implementation using fancy Sort-Tile-Recursive bulk loading, as detailed here.

Generated from random points, notice the nice, clustered, non-overlapping (leaves) packing:

Click to Play


Probably one of my favorite data structures.
10  Discussions / Suggestions / Re: Font for code blocks on: 2015-01-21 03:06:54
This is what I get (and have always gotten):



Did you mess with stylesheets?
11  Discussions / General Discussions / Re: Posting in wrong thread on: 2015-01-20 18:23:24
I can give you the minor annoyance of the non-answer "Well that depends."  Pointing
12  Game Development / Newbie & Debugging Questions / Re: Best way to deal with infinite elements? on: 2015-01-20 13:12:11
Queue is just an interface, LinkedQueue is one implementation of it. ArrayDeque is my personal favorite, and is probably faster for most use cases.
If you are actually concerned about speed (which you probably shouldn't be at this point), then the only way to know it to measure.
13  Discussions / General Discussions / Re: Posting in wrong thread on: 2015-01-19 22:35:57
If you set 'Return to topics after posting by default.' in Profile > Look and Layout Preferences (if it in't already) then at least you should be able to immediately see the error.
14  Game Development / Shared Code / Re: Sortable Map on: 2015-01-18 02:05:52
Yeah, a TreeMap will be much faster than this impl and also maintains it's order without having to remember to sort after insertions.
If any semblance of speed is required, don't use indexOf (or Collections.sort) in everything...
15  Game Development / Artificial Intelligence / Re: Tutorial or example on a* pathfinding without Slick on: 2015-01-12 01:08:44
It's also not a library, merely a translation of the redblobgames tutorial wrapped in a demo.

TileMap
is abstract, a 'template' of a TileMap; you have to subclass it:

Line 27..58

1  
2  
3  
TileMap map = new TileMap() {
    <impl>
};


If you want a drop in solution, then this isn't it. But you did ask for an example.
16  Game Development / Artificial Intelligence / Re: Tutorial or example on a* pathfinding without Slick on: 2015-01-12 00:55:25
I found this: http://pastebin.java-gaming.org/30d824f780e1f
Note: might be subtly broken, or at least not algorithmically perfect.
17  Game Development / Artificial Intelligence / Re: Tutorial or example on a* pathfinding without Slick on: 2015-01-12 00:43:31
http://www.redblobgames.com/pathfinding/a-star/introduction.html

Has interactive examples.

From google of "a star pathfinding"
18  Java Game APIs & Engines / OpenGL Development / Re: Is it ok to use OpenGL 1.1? on: 2015-01-11 04:18:40
Also note that only having very outdated tech in your engine further reduces the already minute chances of somebody else using it.
19  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [LIBGDX] Why my Desktop project work but not the android project ? on: 2015-01-11 00:07:06
m_Animation_Tab is declared as a Map, which doesn't have a putIfAbsent method, at least in the version of dalvik's runtime you're running on, hence why it can't resolve (aka find) that method.

EDIT: see java7 docs: http://docs.oracle.com/javase/7/docs/api/java/util/Map.html
Doesn't have putIfAbsent. Java8 has it.
20  Games Center / WIP games, tools & toy projects / Re: Bit Siege - 2D Competitive Multiplayer PvP Game. (Alpha v1 out now!) on: 2015-01-09 19:12:06
Can you also offer it in zip? My school's computer do not allow users to install programs, so I could not install WinRAR to extract the files.

http://portableapps.com/apps/utilities/7-zip_portable
21  Games Center / Cube World Projects / Re: Voxel Engine written in Kotlin + libGDX on: 2015-01-09 15:36:26
"All engines, libraries and frameworks will be moved to Archived Projects"
-Riven, administrator of JGO

Only "game engines." This would be Cube World Projects, maybe.
22  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-08 03:40:13
Reminds me of L-systems and Turing Turtles.

Figure out a fitness function for "interesting-ness" and throw it in a genetic algorithm stat!
23  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-08 00:29:14
Not groking that yet, would it handle removals well?

Either way, an R-tree (or variant) looks to be near optimal and I want an impl for my utilities anyway, so I'll probably try that.
24  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-07 18:05:14
Since it's just a 3-D nearest neighbor search (dimensions r,g,b), I was thinking a kd-tree, although removal after each search is problematic.
Right now it's just a fuzzy linear search for the proof of concept, which almost anything will beat.
25  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-07 16:52:22
Re-hosted to imgur's gifv: http://imgur.com/SVi6o6k (warning: massive and poor quality)

The code will have to wait until later today, but the process is like this:

Get 2 images, equal dimensions for convenience
1st is the pixel source, 2nd is the target
Create 3rd blank image to draw to
Create an array of indices of the target in the order they will be found from the source
(I did range(0...img.size).sort(euclidean distance from image center) to get the expanding circle,
previously I tried the range shuffled, which looks cool but yields terrible video quality due to the noise)

For each frame:
loop:
    get next index from indices
    get the pixel color of that index in the target image
    find a pixel in the source with a color as close as possible to that
    set that pixel's location in the source image to black, create a new particle in the same spot with the found color
    set particle target point to current index
    add particle to "entities" list
end loop, repeat n times, where n determines the rate of pixel-uprooting (I used 190 to get the video short enough for gfycat, but that many searches per frame kills real-time perf)

render:
draw source and blank image next to each other
for each particle in "entities":
    increment life
    if (life == MAX_LIFE): remove from entities, set target point on 3rd image to this particle's color
    else: cubic interpolate from particle origin to target point with life/MAX_LIFE as alpha, draw
(optional) write current frame to disk via ExecutorService+ImageIO to later mux via ffmpeg

do { frame loop } while(!entities.isEmpty())
26  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-07 15:43:04
Got inspired by this (warning, lots of large images and gifs) and felt like doing something visual again:
http://gfycat.com/IndelibleHeftyCommongonolek

I might post the code if anyone if interested and I can make it somewhat readable.
27  Game Development / Newbie & Debugging Questions / Re: A little problem..... (Rendering) on: 2015-01-06 22:09:01
Better comparator:

1  
2  
3  
4  
5  
6  
7  
8  
9  
public static final Comparator<Entity> rev_YOrder = new Comparator<Entity>() {
    public int compare(Entity a, Entity b) {
        return Integer.compare(b.y, a.y);
    }
};
Collections.sort(entities, rev_YOrder);

// or, if java8:
Collections.sort(entities, (e1, e2) -> Integer.compare(e2.y, e1.y));
28  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-06 06:30:03
Finally getting around to putting together a utilities lib for myself, currently some geometry stuff:

Click to Play


Circumscribed circles of triangles are central to Delaunay triangulation.
29  Game Development / Newbie & Debugging Questions / Re: Is LWJGL 3 stable enough for use? on: 2015-01-06 04:27:40
While this is true, development of 2 will be discontinued unless someone picks it up. Right?

You missed the sticky!
http://www.java-gaming.org/topics/lwjgl-2-9-2/35234/msg/333224/view.html#msg333224

Quote
LWJGL 2.9.2 has been released today. [...]
This will most likely be the last LWJGL 2 release.
30  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-06 03:19:00
@wes
Will it have some kind of skinning support?
EDIT: ninja'd a bit.

Also, congratz on the 29-th commit!
Pages: [1] 2 3 ... 61
 

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

The first screenshot will be displayed as a thumbnail.

GamerIDGoesHere (17 views)
2015-01-27 01:23:23

GamerIDGoesHere (17 views)
2015-01-27 01:22:15

CopyableCougar4 (23 views)
2015-01-27 00:34:41

CopyableCougar4 (15 views)
2015-01-26 04:47:56

Olo (14 views)
2015-01-25 21:26:00

Olo (16 views)
2015-01-25 18:44:22

Robo11 (28 views)
2015-01-25 06:14:26

basil_ (26 views)
2015-01-17 22:29:32

wxwsk8er (26 views)
2015-01-16 21:42:21

wxwsk8er (21 views)
2015-01-16 20:44:20
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

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17
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!