Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (569)
Games in Android Showcase (154)
games submitted by our members
Games in WIP (618)
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: https://gist.github.com/pwnedary/8012530.
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: https://gist.github.com/pwnedary/8012530

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

but here it isn't:


I enter ortho with this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
      glMatrixMode(GL_PROJECTION);
      glLoadIdentity();
      glOrtho(0, width, height, 0, 1, -1); // 0,0 : top-left
      // glOrtho(0, width, 0, height, 1, -1); // 0,0 : bottom-left
      glMatrixMode(GL_MODELVIEW);

      glEnable(GL_TEXTURE_2D);
      glShadeModel(GL_SMOOTH);
      glDisable(GL_DEPTH_TEST);
      glDisable(GL_LIGHTING);
      glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
      glClearDepth(1);
      glEnable(GL_BLEND);
      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
      glViewport(0, 0, width, height);


and construct FBO:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
      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);

      image.bind();

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

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

      image.unbind();
      unbind();


and FBO.bind:
1  
2  
3  
      EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, frameBufferID);
      GL11.glPushAttrib(GL_VIEWPORT_BIT);
      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
1  
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]
 
Riven (22 views)
2015-04-16 10:48:47

Duke0200 (35 views)
2015-04-16 01:59:01

Fairy Tailz (27 views)
2015-04-14 20:13:12

Riven (28 views)
2015-04-12 21:36:37

bus hotdog (45 views)
2015-04-10 02:39:32

CopyableCougar4 (46 views)
2015-04-10 00:51:04

BurntPizza (46 views)
2015-04-06 22:06:58

ags1 (50 views)
2015-04-02 10:58:48

Riven (49 views)
2015-04-01 18:27:05

ags1 (66 views)
2015-03-31 10:55:12
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

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27
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!