Sign in to follow this  
Scouting Ninja

Could I use a raspberry pi as a server for a mobile game.

Recommended Posts

So starting a new mobile game and this time I want to add a proper leader board and allow players to retrieve profiles. For my first game I used Facebook to hold score, however the one score per player limit and the fact that you can only see the score of friends are annoying.

So now I wan my own server to deal with it except servers are expensive and I only need to store int and a copy of the Unity save.I have been thinking about getting my self a raspberry pi and turning it into a server for the mobile game, then I could also use it for my other mobile games if I want.

1.) Can I even use a raspberry pi as a server?

if I can

2.) How hard would it be and how long would it take more or less? (Assume I know nothing of networking.)

3.)What kind of maintenance am I looking at? I notice the rasberry doesn't have a cover or anything. It would have to run day in and out.

if I can't

4.) What are my other options?

I notice free server sites often forbid game hosting and only data storage, I think because then no one sees the adverts these sites use.

I really don't need much. Based on my projections from my other mobile games I think I am going to get around 500 - 800 players for about a month before it rapidly drops down. So I only need to store around 2000 player's data. Having my own server would make it easy to create more complex mobile games as I advance.

 

I am doing this for the experience so I don't mind if it's difficult or comes with some expense, I just don't want to spend thousands on this.

Share this post


Link to post
Share on other sites

The pi works as a great server for personal use, depending on what exactly you need it for. but if your expecting large volumes of people to play your game, the pi will most definitely not cut it. You could certainly start out with it though, and upgrade later. I have a couple pi's set up as servers at my house, ones even hosting a site (not a public site though)

Share this post


Link to post
Share on other sites
24 minutes ago, iedoc said:

but if your expecting large volumes of people to play your game, the pi will most definitely not cut it.

Lucky I am not expecting much. I think that it's going to take a long while before my games get decent downloads.

Thanks for letting me know it's possible.

Share this post


Link to post
Share on other sites
3 hours ago, Scouting Ninja said:

1.) Can I even use a raspberry pi as a server?

You can turn any computer to a server.

 

3 hours ago, Scouting Ninja said:

2.) How hard would it be and how long would it take more or less? (Assume I know nothing of networking.)

3.)What kind of maintenance am I looking at? I notice the rasberry doesn't have a cover or anything. It would have to run day in and out.

Hosting your own server (raspberry pi or not) involves dealing with making sure people from outside can access that box sitting under your desk. You'd most likely need to open up a port on your router. Some say it was that easy, but some others have said that they also need to call their cable provider to let incoming traffic into their home router. YMMV.

There exists tools like ngrok to let you tunnel in without having to deal with all above, but they may have certain limitations on the free version.

Maintaining a home server is not just making sure it has a cover. It is to also make sure it keeps on running, and your server app is not crashing under any condition. Power outages, network loss, DDoS are some of the things that you need to worry about.

Edited by alnite
grams

Share this post


Link to post
Share on other sites
1 hour ago, alnite said:

Maintaining a home server is not just making sure it has a cover. It is to also make sure it keeps on running, and your server app is not crashing under any condition. Power outages, network loss, DDoS are some of the things that you need to worry about.

Thank you for this, it's exactly the kind of information I need. In the past I hired a server and of course these things are easy to miss when other take care of them.

1 hour ago, alnite said:

You'd most likely need to open up a port on your router. Some say it was that easy, but some others have said that they also need to call their cable provider to let incoming traffic into their home router. YMMV.

Good to know. I remembered that I had problems with incoming traffic when I set up my render farm, so chances are I will need to look into this.

1 hour ago, alnite said:

You can turn any computer to a server.

I wasn't 100% sure the raspberry was a full computer. I remember when it first launched it was marketed as a platform for kids to learn python. Yet I think I somewhere seen someone mention that they used it as a server and I just wanted to double check.

I don't want to use my other computers as servers because it could be a risk and I need them for work. With a raspberry if something happens the cost of fixing it should remain low; unless my house burns down.:)

 

I have been reading up on the raspberry and it does look like a good option for a starter server, so I am going ahead with it.

Share this post


Link to post
Share on other sites
2 hours ago, Scouting Ninja said:

I don't want to use my other computers as servers because it could be a risk and I need them for work.

You're right that your server should not also be a workstation, for a whole bunch of reasons.  Consider though that as soon as you open the ports and invite connections into machines in your home, there's going to be some amount of risk involved.  What you could do is get one of those VPS-style hosting services like Digital Ocean or Linode or something and deploy your server on one of those.  You won't be inviting connections into your home network, don't have to worry about weird port forwarding or asking for a static IP from your home internet provider, etc.- but they do cost about $5/month minimum to keep them running.

Edit:  Also, consider that security on a server like that is hard to get right if you don't already know what you're doing- so offloading that task to a machine with nothing else of value on it would be a good idea.

Edited by trjh2k2

Share this post


Link to post
Share on other sites

Yeah your home router/ISP is a more troublesome issue than whether your server is a Pi or a PC :)

Many ISPs actually have a clause in the fine print that hosting any kind of service is not allowed ("please upgrade to a business plan"), so be aware that you might be sneakily doing something that could get you cut off. Likewise most ISPs will change your IP every time your router reboots, which is very bad when trying to maintain a stable server.

You can get free trials of virtual server hosting on Amazon or Azure. If you don't expect longevity you might be done by the time the trial runs out. Alternatively, you can get a virtual server with similar performance to a Pi but in a datacenter with a 1Gbps internet connection for under $5/month.. 

Share this post


Link to post
Share on other sites

Thanks for the advice. I contacted my service provider to check if I would be allowed to host, I explained to them what I needed and found out that under my current contract I would NOT have been allowed to host the server.

It turns out that switching to a contract where I can host costs less than $1 extra and gives me 2GB cloud storage with limited bandwith. I also had to remove a restriction on my modem that they guided me APN restriction?

They reassured me it isn't only for websites, a concern I had when they provided me with website building tools. I don't know how I feel about it.

 

On the one hand I now have every thing I need to keep score and store profiles, with good options to upgrade, don't need to maintain and it all costs less than a single dollar.

On the other hand I still have no idea how any of this works. They gave me software and some example code(Java and C++) to show how I would store data. That part works I made a C++ program to test.

 

I wonder if I should now still get the raspberry just to learn networking, then at the same time would I ever need to?

Share this post


Link to post
Share on other sites

Yes, a Raspberry Pi can be a "server" because a "server" is just a computing machine that responds to requests from other nodes on the internet according to some rules that you decide. A Raspberry Pi 1 is probably about the same compute power as the server computers that ran the game EverQuest, one of the first really big MMOs (back in 2000 or so.) That being said, a Raspberry Pi does not allow you to hook up very durable media -- the compact flash is not designed for constant reading/writing over long times. Perhaps a hard disk on USB could solve that?

What's harder is to figure out how those other machines would find your server. If you have a typical home Internet service, you have a single IP address, and that address goes to your router. You'd then have to port forward from the router to your Raspberry Pi. You'd then have to register a domain name, and make it map to your IP address. And, when your ISP changes your home IP address (which happens automatically every so often without warning or notice,) you'd have to update the DNS to map to the new address, and wait for DNS caching to expire, so some users couldn't find your server for a while.

This is why servers live in data centers. They can have a fixed IP address, and a squirrel chewing on your internet wire won't knock you offline, and a heatwave won't make your home computer suddenly overheat while you're not even there to do anything about it.

Using a web host of some sort is much easier. Even better is something like a virtual private server -- be it Linode ($10/month,) interserver ($6/month,) or Amazon Lightsail ($5/month and up, plus networking fees.) Of course, as your server needs grow, you will need to pay more for the server hosting.

 

So, your web hosting provider has a plan that lets you "host" somehow? It's hard to tell exactly what that means. It might be a small container / virtual machine. At that point, you could build your own service using whatever tech you want (C++, node.js, golang, python, erlang, C#, Java, Haskell, PHP, ...) and have your apps talk to your service. You still need to register a domain name, and make "api.yourgamename.com" or somesuch point to that server's IP.

Or you can use Game Center on iOS and Google Play Services on Android. Sounds simpler :-)

Share this post


Link to post
Share on other sites
11 hours ago, Scouting Ninja said:

I wonder if I should now still get the raspberry just to learn networking, then at the same time would I ever need to?

If you're looking to get into server development and management, get yourself VirtualBox (or VMWare) and set up local test servers as virtual devices on a local workstation in a virtual network.  You can play with everything you need that way, with backups (in case you mess up) and easy restarts (in case you mess up).  Study up on using Docker to wrap and provide your services, and that way you can build and test on your local  workstation-encapsulated server network and then migrate (publish) to your live server, with minimal risk and without change.

If you want to get a Pi, get a Pi.  You don't need a Pi to do any server development.  You can even run Docker on a Pi if you're serious about using one as a server.

Share this post


Link to post
Share on other sites
10 hours ago, hplus0603 said:

($10/month,) interserver ($6/month,) or Amazon Lightsail ($5/month and up, plus networking fees.) Of course, as your server needs grow, you will need to pay more for the server hosting.

So, your web hosting provider has a plan that lets you "host" somehow?

The prices they give me matches very near to what you listed above. So I think I have a virtual server with limited storage and bandwith.

I know that it works. Using the domain name I was provided with and sample code I can link my scoreboard with all the mobiles I have. It's not as convenient as Facebook because there was conflicts with the score board and one player appeared twice on the list. I don't know if I can change the domain name, it looks random generated using my name and some letters and numbers.

A quick search online shows that what I am doing wrong is sorting on the client side. I think this is a virtual server I have, as they did provide me with a sample that shows a basic employee profile login to the server.

3 hours ago, Bregma said:

If you're looking to get into server development and management, get yourself VirtualBox (or VMWare) and set up local test servers as virtual devices on a local workstation in a virtual network.

Thanks for this I am going to need all the practice I can get.

Share this post


Link to post
Share on other sites
37 minutes ago, Scouting Ninja said:

I don't know if I can change the domain name

You would need to register your own domain name, then you can point the name to whatever hosting you want.  Just google domain registrars, should be straightforward.  It is yet another small cost though.

Share this post


Link to post
Share on other sites
15 hours ago, Scouting Ninja said:

It's not as convenient as Facebook because there was conflicts with the score board and one player appeared twice on the list.

A quick search online shows that what I am doing wrong is sorting on the client side. I think this is a virtual server I have, as they did provide me with a sample that shows a basic employee profile login to the server.

You are starting to venture into the server-side development, knowing which logic to do on client vs server, how to prevent duplicate entries, and among many other fun things.

 

15 hours ago, Scouting Ninja said:

I don't know if I can change the domain name, it looks random generated using my name and some letters and numbers.

Once you have your own domain, it's just a matter of updating your CNAME record.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Forum Statistics

    • Total Topics
      627770
    • Total Posts
      2979002
  • Similar Content

    • By INTwindwolf
      COMPANY AND THE PROJECT

      We are an indie game studio consisted of professional and friendly people. Additionally, we are a team of skilled artists and dedicated indie enthusiasts. Our current project is INT, developed on Unity Engine 5 for platforms Windows, Linux, and Mac.

      INT is a 3D Sci-fi RPG with a strong emphasis on story, role playing, and innovative RPG features such as randomized companions. The focus is on the journey through a war-torn world with fast-paced combat against hordes of enemies. The player must accomplish quests like a traditional RPG, complete objectives, and meet lively crew members who will aid in the player's survival. Throughout the game you can side and complete missions through criminal cartels, and the two major combatants, the UCE and ACP, of the Interstellar Civil War.
      Please note that all of our current positions are remote work. You will not be required to travel.
      For more information about us, follow the links listed below.
      INT Official website
      Steam Greenlight
      IndieDB page
      Also follow social media platforms for the latest news regarding our projects.
      Facebook
      Twitter
       
      TALENT NEEDED
      We are looking for an Animator to join the Art team to create and polish animations for the game. You will be collaborating with fellow members of the team, and follow instructions from the Project Lead and the Animation team Lead in crafting smooth, flowing animations.
      As an Animator for this project, your duties would include:
      Create rigs to be used for animations. Skin 3D models to rigs. Contribute to constructive team discussions. Attend regular team meetings.  
      REQUIREMENTS
      To be successful in this position, following requirements apply:
       
      Have working knowledge of 3D animation suites. Understand import/export requirements for Unity Engine integration. Excellent self-management skills. Excellent attention to detail. Excellent communication skills. Preferred requirement:
      Knowledge of the Unity Engine UMA character creation system would be an advantage.  
      REVENUE - SHARE
      This is the perfect opportunity to get into the game development industry. Being an Indie team we do not have the creative restrictions often imposed by publishers or other third parties. We are extremely conscientious of our work and continuously uphold a high level of quality throughout our project.
      We are unable to offer wages or per-item payments at this time. However revenue-sharing from crowd-funding is offered to team members who contribute 15-20 hours per week to company projects, as well as maintain constant communication and adhere to deadlines. Currently the crowd-funding campaign is scheduled for the year 2018. Your understanding is dearly appreciated.
       
      TO APPLY
      Please send your Cover Letter, CV, Portfolio (if applicable), and other relevant documents/information to this email: JohnHR@int-game.net
      Thank you for your time! We look forward to hearing from you!
      John Shen
      HR Lead
      Starboard Games LLC
    • By KARTHI
      Now I am making 2d game in my home. I am so confused with the resolution.
      Please anyone help me to choose the resolution
    • By Nazar22
      Hello guys. I've finally build my first game and if you got some free time please play it
      You can email me (forevernils@gmail.com) so I can send you invitation to test the game. There is first two location in attach


    • By KARTHI
      Free software
       
      1. Lumberyard (Game engine) open-source and free tool
      Amazon Lumberyard is a free cross-platform triple-A game engine developed by Amazon and based on the architecture of Cry Engine, which was licensed from Crytek in 2015.
       
      2. Sculptris (sculpture tool) open-source and free tool
      Sculptris is a virtual sculpting software program, with a primary focus on the concept of modeling clay. It entered active development in early December 2009, and the most recent release was in 2011.
       
      3. Make human (game model creator) open-source and free tool
      Make human is an open-source 3D computer graphics software middleware designed for the prototyping of photorealistic humanoids. It is developed by a community of programmers, artists, and academics interested in 3D modeling of characters.
       
      4. Ipi soft (motion capture software) not free tool
      iPi Motion Capture is a scalable markerless motion capture software tool that supports 1 or 2 Kinect cameras or 3 to 6 Sony PlayStation Eye cameras to track a human action and convert it into a motion capture file
       
       5. Blender (Complete tool) for modeling, texturing and so on (open-source and free tool)
       Blender is a professional, free and open-source 3D computer graphics software toolset used for creating animated films, visual effects, art, 3D printed models, interactive 3D applications and video games.
                 
      6. Audacity (music editor) open-source and free tool
      Audacity is a free open source digital audio editor and recording computer software application, available for Windows, OS X, Linux and other operating systems.
                 
      7. Awesome bump (bump map editor) open-source and free tool (optional)
      Awesome Bump is a free program written using Qt library designed to generate normal, height, specular or ambient occlusion textures from a single image.
       
      8. Faceware (facial animation) not free tool
      Faceware Technologies is an American company that designs facial animation and motion capture technology. The company was established under Image Metrics and became its own company at the beginning of 2012.
       
      9. GIMP (image editing) open-source and free tool
      GIMP is a free and open-source raster graphics editor used for image retouching and editing, free-form drawing, converting between different image formats, and more specialized tasks. Through this you can also create bump maps
       
      10. Meshlab (mesh repair) open-source and free tool (Optional)
      MeshLab is an advanced 3D mesh processing software system that is oriented to the management and processing of unstructured large meshes and provides a set of tools for editing, cleaning, healing.
       
      11. LibreOffice (create documents) open-source and free tool
      LibreOffice is a free and open source office suite, a project of The Document Foundation. It was forked from OpenOffice.org in 2010, which was an open-sourced version of the earlier StarOffice.
                 
      12. Atom (coding software) open-source and free tool
      Atom is a free and open-source text and source code editor for macOS, Linux, and Microsoft Windows with support for plug-ins written in Node.js, and embedded Git Control, developed by GitHub.
                 
       
      Useful websites
      free image
                 
      Reference images will be found on Pinterest
       
      Free Sounds
       
      1.      Freesound.org
      2.      99Sounds.org
      3.      NoiseForFun.com
      4.      Incompetech.com
      5.      OpenGameArt.org
      6.      RaisedBeaches.com
      7.      Musopen.org
      8.      PlayonLoop.com
      9.      Bensound.com
      10.   SoundJay.com
      11.   Dig.ccmixter.org
      12.   Soundgator.com
      13.   Pacdv.com
      14.   Freesfx.co.uk
      15.   Soundtrack.imphenzia.com
      16.   Bxfr.net
       
      Download the free music tracks from these websites
       
      1. http://incompetech.com/music/
      2. http://dig.ccmixter.org/
      3. http://www.joshwoodward.com
      4. http://www.youtube.com/audiolibrary
       
      I hope this information will help full to you. I am got so stress to collect this data so don't waste it 
      🤗🤗🤗🤗🤗🤗🤗🤗🤗🤗🤗🤗🤗🤗🤗🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔
       
       
    • By rXpSwiss
      Hello,
      I am looking for a team to stop developing project alone and start doing bigger things.  I would like a team that is organized and serious even of it is just a hobby. I don't want a project to be dropped every week and the team to disband after 2 months. Even though it is a hobby the quality and complexity of the game should be on par with a game that would be released on a major platform.

      I have experience with UE4, Unity and making my own engine with OpenGL. I prefer UE4 for 3D and Unity for 2D but I am willing to work with both.
      Every one of the games I worked on (personal project) involve multiplayer and netcode, I used what UE4 provided but for unity I used Forge Remastered which gave me a bigger control on how to optimize everything.
      I play several instruments, know about game design and am able to do small modeling task but I am before everything a programmer.
      I play mostly competitive fighting games these days (SFV, MvCi, GG, T7) but before I started getting serious into these types of games it was mostly FPS (CS1.6, UT2k4, Quake 3) and Dota-like. As you can see I love competitive multiplayer games but I play solo games too. I have a preference for darker theme games(F.E.A.R, HL, Shin Megami Tensei/Persona, Last of Us, SH2, RE7) even though I play everything offering me a challenge or some peace (Don't Starve, Stardew Valley, Darkest Dungeon, Zelda etc).
      I do have several ideas for games with a very clear direction gameplay, marketing and art but I am not looking for a team to work on my ideas, I just have them if needed.
      Feel free to ask questions here or PM me if you prefer.
      Best regards,
      rXp
  • Popular Now