Hi !
Featured games (87)
games approved by the League of Dukes
Games in Showcase (672)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (727)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: 1 ... 5 6 [7] 8 9 10
 on: 2016-04-30 23:12:23 
Started by BurntPizza - Last post by delt0r
Sorting the isometric sprites the "correct" way is a hell, if you go for perfection you'll end up with a O(n^2) algorithm in the worst case or O(n * log n) algorithm eating up your mem in the best case.
I really don't follow, esp n^2. I did a isometric engine way back and had no such problems. Also n log n is fast enough even on old hardware for pretty big lists. If its mostly sorted, many sorts tend to O(n).

Anything that has a consistent ordering should always be sortable in n log n worst case. (broken quick sorts not withstanding)

 on: 2016-04-30 18:46:55 
Started by vusman - Last post by orange451
I think office building 1 or 2 has the incorrect download link. They both download the same model Tongue

 on: 2016-04-30 17:52:50 
Started by JaredBGreat - Last post by JaredBGreat
You can get better mixing by mixing algebra groups..which means less operations.  I've always sucked at attempting to come up with this kind of thing.  Examples are the bit-finalizers of mumurhash and xxhash, etc. etc.

I recently read a blog post about this kind of thing...I'll look through my history to see if I can find it.

Thanks, I've been trying to come up with something like this for a while -- put together several RNG that were basically garbage.  When I heard of Xorshift the lightbulb came on -- but even if I stick with this approach it needs to improvement, a bit of which I've done (perturbed the seed to avoid repeats with x and y loop around), but it still has a slight bias toward 0.

A test generation 0-9 gives:

0's: 766966
1's: 669401
2's: 599692
3's: 598700
4's: 602171
5's: 621632
6's: 618932
7's: 602576
8's: 605209
9's: 606177

Total   = 27410618
Numebr = 6291456
Average = 4.3568006

(Also, not sure I may have over done some things {"t" twice? And does wrapping around help me in any way?} -- so, it not optimized at all.)  

EDIT: I've also modified it slightly in the short run to prevent early wrap around based on x and y (without creating special seeds elsewhere):

public long longFromTile(int x, int y, int t) {
        long out = seed + (5443 * (long)t)
                        + (12338621L * (long)x)
                        + (15485863L * (long)y);
        out ^= lshift(out, (x % 19) + 7);
        out ^= rshift(out, (y % 13) + 31);
        out ^= lshift(out, 4);  
        out ^= rshift(out, (t % 5) + 23);
        return out;

I'll look into other ways of optimizing it.  Not to concerned about long periods at any one spot though, since it would probably used to create a small set of number for perlin noise, cellular automata, or similar.  These improvements also fix the zero bias.

 on: 2016-04-30 17:43:40 
Started by JaredBGreat - Last post by Roquen
You can get better mixing by mixing algebra groups..which means less operations.  I've always sucked at attempting to come up with this kind of thing.  Examples are the bit-finalizers of mumurhash and xxhash, etc. etc.

I recently read a blog post about this kind of thing...I'll look through my history to see if I can find it.

 on: 2016-04-30 17:42:34 
Started by Omar - Last post by Amryu
Hi Omar,

guess thats ok but who would ever use this feature?
No one knows it exists and this game requires the mouse
anyways so I think it's unnecessary. Well it's your game,
I'm just trying to help you Smiley


 on: 2016-04-30 17:22:03 
Started by J0 - Last post by J0
Woah, that was quick! Cheesy
So is there no way to do what I was looking for?
I really don't want a custom texture persecutioncomplex

 on: 2016-04-30 17:19:25 
Started by J0 - Last post by SHC
I'd not use the default cursors, at least in games. Disable the cursor completely, and draw your own cursor, with a custom texture.

 on: 2016-04-30 17:16:40 
Started by J0 - Last post by J0
Hi lads!

So I have this OpenGL Display embedded inside a JFrame, and within the Display I'm showing, (very basic) UI elements. So far so good, everything works fine. However, I would like to change the cursor from
when hovering above buttons, because that's a lot nicer (notice I used the AWT Cursor fields, but I'm not necessarily looking for a solution involving those).

At first I tried to call
on the parent
every time the mouse moves to or out of a button.. You'd think that would work, but it turns out the cursor keeps flickering between default and hand — I'm guessing that's because of OpenGL messing with Swing Roll Eyes

Of course, I guess I could just hide the cursor and draw another image at the mouse position, but that does not sound very pretty, now does it? persecutioncomplex

So yeah if someone actually knows how to handle cursors on top of OpenGL Displays that would be great!

J0 Smiley

 on: 2016-04-30 17:14:47 
Started by Ecumene - Last post by Spasi
I was looking for a tutorial like that! I'm implementing the countdown and a bunch of other stuff now.

Note that you don't have to use a CountDownLatch for synchronization/communication, that's just an example. The only important detail is: most GLFW functions are called from the main thread, the per-window threads only deal with rendering.

This does imply that, at some point, you have to have synchronization points and/or pass messages between threads. Neither GLFW nor LWJGL have any special requirements for how that happens, it's entirely up to the application and how it's designed. Fortunately, Java has a very rich set of concurrency primitives (like CountDownLatch) and concurrent data structures that can be used for that purpose.

I meant to ask, does input handling per window still work regardless of the main thread?

The only thread that deals with window/input events is the main thread. It works fine regardless of how many windows or rendering threads you have.

 on: 2016-04-30 16:33:57 
Started by Omar - Last post by Omar
Hey Amryu,

For the main menu, it is actually intentional to keep the entry brightful even after you hover outside of it.
This is because you can also toggle between entries with the keyboard "Up" and "Down" arrows, and it allows
the user to know at which entry he/she is at the current moment.


Pages: 1 ... 5 6 [7] 8 9 10
IanParcs (45 views)
2016-04-18 14:18:53

KaiHH (45 views)
2016-04-18 08:35:41

KaiHH (75 views)
2016-04-15 12:43:58

theagentd (76 views)
2016-04-14 02:16:17

theagentd (90 views)
2016-04-14 02:15:43

IanParcs (104 views)
2016-04-12 03:51:16

IanParcs (47 views)
2016-04-12 03:50:03

IanParcs (43 views)
2016-04-12 03:49:54

IanParcs (38 views)
2016-04-12 03:49:52

IanParcs (48 views)
2016-04-12 03:49:52
Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50

Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30 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‑
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!