Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 1 more developer from Canada and 12 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!


phayer

Member Since 27 Jun 2012
Offline Last Active Apr 15 2014 02:45 AM

#5139704 Threading and networking

Posted by phayer on 17 March 2014 - 08:36 AM

So I'm stuck, and can't seem to figure out what the "right way" to solve this is.

 

I'm using enet - and the "enet_host_service" which takes care of sending and receiving data takes a timeout, like 10ms or 5000ms - whatever. The problem is; how large should this be? 1ms?

 

Cause the wait freezes the rest of the thread, of course. But if I have two threads, one that reads from the top of a list(simulation) and another one that writes to the bottom of the list(network) - wouldn't that impact performance hard and in some cases cause problems with locking?

 

Another thing I thought about was using zeromq(zmq) internally as I then don't have to think about locking, but I'm very unsure about zeromq when it comes to latency.

 

Any suggestions?




#5045328 How to fight lag?

Posted by phayer on 21 March 2013 - 12:07 PM

Hi,

 

over the past weeks I've been trying to get the basics of how to "fight lag" implemented. So far things are going veeery slow, and I think I might have attacked it from the wrong angle.

 

Here is what  I have today;

The server sends a update every 1/25th of a second. This updates includes; Ack, Ackbitfield[From www.gafferongames.com], Object ID, Position, Velocity. The client wait till it has received 10 packets before it starts rendering.

 

Now here it all stops and I'm sitting here with all these questions... How should I render it client side? I've tried to re-implement gafferongames code but I just can't seem to get it right, I still have plenty of jitter and lag - and that is when testing locally. 

 

Why should I re-send a "position, velocity" packet from the past? I just can understand why I would send a position, velocity packet that is already in past time.

 

When receiving a packet on the client, should I include a time stamp from the server or should I use the clients time? Should I synchronize the time between the client & server? If so; how?

 

How should I handle player input "from the past"? Since the client is rendering 1/25th * 10 later than the server, how should I handle shooting? Like the player shooting a zombie that was there 1/25th * 10 of a second ago on the server but is currently right in front of him on his screen.




#5040380 Xna or Unity for first rpg?

Posted by phayer on 07 March 2013 - 07:28 AM

I would rather say MonoGame or Unity. MonoGame is a "clone" of the XNA framework with the added features of support for Linux and OSX, and more to come in the year.. Atleast that is what they MonoGuys are promising.. But still, all the things pointed out above still stands in a MonoGame vs Unity "battle"..




#4955566 What should I program with?

Posted by phayer on 04 July 2012 - 02:56 AM

Q: What to program with?
A: A text-editor, a compiler, and your brain.

But if you meant like what language this might turn in to a little war. But anyway, this is the way I took into programming was; VB6, touched VB.Net, PHP, C++, C# - and I'm always peeking into python and ruby.


PARTNERS