Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (601)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (649)
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  Game Development / Networking & Multiplayer / Feedback on reliable UDP implementation on: 2015-02-09 21:13:43
So, I've implemented a reliable UDP implementation. I am wondering if it can be improved. I don't care in which order the packets arrive. Here is the idea:

When the server sends a packet it sets the sequence number that is located in the end. If the packet is reliable it is stored at the index of the sequence number in an array.

If the client received a packet it first checks the sequence number. If it equals 0 then it's an unreliable packet - just handle it and continue. Otherwise, if it's not a NAK or a ping, the sequence number is compared against the last received packet's. If it is newer/more recent then mark every sequence number between the last and the just received as missing. Update the last received number and mark the packet as received.
Then, til a packet has been received, send NAK:s to the server with the sequence number of the missing packet.

If the server receives a NAK-packet then it just resends the packet as in the array of sent packets. If all packets sent to the client get lost, then there would be no chance of telling if a packet was sent. Pings solve this problem by consisting of the sequence number of the last sent packet.
2  Game Development / Newbie & Debugging Questions / Re: Encouraged model file format on: 2014-05-15 05:40:12
I would go with Collada - maybe it is slower to load, but it can contain a lot of informations, can be easily adapted to any needs and interpreter is easy to write.
Almost all games go with their own format. Then you just need to write a converter from Collada (for example) to your own binary format. The advantage is that loading them is lighting fast since you can format the data in any way you want.
After reading this I think I'll follow your advice theagentd. It'd suit my needs and beyond if I wrote a converter back to Collada.
Thanks for the quick replies!
3  Game Development / Newbie & Debugging Questions / Re: Encouraged model file format on: 2014-05-14 20:38:39
I'm using own wrapper around LWJGL, sorry forgot to mention. My needs are a triangle mesh and bone animations.
4  Game Development / Newbie & Debugging Questions / Encouraged model file format on: 2014-05-14 19:44:55
I'm really confused on which file format to use for importing models into my game. Currently I'm using .obj as the loader didn't take long to write and the format is "fully" supported. But that won't be sophisticated enough as I'd like to read up on and implement skinning.
Using Blender atm, but wouldn't want to limit myself. Some of the points I'm able to think of:
  • There's COLLADA the standard from Khronos. Not binary but ASCII based, so slower to load.
  • FBX; a closed project, making writing the loader painful. Blender's default FBX exporter doesn't seem to support the binary format so that'd make it slow as well.
  • 3ds is binary and looks great at first sight, but is outdated and replaced.
  • Or maybe just skip animations, keep working with OBJ and make a car racing game. Tongue
Thanks in advance.
5  Game Development / Newbie & Debugging Questions / Re: LWJGL - 0, 0 at Top Left, FBO issue on: 2013-12-17 21:00:11
To sum up, it's this I can't get to work:
6  Game Development / Newbie & Debugging Questions / Re: LWJGL - 0, 0 at Top Left, FBO issue on: 2013-12-15 13:08:22
Yes I know and that is the problem, as I want the coordinate system to be the same as in normal Java2D/AWT.
7  Game Development / Newbie & Debugging Questions / LWJGL - 0, 0 at Top Left, FBO issue on: 2013-12-15 10:32:28
I've been making my own sort of 2D game engine matching my code style for fun. As a personal challenge I tried to give it the ability to swap LWJGL with Java2D by changing one line.
I am really new to LWJGL, so upon implementing off-screen rendering with FBOs I noticed they weren't working when I had 0, 0 being the top left corner of the screen as in Java2D.

EDIT: basically I can't get this to work:

Here it is working and drawing a blue square over the firefox logo:

but here it isn't:

I enter ortho with this:
      glOrtho(0, width, height, 0, 1, -1); // 0,0 : top-left
      // glOrtho(0, width, 0, height, 1, -1); // 0,0 : bottom-left

      glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
      glViewport(0, 0, width, height);

and construct FBO:
      if (!GLContext.getCapabilities().GL_EXT_framebuffer_object) throw new Error("FBOs not supported");

      // Initialize frame buffer
      IntBuffer buffer = BufferUtils.createIntBuffer(1); // ByteBuffer.allocateDirect(1*4).order(ByteOrder.nativeOrder()).asIntBuffer(); // allocate a 1 int byte buffer
      EXTFramebufferObject.glGenFramebuffersEXT(buffer); // generate
      frameBufferID = buffer.get(0);


      // Attach a texture
      EXTFramebufferObject.glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,, image.getTextureID(), 0);

      check(); // Check (from LWJGL's tutorial on FBOs)


and FBO.bind:
      EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, frameBufferID);
      GL11.glViewport(0, 0, image.getWidth(), image.getHeight());

Thanks in advance. I'm really desperate for posting this as I have had this problem for weeks.
8  Game Development / Newbie & Debugging Questions / [SOLVED] LWJGL - Draw section of texture on: 2013-05-10 08:43:59
I'm new to LWJGL, and wonder how to draw a section of an image for example a spritesheet, in a 2d game. I have been browsing the internet and only found that you can have half numbers to
glTexCoord2f(0.5f, 0.5f);
Also does the textures dimensions need to be the power of 2, and can you draw a part 12x14 in dimensions of a texture.

Thanks in advance.
9  Games Center / Showcase / Re: Drift Soccer! on: 2013-05-09 16:52:15
Decreasing the friction would make more players move at the same time.
Pages: [1]
Jesse (12 views)
2015-07-29 04:35:27

Riven (35 views)
2015-07-27 16:38:00

Riven (18 views)
2015-07-27 15:35:20

Riven (20 views)
2015-07-27 12:26:13

Riven (11 views)
2015-07-27 12:23:39

BurntPizza (30 views)
2015-07-25 00:14:37

BurntPizza (41 views)
2015-07-24 22:06:39

BurntPizza (24 views)
2015-07-24 06:06:53

NoxInc (27 views)
2015-07-22 22:16:53

NoxInc (18 views)
2015-07-22 22:13:39
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 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!