Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (115)
games submitted by our members
Games in WIP (563)
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 / Shared Code / Re: GLSL Shader Loader on: 2014-07-08 03:20:46
Thanks for sharing this with us.

However, am I missing something or won't sending anything but four floats to the "sendFloats" function cause an ArrayIndexOutOfBoundsException?
2  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Issue with LWJGL Space Inaders Example on: 2013-11-08 20:30:35
I couldn't explain in depth why it occurs but I believe your issue might be the following.

You can make Source Folders or regular Folders while in Eclipse.

If you have a regular folder you will need to do "res/testdata/alphamap.png".
If you have a source folder you can do "testdata/alphamap.png".

So try "res/testdata/alphamap.png" and if that doesn't work, post a screenshot.

Good luck.
3  Games Center / Showcase / Re: Stupid Human Castles on: 2013-10-23 21:40:36
Hi, I tried the demo version on my Note 3.

Feedback:
  • The textures were a bit pixelated for me but nothing too annoying.
  • A good amount of the GUI wasn't aligned perfectly. For example: the health bar text seems like it could be shifted to the left by half of the text's width. I had a black bar to the right of the down buttom but it was more wide than the black bar that is to the left of the left button. (I could post a screenshot if that would help).
  • I would have liked to be able to move the blocks left, right, and rotate them with touch controls.
  • I was able to rotate the block for an infinite amount of time, if I recall correctly the block should eventually land regardless of if you are still rotating the piece.

That's what I got from playing the demo, good work, it's very inspiring as I've recently started my own project with LibGDX intended for Android.

EDIT: That WebGL Water demo is insane Shocked!
4  Discussions / Miscellaneous Topics / Re: JAW browser on: 2013-09-24 00:51:20
Cool indeed! It worked for me, I like the clean interface look. I'm not familiar with programming anything web related so I'll ask the dumb question: is this going to become a browser such as Chrome, IE, Firefox, etc, or is it fitting a more specific niche?
5  Game Development / Newbie & Debugging Questions / Re: Health Bar & XP Bar[Need Help] on: 2013-07-18 01:16:06
It would be really helpful if you could share your health bar rendering code  Wink.
6  Games Center / WIP games, tools & toy projects / Re: MatchNik on: 2013-07-13 23:09:58
Fun game! Aside from standard polish I'd recommend adding a score system based on the number of moves you've made and having the block removal sound's pitch correlate with that color's visible light frequency, ex: green would produce a higher pitched sound than orange when destroyed.

Misc: I skipped to level 64 and was able to beat it on my first try by just destroying everything from the ground up. I have yet to beat 63 from a few attempts. Perhaps level 64 needs a buff?

Well done.
7  Game Development / Newbie & Debugging Questions / Re: Custom fonts on: 2013-07-08 02:58:28
Here is how I load a .ttf file.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
// Font manager should be replaced with your class name.
  public static Font createFont(String path, float size) {
      try (InputStream is = FontManager.class.getClass().getResourceAsStream(path)) {
         Font font = null;
         try {
            font = Font.createFont(Font.TRUETYPE_FONT, is);
         } catch (FontFormatException | IOException e) {
            e.printStackTrace();
         }
         if (font != null) {
            font = font.deriveFont(size);
         }
         return font;
      } catch (IOException e1) {
         e1.printStackTrace();
      }
      return null;
   }

// Example of me creating it later on.
// /fonts/ is located within my res folder.
Font title_font = FontManager.createFont("/fonts/PHATONE_.TTF", 58); //$NON-NLS-1$

If you are not running Java 1.7 you will need to modify the first line. I am unaware if this is the best design but hopefully it helps; please ask any questions you might have.
8  Game Development / Newbie & Debugging Questions / Re: My game is almost half a Gigabyte in size on: 2013-06-18 03:20:10
Extremely Unrelated:
It looks (to me) like you're using Java2D.
This code might help enhance your game's graphical appearance.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
// Put this at the start of your rendering. No need to use every single one.
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.setRenderingHint(RenderingHints.KEY_TEXT_LCD_CONTRAST, Integer.valueOf(100));
g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
g.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
g.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
9  Game Development / Newbie & Debugging Questions / Re: Any idea why my game slows down when I try to record a video of it using Fraps? on: 2013-05-08 06:13:44
You probably already checked this but make sure your code is running efficiently. Running Eclipse + your code + Fraps might be reaching a bottleneck that a game + Fraps doesn't.

Are you isng LibGDX or something else for your base code?

On a related note: I recommend checking out VisualVM, it's free software that monitors any JVM running and will report to you useful statistics such as CPU usage and time spent calling each method.

Pre-Post: 65K beat me to it lol
10  Discussions / Miscellaneous Topics / Re: Razar Black Widow Ultimate! DEAD! on: 2013-04-15 23:39:11
touché
11  Discussions / Miscellaneous Topics / Re: Razar Black Widow Ultimate! DEAD! on: 2013-04-15 22:13:50
http://voices.yahoo.com/how-clean-keyboard-spill-7273146.html
Just water, or coffee or something? You shouldn't drink stuff around your computer unless you're very careful. Also, what do you need a $100 keyboard for Shocked

You may not need a $100 keyboard but higher-end keyboards with macros can actually save you money by saving you time. For example: I have the non LED version of the blackwidow with some of the following key binds (Note: You can have many layout modes):
  • M1 - Runs the eclipse project
  • M2 - Types "System.out.println("");"
  • M3 - Formats the code
  • M4 - Comments out the selected line(s)
  • M5 - Rename shortcut
  • Any key can be set to launch a program (you could make a Java bot binded to it), a combination of keys with a specific time interval, etc
The time it would have taken to do all those things will eventually pay for itself.
12  Java Game APIs & Engines / OpenGL Development / Re: Change draw color on: 2013-03-31 17:31:18
Bind a white texture after you draw all your cubes
13  Games Center / WIP games, tools & toy projects / Re: Viking Supermarket Smash! on: 2013-03-14 02:52:38
I really like the overall theme/feeling (story and art) of the game, so great job on that.
Feedback:
  • Every 8 seconds or so the game stutters for half a second or so. Is that when you create the data for the environment?
  • I would like to see multiple swing styles implemented, I believe you can only hit one item a time currently so perhaps you could add a wider swing that does AoE damage but requires more time to execute. This would allow for more dynamic game play as you have to decide between taking a longer time to hit multiple items stacked up or use precision hits for items that are alone.
  • I encounter the shopping cart and wet floor sign once and never again.
Just a fun thought: perhaps you could have your score reflected in your beard size. So at a score of 0 you have a wimpy beard but at a score of 100 you have a magnificent beard. Good luck on your project, I look forward to updates.
14  Java Game APIs & Engines / OpenGL Development / Re: [LWJGL] isKeyReleased() method? on: 2013-03-14 01:49:42
Questions:
  • When and how is your input object obtaining user input? To my knowledge (and this is how it is done in my projects) it should be called once in each iteration of the game loop.
  • Do you only have one input object or multiple? To my understanding it would be best if you only have one input object (perhaps making it static, though take my advice lightly as I am not that experienced).
  • Could you show us more source code relevant to your problem?



This isn't a solution to your problem but I would just like to point out that instead of doing
1  
brushSize = input.brushSize;
you should do
1  
brushSize = input.getBrushSize();

Some reasons from http://stackoverflow.com/questions/1568091/why-use-getters-and-setters are
  • "Encapsulation of behavior associated with getting or setting the property - this allows additional functionality (like validation) to be added more easily later."
  • "Hiding the internal representation of the property while exposing a property using an alternative representation."
  • "Insulating your public interface from change - allowing the public interface to remain constant while the implementation changes without effecting existing consumers."
  • "Controlling the lifetime and memory management (disposal) semantics of the property - particularly important in non-managed memory environments (like C++ or Objective-C)."
  • "Providing a debugging interception point for when a property changes at runtime - debugging when and where a property changed to a particular value can be quite difficult without this in some languages."
  • "Improved interoperability with libraries that are designed to operate against property getter/setters - Mocking, Serialization, and WPF come to mind."
  • "Allowing inheritors to change the semantics of how the property behaves and is exposed by overriding the getter/setter methods."
  • "Allowing the getter/setter to be passed around as lambda expressions rather than values.
    Getters and setters can allow different access levels - for example the get may be public, but the set could be protected."



EDIT: I plugged your code into one of my projects and I believe you are only tracking pressed input, not released. It my not be the best design but here is how I obtain input, hopefully it is useful to you.

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  
   protected boolean[] keysDown = new boolean[256];
   protected boolean[] keysPressed = new boolean[256];
   protected boolean[] keysReleased = new boolean[256];

   protected void pollInput() {
      for (int i = 0; i < this.keysDown.length; i++) {
         this.keysDown[i] = Keyboard.isKeyDown(i);
      }
      while (Keyboard.next()) {
         if (Keyboard.getEventKeyState()) {
            for (int i = 0; i < this.keysPressed.length; i++) {
               if (Keyboard.getEventKey() == i) {
                  this.keysPressed[i] = true;
               }
            }
         } else {
            for (int i = 0; i < this.keysReleased.length; i++) {
               if (Keyboard.getEventKey() == i) {
                  this.keysPressed[i] = false;
                  this.keysReleased[i] = true;
               }
            }
         }
      }
   }
15  Games Center / Showcase / Re: Mtower - 3D LWJGL game on: 2013-03-06 23:23:56
Welcome morrky! It's me VideoGameMath that committed on some of your videos. You helped me learn fog so thank you for that.

Just to clarify: if you game is done then you have posted in the correct section, if this project is still being worked on then (for future reference) it should be posted in the WIP (work in progress) section. If the project is still being worked on I feel you should expand on the medieval theme by perhaps making the background more dynamic with the tower falling apart and you have to use debris to make your way up.

Otherwise, very nice work on your project.
16  Java Game APIs & Engines / OpenGL Development / Re: [LWJGL] Color problem when I load a Texture ... on: 2013-03-06 05:31:39
Just to theorize before he answers:
103, 199, 299 gives the light blue color of his sky, perhaps Soleil is the sun block (sol in spanish is sun) and when the sun falls it gets darker representing night.
17  Game Development / Newbie & Debugging Questions / Re: JarSplice - "Error in opening zip file" on: 2013-03-06 05:04:51
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?
18  Game Development / Newbie & Debugging Questions / Re: JarSplice - "Error in opening zip file" on: 2013-03-06 04:44:45
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.
19  Games Center / WIP games, tools & toy projects / Re: My First Game! on: 2013-03-06 01:45:51
Ah, I rushed to launching the game. You do have controls written out, sorry about that (but perhaps it indicates something about the typical consumer).

EDIT: The projectiles get removed when the ship that fired them get destroyed. Normal projectiles should be independent of ship status.
20  Java Game APIs & Engines / OpenGL Development / Re: [LWJGL] Color problem when I load a Texture ... on: 2013-03-06 01:41:36
I'm no expert but loading and binding a white texture might fix your problem. Also from your source code I saw "Ciel.setColor(103,199,299);", perhaps it's different for your specific project but I have never seen color values go above 255.
21  Games Center / WIP games, tools & toy projects / Re: My First Game! on: 2013-03-06 01:34:05
Congratulations on getting this far on your first project, I've yet to finish (or get close to finishing) any project that I have started.

I am sure you have plenty planned for this game but here is some quick initial feedback.
  • Please, add in some unique mechanic. Creating a clone game is a great way to learn but I feel you and your team could stand out so much more by creating some unique aspect to the game. An example: giving the player a shield that deflects projectiles instead of absorbing them, allowing the player to angle themselves in order to properly reflect projectiles.
  • I see hit boxes in your screenshot but I am un-sure of how to activate such viewing in my game (granted that it's only for developers to view). This brings the point that you need to make sure users know, or will know the controls of the game.
  • You print information to the console, which is fine for development purposes but keep in mind calling "System.out.println("stuff");" takes execution time. Be careful not to release a public version with too many of those included as it could slow the game down.

I could go on for a while with game-play specific feedback such as...
  • Make that background scroll to the left, that will really give a sense of motion.
  • If you hold space bar down you can fire at a tremendous rate without pause (I am assuming that this is un-intended).
  • Add ship to ship collision.
...but I'm sure that and more is already planned, good luck.
22  Discussions / General Discussions / Re: Problem with Eclispe colors on: 2013-03-04 22:26:56
It might be under Window -> Preferences -> Java -> Editor -> Syntax Coloring
23  Java Game APIs & Engines / OpenGL Development / Immediate Mode Versus Vertex Array Performance Confusion on: 2013-02-26 05:46:02
Hi, I'm trying to advance my OpenGL knowledge past immediate mode. From Riven's (thanks Riven) tutorial I was able to get a vertex array rendering properly but I was not able to see an increase in performance.
Here is how I tested it, if this is the wrong approach to bench-marking please inform me.

To test the performance of immediate mode and vertex arrays I drew a quad repeated, in this test it was 88573 quads. When I one big vertex array hold all 88573 quads it got close to the performance of immediate mode but not quite there.
Pastebin: http://pastebin.java-gaming.org/3dddd044049 (It's messy)

Here is sample console output:
(I should have labeled these). The first columns is individual vertex arrays, the second columns is immediate mode, and the third columns is one big vertex array.
1  
2  
3  
4  
5  
67900774   13660101   15001607   n: 88573
371488407   14153266   19133484   n: 88573
116280710   13882860   14012185   n: 88573
68273896   13738066   15345957   n: 88573
71455953   15008723   12876111   n: 88573


Q1: Could someone please explain why this occurred?
Q2: Does it matter how I render (immediate, vertex array, VBO) when I decide to fully use shaders?


Sorry, these questions must have been asked a lot, thank you for your time.

EDIT: This was done in 3D if that makes a significant difference.
24  Java Game APIs & Engines / OpenGL Development / Re: [LWJGL Texture render order?] *solved* on: 2013-01-29 00:55:14
In regards to your question, yes. The fewer times you can call glBegin and glEnd the better (for performance).
25  Game Development / Newbie & Debugging Questions / Re: Loading a static Texture inside a jar file on: 2013-01-25 08:30:26
I recently had the same problem and here is how I fixed it.

1. Instead of putting all my resources in a res folder I put images directly in my texture package, sounds in my audio package, so on and so forth.


2. I use davedes's texture class (thank you davedes for the tutorials and all code has the proper copyrights attached).
1  
2  
3  
4  
5  
6  
7  
   private static void initTexture(String fileName) {
      try {
         textures.add(new aufait.textures.Texture(Textures.class.getResource(("/aufait/textures/" + fileName))));
      } catch (IOException e) {
         e.printStackTrace();
      }
   }


Just as another example here is how I load my audio resources.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
   private void generateSound(String fileName, int index, boolean lastSound) {
      BufferedInputStream bufferedInputStream = new BufferedInputStream(Audio.class.getResourceAsStream("/aufait/audio/" + fileName));
      WaveData waveFile = WaveData.create(bufferedInputStream);
      if (lastSound) {
         try {
            bufferedInputStream.close();
            waveFile.dispose();
         } catch (IOException e) {
            e.printStackTrace();
         }
      }
      AL10.alBufferData(buffer.get(index), waveFile.format, waveFile.data, waveFile.samplerate);
   }
26  Game Development / Shared Code / Re: [Forcefully clean allocated memory] on: 2013-01-25 04:32:52
@GabrielBailey74 these two links might help.

http://stackoverflow.com/questions/2414105/why-is-it-a-bad-practice-to-call-system-gc
http://bugs.sun.com/view_bug.do?bug_id=6668279

I also like to focus on micro-optimizations but at the end of the day it is more important to focus on macro-optimizations and creating content before polishing it. (I'm guilty of calling System.gc() a couple of times in my game, I now know that it's better not being there).
27  Game Development / Newbie & Debugging Questions / Re: [LWJGL] Projection Question on: 2013-01-20 02:39:42
Ah that's a very good point. Some of friends were complaining about it so I was looking for a way to reduce the effect.

EDIT (Before Posting): Nevermind, my friends were complaing about the field of view. I was better off not making this thread lol, thank you for the help HeroesGraveDev.
28  Game Development / Newbie & Debugging Questions / Re: [LWJGL] Projection Question on: 2013-01-20 02:14:25
That didn't fix it, sorry.
29  Game Development / Newbie & Debugging Questions / [Solved] Projection Question on: 2013-01-20 02:06:04
Hi, this is probably a simple solution so I apologize for not knowing the basics yet. I believe my game is being distorted but I am not exactly sure on how to fix it.

(LEFT: on ground, RIGHT: Bird's eye)


I played around with field of view but to no luck.

Here is my OpenGL init for 3D.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
      GL11.glMatrixMode(GL11.GL_PROJECTION);
      GL11.glLoadIdentity();
      GLU.gluPerspective(fieldOfView, (float) Display.getWidth() / Display.getHeight(), MIN_VIEW_DISTANCE, MAX_VIEW_DISTANCE);
      GL11.glMatrixMode(GL11.GL_MODELVIEW);
      GL11.glEnable(GL11.GL_TEXTURE_2D);
      GL11.glShadeModel(GL11.GL_SMOOTH);
      GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
      GL11.glClearDepth(1.0f);
      GL11.glEnable(GL11.GL_DEPTH_TEST);
      GL11.glDepthFunc(GL11.GL_LEQUAL);
      GL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST);
      Fog.fog();


Thank you so much for your time.
30  Game Development / Newbie & Debugging Questions / Re: [LWJGL] Visual Glitch on: 2013-01-17 03:43:49
1  
2  
private float MAX_VIEW_DISTANCE = 1000f;
private float MIN_VIEW_DISTANCE = 0.0001f;


I just set MIN_VIEW_DISTANCE to 0.5f and that fixed it, thank you.
Pages: [1] 2 3 ... 7
 

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

The first screenshot will be displayed as a thumbnail.

radar3301 (12 views)
2014-09-21 23:33:17

BurntPizza (30 views)
2014-09-21 02:42:18

BurntPizza (19 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (27 views)
2014-09-20 20:14:06

BurntPizza (31 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (102 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24: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!