Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (748)
Games in Android Showcase (226)
games submitted by our members
Games in WIP (834)
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 ... 116
1  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-12-28 10:07:04
Yeah I wasn't clear.  I wouldn't use OpenCL for CPU in AOT land.  I'd use ISCP...not that that's ideal and not than I'd expect everyone to agree with me.  There's plenty of "let's use CPUs power" territory to be explored.  So I'm not going to be dismissive for people trying different things.
2  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-12-27 17:52:44
@Spasi: Programs that use GPU tend to be GPU bound.
3  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-12-22 11:40:53
Skimmed this post: https://astojanov.github.io/blog/2017/12/20/scala-simd.html
4  Game Development / Shared Code / Re: Fast Atan2 [Again] on: 2017-12-11 13:22:55
Yea: hypot avoids overflow & underflow and is significantly more accurate than sqrt of sum of squares...and like princec said it's very unlikely you care.

Those 'fast' square roots are good to about 11 or 12 bits and so are only useful for horseshoes and handgrenades kinda computations.  Take Haswell/Broadwell: sqrtss is 1 uOP to issue, completes in 11 cycles and is ulp correct.  (Yeah, it's too bad java doesn't expose ~sqrt and ~1/sqrt, well and a long list of other things).

Have I ever mentioned that microbenchmarks are only as meaningful as the testing scheme and how well they reflect an an usage?
5  Game Development / Newbie & Debugging Questions / Re: How Can I rotate a triangle's vertices in 2d space? on: 2017-11-21 12:43:13
1  
2  
3  
4  
5  
6  
7  
8  
9  
for (int i = 0; i < verts.length; i++) {
  Vector2 v = verts[i];

  // FWIW:  this is do more work than needed and the compiler can't remove it
  double vX = (v.x - cX) * m00 + (v.y - cY) * m10 + cX;
  double vY = (v.x - cX) * m01 + (v.y - cY) * m11 + cY;
 
   vertices[i].set(vX,vY);
}
6  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-09-21 19:42:01
I downloaded java 9.  Go me.
7  Game Development / Shared Code / Re: Fast Atan2 [Again] on: 2017-09-11 09:00:58
My expectation is that the branches will be the much bigger problem in most cases.  If you're making enough atan/atan2 calls to be statistically important then it's pretty likely they will bunch up in time and the cost of loading the LUT to cache won't be a killer.  For the branches it's very unlikely that the probability of each won't be in the neighborhood of .5  so ~n/2 branch mispredictions per call where 'n' is the number of branches along a path.

EDIT: The way the benchmark is structured means the branch will statistically always be correctly predicted.
8  Game Development / Shared Code / Re: Fast Atan2 [Again] on: 2017-09-09 11:38:04
Broken record time.  Any benchmark that doesn't reflect an actual usage pattern is wishful thinking.  If you're linearly walking through angles you can compute with tiny errors in a couple of products and adds (I'm tired and was thinking forward here, opps)..no lookups no branches.
9  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-08-16 10:52:19
Didn't watch video but symbolically, computer's are actually quite excellent at algebra given a good piece of software...and getting there on verifying and generating proofs.
10  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-08-15 09:11:10
But he was design in different way – so it hold as many float part as he can.

Exactly, the point is to maintain the most significant part of a (sub)result.  The simplest example is multiply, if we think of our two numbers as consisting of a 24 bit integer (all fractional part so: 0.24) and an exponent, then the product simply adds the integer exponents and to store the new fraction part would require: 0.24 x 0.24 = 0.48, so 48 bits for the significand.  Since we're using a fixed number of bits those 48 bits are rounded to 24.
11  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-08-14 06:52:27
Looking at it that way doesn't seem useful.  For singles we have the 24 most significant bits so looking at in hex format and showing all 24 bits and aligning the decimal point gives (the '-' are bit positions beyond 24):

65536.0   0x1p+16               10000000000000000.00000000------
0.00300   0x1.89374cp-9                          .00000000110001001001101110100


So even the highest bit of 0.003 is too small to contribute (by one) so:  65536.0+0.00300 = 65536.0

If we were to multiply that by two and then add then it could:

65536.0+2*0.00300 = 65536.007812 = 0x1.000002p+16 = 10000000000000000.0000001

The exponents from the first are +16 and -9, so 16-(-9)=25 so too large a gap to contribute.
12  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-08-13 19:46:11
The point is it's single precision "floating point" (da dum tish!).  You have 24 significant bits and there you have it.  Notions of "epsilon" seem to add more confusion than clarity.
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-07-04 08:09:59
Made another thing. Sorry for spamming, this is just so neat. I love math!

4yrs ago did some quick goofying with mset domains here (set sampling to .5):
http://glslsandbox.com/e#9994.2
http://glslsandbox.com/e#9903.1
http://glslsandbox.com/e#9904.1
http://glslsandbox.com/e#9915.1
http://glslsandbox.com/e#9916.2
http://glslsandbox.com/e#9971.0
14  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-07-02 08:27:06
Obviously he's being an ass but cmon bruh.

Putting the best possible spin...what's the "valid point" of any of his comments?
15  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-07-01 11:32:52
Ah...cunt + straight pride week?  Nope, he's being an ass.  Even if being straight was illegal and/or got you killed in some places the cunt bit would ruin any potential point.
16  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-06-30 12:43:42
Wow. Markus is being a real dick recently.  If anyone still talks to him, now might be a good time to have a chat.
17  Game Development / Networking & Multiplayer / Re: Best - and currently active - networking lib? on: 2017-05-02 12:23:07
Aeron is designed for extremely low latency and destroys every other library in that metric.
It's too bad Martin Thompson stopped writing blog entries.  Still some great stuff there:  http://mechanical-sympathy.blogspot.fr/
18  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-05-01 21:24:50
Huh...this will be interesting: https://www.infoq.com/news/2017/05/no-jigsaw
19  Game Development / Performance Tuning / Re: Pathfinding over too large grid on: 2017-04-27 02:54:46
A course grain graph of waypoints?
20  Game Development / Shared Code / Re: Basic Image Quantization into 256 colors in 90 lines on: 2017-04-23 06:15:41
RBG isn't a good space to measure color differences.  Web search: "perceptual color spaces"  You'll also get better results if you don't simply map each pixel directly to a palette entry.  There are various methods, search "error diffusion"
21  Game Development / Game Mechanics / Re: Random weighted number between two numbers? on: 2017-04-14 11:03:14
Note that the Gaussian distribution isn't bounded...not sure if that's what you want.
22  Game Development / Game Mechanics / Re: Random weighted number between two numbers? on: 2017-04-14 09:48:51
Of course wikipedia is about as clear as ever:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
// symmetric triangle distribution: result on (-1,1)
public static float symmetricTriangular()
{
   return nextFloat()-nextFloat());  // from random number generator of choice
}

// symmetric triangle distribution: result on [lo, hi)
public static float symmetricTriangular(float lo, float hi)
{
    float halfDiff = 0.5f*(hi-lo);
    float triDist  = nextFloat()+nextFloat();   // triangle on [0,2)
    return halfDiff*triDist + lo;
}
23  Game Development / Game Mechanics / Re: Random weighted number between two numbers? on: 2017-04-14 09:33:34
The easiest the triangle distribution (https://en.wikipedia.org/wiki/Triangular_distribution), but it depends on how you what distribution curve to look.
24  Game Development / Performance Tuning / Re: Question: Branch Prediction Alleviating Performance Loss in Looped Conditionals? on: 2017-04-09 06:57:26
Of course for perf it's really hard to generalize.  On average a switch will win when using it can allow optimizations that wouldn't otherwise occur like not spilling registers between inside/outside the statement.  So the amount of work inside/outside is a really bad guess.
25  Game Development / Performance Tuning / Re: Question: Branch Prediction Alleviating Performance Loss in Looped Conditionals? on: 2017-04-08 20:55:45
Sound like using a @FunctionalInterface might be the thing to do.

"let's say that you have a loop that repeatedly calls a virtual function:"
If it can determine that the actual number of targets is one then it becomes a direct call, two or less it become an 'if' test between them, otherwise the standard read address and jump to it thing.
26  Game Development / Performance Tuning / Re: ArrayList$Itr and Escape Analysis on: 2017-03-06 13:13:11
You don't need a debug VM, just the disasm DLL (which Oracle can't distribute).  I posted a link at some point, but am unable to find it with a search (and don't have a copy ATM)

EDIT: Oh the file is 'hsdis-amd64.dll' and probably someone has a copy. 
27  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-19 18:49:58
My thinking was more "how to think about costs" than the specific example.  BTW, the original (not-complete) sequence is found here: http://www.codercorner.com/
28  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-19 10:58:14
RYG did an easy to understand breakdown of out-of-order optimization of some code by PhysX author Pierre Terdiman,
https://gist.github.com/rygorous/fdd41f45b24472649aaeb5b55bbe6e26?ts=4
29  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-13 19:40:52
https://twitter.com/Jonathan_Blow/status/831225844655796226

edit: or just click here: https://www.humblebundle.com/freedom
30  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-01-10 10:05:13
I quickly skimmed this (a list of java libs and such): https://github.com/akullpp/awesome-java
Pages: [1] 2 3 ... 116
 
xxMrPHDxx (332 views)
2017-12-31 17:17:51

xxMrPHDxx (109 views)
2017-12-31 17:15:51

xxMrPHDxx (158 views)
2017-12-28 18:11:33

Ecumene (340 views)
2017-09-30 02:57:34

theagentd (504 views)
2017-09-26 18:23:31

cybrmynd (548 views)
2017-08-02 12:28:51

cybrmynd (487 views)
2017-08-02 12:19:43

cybrmynd (461 views)
2017-08-02 12:18:09

Sralse (423 views)
2017-07-25 17:13:48

Archive (1346 views)
2017-04-27 17:45:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
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!