Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (702)
Games in Android Showcase (203)
games submitted by our members
Games in WIP (775)
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 ... 7
1  Game Development / Newbie & Debugging Questions / Re: Concurrent Modification when changing maps? on: 2016-12-08 20:40:07
Maybe you should consider using two lists for the game entities?

1  
2  
List<Entity> oldList; 
List<Entity> newList;


I hope you can get rid from your persuasive problems ...

http://stackoverflow.com/questions/1667481/compare-two-lists-for-updates-deletions-and-additions
http://gamedev.stackexchange.com/questions/2647/how-do-i-best-remove-an-entity-from-my-game-loop-when-it-is-dead
2  Game Development / Networking & Multiplayer / Re: Java getting serializer error with kryonet and slick2d? on: 2016-12-02 05:54:02
Hi.

1  
Caused by: java.lang.IncompatibleClassChangeError: Found interface org.objectweb.asm.MethodVisitor, but class was expected


I guess it's happened due the fact that your code tries to create instance of interface MethodVisitor...

I think you have to create your own serializer for the class that's on the start of the last stack trace.

EDIT: Btw, as I see you use Kryonet 2.22-rc1, but AFAIK Kryonet 4 is released.


Sorry, I've mistaken Kryonet for Kryo.  Smiley
3  Java Game APIs & Engines / OpenGL Development / Re: Tilemap NullPointerException on: 2016-10-13 22:45:41
try to replace your code fragment from prev post with this. may be it helps

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
 } else {
         if (First == true) {
            int x = lines.indexOf("chunk: " + loadedchunk + " (");
            x = x + 1;
            String s = lines.get(x);
            s = s.substring(5, s.length() - 2);
            int TilesWide = Display.getWidth() / 32;
            int TileHeight = Display.getHeight() / 32;
            int[][] newMap = new int[TilesWide][TileHeight];
            for (int k = 0; k < s.length(); k++) {
                char character = s.charAt( k );
                assert Character.isDigit( character );
               if (character != ',' && character != ' ') {
                  int towrite = Character.digit(character, 10);
                  for (int i = 0; i < newMap.length; i++) {
                     for (int j = 0; j < newMap[i].length; j++) {
                        newMap[i][j] = towrite;
                     }
                  }
               }
            }

            Chunk ChunktoLoad = new Chunk(newMap, loadedchunk);

            First = false;

         }
      }


Also when you're using Flushable and Closeable use try/finally as well

In the world file I've found chunk with -1 value. Is it correct?
4  Java Game APIs & Engines / OpenGL Development / Re: Tilemap NullPointerException on: 2016-10-13 16:32:59
Btw, why you're using 'switch' in a such way?
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
for (int i = 0; i < ChunktoLoad.getMap().length; i++) {
            for (int j = 0; j < ChunktoLoad.getMap()[i].length; j++) {
               int towrite = 0;
               Tile t = ChunktoLoad.map[i][j];
               switch (t.getType()) {
               case Test:
                  towrite = 0;
                  break;// Warning: this break is for the switch, not for a loop statement
               }
               worldwriter.write(towrite + ", ");
               System.out.println("Loading new Chunk");
5  Java Game APIs & Engines / OpenGL Development / Re: Tilemap NullPointerException on: 2016-10-13 15:26:53
Just newMap[i] [j] is expected. Just a warning.
6  Java Game APIs & Engines / OpenGL Development / Re: Tilemap NullPointerException on: 2016-10-13 07:44:26
Line 30, Chunk.java looks suspiciously:
1  
switch (newMap[j][i]) {
7  Game Development / Newbie & Debugging Questions / Re: Object Oriented Game Programming on: 2016-09-23 06:19:25
It's also worth noting that code implementing simulation of the game world should be single-threaded.

One is often tempted to implement (movable) game entities as threads.
But this only complicates things without any positive result.
8  Discussions / General Discussions / Re: What does your dream language look like? on: 2016-08-17 06:20:18
Quote
You say that like there's something wrong with sounding like princec

I believe it's not Smiley

I agree with most Java improvements mentioned so far.
I also think about mixed languages. It's inspired by Arity Prolog. (though, I'm not sure they really help much)
E.g. Embedded C in Prolog (or Java to Prolog. It's quite near to Scala(?))
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
... various Prolog declarations ...

:- c.
extern unsigned long ulNRlips;
extern char achNRtime[10];
#prolog

nrevbch(Length, Iters) :-
    do_nrev(Length, Iters, Lips, Time),
    float_text(Time, TimeAtom, fixed(2)),
    {
    Lips:long,
    ulNRlips = Lips;
    'MakeCString'(achNRtime, sizeof(achNRtime), &TimeAtom)
    }.

... additional Prolog code ...
9  Discussions / Community & Volunteer Projects / Re: Looking for a programming buddy on: 2016-08-16 05:30:08
Completely agree Smiley
10  Game Development / Networking & Multiplayer / Re: Issues with synchronisation of player movement on a multiplayer server on: 2016-08-09 14:04:21
I have the one question at the moment :
Why do you use multi-threading in your app? (Movement threads)
11  Game Development / Newbie & Debugging Questions / Re: Skeletal Animation on: 2016-07-24 10:53:45
I forget to say that my code implements the multimesh model animation.

And maybe obsolete  advice from http://www.gamedev.net/topic/665992-collada-animation-leads-to-distorted-model/?view=findpost&p=5212149
12  Game Development / Newbie & Debugging Questions / Re: Skeletal Animation on: 2016-07-23 12:36:08
Just to ensure we're talking about the same things here:

Skinning equation:

for i to n
v += {[(v * BSM) * IBMi * JMi] * JW}

    n:     The number of joints that influence vertex v
    BSM: Bind-shape matrix
    IBMi: Inverse bind-pose matrix of joint i
    JMi:   Transformation matrix of joint i
    JW:   Weight of the influence of joint i on vertex v

We should precompute (v * BSM) and (IBMi * JMi) since they are constants.
13  Game Development / Newbie & Debugging Questions / Re: getters and setters vs public vars on: 2016-07-09 06:01:56
The reason for using getters and setters instead of making your members public is that it makes it possible to change the implementation without changing the interface.
Also, many tools and toolkits that use reflection to examine objects only accept objects that have getters and setters. JavaBeans for example must have getters and setters as well as some other requirements.
Also, the fields of a class can be made read-only or write-only.   
 
14  Game Development / Newbie & Debugging Questions / Re: Skeletal Animation on: 2016-06-26 06:02:04
I'd recommend you to implement software-based animation system first.
You can use flag (useGPU) to switch between software and GPU implementations.

I also struggled with animation data (I implemented Collada loader at that time) and watched good bind pose and wrong animation that resembled something like devil's dances.

One of the first bugs I found was incorrectly computed inverse bind pose matrix.
Also I recommend you to implement skeleton as the flat array not the tree-structure.
15  Game Development / Newbie & Debugging Questions / Re: Skeletal Animation on: 2016-06-25 06:31:55
Hi.

I worked few years ago on the same problem.
I post fragments of my code. Maybe this will help.

Joint.java

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
public class Joint implements NamedObject
{
    public final int NULL_PARENT = -1;

    private final short parentIndex;
    private final String name;
    private final Vector3f bindTranslation;
    private final Quaternion4f bindRotation;
    private final Tuple3f bindScale;

    private final Matrix4f invBindPoseMatrix;

    private short index;
    private boolean isAux;

    public final boolean hasParent()
    {
        return ( index > 0 );
    }

    public final void calcInvBindPoseMatrix( Joint parent )
    {
        Matrix4f m = Matrix4f.fromPool();

        MathUtils.compose( bindTranslation, bindRotation, bindScale, m );
        invBindPoseMatrix.invert( m );
        if( parent != null )
        {
            invBindPoseMatrix.mul( invBindPoseMatrix, parent.getInvBindPoseMatrix() );
        }

        Matrix4f.toPool( m );
    }
    public Joint( String name, short index, Joint parent, Transform bindTransform, boolean isAux )
    {
        this.parentIndex = parent == null ? NULL_PARENT : parent.getIndex();
        this.name = name;
        this.index = index;
        bindTranslation = bindTransform.getTranslation( null ).getReadOnly();
        bindRotation = bindTransform.getRotation( null ).getReadOnly();
        bindScale = bindTransform.getScale( null ).getReadOnly();

        invBindPoseMatrix = new Matrix4f();
        calcInvBindPoseMatrix( parent );
        this.isAux=isAux;
    }

    public Joint( Joint joint, Joint parent )
    {
        this.parentIndex = parent == null ? NULL_PARENT : parent.getIndex();
        name = joint.name;
        index = joint.index;

        bindTranslation = joint.bindTranslation;
        bindRotation = joint.bindRotation;
        bindScale = joint.bindScale;

        invBindPoseMatrix = joint.invBindPoseMatrix;
    }
}


SkinnedMeshUpdater.java

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162  
163  
164  
165  
166  
167  
168  
169  
170  
171  
172  
173  
174  
175  
176  
177  
178  
179  
180  
181  
182  
183  
184  
185  
186  
187  
188  
189  
190  
191  
192  
193  
194  
195  
196  
197  
198  
199  
200  
201  
202  
203  
204  
205  
206  
207  
208  
209  
210  
211  
212  
213  
214  
215  
216  
217  
218  
219  
220  
221  
222  
223  
224  
225  
226  
227  
228  
229  
230  
231  
232  
233  
234  
235  
236  
237  
238  
239  
240  
241  
242  
243  
244  
245  
246  
247  
248  
249  
250  
251  
252  
253  
254  
255  
256  
257  
258  
259  
260  
261  
262  
263  
264  
265  
266  
267  
268  
269  
270  
271  
272  
273  
274  
275  
276  
277  
278  
279  
280  
281  
282  
283  
public class SkinnedMeshUpdater
{  
    private static Map<Skeleton, SkinnedMeshUpdater> skeletonToUpdater = new HashMap<Skeleton, SkinnedMeshUpdater>();
    private final Skeleton skeleton;
    private final Shape3D[] shapes;

    private final float[][] weights;
    private final short[][] jointIndices;

    private float[][] bindPoseCoords;
    private float[][] bindPoseNormals;

    private final int[] influencesPerVertex;

    private final Vector3f[] worldTranslations;
    private final Quaternion4f[] worldRotations;
    private final Tuple3f[] worldScales;

    private Matrix4f[] matrixPalette;

    public Skeleton getSkeleton()
    {
        return skeleton;
    }

    public Shape3D[] getTarget()
    {
        return shapes;
    }

    public float[][] getWeights()
    {
        return weights;
    }

    public short[][] getJointIndices()
    {
        return jointIndices;
    }

    public int[] getInfluencesPerVertex()
    {
        return influencesPerVertex;
    }

    public static SkinnedMeshUpdater create( Skeleton skeleton,
                                             Shape3D[] target,
                                             float[][] weights,
                                             short[][] jointIndices,
                                             int[] influencesPerVertex )
    {
        SkinnedMeshUpdater smu = skeletonToUpdater.get( skeleton );
        if( smu == null )
        {
            smu = new SkinnedMeshUpdater( skeleton, target, weights, jointIndices, influencesPerVertex );
        }

        return ( smu );
    }

    public void update( IAnimationData data )
    {
        if( data == null )
        {
            return;
        }
        updateSkeleton( data );
        for( int i = 0; i < shapes.length; i++ )
        {
            updateGeometry( i );
        }
    }

    private void updateSkeleton( IAnimationData data )
    {
        SkeletalKeyFrame pose = ( SkeletalKeyFrame ) data;
        Skeleton skeleton = pose.getSkeleton();
        for( int i = 0, jc = skeleton.getJointsCount(); i < jc; i++ )
        {
            Joint joint = skeleton.getJoint( i );
            setAbsolutes( joint, pose );
            short ji = joint.getIndex();
            if( joint.isAux() )
            {
                matrixPalette[ ji ].setIdentity();
            }
            else
            {
                mul( joint.getInvBindPoseMatrix(),
                        worldTranslations[ ji ],
                        worldRotations[ ji ],
                        worldScales[ ji ],

                        matrixPalette[ ji ]
                );
            }
        }
    }

    private void updateGeometry( int shapeIdx )
    {
        Shape3D shape = shapes[ shapeIdx ];
        Geometry geom = shape.getGeometry();
        float[] bindPoseCoords = this.bindPoseCoords[ shapeIdx ];
        float[] bindPoseNormals = this.bindPoseNormals[ shapeIdx ];
        int influencesPerVertex = this.influencesPerVertex[ shapeIdx ];
        float[] weights = this.weights[ shapeIdx ];
        short[] jointIndices = this.jointIndices[ shapeIdx ];

        float x, y, z;
        float nX = 0, nY = 0, nZ = 0;
        float vSumX, vSumY, vSumZ;
        float nSumX, nSumY, nSumZ;
        float tmpX, tmpY, tmpZ;

        for( int i = 0; i < geom.getVertexCount(); i++ )
        {
            x = bindPoseCoords[ i * 3 ];
            y = bindPoseCoords[ i * 3 + 1 ];
            z = bindPoseCoords[ i * 3 + 2 ];
            if( geom.hasNormals() )
            {
                nX = bindPoseNormals[ i * 3 ];
                nY = bindPoseNormals[ i * 3 + 1 ];
                nZ = bindPoseNormals[ i * 3 + 2 ];
            }
            vSumX = 0f;
            vSumY = 0f;
            vSumZ = 0f;

            nSumX = 0f;
            nSumY = 0f;
            nSumZ = 0f;

            float wSum = 0f;
            float weight;
            for( int j = 0; j < influencesPerVertex; j++ )
            {
                if( j != influencesPerVertex - 1 )
                {
                    weight = weights[ i * ( influencesPerVertex - 1 ) + j ];
                    wSum += weight;
                }
                else
                {
                    weight = 1 - wSum;
                }
                if( weight == 0f )
                {
                    continue;
                }
                final int jointIndex = jointIndices[ i * influencesPerVertex + j ];
                if( jointIndex == 0 )
                {
                    JAGTLog.debug( "jindex=0, influencesPerVertex=", influencesPerVertex );
                }
                Matrix4f m = matrixPalette[ jointIndex ];
                //vertices
                tmpX = m.m00() * x + m.m01() * y + m.m02() * z + m.m03();
                tmpY = m.m10() * x + m.m11() * y + m.m12() * z + m.m13();
                tmpZ = m.m20() * x + m.m21() * y + m.m22() * z + m.m23();

                vSumX += tmpX * weight;
                vSumY += tmpY * weight;
                vSumZ += tmpZ * weight;

                //normals
                if( geom.hasNormals() )
                {
                    tmpX = m.m00() * nX + m.m01() * nY + m.m02() * nZ;
                    tmpY = m.m10() * nX + m.m11() * nY + m.m12() * nZ;
                    tmpZ = m.m20() * nX + m.m21() * nY + m.m22() * nZ;

                    nSumX += tmpX * weight;
                    nSumY += tmpY * weight;
                    nSumZ += tmpZ * weight;
                }
            }

            geom.setCoordinateWithoutOpenGlHandling( i, vSumX, vSumY, vSumZ );
            if( geom.hasNormals() )
            {
                geom.setNormalWithoutOpenGlHandling( i, nSumX, nSumY, nSumZ );
            }
        }
        geom.setBoundsDirty();
        geom.getOpenGLReference_DL_GeomData().invalidateNames();
        geom.getOpenGLReference_DL().invalidateNames();

        shape.updateBounds( false );
    }

    private static void mul( Matrix4f matrix, Vector3f translation, Quaternion4f rotation, Tuple3f scale, Matrix4f out )
    {
        //out.set( matrix );
        Matrix4f tmp = Matrix4f.fromPool();

        tmp.setIdentity();
        tmp.setTranslation( translation );
        out.set( tmp );

        tmp.set( rotation );
        out.mul( tmp );

        tmp.setIdentity();
        tmp.m00( scale.getX() );
        tmp.m11( scale.getY() );
        tmp.m22( scale.getZ() );
        out.mul( tmp );

        out.mul( matrix/* , out */ );

        Matrix4f.toPool( tmp );
    }

    //doesn't work  when non-uniform scales
    private void setAbsolutes( Joint joint, SkeletalKeyFrame frame )
    {
        if( joint.hasParent() )
        {
            short parentIndex = joint.getParentIndex();
            short localIndex = joint.getIndex();
            MathUtils.mul(
                    worldTranslations[ parentIndex ],
                    worldRotations[ parentIndex ],
                    worldScales[ parentIndex ],

                    frame.getTranslations()[ localIndex ],
                    frame.getRotations()[ localIndex ],
                    frame.getScales()[ localIndex ],

                    worldTranslations[ localIndex ],
                    worldRotations[ localIndex ],
                    worldScales[ localIndex ]
            );
        }
        else
        {
            short localIndex = joint.getIndex();
            worldTranslations[ localIndex ].set( frame.getTranslations()[ localIndex ] );
            worldRotations[ localIndex ].set( frame.getRotations()[ localIndex ] );
            worldScales[ localIndex ].set( frame.getScales()[ localIndex ] );
        }
    }

    public SkinnedMeshUpdater( Skeleton skeleton, Shape3D[] target, float[][] weights, short[][] jointIndices, int[] influencesPerVertex )
    {
        this.skeleton = skeleton;
        this.shapes = target;
        this.weights = weights;
        this.jointIndices = jointIndices;
        this.influencesPerVertex = influencesPerVertex;

        worldTranslations = new Vector3f[ skeleton.getJointsCount() ];
        worldRotations = new Quaternion4f[ skeleton.getJointsCount() ];
        worldScales = new Tuple3f[ skeleton.getJointsCount() ];
        matrixPalette = new Matrix4f[ skeleton.getJointsCount() ];

        for( int i = 0; i < worldTranslations.length; i++ )
        {
            worldTranslations[ i ] = new Vector3f();
            worldRotations[ i ] = new Quaternion4f();
            worldScales[ i ] = new Tuple3f();
            matrixPalette[ i ] = new Matrix4f();
        }

        bindPoseCoords = new float[ target.length ][];
        bindPoseNormals = new float[ target.length ][];

        for( int i = 0; i < target.length; i++ )
        {
            int numVertices = target[ i ].getGeometry().getVertexCount();
            Geometry geom = target[ i ].getGeometry();
            bindPoseCoords[ i ] = new float[ numVertices * 3 ];
            geom.getCoordinates( 0, bindPoseCoords[ i ] );
            if( geom.hasNormals() )
            {
                bindPoseNormals[ i ] = new float[ numVertices * 3 ];
                geom.getNormals( 0, bindPoseNormals[ i ] );
            }
        }
    }
}

16  Game Development / Newbie & Debugging Questions / Solved: ConcurrentModificationException using KRYO on: 2016-05-11 08:15:49
I've solved problem by overriding some methods in Kryo and writing a bunch of serializers for my classes.
17  Game Development / Newbie & Debugging Questions / Re: Libgdx Json serialization of HashMap on: 2016-05-06 13:43:33
Javadoc for intMap<V>:https://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/utils/IntMap.html

Quote
So I should change the HashMap to an IntMap? I don't really see why an IntMap (never have seen this before) should be better than a simple HashMap, can somebody explain that? I am just confused because I thought that the Json serializer should be able to serialize a simple HashMap a standard java datastructure but it doesn't seem to be able to do that and it's quite strange that I should adapt my datastructures because of that....
1. please look  at the previuos post.
2. IntMap is a bit faster than HashMap (at least get operation).
3. You still might use HashMap and convert it to IntMap (and back) when serializing/deserializing.
18  Game Development / Newbie & Debugging Questions / Re: Libgdx Json serialization of HashMap on: 2016-05-06 13:17:41
It's about HashMap and IntMap:

Quote
Second issue, for HashMap it treats keys as Strings, sorry. You could write a serialzier for HashMap that tried to write out the type of the keys. You'd be better off using IntMap though, which again will need a specialized serialzier.

19  Game Development / Newbie & Debugging Questions / Re: Libgdx Json serialization of HashMap on: 2016-05-06 11:07:47
Sorry, In slightly mixed up.
Hope this is more appropriate: http://sblackwell.com/blog/2014/05/loading-intmaps-from-json-with-libgdx/
20  Game Development / Newbie & Debugging Questions / Re: Libgdx Json serialization of HashMap on: 2016-05-06 04:38:35
Answer is here : http://stackoverflow.com/questions/12468764/jackson-enum-serializing-and-deserializer.
Look at  the answer labeled with "Actual answer".
21  Game Development / Newbie & Debugging Questions / ConcurrentModificationException using KRYO on: 2016-04-26 13:05:42
Hi everyone!

I'm currently using Kryo for serialization in my project.
While serializing I got ConcurrentModificationException.

At the Kryo support forums I found that it could happen when Kryo serializes some collection that's being modified by one of the threads of my application.

I tried almost everything except making all (possible) collections synchronized.
I'm also thinking about using standard serialization more and more.

Can anybody tell if you ran across the similar problem or simply knows the answer,
how to fix?

Any help is greatly appreciated.
22  Games Center / WIP games, tools & toy projects / Re: djoom3 - Doom 3 java port[HELP WANTED] on: 2016-04-18 09:47:25
As I get you don't use md5 models ( loading ASE and FWO models are above mentioned ).
Why, If it's true, EULA issue?

What you do with EAX sound? Under Windows indirect sound library can be used.

Maybe I'm curious too much - it's just memories about I attempted to do roughly the same some time ago Smiley
 
23  Games Center / WIP games, tools & toy projects / Re: djoom3 - Doom 3 java port[HELP WANTED] on: 2016-04-18 05:46:59
Do you make your own completely different gameplay, models, etc?
Or you mostly follow original game?
24  Game Development / Newbie & Debugging Questions / Re: Using the Java port of Theora on: 2016-01-28 06:06:13
I can't recall any info about pure Java solution...

the links you probably aware of:

Quote
Play - is a Java library to play Video / Music.

It would be based on VLC or multi based on VLC / QTMovie / gstreams.

http://www.xuggle.com/downloads

https://github.com/caprica/vlcj
25  Game Development / Newbie & Debugging Questions / Re: Using the Java port of Theora on: 2016-01-27 05:54:23
Hi,

here's some links:

http://fmj-sf.net/
http://www.jcraft.com/jorbis
https://github.com/Gagravarr/VorbisJava
26  Game Development / Newbie & Debugging Questions / Re: Problem with serialization on: 2016-01-16 12:39:12
You don't  close  both DataInputStream/DataOutputStream.
It can be the cause of your problems, I think.
27  Discussions / Miscellaneous Topics / Re: Looking for a old wipeout-like game on: 2015-12-26 13:52:17
Last trial : Grand Theft Auto III ...

if not try to search here.
28  Discussions / Miscellaneous Topics / Re: Looking for a old wipeout-like game on: 2015-12-23 07:01:22
Is it "Need for Speed"?
29  Game Development / Performance Tuning / Re: Using the sun.misc.Unsafe class to do crazy stuff with the JVM on: 2015-12-19 07:15:12
Hi,

Some time ago I was inspired by Unsafe too.

But I've resisted. Smiley

Just look at this :

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
    public static long sizeOf( Object object )
    {
        return getUnsafe().getAddress(
                normalize( getUnsafe().getInt( object, 4L ) ) + 12L );
    }

    private static long normalize( int value )
    {
        if ( value >= 0 )
        {
            return value;
        }

        return ( ~0L >>> 32 ) & value;
    }

    public static long toAddress( Object obj )
    {
        Object[] array = new Object[]{obj};
        long baseOffset = getUnsafe().arrayBaseOffset( Object[].class );

        return normalize( getUnsafe().getInt( array, baseOffset ) );
    }

    public static Object fromAddress( long address )
    {
        Object[] array = new Object[]{null};
        long baseOffset = getUnsafe().arrayBaseOffset( Object[].class );
        getUnsafe().putLong( array, baseOffset, address );

        return array[ 0 ];
    }


Isn't it wonderful?

But, try to keep away from it.
30  Discussions / Miscellaneous Topics / Adobe PhotoShop CS2 (2005) on: 2015-12-15 07:36:10
Hi,

There's an old version of Photoshop from 2005 which is now offered for free.
Pages: [1] 2 3 ... 7
 
Lunch (62 views)
2016-12-06 16:01:40

ral0r2 (287 views)
2016-11-23 16:08:26

ClaasJG (420 views)
2016-11-10 17:36:32

CoffeeChemist (512 views)
2016-11-05 00:46:53

jay4842 (560 views)
2016-11-01 19:04:52

theagentd (584 views)
2016-10-24 17:51:53

theagentd (567 views)
2016-10-24 17:50:08

theagentd (515 views)
2016-10-24 17:43:15

CommanderKeith (509 views)
2016-10-22 15:22:05

Roquen (468 views)
2016-10-22 01:57:43
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21
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!