Jump to content

  • Log In with Google      Sign In   
  • Create Account


Matias Goldberg

Member Since 02 Jul 2006
Offline Last Active Aug 26 2014 07:20 AM

Topics I've Started

TCP's 3-way handshake... why not 2-way?

13 May 2013 - 01:09 PM

Hi everybody.
 
I'm writting a simple reliability layer on top of UDP. Not that I want to reinvent the wheel, just most of the data I'll be sending can be sent unreliable but there are bits of data every now and then that need to be sent reliably; and mixing tcp & udp gets even more troublesome.
 
For establishing a connection, I'm well aware of the 3-way handshake that TCP uses "SYN; SYN-ACK; ACK"
However, what I don't get, is why the third ACK is needed. Yes, I know it's the ultimate proof that the connection has been acknoledged by both parties; but I don't believe it's absolutely necessary.
 
This question has already been raised in StackOverflow, however the answers there don't satisfy me:
 
Let's see a communication without the 3rd ack:

Case: Client didn't get SYN-ACK
In this case, Server thinks the connection is established, Client think it's not. Just send another SYN from client until the SYN-ACK is received
 
Server may start sending data to client because it doesn't know the SYN-ACK got through. Client won't ACK that data because his connection isn't yet established, so server will continue to keep sending data over & over again until timeout. When the Client successfully gets the syn-ack; it will ack that data, hopefully before the timeout. If timed out, server-side it will just look like one connection timed out, and another came in. It's important that server doesn't use the SYNs from client as proof of heartbeat.
 
Typical view on this: The server needs to allocate resources (for tcp). More SYNs received -> more resources. However I send a random ID generated client-side with the SYN. That way the server identifies the SYN & IP with associated resources using that ID (and deals with client reconnecting and starting a new session as they'll change their ID; or with another client getting the same IP)
 
ACKs from normal messages always send the ID along the sequence number. So that if client reconnects (or new client got the same IP & port old client had) the server won't think an ack received from an old session is acknowledging packets sent from the current session.

 

A connection could be hijacked only if a machine gets the same IP address (and port), happens to use the same ID the other client has been using, and all happens before timeout (or there is a man in the middle that can see all data, spoof the IP, and still read the answers from server because he can see all data going to that spoofed IP).

But it's not like TCP is foolproof to hijacking either. Granted, this method is a lot easier to hijack because the ID, IP & port is repeated in every ack. Furthermore I'm interested in preventing "accidental" hijacking, not directed attacks.
 
The only disadvantage I can see: Potentially much higher bandwidth consumption (because the server may start sending data while client won't acknoledge it), while TCP needs to account for congestion control (which I don't care).
In TCP, everything is silent until SYN-SYN-ACK-ACK has been performed.

 

Bigger ACKs as a disadvantage could also be mentioned, but TCP overhead is already much bigger than UDP, and again, most of the data I'll be sending is unreliable (no need for ack), while every now and then I send some reliable data (needs guaranteed delivery, guaranteed to arrive in order)

 

 

Am I missing something? Why is the third ACK needed?

Thanks!


New site to get free (royalty free) music

19 March 2013 - 05:04 PM

Hi everyone! I don't usually advertise my own sites in a full forum posts, but my Dad's a musician and we're setting up a website for him to share his work under licenses similar to CC BY SA, so yes, you can use his music for your own video games (or film, or other projects) as long as you credit him properly (even if it's a commercial project!)

 

The site already! www.yosoygames.com.ar

 

We're still slowly setting up the site, he has ~80 tracks and counting (but we've only uploaded 19 so far); so let us know through here if you encounter bugs, broken links, can't access the page, just want to leave music feedback, or just thanks. We still don't know how well the server will cope with real load.

We're planning on adding ads & a donation button to support server costs; as well as keep uploading more of my dad's music.

 

Best regards to everyone!

Enjoy!


DOWNLOAD DEMO Distant Souls + Screenshots!

22 May 2012 - 08:19 AM

Some of you may have heard of it.

It's now time to officially announce the first Demo of Distant Souls!

http://www.youtube.com/watch?v=stZ4tLqeEV0

DOWNLOAD
MEDIAFIRE: PART I, PART II
DROPBOX: SINGLE FILE.

IndieDB: SINGLE FILE.

The game demo went into the Intel Level Up contest, but failed to run **sniff**. So now I need testing & feedback from the community.

I've been around in GD.Net for 6 years and many of you may be familiar with my virtual face as I'm always around the Techie forums.
Specially if you've been around the Ogre forums, you may already know about me, I'm always contribute to the Open Source community, be it Ogre Meshy, Instance Manager, Depth Sharing, or as tech support through forums, without ever asking anything in return.
If you still want to know more about my contributions to OSS, you can google my name and my alias (Dark Sylinc, dark_sylinc).


But this time I have big a favour to ask and get some of that love back. Currently I've been running through some tough financial difficulties, and my bets have been on Distant Souls. Being disqualified from the contest didn't help, while I'm also currently in the process of seeking government funding as well as potential private investors.
WANT TO HELP? SHARE on Facebook, FOLLOW the Twitter account,SUBSCRIBE to the Youtube channel. Every bit helps. The more subscribers/followers, the bigger your support. Spread the word!

Let everyone prove there's big, fun, quality game out there in the Indie scene.


You are not forced to do it, I don't expect you to do it; and it won't reflect my future contributions to Open Source projects, but it will help me. And I will greatly appreciate it Posted Image

Other ways you can help:
  • Does it run in your machine? Post all your 5 Logs, they are in the file %AppData%\Distant Souls. Also post all your *.rpl files there so I can reproduce your bug.
  • What do you think about the game?:
  • Do you like it?
  • Is it fun?
  • Was there something you spent too much time to figure out?
  • were you stuck?
  • Did you enjoy it?

Didn't enjoy it? Then tell me! You won't hurt my feelings! Games are an iterative process. We will work on it as many times as possible until we're all 24hs addicted.
This is valuable feedback and please post your results!

IF YOU OWN AN INTEL HD 3000 PLEASE SHARE YOUR EXPERIENCE WITH US!!! I'm 99% sure the game didn't run in the contest because of that GPU, even though, it's ought to be capable to run it.

System requirements:
  • Windows XP/Vista/7
  • Intel Core 2 Duo 2.2 GHz or better/AMD Athlon 64 X2 5000+
  • 2 GB RAM
  • NVIDIA Geforce 8 series or better / ATI Radeon HD 2000 series or better (Shader Model 3.0 compliant with full VTF support)
Unsupported Hardware:
The following hardware is known not to work. And it's really hard to support them, this list not likely to be reduced:
  • ATI Radeon X1000 series
  • Intel GMA 950 series
  • GeForce 6200 (??? needs confirmation)
If you need to contact me directly, you can do so at: dark_sylinc [at] yahoo [dot] com [dot] ar


Mandatory screenshots:
Posted Image
Posted Image

Posted ImagePosted ImagePosted Image
Posted ImagePosted ImagePosted Image
Posted ImagePosted ImagePosted Image


Plot summary:
Distant Souls takes place in the historical events in Dyrvingahl. Long before the start of the game, a dark being killed Nathan's parents, destroyed his entire village, and started a war between the Three Proud Nations.
15 years later little is known about the dark being and those few who track him down call themselves hunters; each hunting it for it's own personal motive.
Today, the world is in complete turmoil, many factions constantly form alliances to take over cities; lasting their control as short as the alliance was formed; while hunters have to make it's way through to reach their ultimate goal.
Player's hunters will have to face with the decision to involve in local affairs or stay distant as much as they can.

Hope you enjoy it!!
AND THANK YOU!

Memory Corruption: OMG Panic attack!

21 January 2012 - 05:47 PM

You're relatively close to deadline, run the program, all's ok. Suddenly crash (hopefully it was a crash). Turns out it's while freeing memory. You realize you have memory corruption.

OMG Panick Attack!!! you remove a piece of code that seems troubling, and everything's fine. Put it back. Corruption. Your heart starts beating faster than normal.

Is it that code?? Or is it that it's just triggering a deeper problem somewhere else completely unrelated???? Is it a recent bug or something you've introduced like, 3 months ago????

I've just had one. Luckily the troublesome code was actually the root cause of the problem. All is well now. I came here just to relieve my pain. I needed to get it out of my system by talking here with other programmers that will understand me. Stupid mistake by the way (like most of bugs).

Don't you hate that feeling? Memory corruption is one of computer bugs that creeps me most. All the other I can bust them pretty quickly; but corruptions are the hardest to fine. Sometimes I wish there were some kind of All mighty monitoring software that would raise an exception each time you get out of a single byte. May be enabling DEP would help? Yes, I know about Purify, tried the trial a month ago when I thought I had one. Didn't convince me at all.

Thanks for listenting. It's therapeutic :)
I feel better now

AI in a fighting game: Reactive or proactive?

17 December 2010 - 02:41 AM

Hi all GD.Net!

I'm new to AI programming (except pathfinding) but, as always, I'm doing my homework ;)
Now, I started to develop an action adventure game which I would describe it for it's mechanics as being in the middle between Kingdom Hearts and Prince of Persia 2008.
As in KH, players are teamed with 3 members.

And finally the time for the AI has come.
I'm using state machines, so far I'm really happy with it. For the two allies I have a "TeamMember" state which is working wonderfully, my partners are very believable mates and feel interactive.

For NPC enemies, I have an "Alert" state, which is a WIP as of today, but it's going in the right direction. For now they stand still with and when an enemy (i.e. the player) enter it's LOS it goes into "Battle" mode. In the future they will support patrolling. Another state (not written yet) will be called "Search" which happens when the NPC losts sight of the player's whereabout, and is looking for him to engage again (I find the idea of walking straight to the player's position as if it were a psychic or see through walls even when he's hiding horrendous) .
TeamMembers when engage their enemies, also go into the "Battle" state.

The game mechanics will allow melee attacks (with combos, already implemented), and magic attacks (close or distant, not implemented yet). There is a defend button. If the character hit the defend button with right timing, he will counter the attack (the combo is broken and both opponents are able to take a counter measure).

With this introduction to better understand how my game works, here comes the question of the topic:

Now what are your thoughts on the "Battle" state?, I want to hear your opinions.

Randomly smashing the attack button with random combo combinations until target is dead, eventually firing some magic seems stupid.
I was thinking of alternating proactive and reactive behaviors based on the following conditions:
* If the enemy is too aggressive in it's attack (many combos in a row, immediately started attacking), go to reactive mode. Most likely this means looking at what the player is doing or going to do, and play defensive, with a low random chance of countering.

* If the enemy is attacking, use some randomness to i.e. 1/4 of the time to go into proactive mode. But maintaining consistency with this randomness (don't switch to proactive in the middle of a defense, that would turn the reactive behavior useless and stupid). If the enemy is blocking or doing nothing, also go into proactive. The proactive state means choose a combo/spell and start smashing, while constantly evaluating if the enemy is about to perform something that could potentially change us to reactive. Note when two attacks clash, either both get damaged and blasted away, or only one attack prevails. The latter most likely scenario due to the game's logic.

What are your thoughts? Do you spot any potential problems with this design? Do you think I'm in the wrong direction?

So far the only problem I spot is that I have to be careful when my AI teammates battle against an NPC, they don't go both into reactive mode, teasing each other who's gonna start the first attack.
(By the way, the AI teammates can be replaced by cooperative multiplayer, but single player needs the AI)

I'm open to suggestions
Thanks

PARTNERS