Author Topic: spontaneously multiplayer solution with tnet?  (Read 1666 times)

m_stolley

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
spontaneously multiplayer solution with tnet?
« on: June 02, 2014, 09:41:19 AM »
Hi,

i am sorry if this sounds totaly stupid and it is not easy to write this in english and hope you can understand what i want to know.

I would like to make some kind of ios game where the player is playing most of the time alone but can invite someone at each time to play with him at that point where he is now.
It will be some kind og rpg and i thought about to have a spawnpoint parented to the player that knows if he is in a position to spawn the second player savely.

So i do not need i list of servers or a room where they can meet before.
Just a button to invite someone of your friends to play with you.
I would also like to know on how to do this on a pc without some kind of gamecenter, maybe this is easier to think about as a beginning point.

Can i do this with ngui and do you have some hints on how to make this for a scripting beginner?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: spontaneously multiplayer solution with tnet?
« Reply #1 on: June 03, 2014, 12:33:15 AM »
To connect to a remote computer you need to know its address. So when you invite someone, you must start a local server, let TNet open up proper ports via UPnP (which may not be possible 100%!), and send your external and internal IP addresses to the person you're inviting.

The other person will then try to establish a connection with you by using those addresses. Once a connection is made, you can join the same channel and start communicating. Note that the best way to achieve what you're trying to do is to make sure that your game is designed with multiplayer in mind, and it's going to be very difficult to do this without first understanding the basics of TNet and how to sync data. Start with simple things first. Once you understand how data is sent via TNet and how to make it persistent you should have a solid understanding of what's needed to achieve what you want with your game.