Beginning C++ / SFML--Goal is 2DtopdownRPG-basicMultiplayerOnline

Started by
18 comments, last by RipIt 11 years, 6 months ago
Sooo..Not sure quite where im going with this but my goal by the end of next year is to make a BASIC 2D top-down RPG that allows users to go to a website and login and play the game online with other players.

I am learning C++ and SFML. using code::blocks


Thank you for all the help and i hope this is a good explanation of what i want / am asking you.

Any help/suggestions/tips/guides will be wonderful thank you!
Advertisement
With a blu-ray burner instead of a dvd writer it should work...

Just kidding. The truth is, nobody could tell you yet. How about coding your game first, then do some testing and once you reach 100 concurrent players, revisit your hardware. I won't be surprised if your internet upstream capability will be the bottleneck.
How would i go about setting up a server for that situation i guess is my problem / question. What are free resources i could use to host it on a server i have at my house?
To be completely honest, C++ and SFML are both bad fits for what you are trying to accomplish.

SFML is not a browser friendly technology and this isn't an area where C++ is really targeted. I did do a tutorial on connecting an SFML C++ client to a NodeJS based server that might give you some insights in to simple network programming with C++. ( Very simple, it is a high score board ).

However, for single developer server side development, C++ is a lousy fit. It will take you 10-100x times longer than working in a higher level language like JavaScript, Python, Ruby, etc... More importantly, C++'s strengths dont really come in to play. You code isn't going to be bound by CPU, but instead the network.

As to the client. SFML doesn't and cannot run in the browser. Period. SDL can through native client, but that is Chrome only.

JavaScript is a much better fit in this capacity, but Flash and Unity are two other alternatives.
Ok, so in order to make a multiplayer 2D online topdown RPG Javascript and python would be better?

I thought C++ was used to make tons of games now a days?
The thing with "can my computer handle this", is it entirely depends on what you are doing. Descibe the end result doesn't describe how your server will actually work under the hood, and it's the under-the-hood that determines the cost.

As a rough guess, I would say, yes you could support a userbase of 100 easily with that (bearing in mind that only 10% or less of your userbase will actually be on at the same time, on average).

When a friend and I were running a small 2D top-down RPG a few years back, we had up to 20 people online at the same time without a problem, and this was six years ago, so worse technology. Sometimes he even ran the server off an old laptop, over WiFi. The laptop ran it fine, the WiFi choked it up. Sometimes he'd stream video while the server was running, and we'd lag like crazy.
The old laptop wasn't the problem, but the WiFi or video streaming was - the bandwidth of the server was more important than the hardware, for our little 2D game. But it fully depends how you make your game, not the feature list of the game, but the implementation details.

Can I poorly make a junky game that uses all of my computers resources? Yep.
Can Call of Duty: Modern Warfare 3 run on my computer just fine? Yep.

It's how it works under-the-hood that determines the needed server hardware, not the "feature list" but the implementation details. Make your game, without worrying about it, then refine and rework your game as needed only when you hit the limitations.

However, if this is your first game you are making, then you are probably overshooting yourself anyway, and the server hardware is the least concern. Adding the words "Basic" and "Small" doesn't mean "easy to create".
"I'm going to create a BASIC car from scratch. Just a SMALL car that only drives around the block. I don't have any experience with engines, but it's just a SMALL/BASIC car, so I figure I can knock it out in a year or less." - Making any kind of car is difficult. Making any kind of game is difficult.

  • Basic Game = Sort-of difficult <- You should be starting here
  • Non-basic game = Difficult
  • Turn-based RPG = More difficult
  • Action-based RPG = Even more difficult
  • Online game (only 10 people at once) = More difficult
  • Online game with persistence = Super difficult
  • Online RPG = Super duper difficult <- You are aiming here


Aim high, long-term, but start small short-term.
Have you already made Pong or Tetris? ([size=2]I heard you groan just now - but you have to crawl before you can walk before you can run)

Ok, so in order to make a multiplayer 2D online topdown RPG Javascript and python would be better?

I thought C++ was used to make tons of games now a days?

The right tool for the right job. C++ isn't the right tool for web-based games. Java or another language or tool is.
This help's a lot. Yes i want to start with a "simple" and "basic" game. i guess it just seemed a bit too simple in my head and i like to push ahead for results of what i want (impatient) lol.

So with your post and the prior post about c++ and SFML, would c++ and sfml be the ideal language to use / continue learning for a BASIC GAME and then move to an online RPG (eventually)?

I haven't made tetris or pong yet, i am deployed right now and i cant download the SFML due to blocked sites / restrictions on downloads :/

I am just reading C++ for dummies and using the contained CD with code::blocks and various internet sites for help like this site and cplusplus.com

It's really just a learning phase and planning phase for things i would like to happen when i get back with making games like tetris and pong in between then and hopefully if time permits a tiny 2D basic game.
First: Thanks for being deployed. If you can't download things from certain sites (bandwidth limitation, or filter?), once you come to a definite conclusion, you could decide what downloads you want, and ask a family member to download them onto a cheap flashdrive (it'll all fit into a 4GB drive, $10) and mail the flashdrive to you, if this doesn't violate your base's security rules (ask your superiors!).

Second: If your goal is a RPG that runs in a browser, but your first goal is learning how to program, you'd probably want a language that can help with both those goals.
C++ cannot run in the browser. It can be used for the server-side, but not the client-side, unless the client is on the user's PC (like Everquest) and not in a webpage (like Runescape).

C++: [color=#008000]Can run the server, [color=#008000]can run a downloadable client, [color=#800000]can't run a webpage client
Python: [color=#008000]Can run the server, [color=#008000]can run a downloadable client, [color=#800000]can't run a webpage client
Java: [color=#008000]Can run the server, [color=#008000]can run a downloadable client, [color=#008000]can run a webpage client
Flash: [color=#800000]Can't run the server, [color=#008000]can sort-of run a downloadable client (with some work-arounds), [color=#008000]can run a webpage client
Javascript: [color=#800000]Can't run the server, [color=#800000]can't run a downloadable client, [color=#008000]can run a webpage client

It's not unusual for the server to be coded in a different language than the client - but if you are a beginner starting out, this does add complications for you.
Perhaps others can offer additional suggestions, or correct any mistake I might've made in the above - My experience is primarily C++ with only a little Python and very little Javascript, so I might've gotten some details wrong.

C++: Hard-ish to learn, but still definitely doable. More "closer to the metal", requiring more code to do less, and making for slower development time, but gaining faster speeds.
Python: Easier to learn. Runs fast, but not as close to the metal which means faster development time (less code to do more).
Java: My impression is that it is somewhere between C++ and Python in terms of difficulty and development time, but I've never used Java, so this is speculation.

Your game's goals:

  • 2D, online (100 person community, 25 or less on at once), RPG, in a webpage.

Your game's requirements:

  • Client speed isn't an issue (it's 2D).
  • Server speed isn't an issue (it's 25 or less people).
  • Client needs to run in a webpage.


Using the knowledge above, you choose the right tool for the right job, from multiple options available, while keeping in mind both your short-term (Learning programming through Pong or Tetris or another small game or two) and long-term (Small online RPG) goals.

If you are set on your game running within a webpage, it would seem to me, as someone who never made webpage games, that Java might be the best choice.
If you are willing to have your game run on the user's PC instead of in a webpage, I'd recommend Python, but C++ would also work (it'll just take longer).
Would C++ be a good language to make a text based RPG / online text based RPG in?

I would like to stick with one language through the whole process and not differentiate if at all possible, like use c++ from a basic game, text based RPG to a 2D graphics based ONLINE RPG, but if i cannot do this with C++ easily / at all

What language should i use for a text based rpg online game?

This topic is closed to new replies.

Advertisement