Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: I'm about to start making my first game project.  (Read 2077 times)

0 Members and 1 Guest are viewing this topic.

laiden

  • Newbie
  • *
  • Posts: 1
    • View Profile
I'm about to start making my first game project.
« on: November 19, 2016, 02:06:56 pm »
Hey! I've been lurking for a while, but haven't really found any examples of Network Module packets and sockets that suit me.

I'm planning to make a 1v1 roguelike game (turn-based!)
What type of packets is preferable? There would be only two players and no other connections, but the player should be able to play with a friend without starting a server application externally. Just like Steam's co-op, or whatever. Preferably it should be as simple as possible: Player 1 starts the app and tells his username. This username is sent to a webserver and associated with IP address. Player 2 types in the username of Player 1, and connects to the Player 2. The game starts if both agree to it. Then data is being exchanged depending on the game state, etc.

How do you implement such thing? Can you point me in the right direction? Maybe a code snippet will do, thanks!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: I'm about to start making my first game project.
« Reply #1 on: November 22, 2016, 01:54:31 pm »
If this is really your first game, then you should focus on writing the game itself first.
Get your dungeon generation working, your game mechanics, the rendering, sound, asset loading, etc. Then you can start with the game logic, like how do you implement one game "round"?

Only after you have most of this running and you actually know how things should play out, you should start thinking about networking. If you don't know the difference between UDP and TPC or how you'd go about doing a simple multi-player, then I highly recommend you first study some resources on general networking. You need to understand the basics and can't just copy&paste some code or trial-and-error your way to a solution. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/