Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (293)
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]
1  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Slick2D faster movements at higher FPS on: 2013-04-12 13:20:58
Thanks for your answers. I always tohught this way:

lower FPS -> higher Delta
x = velocity * delta;


higher FPS -> lower Delta
x = velocity * delta;

x = x ??

Or is the problem at the acceleration, because First I accelerate without multiplying with delta, and use the accelerated value for my movement...?

On the other hand setTargetFPS(60) seems to be a good way to get rid of it, but it's not the best way I think.

Are there other suggestions? Thanks
2  Java Game APIs & Engines / Engines, Libraries and Tools / Slick2D faster movements at higher FPS on: 2013-04-09 21:25:13
Hello everyone,

I got a problem with slick2D. The movements are faster at higher FPS rates, although I multiply with the delta given in Update();

Example:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
@Override
public void update(GameContainer gc, int delta) throws SlickException {
myUpdate(delta);
}

public void myUpdate(int delta) {            
tmpY = body.getBounds().getY();
tmpY += gravity.y * body.acceleration * delta;
body.getBounds().setY(tmpY);
}


Aft 300 FPS the movement is much faster than 60 FPS. This is very frustrating since I am doing such stuff for weeks and now it won't work. Where is the problem?

Am I using delta wrongly?
3  Games Center / 4K Game Competition - 2013 / Re: Judging.. on: 2013-03-21 09:06:22
Nice, I really appreciate what you're doing.  Smiley
4  Games Center / 4K Game Competition - 2013 / Re: Judging.. on: 2013-03-21 08:20:59
hey judges thank you guys for wasting your time playing and rating our games  Tongue

when will the judging results be published?
 
regards, Kronos
5  Games Center / 4K Game Competition - 2013 / Re: Community Voting Has Started! on: 2013-03-20 20:03:28
thanks Smiley
so it will be 1 am in germany -.-, I'll have to wait till tomorrow then
6  Games Center / 4K Game Competition - 2013 / Re: Community Voting Has Started! on: 2013-03-20 19:38:55
how much hours left untill we see the results? I'm running out out patience Cheesy
7  Games Center / 4K Game Competition - 2013 / Re: Community Voting Has Started! on: 2013-03-16 13:19:58
Hey guys. Where are the results?
8  Games Center / 4K Game Competition - 2013 / Re: Sorcerer4K on: 2013-02-28 13:33:31
I like the graphics and the effects! Well done Smiley
But I did not know what to do, except shooting the ghosts  Clueless
9  Game Development / Game Mechanics / Re: A little bit of math - Rotation on: 2013-02-27 19:21:49
Thanks vbrain.

I came up with a new problem. How can I manage stop increasing my laser's beam width when it collidates with the frame bounds (or objetcs flying around). I do not know how to calculate the ending point of my Rectangle, when it is rotated. The beam currently goes endlessly into the wide nothing (out of frame)....

 Shocked



edit:

I think I made it. It looks good so far.

1  
endPos.set((float)(x + width * Math.cos(Math.toRadians(rotation))), (float)(y + width * Math.sin(Math.toRadians(rotation))));


width is the radius. This gives me a Point of the "circle" -> my rotation. for those who had the same problem, or will have the same problem in the future.

I am a one man show Cheesy
10  Game Development / Game Mechanics / Re: A little bit of math - Rotation on: 2013-02-27 14:30:47
I was to quick writing this thread Sad

I added a g.resetTransform(); before the burst image even could rotate...
however... is there an idiot secure mini tutorial for wanne-be game developers regarding cos(), sin() and PI, which you would recommend?
11  Game Development / Game Mechanics / A little bit of math - Rotation on: 2013-02-27 14:07:31
Hey guys,

I never listened to our maths teacher back in school time, now I could kick myself in the a** Sad.

I got a laserbeam and at the end a burst (in this case a dot). This laserbeam is rotating from the center to all the edges and so on.
How can I calculate the new coordinates for the end of the beam, where should be displayed an image of a typical laser burst.

My first attempt (thought) was to use some Math.sin and cos. But I really do not know how to use them properly. Wikipedia couldn't help me neither, it's not game dev related enough. I hope you guys are patient and could help me with this, hopefully trivial, question.

Thanks in advance. Smiley
Kronos

12  Games Center / 4K Game Competition - 2013 / Re: Moonshadow on: 2013-02-17 15:44:22
Sorry guys. Now it works! Smiley
13  Games Center / 4K Game Competition - 2013 / Re: Moonshadow on: 2013-02-16 15:23:31
Hey thanks for your comment. The more clouds are covering the moon the lesser is the strength of every hit. So the cloud meter reprents also damage strength in some way
14  Games Center / 4K Game Competition - 2013 / Re: Moonshadow on: 2013-02-16 14:57:46
I see... Mmhh could any of the admins fix the pseudo html tag. I dont know why this does not work. Thank you
15  Games Center / 4K Game Competition - 2013 / Moonshadow on: 2013-02-16 13:17:23
Hello everybody,

I just submitted my first game ever made.
Hope somebody likes it.

here it comes  Pointing

Warning! Untrusted content: Kronos submitted an applet to JGO.


 
If the applet asks for permissions, it will have full access to your system. (read more)
JGO cannot be held responsible for the contents and/or behavior of the hosted applets.


or link:

http://www.besli.de/
16  Games Center / 4K Game Competition - 2013 / Re: Easy shrink method on: 2013-02-15 20:39:38
Why? Isn't 28.02. the last day to submit?

I still have to put some extra flavour in the game Cheesy
17  Games Center / 4K Game Competition - 2013 / Re: Easy shrink method on: 2013-02-15 12:35:17
Kronos, did you try to unpack and test locally the resulting jar in a standard applet code ?

1  
2  
3  
Input file : game.pack
Command line>unpack200 game.pack game.pack.test.jar  
Output file : game.pack.test.jar


That worked, and it is even smaller. However. Does that mean my pack.gz file will work at the 4K website?
Thank you very much, I am relieved a bit  Cool
18  Games Center / 4K Game Competition - 2013 / Re: Easy shrink method on: 2013-02-14 17:42:48
you did read what I said that you have to set it up in a real webserver ?
You cannot simply create a .html page with this code and double click it. It will not work .

In any case, just submit it and keep trying to set it up on your computer. The approval process takes 1 or 2 days anyway, and by then you'll know if it works or not.

I myself submitted my pack200ed without testing it. If the pure jar works in your machine, pretty much likely it will run pack200 in the java4k site.

I uploaded it on my website, and nothing happened. I hope the guys from 4K know better to handle that thing Cheesy I really hope Wink

Thank you all for your patience Wink
19  Games Center / 4K Game Competition - 2013 / Re: Easy shrink method on: 2013-02-14 15:44:16
I'm getting desperate Sad

I only used eclipse export, than pack200 with mentioned options:

--effort=9
--no-keep-file-order
--strip-debug

and this HTML5 object Tag:

1  
2  
3  
4  
5  
   <object type="application/x-java-applet" height="600" width="800">
     <param name="code" value="G.class" />
     <param name="archive" value="jar/game.pack.gz" />
     <param name="java_arguments" value="-Djnlp.packEnabled=true"/>
   </object>


also with cache_archive. I've seen this several times.

Please help me Smiley I want to submit today  Shocked


P.S.: the applet without pack200'ing it, runs very well in the browser with the object tag.
20  Games Center / 4K Game Competition - 2013 / Re: Easy shrink method on: 2013-02-14 10:06:31
@StephR:
Yes I tried, and still ClassNotFoundException. I tried letting the Jshrink step out. Still not better. The applet cannot be started trough the webbrowser.

@teletubo:
Thanks for that Smiley helped a bit
21  Games Center / 4K Game Competition - 2013 / Re: Easy shrink method on: 2013-02-13 22:15:11
I tried it your way, but I get errors after the 3rd step with the jarg.jar.

But the jshrinker does the job anyway, but I it won't run in the browser, although I added the params to the applet tag. It says no G.class found... Sad

Whats wrong there?

My steps

Quote
javac -target 1.7 G.java
jar cvfM game.jar G.class
jshrink with standard configuration (load and save)
pack200 game.pack.gz game.jar


1  
2  
3  
4  
5  
6  
7  
   
<object type="application/x-java-applet" height="600" width="800">
     <param name="code" value="G.class" />
     <param name="archive" value="game.pack.gz" />
     <param name="java_arguments" value="-Djnlp.packEnabled=true"/>
     Applet failed to run.  No Java plug-in was found.
   </object>
22  Games Center / 4K Game Competition - 2013 / Re: Easy shrink method on: 2013-02-13 20:22:10
Thanks for your help Cheesy

It worked out very well Cheesy
First I used Jshrinker, than pack200. Now I got a shrink.pack.gz file. How do I test my applet if it still works?

 Huh
23  Games Center / 4K Game Competition - 2013 / Re: Easy shrink method on: 2013-02-13 19:55:29
I already tried to download it, but the download link is broken

http://www.e-t.com/jshrink.zip
24  Games Center / 4K Game Competition - 2013 / Easy shrink method on: 2013-02-13 19:52:32
Hello,
I want to contribute to the current 4K contest.

My jar is 6.819 Bytes big. I am doing this at the moment with little success:

Quote
pack200 --repack fourK.jar
pack200 fourK.jar.pack.gz fourK.jar

The result is 4.420 Bytes.

All the shrinking tools seem to be offline Sad

Please help me, thanks guys Smiley
25  Game Development / Newbie & Debugging Questions / Re: Game Loop too fast on: 2013-01-25 11:24:24
Hello, thanks for your answers.

Is this game Loop good for 4K Contest? What would you improve or leave out? Thanks Smiley
26  Game Development / Newbie & Debugging Questions / Re: Game Loop too fast on: 2013-01-22 22:58:45
Thanks guys. I have changed the period variable to: long period = 1000000000 / TARGET_FPS;

no I can use a more "normal" speed value -> 1.75 e.g. before it was 0.025 I think Cheesy
But the FPS still shows about 280.

A delta value about 0.2 to 1.2 is pretty normal, isn't it?

p.s.: it is too obvious that this is the source code from the killer gaming book Tongue

P.s.s: What does Polygon's translate do? I wrote the coordinates to the console, and x an y were only at about 20 and the thing flew around like fire Cheesy
27  Game Development / Newbie & Debugging Questions / Game Loop too fast on: 2013-01-22 21:27:46
Hello everybody,

this is a very nice forum.

I have got a problem with my run - game loop. The first 1-2 seconds it has more than 1800 FPS and after that it is about 300, althoug I set the target FPS to 60.
I tested this loop and animated a polygon which moves from x:0 y:0 diagonal down. After the FPS break from about 1800 to 300 it runs with full speed out of sight Cheesy

These are the deltas at that special moment:

0.15598080623923224
1.5791460031658402

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  
   public void run() {
      final int MAX_FRAME_SKIPS = 5;
      final int NO_DELAYS_PER_YIELD = 16;
      final int TARGET_FPS = 60;
      final long OPTIMAL_TIME = 1000000000 / TARGET_FPS;

      long beforeTime, afterTime, timeDiff, sleepTime;
      long overSleepTime = 0L;
      long excess = 0L;
      long period = 1000 / TARGET_FPS;

      int noDelays = 0;
      int fps = 0;
      int lastFpsTime = 0;
     
      double delta = 1.0;
     
      beforeTime = System.nanoTime();
      isRunning = true;

      while (isRunning) {
         update(delta);
         render();
         paintScreen();

         afterTime = System.nanoTime();
         timeDiff = afterTime - beforeTime;
         sleepTime = (period - timeDiff) - overSleepTime;
         
         delta = timeDiff / ((double) OPTIMAL_TIME);
         
         lastFpsTime += timeDiff;
         fps++;

         if (lastFpsTime >= 1000000000) {
            printFps = fps;
            lastFpsTime = 0;
            fps = 0;
         }

         if (sleepTime > 0) {
            try {
               Thread.sleep(sleepTime / 1000000L);
            } catch (InterruptedException e) {
               e.printStackTrace();
            }
           
            overSleepTime = (System.nanoTime() - afterTime) - sleepTime;
           
         } else {
            excess -= sleepTime;
            overSleepTime = 0L;

            if (++noDelays >= NO_DELAYS_PER_YIELD) {
               Thread.yield();
               noDelays = 0;
            }
         }

         beforeTime = System.nanoTime();

         int skips = 0;

         while ((excess > period) && (skips < MAX_FRAME_SKIPS)) {
            excess -= period;
            update(delta);
            skips++;
         }
      }

   }



I really hope, that somebody could help me. Maybe to improve my loop as well.
Thank you very much in advance,
Best regards, Kronos.

edit:

embarassing moment  persecutioncomplex

I used myPolygon.translate(x, y);
I don't know what this does exactly, but not what I wanted it to do. The loop seems to be okay, beside that it does not reach my target FPS which is set to 60. Sad
Pages: [1]
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (81 views)
2013-05-17 21:29:12

alaslipknot (91 views)
2013-05-16 21:24:48

gouessej (122 views)
2013-05-16 00:53:38

gouessej (114 views)
2013-05-16 00:17:58

theagentd (126 views)
2013-05-15 15:01:13

theagentd (113 views)
2013-05-15 15:00:54

StreetDoggy (158 views)
2013-05-14 15:56:26

kutucuk (180 views)
2013-05-12 17:10:36

kutucuk (180 views)
2013-05-12 15:36:09

UnluckyDevil (186 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.228 seconds with 21 queries.