Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 25 Dec 2012
Offline Last Active Jun 10 2013 06:24 AM

Posts I've Made

In Topic: How do I rotate a rectangle with the four vertices

08 January 2013 - 05:15 AM

Equation for rotating a point around a center:
(x2,y2) = resulting rotated point
(x1,y1) = original point before rotation
(xc,yc) = center of rotation
x2 = xc+(x1-xc)*cos(angle)-(y1-yc)*sin(angle)
y2 = yc+(x1-xc)*sin(angle)+(y1-yc)*cos(angle)

In Topic: Networking

08 January 2013 - 05:04 AM

I've thought about this myself and I think it depends on the type of 1v1 game. If it is real-time action, I would suggest researching GGPO and how it has gained its reputation as having the best latency hiding netcode for 1v1 fighting games. http://en.wikipedia.org/wiki/GGPO


I can't find any clear implementation discussions but from the looks of it, it is should be possible to implement it based on the clock synchronization GDNet article here:



Basically in GGPO, all keys are sent peer-to-peer with a timestamp and from that timestamp, you can figure out what the peer's current state should be like on your screen at the current time. A history of events will need to be kept for all entities and if something is off by a game-affecting amount, a state in history is chosen and the correction is predicted and applied.


For something like this, you'd basically have to dabble at the socket level.