Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
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 ... 77
1  Discussions / Miscellaneous Topics / Re: f.lux on: 2014-04-19 16:31:34
I just repeeked at the web-site.  Ignoring comments like: "they're designed to look like the sun" (WTF?)  The colors of the site: text vs background colors are very not eye-friendly.
2  Discussions / Miscellaneous Topics / Re: f.lux on: 2014-04-19 16:06:51
There are two different issues here.  The first is eye response/fatigue related to lighting conditions luminosity of monitor vs. environment.  This issue is solved by working in a properly lit environment and properly set gamma response.  If you need to work in more than one then the answer is a different gamma response per environment.  Also properly choosing color schemes, fonts and sizes certainly play a role.  Check your white-point, black-point and reference images.  If you're not a professional digital artist then an exactly calibrated monitor isn't very important.

The second issue is the reported correlation between sleeplessness and expose to light in the blue range at night.  Seems plausible since we get hit with more blues during photopic vision (day) than otherwise.  My color selections are mostly "cold" and never have sleeping problems so I'm not concerned.  If you think you effected then it would make sense to try changing to "warm" color schemes.
3  Discussions / Miscellaneous Topics / Re: Where to find dark windows themes? on: 2014-04-19 15:45:29
I get the impressing that people don't set up their monitor color settings these days.
4  Discussions / Miscellaneous Topics / Re: f.lux on: 2014-04-18 14:25:46
My guess is: pr0n
5  Discussions / Miscellaneous Topics / Re: f.lux on: 2014-04-18 11:37:36
I'm old school.  I don't work in the dark nor in overly lit environments.  Indirect lighting is your friend.
6  Game Development / Newbie & Debugging Questions / Re: New vector from known angle on: 2014-04-17 20:08:53
Well, understanding the "special cases" is very useful in understand the general case....if you bother to make the connection.  Both in math and CS this is a useful learning technique....the trick is not to black box.
7  Discussions / Java Gaming Wiki / Re: Complex number cookbook on: 2014-04-17 16:42:10
Yeah: I know.  My main barrier is I doubt that enough people would bother to understand even with "aids" to make the effort worthwhile.
8  Discussions / Java Gaming Wiki / Re: Complex number cookbook on: 2014-04-17 16:05:43
Think about integers for a second.  We start with 0 (or 1 depending on who to talk to) and they're formed by repeatedly adding 1.  Each time giving you the next number in the sequence.  Then you get wild-and-crazy and extend the concept to extend in the negative direction.  Negative numbers!  What?  You can't say have a negative number of cows!!  Madness!  At least to the ancient greek math-heads it was...they didn't have the concept.  Now jump to complex numbers.  Constructed by using two instead of one number where the 'second' has a magic basis that squares to -1.  Placing special "meaning" to the sqrt(-1) in complex numbers is the same as placing special meaning to subtracting 1 in integers.  Neither are interesting as operations.  The sqrt(-1) is meaningless in reals just as you can't give away a cow you don't have.
9  Game Development / Shared Code / Re: My entity properties... a bad idea? on: 2014-04-17 14:41:09
Yeah that's one thing you can do...distribute across frames.  Sleep stuff as much as possible, etc. etc.

I've an example/mimimal prototype based variable here: https://github.com/roquendm/JGO-Grabbag/tree/master/src/roquen/wiki/dvar
and of course, it's targeting single threaded. Wink
10  Discussions / General Discussions / Re: What genre/artists do you listen to while coding? on: 2014-04-16 18:36:38
Recently: Sound of the keyboard.
11  Game Development / Shared Code / Re: My entity properties... a bad idea? on: 2014-04-16 09:00:35
Don't multithread the AIs.  You don't need to.  If you think you need to: think again about how to lower the computations per frame.  About the only situation I'd think about it would be for a server bank targeting tens of thousands of active players and then I'd use a DSL (probably partly actor based).
12  Game Development / Shared Code / Re: My entity properties... a bad idea? on: 2014-04-16 07:40:38
Where's the optimization?  This design needlessly (as described) slows things down.
13  Discussions / Java Gaming Wiki / Re: Complex number cookbook on: 2014-04-15 15:22:08
Yeah I've seen that site.  Diagrams are great and very helpful...interactive is even better.  And I can't motivate myself to do either.
14  Game Development / Newbie & Debugging Questions / Re: Identifying Subclasses on: 2014-04-15 14:39:49
Inspecting a type is brittle, error prone and exponentially more work.  If polymorphism isn't the solution (and I'm not saying that it always is)...what's the problem?

EDIT: And before anyone misunderstands my statement:  If I were designing a spell system all spells would be the same class..there'd be no polymorphism.
15  Game Development / Newbie & Debugging Questions / Re: Identifying Subclasses on: 2014-04-15 14:02:49
What's the real problem?  If you're examining the type of something...that usually has a high stink value.  Normally you do:

spell.doSomething();
16  Discussions / Miscellaneous Topics / Re: What are Anti-Virus Developers Protecting us From? on: 2014-04-15 10:18:09
Venn diagram from xkcd

17  Game Development / Newbie & Debugging Questions / Re: New vector from known angle on: 2014-04-15 07:48:34
http://www.java-gaming.org/topics/complex-number-cookbook/28991/view.html
18  Game Development / Newbie & Debugging Questions / Re: Can you randomly bitwise shift an integer left or right? on: 2014-04-13 08:15:59
Shifts are defined for all inputs
19  Game Development / Newbie & Debugging Questions / Re: Almost Completely Static Class Design on: 2014-04-10 12:09:48
The "other" choice is worse: http://en.wikipedia.org/wiki/Initialization-on-demand_holder_idiom

You only need to do that if you need type compatibility (of the singleton with something else) where the type must (or very desirable) via inheritance and not interface.

All other choices are either: not thread safe or an insane mess which looks thread safe but probably isn't.
Quote
I love you   Wink
I'd say it warms my heart but I seem to have misplaced it.
20  Game Development / Newbie & Debugging Questions / Re: Almost Completely Static Class Design on: 2014-04-10 07:16:11
Oh yeah lazy loading!  Kids: exactly when does the JVM load a class?  We're not C++.  If you think you need a singleton it's because you're parents gave you a red bicycle instead of a blue one when you were two.  You can forgiven them now.
21  Game Development / Newbie & Debugging Questions / Re: Almost Completely Static Class Design on: 2014-04-09 21:41:30
If you're compelled by the forces of evil to use a singleton: http://www.java-gaming.org/topics/stupid-enum-tricks/31916/view.html
22  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Pass OpenGL context to another thread on: 2014-04-09 00:08:52
Forget about clocks, libgdx and multiple threads for a moment.  You have a simple game and it tracks the current frame count.  Pretend like it's currently 1000.  And we'll pretend like we're using a priority queue.

It needs to check to see if it needs to run any triggers this frame:  peek at the PQ..is the key 1000 (or less)?  grab it and run it (repeat until none). 

Some code happens this frame and want to trigger something in 1 sec: add with key 1000+60 (assuming the 1/60 timer), something else in 1 min (1000+60*60), etc, etc.
23  Game Development / Newbie & Debugging Questions / Re: Advice on a faster way to check every pixel in an image. on: 2014-04-08 21:10:36

b = byte (method or array), then (b+1)>>8 yields 1 for 0xff and 0 otherwise.  Only 0xff will overflow into the ninth bit.  Likewise for 32-bit array accesses.  d = ((r & 0xFF0000) + 0x10000) >> 24 if 'alpha' can be any value...the and can be removed if A is insured to be zero.  If A is 0xff, the simply change the additive constant.
24  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Pass OpenGL context to another thread on: 2014-04-08 16:06:27
You're not mentioning anything that needs greater than 1/60 resolution.  Have one data-structure per thread.  It stores:
1) trigger time
2) code that needs to be run
3) data (2) needs to do it's thing.

And yes the trigger code should just trigger things.  If thread A needs to single something to be done in thread B...use a different communication channel.

For PQs...binary heap (potentially modified) is a choice.  Other things pop to mind like a skip list.
25  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Pass OpenGL context to another thread on: 2014-04-08 14:45:51
I'm really saying: keep it simple.  Why isn't 1/60 of a sec good enough resolution for triggering things?  Does multiple threads really matter?
26  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Pass OpenGL context to another thread on: 2014-04-08 13:58:12
Priority queue. 
27  Game Development / Newbie & Debugging Questions / Re: Advice on a faster way to check every pixel in an image. on: 2014-04-08 10:17:40
Humm..that's probably too hard.  Let me try again.  What happens if you add 1 to 0xFF that doesn't for any other value?
28  Game Development / Newbie & Debugging Questions / Re: Advice on a faster way to check every pixel in an image. on: 2014-04-08 10:02:25
Understand this (not optimal, but should point you right direction):

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
  public void foo(int[] src, byte[] dst, int w, int h) {
    int len = w*h;
    int id  = 0;
   
    for(int i=0; i<len; i++) {
      int p = src[id];   // assuming ARGB with A any value legal
     
      p = 1 + ((((p >> 16) & 0xFF) - 0xFF) >> 8);
     
      dst[id++] = (byte)p;
    }
  }
29  Discussions / General Discussions / Re: Libraries You Wish For on: 2014-04-07 15:43:48
Oh I skipped the middle ground: 
(int) (n * ((result >>> 12) * 0x1p-52));


---
There lots of libraries I people wish would write for or port to java.  A recently mentioned is recast detour for navigation meshes.
30  Discussions / General Discussions / Re: Libraries You Wish For on: 2014-04-07 13:22:39
Quote
If you are really going for the explicit purpose of "fast," I wouldn't use conditionals:
http://www.java-gaming.org/topics/bit-twiddle-amp-branch-removal/21443/view.html
However things might have changed in the JVM since 2009 enough to make these irrelevant.
Conditionals are always tricky.  Does hotspot convert into a branch or not...if a branch on average will the prediction be correct.  A correctly predicted branch is as close to free as possible...mispredicted can get quite expensive.  Hotspot has change alot, but branchless versions are still interesting.  As an example HotSpot engineers are currently wondering what to do about Math.max & Math.min...both of which are intrinsic, but they way they are lowering (to a conditional move) can have drastically negative impact on performance.  (The start of the conversion is here: http://comments.gmane.org/gmane.comp.java.openjdk.hotspot.compiler.devel/13893, but there's quite a few comments since)  A specific comment in that thread, no showing here is "Bit twiddling vs cmov is hard to guess at.  With register renaming (and register files seem to be growing) and more exec units it's possible that bit twiddling can end up faster, but sure, this is not a rule."  For min/max is dep-chain length is four and it needs one temp register..not heavy weight, so it's going to depend on what surround code is doing.

But in general, just use one that works.  You only need to think about the choice at some "spots" that are inside something you need to juice cycles out of and you can't think of any other options.

int result = seed % n; return result < 0 ? -result : result;


can be replaced by

return (seed>>>1) % n;


and you can kill the division by treating the result as fixed-point (https://github.com/roquendm/JGO-Grabbag/blob/master/src/roquen/math/rng/PRNG.java)
Pages: [1] 2 3 ... 77
 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (50 views)
2014-04-15 18:08:23

BurntPizza (46 views)
2014-04-15 03:46:01

UprightPath (62 views)
2014-04-14 17:39:50

UprightPath (44 views)
2014-04-14 17:35:47

Porlus (61 views)
2014-04-14 15:48:38

tom_mai78101 (84 views)
2014-04-10 04:04:31

BurntPizza (142 views)
2014-04-08 23:06:04

tom_mai78101 (242 views)
2014-04-05 13:34:39

trollwarrior1 (201 views)
2014-04-04 12:06:45

CJLetsGame (208 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!