Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (521)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
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 ... 54
1  Discussions / Miscellaneous Topics / Re: Remove all comments Eclipse shortcut on: 2014-11-21 02:41:32
Pro tip: most editors have this functionality. (although things like word processors probably don't often include regex ability...)
2  Discussions / Miscellaneous Topics / Re: Remove all comments Eclipse shortcut on: 2014-11-21 02:39:09
Find: * enter number of spaces for each tab *
Replace: * tab *

Un-check regular expressions. Click.
3  Discussions / Miscellaneous Topics / Re: Remove all comments Eclipse shortcut on: 2014-11-21 02:37:12
/\*.*?\*/ From the SO post seems to remove the line nums just fine on regexpal, but you'll have to remove the description(s) at the bottom yourself.

Just Ctrl-F in the editor, put /\*.*?\*/ in the Find field, leave 'Replace with' blank (to replace the comments with nothing, effectively removing them), check 'Regular Expressions', and then click 'Replace All.'
4  Discussions / Miscellaneous Topics / Re: Remove all comments Eclipse shortcut on: 2014-11-21 02:30:34
What do the comments look like?

Also: http://regexpal.com/ is great for figuring these out.
5  Game Development / Newbie & Debugging Questions / Re: Saving only one value in preferences file - libgdx on: 2014-11-21 02:29:07
Just don't change the options you don't want updated when you flush().
6  Discussions / Miscellaneous Topics / Re: Remove all comments Eclipse shortcut on: 2014-11-21 02:23:35
Use eclipse's Find/Replace (google that if you don't know)

In fact, here is the regex for this exact situation it appears: http://stackoverflow.com/questions/10530055/eclipse-find-replace-with-regex-to-comment-lines?lq=1
7  Discussions / General Discussions / Re: Jar Decompiler? on: 2014-11-20 23:48:03
Chances are, rebuilding an old project from scratch would increase code quality.

As for decompilers, here are some: http://stackoverflow.com/a/272550
(note: the SO question is 6 years old, check recency of answers)
8  Discussions / General Discussions / Re: General Java Questions on: 2014-11-20 04:27:40
Google. Wikipedia. You will find better answers faster.

Here's a sample of uses:
http://www.informit.com/library/content.aspx?b=STY_XML_21days&seqNum=15
http://webdesign.about.com/od/xml/a/aa060401a.htm

Why such an interest in XML?
9  Discussions / General Discussions / Re: [Resolved] java jar file rejected by folks at "Demo Derby", need .mov ASAP on: 2014-11-19 21:32:46
Fraps + WinFF for encoding has been my combo for a while, but I'm thinking I'll try OBS next time I need to do video stuff.
10  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-11-18 22:31:11
Added MORE multithreading to Verbal. There is no programming problem that cannot be solved by an extra layer of indirection, and an extra thread!

Still trying to find the transformation that makes my seam carving cost function scale linearly with threads, instead of what it is currently doing: slowing down quadratically. Damn false sharing...  Emo
The energy function gets a nice 3.5x speedup though.  Smiley
11  Discussions / General Discussions / Re: Programmer jokes on: 2014-11-18 21:11:50
Not really a joke, but this is valid code:

1  
2  
3  
4  
// the face of disapproval
public static void ಠ_ಠ(String s) {
    throw new Error(s);
}


Useful for all your exception handling needs!


http://kutruff.wordpress.com/2011/02/08/using-%E0%B2%A0_%E0%B2%A0-to-throw-exceptions/
12  Game Development / Newbie & Debugging Questions / Re: How does this work? on: 2014-11-17 04:37:50
Might as well go ahead and write an embedded scripting language for all your dynamic variable setting needs!
It's, uh.. webscale!
13  Game Development / Newbie & Debugging Questions / Re: How does this work? on: 2014-11-17 04:33:36
So you want to prematurely complicate things?  Wink
14  Game Development / Newbie & Debugging Questions / Re: How does this work? on: 2014-11-17 04:28:58
Why? (for both of those last sentences)
15  Discussions / Miscellaneous Topics / Re: How memory works? on: 2014-11-17 04:25:52
* plugs Clojure for it's small size (read: easy to pick up), elegance, and it's lispy brain-expanding powers... *  Pointing
16  Game Development / Newbie & Debugging Questions / Re: How does this work? on: 2014-11-17 04:20:26
This code is simply "measuring" (if you can call it that) the JIT warmup time.
By the time the code is optimized the first loop is probably almost done.
Also have to look out for that fact that it can often be smart enough to see that the loops accomplish nothing, and remove them entirely.

If you want any kind of meaningful data out of a Java microbenchmark you're pretty much going to have to use JMH.
http://openjdk.java.net/projects/code-tools/jmh/
http://java-performance.info/jmh/

Do you have any opinion on using this KeyValue class for things like storing Entity X/Y which would be constantly read/written to? I imagine it would be more optimized in that case if I were to encapsulate the x/y coordinates in an Object like a Point or something as well.

HashMaps are pretty bad for cache locality, good ol' ArrayList has your back 99% of the time. And you know what they say about premature optimization. Have you attempted to time ArrayList<Point> etc. vs. Map? I'll bet List is faster.
It's also almost guaranteed that you don't need every last drop of perf anyway. Don't think too hard about it until you need to.
17  Game Development / Newbie & Debugging Questions / Re: ArrayList error on: 2014-11-16 06:20:58
I may misunderstand something, but isn't using a rawtype not a good idea? I know mine is far from the best idea, but at least there isn't any possibility of contaminating the list, such as putting a string in a boolean list.

CopyableCougar4

One should always prefer the genric of course, but in this case (arrays) it's not possible, and in fact you loose no type saftey with a raw type: (because the declaration isn't raw, only the initializer)

1  
2  
3  
4  
5  
@SuppressWarnings("unchecked")
List<Boolean>[][] lists = new ArrayList[2][2];

lists[0][1] = new ArrayList<>();
lists[0][1].add(5); // Compiler error; just like you would expect
18  Game Development / Newbie & Debugging Questions / Re: ArrayList error on: 2014-11-16 04:50:47
Ah, sorry, didn't see it.
19  Game Development / Newbie & Debugging Questions / Re: ArrayList error on: 2014-11-16 04:41:19
To circumvent the issue without changing the rest of the code, use a rawtype:

1  
grid = new ArrayList[cols][rows];


instead of grid = new ArrayList<Entity>[cols][rows];

The declaration can stay as it is.
20  Discussions / Miscellaneous Topics / Re: How memory works? on: 2014-11-16 00:09:35
In the same way the memory address 0 isn't at 0 but it is at 0 on the assigned memory group...

Pretty much, the more concise way to think about it is as an offset:

1  
2  
3  
4  
// array is located at some address, but we don't care,
// we use addresses relative to the offset of the array:
int[] array = new int[10];
int a = array[4]; // we fetched the data at {array offset} + {sizeOf int} * 4


Individual variable offsets are also relative to the offset of the program they are contained in, which is in turn contained in the "virtual address space" created by the OS.
It's offsets all the way down...
21  Game Development / Newbie & Debugging Questions / Re: ANDROID Perlin Noise clouds & CPU-Usage & Bitmaps on: 2014-11-15 05:58:16
Ah, I believe I mixed up what the desired effect was... (I still suggest the lens)

Both combined would definitely look good. If the 3D is too slow (probably won't be if you don't compute too many layers of z), then you could fake it by thresholding the 2D noise.
22  Game Development / Newbie & Debugging Questions / Re: ANDROID Perlin Noise clouds & CPU-Usage & Bitmaps on: 2014-11-14 22:12:46
That would (probably) look strange and be significantly slower...
What I was thinking is you could map the 2D noise over the sphere, probably using a "fisheye lens" type of mapping so that the clouds would actually look like they are wrapping around a sphere.
Something like what this probably looks like: http://stackoverflow.com/questions/6214377/fisheye-distortion?rq=1

EDIT: for the actual function, see the "Orthographic" section under http://en.wikipedia.org/wiki/Fisheye_lens#Fisheye_lens
23  Discussions / Miscellaneous Topics / Re: How memory works? on: 2014-11-14 22:09:24
Nothing says that objects are heap allocated. You just don't have the control. Because of this JVM can optimize allocations away if its like.

True, although it doesn't seem to happen much and you definitely can't count on it. But I will concede that you are technically correct.
24  Discussions / Miscellaneous Topics / Re: How memory works? on: 2014-11-14 21:27:57
In Java, everything is heap allocated.

Just to be clear, Objects are heap allocated. Primitives (like ints, doubles and pointers) are (since their size is known) allocated on the stack.

Computerphile has a video on stacks and why they are fundamental to how we do computation: https://www.youtube.com/watch?v=7ha78yWRDlE
If you liked that, you should go and watch as much of their other stuff as you have time for. It's good stuff.
25  Discussions / General Discussions / Re: what's up ? on: 2014-11-14 03:18:46
there had been an arguement about too many people making engines.... There was a small arguement over one engine with a bit of swearing... And a few more games...

So the usual, eh?  Wink

@DzzD Welcome back!
26  Game Development / Newbie & Debugging Questions / Re: Java Game to native HTML5 & JavaScript? on: 2014-11-13 03:12:09
I believe that is what libGDX uses under the hood.
27  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-11-13 00:48:30
@Agent Here's the latest real crazy stuff in photo manipulation:

<a href="http://www.youtube.com/v/bMeBvrG9Uyo?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/bMeBvrG9Uyo?version=3&amp;hl=en_US&amp;start=</a>
28  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-11-13 00:33:44
After working with it for a bit the artifacts are actually pretty noticeable to me, it will look even more seamless later because I'm not yet performing the extra "quality-assurance" heuristics!

EDIT: spooky object removal via seam carving (which I also plan to implement) : http://youtu.be/6NcIJXTlugc?t=3m43s
29  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-11-12 23:43:27
Ah, whoops. Thanks.
30  Game Development / Newbie & Debugging Questions / Re: 2D Array with ArrayList for map on: 2014-11-12 21:27:06
Or, depending on access patterns, a Hilbert/Z-order/etc curve-mapped array!

Best to simply know that there is no silver bullet.
Pages: [1] 2 3 ... 54
 

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

The first screenshot will be displayed as a thumbnail.

xFryIx (58 views)
2014-11-13 12:34:49

digdugdiggy (36 views)
2014-11-12 21:11:50

digdugdiggy (30 views)
2014-11-12 21:10:15

digdugdiggy (24 views)
2014-11-12 21:09:33

kovacsa (48 views)
2014-11-07 19:57:14

TehJavaDev (51 views)
2014-11-03 22:04:50

BurntPizza (51 views)
2014-11-03 18:54:52

moogie (66 views)
2014-11-03 06:22:04

CopyableCougar4 (64 views)
2014-11-01 23:36:41

DarkCart (150 views)
2014-11-01 14:51:03
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

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!