What would be the software architecture of a videogame? - unity3d

I'm developing a videogame under Unity. I've been asked to describe the software architecture of my project. My videogame won't be using databases nor it will be connected to a server, it is a platform adventure kind of game with one player.
I have heard of other architectures like client-server, peer-to-peer, service-oriented, but can't find the one that truly fits a videogame.

Without further informations nobody can help you. You need to tell us more about your game.
But I guess you program a multiplayer.
Client-Server
In short every player (client) will connect to a server and this server will mostly do all the work what happens in your game.
Peer-to-Peer (P2P)
Here, there will be only one host (server) and every client will connect on it. Because of this, there will be some problems if the host is far away from the clients and more. Basically if you are the host it is much easier to cheat because you are the server.

Related

Unity Matchmaking how it works / dedicated Server

I create a 2D ffa multiplayer game for android with Unity/Netcode. Now my question is how i could set up a dedicated Server with matchmaking. Do i have one Unity instance who is waiting for requests. And when it received enaugh question. It creates a new Unity instance as 'real' server and send pack the port. But we only have around 64k ports. So i would realy intrested how at the end, the server is started. Or is there only one Unity instance with multiple game Scences? I know unity has a hosting/matchmaking service. But i have not much money. And i want run specific code on Server for other stuff in the game for example database and a Trading system. Maybe somebody has an idea.
Thanks for your time.Lyksel
I was thinking of openmatch but i didn't find out if i can use it on a dedicated server.

Unity5 - Make a server only for multiplayer game

I followed the Unity tutorial of an online multiplayer game (here), and the architecture is the following :
But I would like to have this architecture :
I would like to really separate the client part and the server part in an online game. I'm new with Unity and especially with online multiplayer game and I really don't know how to do that. I don't want the solution, but maybe idea of how to do that.
Thanks a lot for helping me.
I am surprised you didn't learn the Tut and post this question. obviously you can make separate server.
As unity UNet basic concept stated:
In the unity networking system, games have a Server and multiple
Clients. When there is no dedicated server, one of the clients plays
the role of the server - we call this client the “host”
Three Modes of UNet Multiplayer Game:
A Networking multiplayer game can run in three modes - as a client, as a dedicated server, or as a “Host” which is both a client and a server at the same time. Networking is designed to make the same game code and assets work in all of these cases. Developing for the single player version of the game and the multiplayer version of the game should be the same thing.
NetworkManager has funcions for entering each of these modes:
NetworkManager.StartClient()
NetworkManager.StartServer()
NetworkManager.StartHost()
Check UNetManager for more details
You can open a Unity instance as a dedicate server.
NetworkManager.StartServer();
However for current state of UNET you can only have 1 room per Unity instances.
Which mean if you want to open many game room at the same time it'll cost you a lot of hardware.
Run as headless mode (No GUI) will help you a bit but that's not enough (Currently I've done that on DO).
So my recommendation is don't use UNET if you want massive users on your game.

How to create a Mac/PC server app that interacts with iPhone/iPad App?

Can someone please point me in the right direction to create a Mac/PC server app that runs in the background and connects to an iPad app over the local WiFi network?
No matter how I phrase a search on Google it just brings up various apps like Remote Mouse and whatnot and no tutorials or even a hint of where to start.
I just need to send simple commands from iPad to computer over local wifi. A point in the right direction and I can likely fill in the blanks.
Thank you.
Thomas
EDIT: I am using web languages for the iPad version that I will build as a native app using open source tools.
OK, then. It actually depends on what you really need. I made the assumption you need real-time and perhaps binary data transfer.
Your best bet is to write your server application using standard C or C++ so it compiles on both as simply as possible.
If you want to avoid all the burden of writing a protocol for service discovery or asking users to enter the ip address of your server you will use a mDNS implementation for your server and your iPhone app.
If I were you I would try bonjour: http://www.apple.com/support/bonjour/
on iPhone You could start here: http://developer.apple.com/library/mac/#documentation/Networking/Conceptual/NSNetServiceProgGuide/Articles/PublishingServices.html
Once you have your sockets you will have to implement a networking protocol between your server application and your iPhone app.
You will have to be careful about byte ordering and little subtle problems with latency, disconnections and other problems inherent to networking and WiFi.
In windows you will want to register your application as a service and in Mac OS X/UNIX you'll probably want to deamonize it.
Good luck!

Synchronization in multiplayer networked game?

Recently I have been working on a multiplayer networking app. I had successfully implemented the client server model using Bonjour services and NSStream objects. The two way communication has been done successfully.
The problem I'm facing is: the two devices running the app are connected via local wifi. There is a latency problem while sending the messages from client to server and vice versa.
Describing in brief:
It's a car racing game with at most two players.
One server and other client.
When client press the buttons a particular message is sent to the server telling which key or button was pressed. Then the server responds accordingly and make changes on the client's car on the server itself. These changes are not always the same. There is always a difference between the actual location of the car on the client's screen and that in the server screen.
Any ideas?
Welcome to the world of networking. :)
These are the classic difficulties with game networking programming. There's a lot of different techniques to overcome these issues.
This blog has great info on the subject and will probably help you out.
http://gafferongames.com/networking-for-game-programmers/
You may be specifically interested in this article:
http://www.gafferongames.com/networking-for-game-programmers/what-every-programmer-needs-to-know-about-game-networking
Good luck!

peer-to-peer multiplayer game with xmpp

I'm fairly new to multiplayer games. I have made a few for my own fun, but nothing profound.
Anyway, I want to make a game that is very cross-platform. The clients would be connected with their facebook accounts on the devices I release the game for (most likely computers (via flash), iPhone, and android). I am a solo developer on a shoestring budget (actually more like no budget). So, I want to make the game with a peer-to-peer connection. I would like to avoid using a client/server setup because of the cost to maintain a server. The problem I am running into is there is no way to connect peers over the internet, and the game is not meant to be played over a local wifi.
So, I have an idea. Can I use facebook's built in xmpp chat to send the game's multiplayer communication over the internet? I have head of xmpp being used for multiplayer games before. Does anyone have any other ideas? I understand that xmpp can be connected peer-to-peer, but can it be done over the internet somehow. I don't want the users to have to mess with router settings to play.
Thanks for your help!
The main problem in P2P systems are NATs and firewalls. Firewalls can be locally opened, NATs cannot in 99% of the cases. In the IPv6 world there will be no NATs, so P2P will be free for all.
Now you want to use Facebook's XMPP APIs for P2P multiplayer. Well... Facebook's XMPP is practically client/server because of the above reason. All Facebook's APIs do is to hide the transport layer to applications, meaning that you can send messages to "another user" while they actually transit through Facebook server. Skype is another example of P2P+server environment. If two users stand behind a NAT, it automatically uses a proxy server.
This is mostly the same with FB's XMPP, so you can go with that, unless your facebook users will see lots of strange messages in their chat window :)
I think you cannot build a multi-player game just by using facebook jabber servers. You will need to have a custom jabber component sitting at your own server to enforce your game business logic on the xmpp packets transferred between the game users.
This will (probably) involve writing custom Jabber Component Protocol XEP-0114 and Bosh Connection Manager component at your end. If you are looking to use PHP for developing your application you can have a look at Jaxl library (XMPP component and client library in PHP)