Hello everyone, just thought I would introduce myself. I am new here at the SFML Forums. I'm a beginning game programmer and have a small amount of experience with C++ and I know the basics of networking.
Which would be more suitable for a simple online pong game with a chat, UDP or TCP? And UDP or TCP for the chat too? Setting up multiple streams would probably be wise if I were to do so.
I'm lost with networking with my game loop. What I'm thinking is a design like:
main
engine::network::setup();
engine::game::run();
And for my Update method within my engine, and please note this is not real code and is just a design document:
engine::game::tick() {
while(myWindow.IsOpened()
while(myWindow.GetEvent())
currentState.HandleEvents();
engine::network::SendData();
myWindow.Clear();
currentState.Draw();
myWindow.Display();
}
}
}
Criticism is welcome
Also, should my server and client be separate programs? Or should I just assign a server to the person who starts the game? How would that implement into the loop?
Also, anyone with articles to share please share them