Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
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 ... 11
1  Game Development / Game Mechanics / Re: Issue with smooth game loop on: 2013-11-26 03:20:43
I agree, desktops are the best Cheesy I've got a pretty decent rig myself, but I got this for the portability/battery life almost exclusively.

I would not recommend a busy loop around Thread.yeild(). Try removing at and see if it's any smoother.

WOW. This fixed it immediately! See here!

Thanks so much friend!
2  Game Development / Game Mechanics / Re: Issue with smooth game loop on: 2013-11-26 03:06:18
You're mistaken, but no worries.

This processor can actually run League at 60fps on medium settings, WoW at 100fps on medium settings, Minecraft on 60 on normal render distance, etc. The low clock speed is to conserve battery life (it's unreal. 12 hours). In short, I'm positive it isn't my processor. Smiley
3  Game Development / Game Mechanics / Re: Issue with smooth game loop on: 2013-11-26 03:00:58
Couldn't be the cpu - I have a 1.3ghz i5 Haswell; IE the new Macbook air, and I'm running dual-boot with Windows 7, which is what I'm programming in.

I'm not emulating Windows so I doubt it's related to the Macbook hardware.
4  Game Development / Game Mechanics / Re: Issue with smooth game loop on: 2013-11-26 02:57:33
Yeah, it's on a tile based movement system.

Hm. Maybe it'll happen if someone else tries? It very well could be a hardware related occurrence.

Thanks for your time though!
5  Game Development / Game Mechanics / Re: Issue with smooth game loop on: 2013-11-26 02:52:48
Sorry! I just updated the download to the most current version - that one was a few days old.
6  Game Development / Game Mechanics / [SOLVED] Issue with smooth game loop on: 2013-11-26 02:47:51
EDIT: Problem solved! Thanks so much to theagentd for helping me!

It's been a while!

I've been dealing with a minor issue for a few days. I'd been having issues with consistency in screen scrolling and small screen tears, so I rewrote my game loop based on examples from ra4king and Eli. I'm still seeing small issues, though, and was wondering if I could have a few more pairs of eyes check it out.

Here's a jar edit: updated to current version
Here's the full source on BitBucket

Here's the most relevant source

Game loop

----------

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  
@Override
   public void run() {
      createBufferStrategy(2);
      BufferStrategy bs = getBufferStrategy();

      init();

      while (running) {
         final double GAME_HERTZ = 60.0;
         final double TIME_BETWEEN_UPDATES = 1000000000 / GAME_HERTZ;
         final int MAX_UPDATES_BEFORE_RENDER = 1;
         double lastUpdateTime = System.nanoTime();
         double lastRenderTime = System.nanoTime();

         final double TARGET_FPS = 60;
         final double TARGET_TIME_BETWEEN_RENDERS = 1000000000 / TARGET_FPS;

         while (running) {
            double now = System.nanoTime();
            int updateCount = 0;

            if (!paused) {
               while (now - lastUpdateTime > TIME_BETWEEN_UPDATES && updateCount < MAX_UPDATES_BEFORE_RENDER) {
                  tick();
                  lastUpdateTime += TIME_BETWEEN_UPDATES;
                  updateCount++;
               }

               render(bs);
               lastRenderTime = now;
               
               while (now - lastRenderTime < TARGET_TIME_BETWEEN_RENDERS && now - lastUpdateTime < TIME_BETWEEN_UPDATES) {
                  Thread.yield();
                  now = System.nanoTime();
               }
            }
         }
      }

      System.exit(0);
   }


----------

Render function

----------

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
private void render(BufferStrategy bs) {
      do {
         do {
            Graphics g = image.getGraphics();
            g.clearRect(0, 0, WIDTH, HEIGHT);

            game.draw(screen);

            g = bs.getDrawGraphics();
            g.drawImage(image, 0, 0, getWidth(), getHeight(), null);
            g.dispose();

         } while (bs.contentsRestored());

         bs.show();

      } while (bs.contentsLost());
   }

edit: added code tags

----------

Thanks for taking the time to help me!

Nathan
7  Games Center / WIP games, tools & toy projects / Re: Ant colony simulation on: 2013-03-21 16:29:11
SimAnt is the shit. I played that allllll the time growing up.

Good luck with this! c:
8  Java Game APIs & Engines / Java 3D / Re: Java3D: 2 Appearances on a same Shape on: 2013-03-20 18:15:34
I do not have the answer you seek, but I would highly recommend switching to either LWJGL or JOGL.
9  Game Development / Newbie & Debugging Questions / Re: How to listen multiple Key presses? on: 2013-03-18 16:45:34
Here's the listener that I use. I got it from Notch.

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  
public class Input implements KeyListener {

   public List<Key> keys = new ArrayList<Key>();
   
   public Key up = new Key();
   public Key down = new Key();
   public Key left = new Key();
   public Key right = new Key();
   public Key exit = new Key();
   
   public Input(Main game) {
      game.addKeyListener(this);
   }
   
   @Override
   public void keyPressed(KeyEvent e) {
      toggle(e, true);
   }

   @Override
   public void keyReleased(KeyEvent e) {
      toggle(e, false);
   }

   @Override
   public void keyTyped(KeyEvent e) { }
   
   private void toggle(KeyEvent e, boolean pressed) {
      if (e.getKeyCode() == KeyEvent.VK_UP) up.toggle(pressed);
      if (e.getKeyCode() == KeyEvent.VK_DOWN) down.toggle(pressed);
      if (e.getKeyCode() == KeyEvent.VK_LEFT) left.toggle(pressed);
      if (e.getKeyCode() == KeyEvent.VK_RIGHT) right.toggle(pressed);
      if (e.getKeyCode() == KeyEvent.VK_ESCAPE) exit.toggle(pressed);
   }
   
   public void releaseAll() {
      for (Key key : keys) key.down = false;
   }
   
   
   public class Key {
      public boolean down;
     
      public Key() {
         keys.add(this);
      }
     
      public void toggle(boolean pressed) {
         if (pressed != down) down = pressed;
      }
   }
}
10  Game Development / Networking & Multiplayer / Re: [KryoNet] Desktop can connect, phone can't. on: 2013-03-15 16:03:12
Oh. My. God.

I hate myself.

I forgot to add...

<uses-permission android:name="android.permission.INTERNET" />

to the AndroidManifest.xml file.

Someone make fun of me, I deserve it.

Nah, you solved your own problem! That's always a good feeling.
11  Java Game APIs & Engines / Java 2D / Re: Slick2D, play sound at location on: 2013-03-14 18:39:39
I would recommend Pauls sound library for 3D sound, found here.
12  Java Game APIs & Engines / Java 2D / Re: Fake 3d effect? on: 2013-03-13 15:50:07
A game like command and conquer tiberian sun is 2d or 3d?

I would say 2D.
13  Java Game APIs & Engines / Java 2D / Re: Fake 3d effect? on: 2013-03-13 15:41:13
thanks for the replies...
I already was looking on LibGDX and it looks also pretty simple to use.
But why do i have to make my own methods? Doesn't libGdx have it? I've seen for example that there is already a orthographic camera coded...



and what about MonkeyEngine? I'm not alone and i could use the help of my brother that is really good on drawing...

I've never used JME, but if that's what you want to try, go for it. There is no perfect solution, no definitive answer to your question. Just try different things and see what works for you.
14  Java Game APIs & Engines / Java 2D / Re: Fake 3d effect? on: 2013-03-13 15:35:00
so that game shown on the video is 3d?

It's pretty impractical to try to do 3D rendering in Java2D (hence the name). If you want to do a top-down style 3D game (like GTA 1 and 2) then I would recommend using LibGDX. It sounds like you are looking for a library that will do that style of rendering work for you, but you won't find one. You will still have to program your own model loader, your own renderer, your own collision, etc, etc. A library like LibGDX is your best bet.

However, unless you are really experienced in 2D rendering and collision, I would recommend sticking with 2D for the time being. Try and see if you can get the game you are thinking of working in 2 dimensions first, then worry about the third. Trying to dive in and do 3D right off the bat is just asking for failure.

Hope this helps.
15  Discussions / Miscellaneous Topics / Re: Keeping a diary? on: 2013-03-11 15:51:50
While I can't say that keeping a log is a bad thing, I've found that simply keeping ALL of my projects and looking back at them if I feel like it is a log enough for me.
16  Discussions / Community & Volunteer Projects / Re: Online multiplayer game project on: 2013-03-11 15:16:39
Errrr this is from over 1.5 years ago......

Who knows, maybe the OP is still looking for someone to help him.
17  Game Development / Newbie & Debugging Questions / Re: JarSplice - "Error in opening zip file" on: 2013-03-07 02:52:54
Quote
What would you recommend for distributing programs that use Slick2D?

windows: exe
linux: .sh or package like .deb
mac: whatever mac does: appbuilder thing
has nothing to do with slick, goes for everything
you also package a private jvm

Thanks, but my issue lies in simply getting a .jar to run that references Slick. I don't know why this is causing me so much trouble, it's worked for me for over a year now with no problems.
18  Game Development / Newbie & Debugging Questions / Re: JarSplice - "Error in opening zip file" on: 2013-03-06 19:40:58
Runnable Jars have been working for me  persecutioncomplex. I should switch to standard jar then.

Is "Jar creation failed due to the following exception: error in opening zip file" all the error message says?

Yes, that is the only error given.

Fat JARs might be opened by the default software handling ZIP archives, WinRAR for example... Please don't use fat JARs, it is not a viable solution.

What would you recommend for distributing programs that use Slick2D?
19  Game Development / Newbie & Debugging Questions / Re: JarSplice - "Error in opening zip file" on: 2013-03-06 04:49:52
How are you exporting your Eclipse project into a .jar?

File -> Export -> Java -> Runnable JAR file -> Copy required libraries into a sub-folder next to the generated JAR, is my process.

I am exporting as a standard JAR, not a runnable one. JarSplice doesn't like runnable JARs.
20  Game Development / Newbie & Debugging Questions / JarSplice - "Error in opening zip file" on: 2013-03-06 04:24:04
My current project uses Slick2D. I've never had a problem with using JarSplice to distribute my programs that use Slick up until now. When I go to actually create the "Fat Jar", it gives this message:

Jar creation failed due to the following exception: error in opening zip file

Like I said, I've never come across this problem before. I know that it isn't the natives or the main class causing the issue.

Has anyone ever run into this before? What was causing the issue?

Here's my source, if that helps at all. http://www.mediafire.com/?57qee753bpru8d7

Thanks.
21  Game Development / Newbie & Debugging Questions / Re: Instances problem on: 2013-03-05 17:56:00
never mind fixed it I just need to look it see if the tilelist had nulls in it and then just throw those away, my fault , but thanks anyway

ALWAYS check what exception was thrown first, especially if it's a null pointer. Those are very easy to fix.
22  Game Development / Game Play & Game Design / Proper way to implement vast amounts of character dialogue? on: 2013-03-04 19:04:18
I've been working on a pretty standard role-playing game for quite a while now. It's coming along nicely, but I still don't have a good solution for a major part of the game: handling large amounts of character dialogue and scripted cutscenes.

The simplest (and least-ideal) solution would be to simply make a new class for each cutscene that contains info on where the camera needs to be looking, who needs to say what, etc etc. This doesn't seem like a very good approach to me.

Another idea would be to have a bunch of XML (or something like XML) files that contain the data.

So, my question to anyone who has tackled this issue in the past: how did you do it? If you haven't done this before, what would you do in this situation?

Thanks a bunch for your time.
23  Game Development / Newbie & Debugging Questions / Re: libGDX - It's so large? on: 2013-02-26 18:10:19
There are four of us, and that sort of money arrives at random intervals a few times a year.

The rest of the time we make $10 a day to share between us.

Cas Smiley

Sad

I subscribe to the believe that making money is not more important that happiness, but how do you survive off of that? I'm sure it takes a LOT of care and planning, but it seems next to impossible.

 | Nathan
24  Discussions / General Discussions / Change eclipse code font? on: 2013-02-14 17:20:42
On one computer I have a nice lovely font that I've been using since i started programming. However, on the new, evil computer, the font is one that I'm not used. I've looked high and low and can't find the option to change it. Anyone know how?

I want my font to look like the image on top. Currently it looks like the image on bottom.

http://imgur.com/a/5TyVf

Thanks!
25  Games Center / WIP games, tools & toy projects / Re: Barley-break on: 2013-02-08 19:54:38
No offence, but I personally won't click that link until I read a description/see more screenshots.
26  Games Center / Archived Projects / Re: miniRailCraft on: 2013-02-08 19:53:57
Cool to see Notch's MiniCraft help other people learn. I learned so much about rendering pixels from him.
27  Java Game APIs & Engines / OpenGL Development / Re: Moving from OpenGL 1.x to shaders and modern OpenGL - any tutorials? on: 2013-02-08 17:52:17
If you decide to use a minimum version of OpenGL in the 3.x range, then yes, you will be eliminating possible customers. However, it's their fault for trying to play games on an old computer, haha.
28  Game Development / Networking & Multiplayer / Re: Game Patcher? on: 2013-02-06 18:17:18
Much appreciated.
29  Game Development / Networking & Multiplayer / Game Patcher? on: 2013-02-06 16:57:26
All I want is to program a simple launcher that will allow players to launch the game and change settings. This launcher will also function as a game patcher.

For this, all I want is for the game to be able to download a new, updated .jar file.

Is there an established way for doing this? Also, how can I track the completion of the download to make a status bar?

Thanks a bunch,

Nathan
30  Games Center / WIP games, tools & toy projects / Re: Puzzle on: 2013-02-06 16:50:01
Might I ask what in God's name it says on the bottom of the game window in that screen shot?
Pages: [1] 2 3 ... 11
 

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

The first screenshot will be displayed as a thumbnail.

TehJavaDev (17 views)
2014-08-28 18:26:30

CopyableCougar4 (26 views)
2014-08-22 19:31:30

atombrot (39 views)
2014-08-19 09:29:53

Tekkerue (36 views)
2014-08-16 06:45:27

Tekkerue (33 views)
2014-08-16 06:22:17

Tekkerue (22 views)
2014-08-16 06:20:21

Tekkerue (33 views)
2014-08-16 06:12:11

Rayexar (67 views)
2014-08-11 02:49:23

BurntPizza (45 views)
2014-08-09 21:09:32

BurntPizza (36 views)
2014-08-08 02:01:56
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!