🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

What should I learn to create a HTTP server with C# for games?

Started by
10 comments, last by 8Observer8 4 years, 6 months ago

Hello,

I'm new to server programming, I have beeing creating small Unity games using C# (the only language I know), and now I need a simple server just for players to login and save their progress, maybe also generate some random numbers for gameplay.

The server doesn't need to repond to clients very quickly, and doesn't need to maintain a connection with clients either, only clients call the server when needed. And I don't want to go directly with lower level socket programming. I think a HTTP kind of server may just do the work (I also use HTTP modules on the client side).

So in this case, I want to know what should I learn, or whether there are some frameworks / architectures I can leverage. Shall I learn ASP.NET? But it's for game, there will be no web page involved. I'm totally new to server programming, so I'm sorry if I ask the question in a wrong way.

Btw, I don't want to use some game server engines like Photon or Unity network features, just want to build something of my own (but it's also good if there are some frameworks / architectures I can leverage).

Thank you very much for checking out my question.

Advertisement

Anything that creates or serves a web page can do it.

It's rather difficult to say what you should learn, because you could learn just about anything.

You can program int in asp.net if you want. You can use PHP if you prefer. If you've got a server like Apache you can write server-side modules or leverage existing extensions to generate data. You can use the language of your choice to implement servers, there are many Java frameworks, or Python, or Ruby, or Go, or Rust. Or, if you already run a web site using something like WordPress or Drupal, they have ways to program on them, too.

Since you know C#, you could build a .Net Core api. There are a lot of examples online and it's not hard to setup at all. The only downside is that I don't know if there exists completely free hosting platforms. If you're willing to learn a little bit of Javascript, you could build a simple api project using Node js and Express; furthermore, you could host said app for free using a platform called Heroku. Hope this helps!

ASP.Net Core works well for sharing common code between Unity projects and a web service. Using this at work on my current project and it's much nicer than having to maintain a separate PHP codebase for the server.

cesco1286 said:

Since you know C#, you could build a .Net Core api. There are a lot of examples online and it's not hard to setup at all. The only downside is that I don't know if there exists completely free hosting platforms. If you're willing to learn a little bit of Javascript, you could build a simple api project using Node js and Express; furthermore, you could host said app for free using a platform called Heroku. Hope this helps!

Thank for the thoughtful tip, when I searched online, I found most of the game server solutions were not C# related, and there were even fewer results can be found when I combined the "game + server + C# + HTTP" key words together, unless absolutelly needed, I'd like to stick to .net :D

frob said:

Anything that creates or serves a web page can do it.

It's rather difficult to say what you should learn, because you could learn just about anything.

You can program int in asp.net if you want. You can use PHP if you prefer. If you've got a server like Apache you can write server-side modules or leverage existing extensions to generate data. You can use the language of your choice to implement servers, there are many Java frameworks, or Python, or Ruby, or Go, or Rust. Or, if you already run a web site using something like WordPress or Drupal, they have ways to program on them, too.

Thank you for the information. I now have a clearer picture. I think I'll check out some solutions based on languages / frameworks other than .net as much as possible, since the ideas can be same useful even I'll focus on .net.

Nypyren said:

ASP.Net Core works well for sharing common code between Unity projects and a web service. Using this at work on my current project and it's much nicer than having to maintain a separate PHP codebase for the server.

That's wonderfull if it can share common code between Unity projects and a web service. I'll dig more into that, thank you so much for the help.

cesco1286 said:

Since you know C#, you could build a .Net Core api. There are a lot of examples online and it's not hard to setup at all. The only downside is that I don't know if there exists completely free hosting platforms. If you're willing to learn a little bit of Javascript, you could build a simple api project using Node js and Express; furthermore, you could host said app for free using a platform called Heroku. Hope this helps!

BTW, "host said app for free using a platform called Heroku", what is a "said app"? Do you mean REST or web app?

megarfield said:
cesco1286 said:

Since you know C#, you could build a .Net Core api. There are a lot of examples online and it's not hard to setup at all. The only downside is that I don't know if there exists completely free hosting platforms. If you're willing to learn a little bit of Javascript, you could build a simple api project using Node js and Express; furthermore, you could host said app for free using a platform called Heroku. Hope this helps!

BTW, "host said app for free using a platform called Heroku", what is a "said app"? Do you mean REST or web app?

I was just referring to the app that you would build ?

cesco1286 said:
megarfield said:
cesco1286 said:

Since you know C#, you could build a .Net Core api. There are a lot of examples online and it's not hard to setup at all. The only downside is that I don't know if there exists completely free hosting platforms. If you're willing to learn a little bit of Javascript, you could build a simple api project using Node js and Express; furthermore, you could host said app for free using a platform called Heroku. Hope this helps!

BTW, "host said app for free using a platform called Heroku", what is a "said app"? Do you mean REST or web app?

I was just referring to the app that you would build ?

xD sure, thank again for all the replies.

This topic is closed to new replies.

Advertisement