Sign in to follow this  
Unlovable1337

Where should I start? (2D Game Programming)

Recommended Posts

A few friends of mine, and myself have been wanting to create a 2D multiplayer game. We don't know where we should start really? We just want to make a basic 2D game where we can all communicate with eachother through a server. Any help on where to start?

Share this post


Link to post
Share on other sites
Eck    7581

If you haven't written any games yet, starting with a multiplayer game is too big of a first step. Jumping straight into network game programming will over complicate things.

 

Here's a great article for starting out:

http://www.gamedev.net/page/resources/_/technical/game-programming/your-first-step-to-game-development-starts-here-r2976

 

It explains which games you should make first and why.

 

Once you have a game, then you can move on to trying to make it multiplayer. You'll want to find a good networking library for C++. I used Lidgren for a few personal C# projects a while back and was very pleased with it. I'm not sure if Lidgren has a ready-to-use C++ library or not.

 

- Eck

Share this post


Link to post
Share on other sites
rAm_y_    686
What are your skills, what languages etc?

Have you considered using a game engine such as Unity/Unreal?

What are you amitions, network programming isn't really that that bad...

If you need some help just ask.

Share this post


Link to post
Share on other sites


What are your skills, what languages etc?

Have you considered using a game engine such as Unity/Unreal?

 

I don't know if I really have any "skills". I know Java like the back of my hand, and am trying to transition over to C++ because it is much more secure for game programming. 

I do not consider using pre-built game engines like those because I want to create an MMORPG. No "real" (or in other words successful) MMORPG's were ever created in a pre-built engines such as Unity.

 


If you haven't written any games yet, starting with a multiplayer game is too big of a first step. Jumping straight into network game programming will over complicate things.

 

The best I have done as far as programming a video game would be making a text game in C++, and making an incomplete version of Super Mario Bros in Java as seen here: https://www.youtube.com/watch?v=zHmZPfNfI1k&list=UUsesAqYy4ronMU9GQcHTb_w

Share this post


Link to post
Share on other sites

Also, not going to lie. If I could make my game in Java, it would be a piece of cake for me. But the fact is that Java will most likely never be secure enough to make video games due to the fact that .JAR files are very VERY VERY VERY easy to decompile and hack. So that's why I have to now learn C++. I am having A LOT of trouble coming over from Java because C++ goes much more in depth when it comes to coding things such as servers and what not. Especially since in order to use MySQL in C++ you have to use a windows form application. You cannot use MySQL in a normal "empty project". :/ any help on that would be appreciated. All of the links to MySQL in C++ seem to have to be a Windows form application which I cannot use...

Share this post


Link to post
Share on other sites
GuyWithBeard    1890

Especially since in order to use MySQL in C++ you have to use a windows form application. You cannot use MySQL in a normal "empty project". :/ any help on that would be appreciated.

 

That's not true. You can use MySQL from any sort of C++ program you wish, from Win32 console applications to graphical applications. What sort of problem are you having?

 

The easiest way to use MySQL from C++ is probably through the connector: http://dev.mysql.com/downloads/connector/cpp/

Share this post


Link to post
Share on other sites
Eck    7581

Ah... At first you said  "a simple 2d game where my friends and I can chat" and then you drop the term "We're going to make an mmorpg"...  Ugh...

 

Go read this article right now:

http://www.gamedev.net/blog/355/entry-2250155-why-you-shouldnt-be-making-an-mmo/

 

Read the whole thing! >.<

 

And don't knock using game engines or higher level languages. Read this one too:

http://clicktobegin.net/productivity/reasons-you-arent-a-successful-indie/

 

Especially #2 where he talks about using game engines and languages. He even points out that Minecraft was made in Java.

 

- Eck

Share this post


Link to post
Share on other sites
Lactose    11446

 


Java will most likely never be secure enough to make video games due to the fact that .JAR files are very VERY VERY VERY easy to decompile and hack

 

Not necessarily true. You might want to google up the term "obfuscation".

 

Code obfuscation, in this case, would be an example of security through obscurity.

I would advise against relying on security through obscurity.

 

Other than that, Eck posted valuable information.

Share this post


Link to post
Share on other sites


The easiest way to use MySQL from C++ is probably through the connector

 

I've tried the connector countless times in the past, all I get is errors. Then when I ask for help, people just point to the documentation, and tell me to read it. I don't have time to read the documentation. I read it anyways, and it was still a waste of time because I never got my problem solved.

Share this post


Link to post
Share on other sites
RaoulJWZ    1305

If you come here to ask something, people give you advice in there own free time,

but it seems a bit that you don't want to listen to them and that you know it better.

My advice for the rest of your life is: Open your mind for advice from other people. In that way you'll become way smarter!

So you better take this advice.

 

Good luck with your project. 

Share this post


Link to post
Share on other sites
GuyWithBeard    1890

 


The easiest way to use MySQL from C++ is probably through the connector

 

I've tried the connector countless times in the past, all I get is errors. Then when I ask for help, people just point to the documentation, and tell me to read it. I don't have time to read the documentation. I read it anyways, and it was still a waste of time because I never got my problem solved.

 

 

Okay, well I have used the connector successfully in multiple projects, so I can tell you it works. I did ask you what problems you are having, but you did not answer me.

 

Also, you don't have time to read the docs? Seriously, with that attitude you won't get far with game programming. It takes time, lots of it.

 

Now, what was the exact problem?

Edited by GuyWithBeard

Share this post


Link to post
Share on other sites

If you come here to ask something, people give you advice in there own free time,
but it seems a bit that you don't want to listen to them and that you know it better.

Wow, that's a broad statement xD I never even stated anything as if I know anything better. I even admitted I can't code very well in C++, I'm a newb here. Please, before prosecuting me take a look at my past messages. I've never stated that I know more than ANYONE here. Thank you.
 

Okay, well I have used the connector successfully in multiple projects, so I can tell you it works. I did ask you what problems you are having, but you did not answer me.

?
Well one problem I have noticed is that I am using VS2013, and it says in the MySQL C++ Connector docs that I have to use the outdated 2008 IDE which is fairly retarded. I don't understand why I should have to downgrade my IDE in order to use something that should work fine since it's still the same language. (MicroSoft problems am I right?)

As for my actual problems, here is my code (which is an actual sample code from their website and should work by default):

 

#include <mysql_connection.h>
#include <mysql_driver.h>
#include <mysql_error.h>
 
int main(){
sql::mysql::MySQL_Driver *driver;
sql::Connection *con;
 
driver = sql::mysql::MySQL_Driver::get_mysql_driver_instance();
 
delete con;
}

 

I get these errors in the Error list:


    1    IntelliSense: cannot open source file "boost/variant.hpp"    c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h    31    1    MySQL
    2    IntelliSense: name followed by '::' must be a class or namespace name    c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h    41    9    MySQL
    3    IntelliSense: expected an identifier    c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h    41    24    MySQL
    4    IntelliSense: identifier "ConnectPropertyVal" is undefined    c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h    43    35    MySQL
    5    IntelliSense: cannot open source file "boost/shared_ptr.hpp"    c:\Program Files\MySQL\Connector C++ 1.1.3\include\mysql_connection.h    31    1    MySQL
    6    IntelliSense: cannot open source file "boost/scoped_ptr.hpp"    c:\Program Files\MySQL\Connector C++ 1.1.3\include\mysql_connection.h    32    1    MySQL
    7    IntelliSense: cannot open source file "boost/scoped_ptr.hpp"    c:\Program Files\MySQL\Connector C++ 1.1.3\include\mysql_driver.h    30    1    MySQL
    8    IntelliSense: class "sql::mysql::MySQL_Driver" has no member "get_mysql_driver_instance"    c:\Users\Jeremy\Dropbox\C++\Projects\MySQL\MySQL\Main.cpp    9    37    MySQL
Also, you don't have time to read the docs? Seriously, with that attitude you won't get far with game programming. It takes time, lots of it.

 

That's also another broad statement. I have been able to code anything I've ever wanted in Java without ever touching a doc, thanks to the great community support and millions of working examples on websites such as YouTube that will teach you how to do things correctly. However with C++ there seems to be much less resources like those I found for Java, and it's much more complicated. That's why I'm trying to get help.  

Edited by Unlovable1337

Share this post


Link to post
Share on other sites
Ocelot    375


I get these errors in the Error list:

    1    IntelliSense: cannot open source file "boost/variant.hpp"    c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h    31    1    MySQL
    2    IntelliSense: name followed by '::' must be a class or namespace name    c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h    41    9    MySQL
    3    IntelliSense: expected an identifier    c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h    41    24    MySQL
    4    IntelliSense: identifier "ConnectPropertyVal" is undefined    c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h    43    35    MySQL
    5    IntelliSense: cannot open source file "boost/shared_ptr.hpp"    c:\Program Files\MySQL\Connector C++ 1.1.3\include\mysql_connection.h    31    1    MySQL
    6    IntelliSense: cannot open source file "boost/scoped_ptr.hpp"    c:\Program Files\MySQL\Connector C++ 1.1.3\include\mysql_connection.h    32    1    MySQL
    7    IntelliSense: cannot open source file "boost/scoped_ptr.hpp"    c:\Program Files\MySQL\Connector C++ 1.1.3\include\mysql_driver.h    30    1    MySQL
    8    IntelliSense: class "sql::mysql::MySQL_Driver" has no member "get_mysql_driver_instance"    c:\Users\Jeremy\Dropbox\C++\Projects\My

 

You really should start reading documentations and practice gogle fu. If you would ask google about "IntelliSense:" errors you would be know that they are not the real errors. Do you try to compile your program? If yes, are there any compile/linker errors? If yes, I guess that "cannot open source file "boost/variant.hpp" ; solution: you should give visual the path to the boost library.

Share this post


Link to post
Share on other sites
RaoulJWZ    1305

 

If you come here to ask something, people give you advice in there own free time,
but it seems a bit that you don't want to listen to them and that you know it better.

Wow, that's a broad statement xD I never even stated anything as if I know anything better. I even admitted I can't code very well in C++, I'm a newb here. Please, before prosecuting me take a look at my past messages. I've never stated that I know more than ANYONE here. Thank you.
 

 

No offense, but i'm only trying to help you ;)

Share this post


Link to post
Share on other sites
GuyWithBeard    1890


That's also another broad statement. I have been able to code anything I've ever wanted in Java without ever touching a doc, thanks to the great community support and millions of working examples on websites such as YouTube that will teach you how to do things correctly. However with C++ there seems to be much less resources like those I found for Java, and it's much more complicated. That's why I'm trying to get help.  

 

It's not a broad statement at all. The fact is, if you think that reading the docs takes too much time, then you need to adjust your attitude. And just because you have supposedly "been able to code anything you have ever wanted" without reading any docs, it does not mean that you can keep doing that. You have been lucky (not that I consider it unlucky to have to read the docs).

 

Now, if you would have read the docs for the connector you would have found the line that says "As of MySQL Connector/C++ 1.1.0, the Boost C++ libraries 1.34.0 or newer must be installed.". In other words, the errors you are getting are because you are missing the boost library (or the IDE cannot find it because of incorrect include paths or something).

 

You can find the whole thing here: http://downloads.mysql.com/docs/connector-cpp-en.pdf

 

Seriously, next time check the docs (or at least do a google search). Also, remember that we all really want to help you. GD.net is an awesome community, so try not to get offended when someone more experienced gives you a gentle nudge. Good luck with your project!

Share this post


Link to post
Share on other sites


I guess that "cannot open source file "boost/variant.hpp" ; solution: you should give visual the path to the boost library.

 

That would explain a lot. I didn't know I needed Boost. Thanks, I'll install Boost, try to compile, and let you guys know if it worked when I get back from work.

Share this post


Link to post
Share on other sites
BHXSpecter    3119

 


The easiest way to use MySQL from C++ is probably through the connector

 

I've tried the connector countless times in the past, all I get is errors. Then when I ask for help, people just point to the documentation, and tell me to read it. I don't have time to read the documentation. I read it anyways, and it was still a waste of time because I never got my problem solved.

 

You want to take a wild guess how I learned what I know? How about how the professionals learn to use their APIs and compile against them? They don't have a 24/7 hotline to walk them through learning it all, they have to read the documentation. If you don't have time to read documentation then you don't have time to write code.

Edited by BHXSpecter

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