Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 23 Feb 2011
Offline Last Active Jul 17 2012 07:41 AM

#4904191 How to go from console to graphical text- based games

Posted by on 19 January 2012 - 12:23 AM

Well, to start using graphics for text, you'll need at this point to choose a graphic library that you want to work with, the overall notion for C++ says that you're better off with either SDL or SFML.
I don't know much about SFML, but I think that it's higher level, so it's easier to learn and use.
My expertise is set in SDL, so I can provide links for that if that helps, the best place to start would be this site:
Or if you prefer the following site is better at explanations of the process and, in my opinion, is better to get started up with the basics of SDL before you head over to lazyfoo above:

As for publishing, I'm not sure, but it's probably IDE specific.
If you're using Visual Studio, after compiling just go to the location in which your project is saved and there should be a folder named either 'Debug' or 'Release' according to your configuration settings for the project, you can change this on the top of the IDE next to the Run button.
Should probably be a similiar method for other IDEs though, just go to the project's folder and you should find something useful.

Once you have the .exe you can start distributing it, but you'll most likely need to pack this along:
That's for x86 VS2008 though, so make sure that you find the right version if that's not the one that you need.
A computer that doesn't have Visual Studio installed needs to have run this program once in its' lifetime to allow a VS created program to run on it.

Hope this all helps.

#4902630 Starting out

Posted by on 14 January 2012 - 06:14 AM

Seems like Java would be the better option for you then.

Not only because you are already familiar with it, and it's always good to stick with the language you're familiar with, but also because Java allows for better publishing options, you don't just get PC/Mac as possible platforms, you can make your game to run on the web and Android, and that's just a huge perk.

I don't have much Java experience myself, so I can't really help you in that area, but I hear that Eclipse is the best you can get as an IDE for Java.

#4895508 C# Compiler Error

Posted by on 19 December 2011 - 04:38 PM

You should probably not use the empty project template, just take the console application like suggested above.
Should solve any problem.

As for adding 'items'(I suppose you mean code files?), just right click the Source or Header folder in the Solution Explorer according to your file, and click Add, you can then add a new item using a template like you did when creating the folder, or add an existing item you might want to import.

#4843646 Some Basic Tips

Posted by on 02 August 2011 - 10:02 AM

Well, I'm not really knowledgable on OpenGL, but I can tell you that resizing IS in fact possible with SDL, you just need the SDL_rotozoom header included as well, it has a function called rotozoomSurface() that does exactly what you wanted.

If you're happy with OpenGL, then forget about this, but if you'd still rather work with SDL, just letting you know that it's possible =)

#4830684 game programming with librarys

Posted by on 03 July 2011 - 01:32 PM

That really depends alot on the libraries in question, and the way you format your code.
For the most part, if your code is well written, you should have functions that will contain all library related code in them, and keep minimal touch with the rest of the non-methodized code, and it'll evantually only come down to replacing each line of code with the respective one from the new library(Keep in mind it won't always go smooth since not all libraries function in the same manner, and it's always possible that you'll have to rewrite your code from scratch in the extreme cases)

In the end, it's always viable to change your library, but there's no set amount of difficulty or time or recoding that you'll have to do, it all really depends on what you have, what you want and how you did it.

Since you're only asking in theory though, I'll go ahead and say this: Always program with the mindset of that there's a chance you'll have to replace your library if something doesn't quite work, work from the get-go with the purpose of keeping clean and well commented code, as well as one that's well seperated between game mechanics, distinct objects in the game, the main function and external library code you'll need.

Hope this could help. =)

#4830680 Newbie Programming Help.

Posted by on 03 July 2011 - 01:25 PM

First of all, there's no right or wrong way to learn this, any option you choose will get you closer to your final goal of making a game, be it C++, C#, XNA, UDK or even RPG Maker or Phantasya. All pathes lead to Rome, as they say.

My suggestion depends on a question, do you have any background in programming, or just the background knowledge you mentioned and no actual experience? Did you ever try to make a game with some of the GUI designers?(Game Maker/RPG Maker/Phantasya/etc.)

If you already know how to program in a real language, stick to it, any language can be used to make games, and in the end, what matters the most to the quality of your projects, is your expertise.
At that point I would suggest to pick up on tutorials regarding game development specifically(Try here, and when you get the hang of it here, for example).

If you don't know how to program at all, you can still take up on Unity or UDK, but I'd highly recommend that you learn a real programming language before you do, since that always comes useles at some point(This is a good starting point).

In case you'd rather give up on the programming all together, then again it will depend.
If you have experience with game making in general, then sure, you could try Unity or UDK, but if you're new to the subject all together, I'd highly suggest starting out with a RPG Maker variant, which is alot simpler to use than the aformentioned programs, and provides a good basis to all concepts of programming and game design in general.

As for your other question, a game engine is basicly just a compilation of functions made to make your life easier when making a game, keep in mind engines are libraries, for the most part, so no, they don't have a language of their own, but they do have a lot of functions that you'll need to learn and extend the language you're currently using with.

I hope I could help you even the slightest in taking your choice,
Don't hesitate to post more questions if any come up. =)

#4830617 Troubleshooting an error learning GUI

Posted by on 03 July 2011 - 08:53 AM

You're using a .jpeg file with the BMP loading function, so it doesn't work.

Check the next tutorial here for a way to blit other types of images(Use IMG_Load()).

On a general note though, using .jpegs isn't advised in 2D games, as they are of less quality, are lossy and usually weigh more, the preferred image types are usually .PNGs and .BMPs.

Also, this probably should've gone in the alternative game libraries forum =P

#4830612 Now a simple GUI

Posted by on 03 July 2011 - 08:46 AM

Seems like the easiest way for you right now, so sure =)
Don't hesitate to post questions if you get stuck too.

#4830525 Now a simple GUI

Posted by on 02 July 2011 - 10:31 PM

Unfortunately, no. There's no way to manipulate the drawing of several graphics into a single pictureBox at one time, as far as I know.

And yea, I think it'd be best to stick to his own code here for the GUI too =P

#4830469 Now a simple GUI

Posted by on 02 July 2011 - 03:28 PM

The problem in making a game with Windows Forms is that they don't support alpha transparency for images, you can stack images, and you can move them around, but if you use an alpha color to become transparent, it'll show the bottommost layer below the color, deleting all images below it as well. I had a very hard time with this part when I needed to use a transparent panel to select a part of an image below it.

Also, I'm not sure how keyboard buttons will work in affecting the sprites, considering that Forms projects are Event Driven, and don't have a main loop to check for presses that don't relate to a specific control.

But, I don't really know many libraries that build off this, so you might be right, it might be possible, but wether it is, or not, I honestly don't think it's worth the effort, with the low support it gets both from the community and extension libraries.

#4830453 Now a simple GUI

Posted by on 02 July 2011 - 02:26 PM

Unfortunately, as I mentioned, there's no way to run a game using a Form Project, you can make a seperate executable that will take entry point arguments(Using argc and argv from your main function), and open it through your Form Project, in a way that you'll be able to change settings before running the game(Using Process:Start()), but there's no real way, that I know of atleast, to use a Form Project to interact with another open application after its' initial starting point, so no, you can't draw information from your running game to draw on a Windows form, since the 2 are 2 different programs.

For your cause, you'll probably have to make your own GUI.
But by how you described it just now, most of what you need is just a HUD, right? Buttons to change settigns are simple too, if you don't want to go to ability extensive and just stick to basic click to activate it's very easy to do.

Let me direct you to these couple of tutorials by Lazy Foo', dealing with mouse events and graphic and text drawing with SDL:
Graphic drawing
Mouse events

For your HUD, you can simply draw pictures that have the info you need, like a compass, a minimap or your health, and, if needed, draw text onto parts of the screen to signify things like objectives, ammo, etc.
Look at the mouse events tutorial to see how simple it is to make a functional button with custom graphics in your game.

Unless you need more advanced options like dropboxes, checkboxes, or anything else that is not covered in Lazy's tuts, I suggest you stick to them, since they are really fairly easy to follow =)

Also Joe, I very much agree with your view on this, but I don't have any experience with the 2 toolkits you suggested, so I can't really say much more about that.
Also, about what you said about learning how to make your own by using someone else's ready kit, I just have to say, that's pretty much true for anything in programming, it's always better to use someone else's work before making your own in every single aspect of programming, that's why it's always good to send the new people around here to try programs like RPG Maker, Game Maker and Phantasya before sending them off on their own to learn C++ and start there. Wouldn't you agree?
I just know that my years with RM taught me a whole lot of techniques in game making and project managing, before even starting to learn to program, that I still use often.

#4830430 Now a simple GUI

Posted by on 02 July 2011 - 01:05 PM

Well, I'm not quite sure what you intend to with your program in general, and that makes this a little hard to answer, but there are a couple of options that come to mind.

First, and a very easy method, actually, is .NET, you can simply make a .NET Windows Forms Projects in Visual Studio, making the GUI is pretty much the simplest thing you'll have to do in your entire programming career, it's just a simple drag and drop interface to make it and implement Windows controls such as buttons, drop boxes and list containers, as well as picture and sound support.
However, this has 2 drawbacks, the primary being that it's a WINDOWS Form Project, and as such, I don't think it's crosscompatible, but seeing by your question that you intend it for Windows only, that's probably not too big of a deal for you.
And the 2nd being that this sort of project uses a more advanced form of C++ that is far less supported by the community, it uses Managed C++, whileas what you have probably done up until now had been Native C++.

The difference is not _too_ drastic when you get used to it, but there are a number of things that you'll have to overcome, such as MC++ being an Event-Driven language, having some data types that aren't compatible between Native and Managed C++(I.E. 'string's and 'list's that are now 'String^'s and 'List^'s, and pointers that now use ^ instead of * and aren't interchangable), classes that need to have a different design, making native classes need to be wrapped, and native libraries that basically aren't supported(Though thankfully, a large number of which can automatically be wrapped by VS's IJW(It Just Works) system).

While all of the above can be solved, it does take a while to get used to and learn how to do everything, though like I said, you don't get much support for it over the net, and that is because that most people that use .NET, prefer to use the C# .NET, which is more advanced and easier to use, but would require you to pick up on C# now.

So, going down this path, you need either learn how to program in Managed C++, or C#, neigther are complicated, but that's still something you'll have to do.

The other option, is just making your own GUI using existing graphic libraries, like SFML or SDL, I'm not gonna lie, these are gonna be alot harder to do, even if you're already familiar with the libraries, since you'll need to manage all your keyboard and mouse events on your own, as well as their effect on the GUI.
The benefit in going this way, however, is bigger, since you get your support for Native C++ back, and get cross platform abilities.

So, to sum it up:
Positive - Easy to use, implement and design, has a very large number of ready controls, powerful,
Negative - Not widely supported, doesn't support crossplatforms(And in your case will need you to take up a new language to learn).

Positive - Crossplatform, simple library, very customizble in comparison, widely supported.
Negative - Harder to make, time consuming, and only as powerful as you make it.

Now, lastly, getting back to my main problem with your post, you didn't specify what exactly you want to do, if all you need is button support and no real code being it, but .NET is certainly the best for you, but if you're planning on an actual game, that probably won't be using Managed C++, or .NET, for that matter, code in it, and as such you can't even run it in the same program, so if you're planning on using the GUI's buttons DURING the game's run, to effect the game itself, you'll have to go with a native library.

Sorry for the long post, but just trying to do my best to help here :)
If you have any more questions, feel free to ask.