Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (686)
Games in Android Showcase (198)
games submitted by our members
Games in WIP (758)
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 ... 306
1  Game Development / Game Mechanics / Re: Downloading and running jars from servers - Security? on: 2016-08-28 14:28:09
The theory behind applets was exactly that - lock the java code in a sandbox
that protects the user from harm.  Sadly, Oracle gave up trying to maintain that
The sandbox model blacklists (locks and barriers), it doesn't whitelist.

Furthermore, the sandbox did checks at runtime, instead of whitelisting code at compile/load-time.
2  Game Development / Game Mechanics / Re: Downloading and running jars from servers - Security? on: 2016-08-26 17:13:52
You can write a bytecode analyser, block reflection, and then whitelist all privileges on each class/method/field that you want to expose (you can even only grant read-access on certain fields). There isn't any performance overhead with this approach. It's just quite advanced stuff.

Oh, and blacklisting never works. Whitelisting is your only option.
3  Game Development / Newbie & Debugging Questions / Re: Converting RGB images to a master palette on: 2016-08-24 18:43:46
Why is memory such a constraint?
4  Game Development / Newbie & Debugging Questions / Re: Converting RGB images to a master palette on: 2016-08-23 20:03:02
Don't forget you can use dithering to approximate colors (in groups of pixels).

Here I created code to approximate any RGB input in the EGA16 palette (obviously only 16 colors)

If you add animation, you can dither in the 3rd dimension (time).
Click to Play
I remind you, these are just 16 colors, evenly spaced out colors in the RGB color space, which means I probably use only 8-12 per frame in this specific image.

Just run this JAR for yourself:

It should be relatively easy to use this concept to match an arbitrary palette.
5  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-08-18 19:44:26
Define it as method then, you silly.
6  Discussions / General Discussions / Re: Programmer jokes on: 2016-08-18 19:38:58
Why did the developer stumble to an ATM?
 - He ran out of cache.

7  Discussions / Community & Volunteer Projects / Re: Looking for a programming buddy on: 2016-08-15 22:12:16
Not even a link to your project? How would you find a stranger willing to finish / maintain 'this project' without even the slightest incentive.
8  Discussions / Java Gaming Wiki / Re: Quasi random number (low-discrepancy sequences) on: 2016-08-14 23:14:33

(click this page to load the PDF)
9  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Status of Riven's LibStruct? on: 2016-08-14 22:10:42
When you say structs don't get pushed into registers, do you mean that even the individual fields don't get pushed? I assumed that declaring a struct was semantically equivalent to declaring all of its fields in place. Otherwise, I have no expectations of this pushing entire structs into SIMD registers or anything. (Bytecode has no way of representing this, to my knowledge.)

Let's say  you have this code:
thing.a = vec.x * -1;
thing.b = vec.y * 2;
thing.c = vec.x * -3;

With POJOs,
will be stored into a register after the first read, with structs however, the memory (or L1-cache in this case) will be read twice.

As for the reordering: with POJOs, HotSpot will very likely swap line 2 and 3, whereas it won't with structs.

Both factors can result in a slowdown, depending on the bottleneck.
10  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Status of Riven's LibStruct? on: 2016-08-14 17:12:59

LibStruct basically has these advantages:
 - zero-copy
 - zero-garbage
 - convenience (on sourcecode level)

The disadvantages are:
 - struct values are never pushed into registers by HotSpot
 - structs are not eligible for escape analysis
 - struct I/O is never reordered by HotSpot

There are quite a few pitfalls when using LibStruct:
 - a NPE or AIOOBE turns into a segfault/memory-access-violation
 - structs must never be used as objects (like adding them to a Collection, or in general: passing them to a function accepting a java.lang.Object)
 - conceptually wrong struct code but valid Java code can be rather hard to debug, as the JVM typically crashes.

As to come back to the original post: LibStruct is currently frozen, as the number of users is zero (me included).
11  Game Development / Game Play & Game Design / Re: Exaggerated Sprite Animation Sizes on: 2016-08-09 22:47:06
You could have 2 sprites, render one on top of the other.
12  Game Development / Performance Tuning / Re: Interesting talk from Cliff Click, Azul Systems on: 2016-08-09 21:38:23
They might be able to increase the speed of Java another 20% but if it means startup takes minutes nobody will want it.
I realize that the last part of that sentence is in the context of apps/games, but... in the server world, people would fling hundreds of millions of dollars at you for improving performance 20% if that means the server takes only a few more minutes to start. Java web-container initialization time usually is 5-10min anyway.
13  Discussions / Miscellaneous Topics / Re: Hello gang! Hope all is well! - Missing JGO on: 2016-08-08 20:58:43
Hi Chris! Back then, I used to wonder how one could possibly not have enough time to maintain a forum... Now I feel realife slowly creepin' in Smiley

Having said that, what have you been up to lately?
14  Java Game APIs & Engines / Engines, Libraries and Tools / Re: JOML 1.8.0 Release on: 2016-07-31 16:18:15
... copying a Matrix4f into another Matrix4f ...

        final void copy(Matrix4f src, Matrix4f dest) {
            UNSAFE.putLong(dest, m00FieldOffset,    UNSAFE.getLongVolatile(src, m00FieldOffset));
            UNSAFE.putLong(dest, m00FieldOffset+8,  UNSAFE.getLongVolatile(src, m00FieldOffset+8));
            UNSAFE.putLong(dest, m00FieldOffset+16, UNSAFE.getLongVolatile(src, m00FieldOffset+16));
            UNSAFE.putLong(dest, m00FieldOffset+24, UNSAFE.getLongVolatile(src, m00FieldOffset+24));
            UNSAFE.putLong(dest, m00FieldOffset+32, UNSAFE.getLongVolatile(src, m00FieldOffset+32));
            UNSAFE.putLong(dest, m00FieldOffset+40, UNSAFE.getLongVolatile(src, m00FieldOffset+40));
            UNSAFE.putLong(dest, m00FieldOffset+48, UNSAFE.getLongVolatile(src, m00FieldOffset+48));
            UNSAFE.putLong(dest, m00FieldOffset+56, UNSAFE.getLongVolatile(src, m00FieldOffset+56));

Why volatile?
15  Java Game APIs & Engines / Engines, Libraries and Tools / Re: FXGL - JavaFX 8 / Kotlin Game Library on: 2016-07-31 11:16:24
If you want to engage people, put the screenshots in your post, not behind a link.
16  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LibZ - 2D Java Game Library on: 2016-07-30 21:34:31
1) Guy makes engine
2) Guy makes demo-game
3) People nitpick demo-game
17  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-07-28 06:17:40
Dude, this in WIDT? Emo
18  Game Development / Newbie & Debugging Questions / Re: LWJGL 3 glfwSetWindowIcon does not work - at all on: 2016-07-20 18:41:30
If someone with the necessary power reads this: You can close this ticket if you want to, as it solved  Wink
This is not how this forum works Smiley What if somebody wanted to add some other piece of wisdom? (Or share a good joke about... ehm... buffers!)

You can put [solved] in the subject-line though, the forum will turn it into a pretty little picture.

19  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-07-20 05:21:22
If this code is useful to anyone, I can post it, but I want to handle the license and permissions stuff correctly.

Basic usage:
    float[] audioFloats = OggVorbisToPCMFloats(URL oggUrl);

How do I know how many channels the audio stream is comprised of?

Maybe you could return float[][] or an actual POJO with some meta-data like sample-rate.

Transforming all samples into floats, only to have them converted into bytes/shorts again to play it seems a bit cumbersome. It may also be disadvantageous to be forced to decompress the entire file before you can play it. For long audio files this means significant decoding time and serious memory usage (especially due to the floats).
20  Discussions / General Discussions / Re: JGO bounced back on: 2016-07-13 09:34:48
A surge in visitors (bots?) blew up apache's access.log to 20GB, taking down MySQL and crashed a few MyISAM tables beyond recovery.

Obviously the log-files should have been in rotation-mode, but it wasn't.
21  Discussions / General Discussions / JGO bounced back on: 2016-07-13 01:33:50
I found some time (3:30AM) to restore JGO from a backup just prior to the crash.

Happy posting.
22  Game Development / Newbie & Debugging Questions / Re: Temporary ObjectOutputStream wrapping InputStream on: 2016-07-06 23:04:00
   public static GLSLFile deserializeFrom(InputStream input) throws IOException {
      ObjectInputStream ois = new ObjectInputStream(input);
      return (GLSLFile) ois.readObject();
      //I feel so dirty for not closing ois...

Is this correct? Can this explode somehow? What am I supposed to do here?!
Yes it can explode, because ObjectInputStream is buffered, and may read beyond the boundaries of the object.
The code I provided in the previous reply doesn't explode as much, they say.
23  Game Development / Newbie & Debugging Questions / Re: Temporary ObjectOutputStream wrapping InputStream on: 2016-07-06 22:56:00
Just use what mother nature provided:

   public void serializeTo(OutputStream output) throws IOException {
+     ByteArrayOutputStream baos = new ByteArrayOutputStream();
      try(ObjectOutputStream oos = new ObjectOutputStream(baos)) {
+     new DataOutputStream(output).writeInt(baos.size());
+     baos.writeTo(output); // pump buffered data into the output

   public static GLSLFile deserializeFrom(InputStream input) throws IOException {
+     DataInputStream dis = new DataInputStream(input);
+     byte[] buf = new byte[someSanityCheck(dis.readInt())];
+     dis.readFully(buf);

+     try(ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(buf))) {
         return (GLSLFile) ois.readObject();
24  Discussions / General Discussions / Re: Interesting proposals: Java 9 and beyond on: 2016-07-06 21:21:28
Keep in mind Java EE != Java JDK.

Obviously, Oracle will handle the fallout of all confusion in the worst possible way, and in 3 months time the story will be nuanced somewhat.
25  Discussions / General Discussions / Re: Virtual Reality on: 2016-07-06 13:28:13
Just tried the Microsoft HoloLens. AMA.
What was it like.
26  Game Development / Game Mechanics / Re: Using Bullet for something other than simulations on: 2016-07-02 12:36:11
Bullet has a collision callback, but the collision callback is called for as long as the object is in contact with another object, instead of being called when the object FIRST collides with another object. This means that if I use the collision callback to play impact sounds, the sounds will be played repeatedly for as long as the object is in contact with the other object.

Of course, there are workarounds, but it'd be incredibly messy and I want to avoid that.

I don't understand the problem... this is what programming is all about: taking something low-level and transforming it into something high-level. Why would this workaround feature be messy by definition? That's for you to design.
27  Java Game APIs & Engines / Java 2D / Re: Fast sprite rotation on: 2016-06-27 17:57:37
@KaiHH: text book case of premature optimisation Pointing

It makes the code less simple (simplicity is important) and won't have significant impact on performance.
28  Java Game APIs & Engines / OpenGL Development / Re: Discussion: The mother of all shading languages on: 2016-06-21 19:22:20
Be pragmatic, because life is short 'n all. Just go with the pre-compiler Pointing
29  Game Development / Newbie & Debugging Questions / Re: [Libgdx]GWT 'not emitting code for accessing method' on: 2016-06-18 18:37:15
CopyOnWriteArrayList has perfectly fine usecases in single-threaded code.
30  Games Center / WIP games, tools & toy projects / Re: TritonForge || 2D RPG Sandbox (DOWNLOAD V2 NOW-AutoUpdater!) on: 2016-06-06 05:14:19
Unlocked upon request Pointing
Pages: [1] 2 3 ... 306
roseslayer (514 views)
2016-08-06 11:43:29

roseslayer (472 views)
2016-08-06 09:43:11

xTheGamerCodes (546 views)
2016-08-04 15:40:59

xTheGamerCodes (541 views)
2016-08-04 15:40:24

orrenravid (886 views)
2016-07-16 03:57:23

theagentd (964 views)
2016-07-11 14:28:54

Hydroque (1060 views)
2016-07-06 05:56:57

Hydroque (1041 views)
2016-07-03 08:52:54

GrandCastle (855 views)
2016-07-01 09:13:47

GrandCastle (644 views)
2016-07-01 09:09:45
Rendering resources
by Roquen
2016-08-08 05:55:21

Rendering resources
by Roquen
2016-08-08 05:52:42

Rendering resources
by Roquen
2016-08-08 05:50:38

Rendering resources
by Roquen
2016-08-08 05:49:53

Rendering resources
by Roquen
2016-08-08 05:32:39

Making a Dynamic Plugin System
by Hydroque
2016-06-25 00:13:25

Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42 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!