Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (623)
Games in Android Showcase (176)
games submitted by our members
Games in WIP (676)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: 1 ... 6 7 [8] 9 10
 on: 2015-10-05 14:10:07 
Started by ags1 - Last post by ags1
Just a little update... I have added miners and guards to the village as well as starting on smiths, hunters and chieftains. I have got frills working ok, and added some new models to the village. I just need to get the smith working, and implement tax and pay relationships and I will have a basic village economy up. Well, I will have 50 basic village economies up. Then I will build a JAR for this currently uneventful non-game. It will be interesting to see the rendering and logic benches from some other systems.

 on: 2015-10-05 14:07:03 
Started by noctarius - Last post by KaiHH
JNR does some tricks to spin native code at runtime to call the native function with less transition time.
I wonder how that is actually possible right now. I mean for any native library, be it JNR or anything else, there is _only_ JNI to bridge the gap between Java and native.
Even JNR _must_ use JNI to go from Java to native - whether or not that native is statically compiled or dynamically generated during runtime.
I see JNR only as a Java-friendly way to declare native functions and structures, and thusly it can be the basis for Project Panama on the API-side.
But on the inside, right now as it stands, it just - as any other JNI bridge - has to use JNI somewhere along the road to call into native.
Surely on the inside this will change with Project Panama.

 on: 2015-10-05 13:59:28 
Started by noctarius - Last post by noctarius
That's the reason why JNI is no real solution. JNR does some tricks to spin native code at runtime to call the native function with less transition time. JNR is also the base for the new FFI in Java (Project Panama) and therefore, eventually, we get inlining right to the call itself. With cutom intrinsics that would be like heaven Smiley

 on: 2015-10-05 13:57:15 
Started by noctarius - Last post by basil_
i gave it a try and rewrote the sun.misc.unsafe getByte(pointer), getChar(..), setByte(pointer,value), etc. into JNI and it turned out to be devastating.

micro tests looked good but a real-world-example, iterating over trees to write sequences to feed glDrawArrays etc turned out to run at 50% performance. memory access is already the bottleneck.

it surely is related to the intrinsic implementation of unsafe into the VM. Sad

isn't JNA affected by that too ?

 on: 2015-10-05 13:46:40 
Started by DarkCart - Last post by KevinWorkman
Why don't you create a test account, take the test, make a test post, then take the test again?

But no, I doubt anything bad happens. It probably just changes your activation status to true- in other words, nothing happens.

 on: 2015-10-05 13:46:00 
Started by DarkCart - Last post by matt_p
Most likely it will do absolutely nothing, since most of such activation implementations redirect to the main page of the site if the specified user is already activated (or something different is wrong, like wrong activation key, etc.)

 on: 2015-10-05 13:30:52 
Started by mike_bike_kite - Last post by mike_bike_kite
I think I'm going to need more clues Smiley

Does it mean I can't use sleep in the run bit? is there something else I should use?

 on: 2015-10-05 13:04:30 
Started by mike_bike_kite - Last post by princec
Thread.sleep() is itself a static method, and operates on the current thread.

Cas Smiley

 on: 2015-10-05 12:40:25 
Started by DarkCart - Last post by DarkCart

I was going through some old emails when I found my old activation email. I clicked on it (I didn't think it would work), but lo and behold, it pulled it up. But, I had a thought. Would taking the test wipe everything I've done? Or would it just do nothing. Does anyone know?

 on: 2015-10-05 12:39:24 
Started by mike_bike_kite - Last post by mike_bike_kite
I have a game that works and I want to write any high scores to a central server so people can compare their scores. The idea is just to have a thread that loops once a second and either does nothing (most of the time) or reads the current high scores or writes the players high score. The program on the web works fine but I'm having issues getting my daemon code to compile with static non static errors:
11 error: cannot find symbol
                                try { this.sleep(2000); } catch (InterruptedException e) { ; }
  symbol: method sleep(int) error: non-static method writeHighScores() cannot be referenced from a static context
                                        neptune.writeHighScores( );
                                               ^ error: non-static method isGameStillPlaying() cannot be referenced from a static context
                        } while( neptune.isGameStillPlaying() );
3 errors

My code is arranged like this:
public class neptune extends Panel implements Runnable, KeyListener {
   int Score = 0;
   public static void main(String[] args) {
      neptune w = new neptune();
      try {
                   WebIO webIoThread = WebIO();
      } catch (Exception e) { ; }


   class WebIO implements Runnable{
      public void run( ){
         long timeLastAttempt = 0;

         do {
            try { this.sleep(2000); } catch (InterruptedException e) { ; }

            // if failed to load high scores then try again
            if (   neptune.ThreadAction == neptune.READ_SCORES
               ||   neptune.HighScoreScores[0] == 0
                  && System.currentTimeMillis() - timeLastAttempt > 300000L ) {

               timeLastAttempt = System.currentTimeMillis();
               neptune.readHighScores( 0 );
               neptune.ThreadAction = neptune.NO_ACTION;
            } else if ( neptune.ThreadAction == neptune.WRITE_SCORES ) {
               neptune.writeHighScores( );
               neptune.ThreadAction = neptune.READ_SCORES;

         } while( neptune.isGameStillPlaying() );

My apologies if I've included too much/too little. The problem is, if I start to change variables to static, then this soon snowballs into more static/non-static errors. I assume I'm missing something simple and just wondered if anyone could have a quick peek.

Many thanks


Pages: 1 ... 6 7 [8] 9 10
basil_ (42 views)
2015-09-30 17:04:40

shadowstryker (21 views)
2015-09-29 15:55:06

TheSpaceHedgehog (27 views)
2015-09-29 01:58:48

GamerC4 (50 views)
2015-09-24 21:10:38

GamerC4 (70 views)
2015-09-24 21:09:48

htuy (27 views)
2015-09-24 04:57:24

htuy (35 views)
2015-09-24 04:56:35

htuy (25 views)
2015-09-24 04:56:09

htuy (26 views)
2015-09-24 04:47:33

Roquen (63 views)
2015-09-21 12:54:28
Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36 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!