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] 2 3 ... 10
1  Game Development / Newbie & Debugging Questions / Re: Jesus, seperate entities PLEASE on: 2013-04-30 05:22:56
Posting the code would be most helpful.

Also try doing a println of each rect to the logs or using the debugger.  This will help determine if they are all the same or if they are offscreen etc.
2  Games Center / WIP games, tools & toy projects / Re: Pseudo Voxel Expriements on: 2013-04-11 17:17:57
Looks pretty cool.  The dungeon art-style and characters reminded me of Gauntlet and the ability to walk behind things reminded me of King's Quest.
3  Game Development / Game Mechanics / Re: What are the ways to optimize game? on: 2013-04-09 15:56:41
The fastest data-structure I know of for iterating over is a raw Array (and using an int index into it).  I don't know if it would be any faster than an ArrayList but it might be worth trying out and then profiling.
4  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-03-20 12:50:21
In your images the glyph spacing is proportional (e.g. the 'l's takes less horizontal space than capital letters).  How are you doing that?  It's not apparent in the code.
5  Game Development / Game Play & Game Design / Re: Favorite Window Size on: 2013-02-24 01:47:50
My native resolution is 1650 x 1050 on my MacBook Pro.

I prefer to size my gaming window so that it takes all of the vertical space minus the height of the system menu bar.  I never use the full width.  Thus approximately 1000 x 1020.

I actually find it very annoying for games to take up the entire display if they really don't need to.
6  Java Game APIs & Engines / OpenGL Development / Re: Fast and easy projection matrix for 2d only rendering? on: 2013-02-22 02:35:26
FWIW this is what I do to enter/exit '2D mode'.  0,0 is the top-left corner and coordinates are pixel counts.

UIComponent.is2D is a global variable initially set to false.

Scala:

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  
  /**
   * Call before drawing 2D elements on the glCanvas.
   */

  protected def toggleOn2D() {
    if (!UIComponent.is2D) {
      val viewport: IntBuffer = BufferUtils.createIntBuffer(16)

      glGetInteger(GL_VIEWPORT, viewport)

      glMatrixMode(GL_PROJECTION)
      glPushMatrix()
      glLoadIdentity()

      glOrtho(viewport.get(0), viewport.get(0)+viewport.get(2), viewport.get(1), viewport.get(1)+viewport.get(3), -1, 1)
      glMatrixMode(GL_MODELVIEW)
      glPushMatrix()
      glLoadIdentity()
      glTranslated(0.375, 0.375, 0.0)  // slight transition for exact pixel positioning

      glPushAttrib(GL_DEPTH_BUFFER_BIT)
      glDisable(GL_DEPTH_TEST)

      UIComponent.is2D = true
    }
  }

  /**
   * Call before drawing 3D elements on the glCanvas or doing 3D calculations
   * involving the projection matrix.
   */

  protected def toggleOff2D() {
    if (UIComponent.is2D) {
      glPopAttrib()
      glMatrixMode(GL_PROJECTION)
      glPopMatrix()
      glMatrixMode(GL_MODELVIEW)
      glPopMatrix()

      UIComponent.is2D = false
    }
  }
7  Games Center / 4K Game Competition - 2013 / Re: tiny_world on: 2013-02-17 02:40:38
Very nice!

Enhancement request: holding down the arrows to scroll too.
8  Games Center / WIP games, tools & toy projects / Re: Pixely Adventure-thing on: 2013-02-10 00:24:53
I noticed that the player moves ever slightly faster than the bear.

Is there any turn-based mechanism or is this pretty much real-time only?
9  Game Development / Newbie & Debugging Questions / Re: Looking for Code Criticism on: 2012-12-14 06:19:27
My three cents:

Storing variables in bytes and shorts is unnecessary and a premature optimization.

Naming your classes with verbs e.g. Create* is a bit strange.

Technically, instantiating your main frame should be run on the EDT as well.
10  Game Development / Game Play & Game Design / Re: Code is getting convoluted on: 2012-12-12 03:11:59
I already have packages and classes and I feel like it's organized, but I still have to search through my classes to find certain methods and variables. For example, I'm in the process of drawing the equipment my player has equipped in the UI and it took me a few minutes to trace back through the player class and equipment class where I actually stored the equipment information. Also when I add more character classes(archer, wizard, etc) to my game, I'm going to have to go through quite a few java classes to add functionality for a new character class. I'm worried that it will be easy to miss places that I would need to add code for full functionality. Is this just inherent in bigger games?

I could upload my whole zip file project, but I feel it would be a lot to look through.

What IDE are you using?  Finding methods and variables should be as easy as tab completion.

Adding a new class shouldn't require onerous amounts of work if you have a default implementation (e.g. MouseAdapter implements most of the MouseListener interface).

Probably best if you can post an example.  Then you'll get more distinct feedback.
11  Discussions / General Discussions / Re: Hard float ARM JVM coming! on: 2012-12-05 06:50:26
Very sweet!  I have an older 256 MB Pi but this will be the kicker for me to write Java games that will run on that platform.
12  Game Development / Newbie & Debugging Questions / Re: Newbie hex map on: 2012-11-13 03:32:46
Amit's Game Programming pages probably has the best in-depth treatise regarding hex maps and coordinates.

http://www-cs-students.stanford.edu/~amitp/gameprog.html
13  Discussions / Miscellaneous Topics / Re: What's your favorite game. on: 2012-11-12 02:53:59
Dude, your forum avatar dates you.  Awesome game, I always loved cornering the market on energy and squeezing everyone dry. Smiley  Heck, I even got to make a reference to it recently in another thread here.

My favourite was playing all 4 characters at once, mining a ton of Smithore, and not selling it until the final month for 255 a pop!
14  Discussions / Miscellaneous Topics / Re: What's your favorite game. on: 2012-11-11 23:19:53
Hmm, I'm dating myself here.  Games I've really enjoyed in the past include (in no particular order):

  • Ultima IV
  • Loderunner
  • Gauntlet
  • Bard's Tale
  • Zak McKracken and the Alien Mindbenders
  • King's Quest IV
  • Colonel's Bequest
  • Planetfall
  • Thexder
  • M.U.L.E. Cheesy
  • Karateka
  • Realm of Impossibility
15  Game Development / Game Mechanics / Re: Hexagons in game development on: 2012-10-26 14:10:32
Hexagons are popular for turn-based strategy games where units can move X number of tiles per turn.  Hexes allow 6 possible directions where moving X tiles equals the same distance.  It is also very clear if units are adjacent to each other.

Squares, on the other hand, have that pesky problem of whether or not to allow diagonal movement.  Moving diagonally is sqrt(2) distance and if you allow it, units are covering more distance each turn in the diagonal directions as opposed to the 4 cardinal directions.
16  Discussions / Miscellaneous Topics / Re: HeroDex - Trading Card MMO on: 2012-10-24 13:28:01
When is it a "game" by your standards? Website/full trailer launch? Closed Beta? Open Beta? Launch?

To get the best feedback, your game should be playable (in any state) and should have minimal requirements to signing up (e.g. no email registration required).

Then ask specific questions that you want answered.

There are a lot of developers here and hopefully that is the audience whose input you're soliciting.
17  Discussions / Miscellaneous Topics / Re: Getting a job in Java dev. on: 2012-10-24 13:21:56
Getting your first paying gig is the hardest.  I did it through an internship program at my university.  In the worst case it may require volunteering or very low pay.

After that, the networking counts.

The Java web stack isn't as bad as some people make it sound like.  In my opinion, what matters more is that you find a development shop where people are passionate about programming.  You could be using the coolest technologies but if the executive view development as a cost-center then life is pretty much going to suck.
18  Game Development / Newbie & Debugging Questions / Re: Is there a better way to do this? on: 2012-10-15 10:50:19
Have you looked at CardPanel?

As for instantiating game state objects I actually have a class called GameState that holds everything I need regarding the game.  Then I instantiate it and hold a reference within my main frame instance.  Thus it's accessible wherever I need it.

Naturally the GameState class doesn't include GUI code, loading/saving, etc... just the raw data that represents the guts of the game itself.

My golden rule is "get it working first".  Then refactor if it smells really bad or if you think of a better way to do it later on.
19  Game Development / Game Play & Game Design / Re: Simplex noise, experiments towards procedural generation on: 2012-09-20 07:36:53
Pretty cool stuff!

I'm just starting to explore Perlin noise for my game.  I was able to get a simple version working but I definitely see the need for decent visualization in order to get the results I really want.  I was wondering what direction you wanted to take your current project.

Were you planning to open source it an any manner?  Would you be interested in any kind of collaborative effort?  I can offer interface improvements, testing on the Mac platform, and additions to the tutorial that would help other devs learning this stuff for the first time.
20  Discussions / General Discussions / Re: Plan out or Dive In? on: 2012-09-16 06:51:08
Planning is useful for ensuring systems are consistent but I highly recommend getting something playable as quickly as possible and ensure that as you add stuff, the game remains playable.

Having something you can play and showcase helps with the self-motivation to keep developing!
21  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Making a custom game engine vs libGDX on: 2012-09-11 04:00:10
LibGDX is indeed good, this was a question me and my partner in crime asked 8 months ago, make an engine, or go with libGDX.

We went the route of making an engine. After 24,000 lines of code later we are somewhat ready to makes games. It took us monday to friday, programming 9 - 5:30 for past 8 months to get to this point. We have an editor, our own scripting language (incomplete) and an Engine that can port to pc (incomplete) via LWJGL and Android (complete). And unfortunately after all this hard work, we don't even come close to the features that libGDX provides.

Making an engine is not easy, it will require dedication, skill and utmost motivation. I recommend is go with libGDX or equivalent and don't waste time, start making games.
If you're still keen on making an engine i can recommend a few good reads.

Beginning Android Games - We started with this early on, an excellent book, based on early libGDX design.
Game Engine Architecture - Again, excellent read, it will pummel your mind on various ways to approach engine design.
Ericson Real-Time Collision Detection - If you're making an engine, you will need good collision detection that's both accurate and fast, this book is a very good read. Its examples are written in C though.
Programming Game AI by example - Very beginner friendly book, also a very good read for AI.
Game Physics Engine Development - If you plan to have physics and are not very good at math (like me) this book is also a very good read. The engine it develops is not optimal but it does give very good examples.

I hope I didn't scare anyone off. Making an Engine can teach alot. This past 8 months i've learned more developing this software than I did in 4 years of University doing Computer Science.

My experience writing an engine for my game has been pretty similar.  I've been working away at it in my spare time for about a year and half now.  After the last month of polishing I'm mostly at a point where I can start working on the actual content of my game.

I'm glad went the route that I did but then I like interesting challenges and the engines I initially investigated couldn't do what I wanted them to do.

I didn't learn nearly as much as my degree though its knowledge sure came in helpful.  The stuff I learned in the last 18 months while writing the engine was more orthogonal (applied) in nature.
22  Game Development / Game Mechanics / Re: Random thoughts: Extreme speed 2D collisions on: 2012-09-08 03:46:21
I think you're on the right path concerning quad-trees.  They only make sense in my opinion for static items.  I used an octree to great success for hit-testing terrain.
23  Game Development / Newbie & Debugging Questions / Re: Weighted average of colors [solved] on: 2012-09-07 06:53:31
No, RGB isn't a very good colour space for interpolation.

This is important.  Take, for example, converting to grayscale.  A simple linear interpolation might do something like ((r+g+b)/255.0*3) * 255 and set all the r/g/b components to that value.  It ends up looking like crap.

This works much better:
1  
2  
3  
val brightness = math.sqrt(0.259 * color.getRed   * color.getRed +
                           0.587 * color.getGreen * color.getGreen +
                           0.114 * color.getBlue  * color.getBlue)


There are many other similar formulas available.  It's because the human eye is more sensitive to certain colors than others:
http://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color
24  Discussions / Miscellaneous Topics / Re: Things you disagree with in the java language on: 2012-09-04 01:49:30
What I don't like are annotations.

At first they were just visual sugar but I knew that wouldn't last.  Now your code won't work if you're missing or have the wrong annotations.

As far as I'm concerned annotations are the equivalent of C macros.  Programmers can do anything inside them and the potential for misuse outweighs the advantages.
25  Games Center / Showcase / Re: some games i made on: 2012-09-01 19:43:31
Shoot Some Rocks ran smoothly in Safari on my MacBook Pro.  Fun little game.  I got to level 64.  Thanks for sharing!
26  Game Development / Newbie & Debugging Questions / Re: Alpha doesnt work on: 2012-08-30 18:18:53
Don't know if this will help but here is what I needed to do to get alpha textures in lwjgl.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
    glEnable(GL_BLEND)
    glDisable(GL_DITHER)
    glDisable(GL_FOG)
    glDisable(GL_LIGHTING)
    glEnable(GL_LINE_SMOOTH)
    glDisable(GL_TEXTURE_1D)
    glEnable(GL_TEXTURE_2D)

    //glShadeModel(GL_FLAT)
   glShadeModel(GL_SMOOTH)

    //glPolygonMode(GL_FRONT, GL_LINE)
   glPolygonMode(GL_FRONT, GL_FILL)

    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)

    glEnableClientState(GL_VERTEX_ARRAY)
    glEnableClientState(GL_TEXTURE_COORD_ARRAY)
    glEnableClientState(GL_COLOR_ARRAY)
27  Game Development / Game Play & Game Design / Re: Map Chunk system on: 2012-08-29 16:10:00
I did something like this once:

http://www.java-gaming.org/topics/negative-integer-division/25116/msg/215445/view.html

After probably spending a full week or more getting it to work and all of the side-effects (e.g. loading/saving) I ended up taking it out.  It added too much complexity for its benefit.

Unless your game is a sandbox game like Minecraft then too large of a world map (or a continuous one) is a drawback.  It's next to impossible to add enough meaningful content for the player.
28  Game Development / Game Mechanics / Re: Canvas: How do you make the Canvas as a chase camera for moving objects? on: 2012-08-28 18:37:40
Is your code what you have now or what you had before your changes?

In either case you'll need to process most of your objects each render pass (until you add viewport culling).

I would recommend storing the camera position e.g.:
1  
2  
int cameraX;
int cameraY;


Then your main render pass would appear as such:
1  
2  
3  
4  
5  
6  
for (entity <- all entities) {
  int xOffset = entity.x - cameraX;
  int yOffset = entity.y - cameraY;

  draw entity on your Canvas at (Display.width/2 + xOffset, Display.height/2 + yOffset)
}


Now you can either keep your camera stationary (fixed values) or update its position to be the location of your tracked entity each frame.
29  Game Development / Newbie & Debugging Questions / Re: LWJGL rendering problem? on: 2012-08-28 17:59:10
You need to actually store the existence of your shop in a variable somewhere.  Then read that variable during the render pass.

Right now you're triggering the display of your shop based on the mouse button state.  The input event handling and render pass is occurring 60 times per second.
30  Game Development / Newbie & Debugging Questions / Re: LWJGL rendering problem? on: 2012-08-28 17:48:31
I would recommend storing the last state of the left-button in a persistent variable somewhere.

1  
boolean lastLeftButtonState;


Then each frame while you are processing the input events, check to see if a state change (0 -> 1 or 1 -> 0) occurs.  This corresponds to a 'pressed' or 'released' event.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
boolean isLeftButtonDown = Mouse.isButtonDown(0);
if (isLeftButtonDown != lastLeftButtonState) {
  // a transition has occurred; determine what it is and trigger an event.
 if (isLeftButtonDown) {
    // pressed event; add your shop to the game state
 } else {
    // released event
 }
  lastLeftButtonState = isLeftButtonDown;
}


Then add handling to detect a 'pressed' event and add your shop.

Inside your render loop, check your game state for the shop and if it's present, display it.
Pages: [1] 2 3 ... 10
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 (77 views)
2013-05-17 21:29:12

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

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

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

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

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

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

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

kutucuk (178 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.247 seconds with 20 queries.