Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
19 replies to this topic

#1 RipIt   Members   -  Reputation: 108

Like
0Likes
Like

Posted 27 September 2012 - 05:21 AM

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!

Edited by RipIt, 28 September 2012 - 01:40 AM.


Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 7837

Like
0Likes
Like

Posted 27 September 2012 - 05:35 AM

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.

Edited by Ashaman73, 27 September 2012 - 05:37 AM.


#3 RipIt   Members   -  Reputation: 108

Like
0Likes
Like

Posted 27 September 2012 - 07:21 AM

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?

#4 Serapth   Crossbones+   -  Reputation: 5592

Like
0Likes
Like

Posted 27 September 2012 - 10:59 AM

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.

Edited by Serapth, 27 September 2012 - 11:01 AM.


#5 RipIt   Members   -  Reputation: 108

Like
0Likes
Like

Posted 27 September 2012 - 11:20 AM

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?

#6 Servant of the Lord   Crossbones+   -  Reputation: 20360

Like
2Likes
Like

Posted 27 September 2012 - 11:22 AM

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? (I heard you groan just now - but you have to crawl before you can walk before you can run)
It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#7 Servant of the Lord   Crossbones+   -  Reputation: 20360

Like
0Likes
Like

Posted 27 September 2012 - 11:23 AM

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.

Edited by Servant of the Lord, 27 September 2012 - 11:24 AM.

It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#8 RipIt   Members   -  Reputation: 108

Like
0Likes
Like

Posted 27 September 2012 - 11:32 AM

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.

#9 Servant of the Lord   Crossbones+   -  Reputation: 20360

Like
0Likes
Like

Posted 27 September 2012 - 12:47 PM

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++: Can run the server, can run a downloadable client, can't run a webpage client
Python: Can run the server, can run a downloadable client, can't run a webpage client
Java: Can run the server, can run a downloadable client, can run a webpage client
Flash: Can't run the server, can sort-of run a downloadable client (with some work-arounds), can run a webpage client
Javascript: Can't run the server, can't run a downloadable client, 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).
It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#10 RipIt   Members   -  Reputation: 108

Like
0Likes
Like

Posted 27 September 2012 - 12:49 PM

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?

#11 RipIt   Members   -  Reputation: 108

Like
0Likes
Like

Posted 27 September 2012 - 12:51 PM

I posted the above as you were typing that up, sorry lol.

#12 Servant of the Lord   Crossbones+   -  Reputation: 20360

Like
0Likes
Like

Posted 27 September 2012 - 12:57 PM

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?

I'm assuming you posted this post before seeing my previous post.

Few notes about internet etiquet:
  • Bold, italic, or colored text is for emphasizing a few words in a sentence - not for highlighting your entire post. It's considered rude and pushy.
  • This is an internet forum, not a chat room, it takes time for people to respond - it's also considered impolite to bump your post after only a single hour. We're helping you make an informed decision, giving our time for free. Have patience! We don't get paid to sit here, we're doing other things at the same time.
  • We provide you with information so you can make informed decisions. If we told you, "Use python", it removes the burden of a decision from you, and while easier for you, doesn't help you know why python is a good choice. Remember, nothing is "better" or "best", just different and better suited to certain situations.

(Note: I am not a moderator, and I'm not giving you orders or commands - these are just general "How to be a proper gentleman when online" rules that apply to the entire internet)

That said, use python. Posted Image
(You just can't embed in in a website, as far as I know)

Edited by Servant of the Lord, 27 September 2012 - 12:58 PM.

It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#13 RipIt   Members   -  Reputation: 108

Like
0Likes
Like

Posted 27 September 2012 - 12:57 PM

I am thinking more like Runescape as i played this game since it first started to just recently. Except mine would obviously be much worse movement and graphics, even worse than when Runescape started, haha. Thank you so much for this information as it has helped me a lot.

So if i were to want to do the Runescape type game, i could use say Java for an online RPG text based as well as long term Runescape type game? So i could use C++ for the server side / game engine ? and Java as the actual game code ? i may be confused to this part still.

#14 Servant of the Lord   Crossbones+   -  Reputation: 20360

Like
0Likes
Like

Posted 27 September 2012 - 01:00 PM

Java could do the server, and the web-client. Minecraft uses Java, and Runescape uses Java.
Java could do everything you want, if you decide to invest time to learn it.

Text-only output maybe won't work too well, I'm not experienced enough with Java to say, but I'm sure a 3rd party library could help with that, if there is no native support.

Edited by Servant of the Lord, 27 September 2012 - 01:01 PM.

It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#15 RipIt   Members   -  Reputation: 108

Like
0Likes
Like

Posted 27 September 2012 - 01:04 PM


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?

I'm assuming you posted this post before seeing my previous post.

Few notes about internet etiquet:
  • Bold, italic, or colored text is for emphasizing a few words in a sentence - not for highlighting your entire post. It's considered rude and pushy.
  • This is an internet forum, not a chat room, it takes time for people to respond - it's also considered impolite to bump your post after only a single hour. We're helping you make an informed decision, giving our time for free. Have patience! We don't get paid to sit here, we're doing other things at the same time.
  • We provide you with information so you can make informed decisions. If we told you, "Use python", it removes the burden of a decision from you, and while easier for you, doesn't help you know why python is a good choice. Remember, nothing is "better" or "best", just different and better suited to certain situations.

(Note: I am not a moderator, and I'm not giving you orders or commands - these are just general "How to be a proper gentleman when online" rules that apply to the entire internet)

That said, use python. Posted Image
(You just can't embed in in a website, as far as I know)





I wasn't meaning to bold it, i was actually suprised by that myself, i didnt mean to or know i did.

I know, i am not trying to be pushy or even bump my thread i was just posting that comment in here since i had a thread going already instead of making a new thread, i was just curious that is all. Sorry if i came / come off as pushy or a jerk. not my intentions :/

#16 Serapth   Crossbones+   -  Reputation: 5592

Like
1Likes
Like

Posted 27 September 2012 - 01:12 PM

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



A few small corrections here. C++ can actually be used in the webpage, either via Google Native Client ( aka, a recent version of Chrome ), or through Alchemy. Of course, C++ isn't particularly a good choice for server side development, and Alchemy and NaCL both impose pretty heavy limitations.

Java can run on the server, native or in a webpage, but it depends on a Java plugin existing... this is a gigantic flaw though, as plugins are going the way to the dodo. Safari, Chrome and Internet Explorer all anounced they are dropping support for them in the future. This is already pretty evident on tablets, where Java in the browser is a non-starter. I surf with JVM support disabled, and encourage most others to do the same, so don't rely on the browser supporting Java.

Flash has the same limitations. Thanks to Steve Jobs war on Flash, expect it as a browser technology to be dead very soon. All ready you can't run Flash on millions of iDevices and Adobe dropped development for Flash for Android and BB10.

As to JavaScript, frankly, it is the best language in this scenario. JavaScript *CAN* run on the server, and with the rise of Node is becoming extremely popular. JavaScript runs on all browsers, with varying degrees of success, requires no plugins, and is frankly the future of web game development. All that said, it can be a right pain in the ass to develop for, and the browser DOM is a complete mess.

#17 RipIt   Members   -  Reputation: 108

Like
0Likes
Like

Posted 27 September 2012 - 01:17 PM

So if the support for Java in browsers is going to "die" what will then happen to such things like runescape or games like?

#18 RipIt   Members   -  Reputation: 108

Like
0Likes
Like

Posted 27 September 2012 - 01:45 PM

So pertaining to Text-based online RPG's i could use C++ for all of it, or i could use it for just the server side
-also i can use python for this as well?

Or i could use javascript for all my needs?

I feel like i may have missed something so im just trying to clarify

What would be the "best" language to create the following, if its this simple, im still a bit lost lol sorry.
Text-based RPG in a web browser:
Text-based MMORPG in a webbrowser:
2D top down RPG not in a web browser:
2D top down MMORPG:
2D topdown MMORPG in a web browser ( if possible ) :

Or:

Any other variation i may have missed which i was aiming for.

My short term goal would be to make a text based RPG either playable through web browser / download, while my long term would be 2D/3D RPG through how Runescape is, Browser based MMORPG.

Sorry i am just trying so hard to narrow down my topic / needs so i am not looking into the wrong language / direction for what i want. I am new to it and want to learn with long term goals in mind.

#19 Serapth   Crossbones+   -  Reputation: 5592

Like
0Likes
Like

Posted 27 September 2012 - 01:46 PM

So if the support for Java in browsers is going to "die" what will then happen to such things like runescape or games like?


They will require you to use a legacy browser, or they will turn their product into an app. Or, they will port to HTML5. Probably the last item.

#20 RipIt   Members   -  Reputation: 108

Like
0Likes
Like

Posted 27 September 2012 - 01:49 PM

What would that mean for graphics and game play / user accesibility? (the porting to HTML5 part)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS