Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Creating a game with C++  (Read 10890 times)

IT 000

  • Bay Watcher
  • Strange Mood
    • View Profile
Creating a game with C++
« on: September 02, 2011, 09:35:57 pm »

I plan on creating a game with C++. It will probably end up being a rogue-like, or a fallout-type game (1 and 2). Any tutorials for beginners? Or other videos you recommend I watch?
Logged

***CORROSION v2.14***
<<<More Than Just Zombies>>>
Back from the Dead!

Gatleos

  • Bay Watcher
  • Mournhold... City of Light... City of MAGIC!
    • View Profile
    • Someone Sig This
Re: Creating a game with C++
« Reply #1 on: September 02, 2011, 09:47:27 pm »

How experienced are you with C++? That is to say, when you ask for a tutorial, do you mean a roguelike tutorial or a general C++ tut?

If you're planning on making a roguelike, I'd say Roguebasin is your best source for tutorials.
Logged
Think of it like Sim City, except with rival mayors that seek to destroy your citizens by arming legions of homeless people and sending them to attack you.
Quote from: Moonshadow101
it would be funny to see babies spontaneously combust
Gat HQ (Sigtext)
++U+U++ // ,.,.@UUUUUUUU

IT 000

  • Bay Watcher
  • Strange Mood
    • View Profile
Re: Creating a game with C++
« Reply #2 on: September 02, 2011, 09:52:55 pm »

Not much I'm afraid, I just got into it a little while ago. So any links you can supply will be greatly appreciated.
Logged

***CORROSION v2.14***
<<<More Than Just Zombies>>>
Back from the Dead!

Gatleos

  • Bay Watcher
  • Mournhold... City of Light... City of MAGIC!
    • View Profile
    • Someone Sig This
Re: Creating a game with C++
« Reply #3 on: September 02, 2011, 10:00:31 pm »

Object-oriented programming is very important for procedural games like roguelikes, where the game is made of a jumble of randomly-selected elements rather than one hard-coded block. So, it's important to learn C++ concepts like classes, structs and such. It'll make things a lot easier later on.

I think the best place to learn C++ from the ground up is... well... cplusplus.com. They've got an excellent tutorial, and plenty of reference pages for individual functions.

Once you feel confident in your C++ skillz, the next step would be to choose a rendering method. Are you planning on using ASCII, or more complex graphics?
Logged
Think of it like Sim City, except with rival mayors that seek to destroy your citizens by arming legions of homeless people and sending them to attack you.
Quote from: Moonshadow101
it would be funny to see babies spontaneously combust
Gat HQ (Sigtext)
++U+U++ // ,.,.@UUUUUUUU

Reelyanoob

  • Bay Watcher
    • View Profile
Re: Creating a game with C++
« Reply #4 on: September 02, 2011, 10:09:50 pm »

If you want any help with general c++, openGL or terrain generation, I'm the guy. Also, I'm good at debugging
Logged

Lectorog

  • Bay Watcher
    • View Profile
Re: Creating a game with C++
« Reply #5 on: September 02, 2011, 10:19:22 pm »

I'm just going to drop this link off here.
I started the tutorial a few days ago. I'm learning C++ well through it, and really easily.
It gives directions specifically for the programs it recommends, which is great (unless you can't get them).

If you want to get directly into making a roguelike, I'd recommend dissecting an open-source one and fiddling around with it while going through C++ tutorials, as you will.
It'll take longer to learn C++, but you'll have more experience with roguelikes by the time you finish.
Logged

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: Creating a game with C++
« Reply #6 on: September 02, 2011, 10:58:24 pm »

Is there a specific reason you want c++ for your roguelike? Without graphics, I doubt it will require that sort of heavy lifting, thus might I persuade you to instead try c#, or perhaps Java?

SeaBee

  • Bay Watcher
  • Wolves are atheists
    • View Profile
Re: Creating a game with C++
« Reply #7 on: September 03, 2011, 12:04:14 am »

Or Python! Python is both object-oriented and procedural, so you can do both (or either). The learning curve is a bit more gentle. The Rogue Basin has a Python tutorial for making a decent Roguelike using the libtcod library (awesome).

In fact, even if you stick with C++, the libtcod library might be of interest. Here's a link to it.

I'm no expert programmer, but I do have on small bit of advice: for your first project, think small. Roguelikes are often surprisingly complex, despite the otherwise simple presentation. Oh, and good luck! I'll play it when you finish.
Logged

IT 000

  • Bay Watcher
  • Strange Mood
    • View Profile
Re: Creating a game with C++
« Reply #8 on: September 03, 2011, 12:38:25 pm »

I've heard of Python and C#, I just had C++ lying around, are they notably easier to learn then C++?

And I appreciate the high hopes but if I ever produce anything worth playing it will be more Nethack then DF.  :P
« Last Edit: September 03, 2011, 12:47:34 pm by IT 000 »
Logged

***CORROSION v2.14***
<<<More Than Just Zombies>>>
Back from the Dead!

malloc

  • Bay Watcher
    • View Profile
Re: Creating a game with C++
« Reply #9 on: September 03, 2011, 01:04:21 pm »

Hi IT000.

I would not recommend using c++ for game creation before you feel VERY comfortable using it.

Actually I would not recommend using c++ for any small time game creation, the reason is quite simple, c++ is a very hard language to use fluently, and is static beyond belief so you have to be able to see the big picture at all time, which might be hard without some practice in software design.

That said, c++ offers a lot of control (Pointer arithmetic and the likes) , also the program produced is lighting fast, if these aspects are very important to you, then I say, go ahead, but expect it to be hard (If you are not experienced with c++).

For beginners I would actually recommend Java (While python is easier, Java is actually more portable since most people have the runtime installed.), it should not be a problem to set up some base code for a rogue like.

Hope this helps.
Logged

IT 000

  • Bay Watcher
  • Strange Mood
    • View Profile
Re: Creating a game with C++
« Reply #10 on: September 03, 2011, 02:17:37 pm »

So it looks like Java or Python would be the way to go, anything special I need to download for Java?
Logged

***CORROSION v2.14***
<<<More Than Just Zombies>>>
Back from the Dead!

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: Creating a game with C++
« Reply #11 on: September 03, 2011, 04:14:00 pm »

For Java, you will need to download the JDK (Java development Kit) but... I know all the indie kids out there love Linux and hate Windows, but c# is a faster and easier language. Sorry but it just is. Java is pretty damn easy as it is, but c# is one up on it.

IDisposable is fucking awesome. Use it!

nenjin

  • Bay Watcher
  • Inscrubtable Exhortations of the Soul
    • View Profile
Re: Creating a game with C++
« Reply #12 on: September 03, 2011, 04:33:32 pm »

Having now dabbled in Python to create a simple text adventure game, and a little Java....I've decided I want to learn C++. I do this knowing that it's the tougher language to learn to get to the end result of a game. But it's foundational and I feel like that's really important in the long-term for the kind of games I want to create. Memory management, garbage collection, these are all things you have to learn to manually address in C++ and that's what makes it harder....but it's what gives you greater control. That and I don't want the language to be a means to an end....I want to actually learn to code and a game is the best way I know how to express it.

So anyways, here's what I've been using to get started on C++.

http://www.cprogramming.com/
http://www.cppreference.com/
http://www.codecademy.com/#!/exercise/0 (This is a really simple java introduction to coding for people who understand absolutely nothing about it.)
« Last Edit: September 03, 2011, 04:36:16 pm by nenjin »
Logged
Cautivo del Milagro seamos, Penitente.
Quote from: Viktor Frankl
When we are no longer able to change a situation, we are challenged to change ourselves.
Quote from: Sindain
Its kinda silly to complain that a friendly NPC isn't a well designed boss fight.
Quote from: Eric Blank
How will I cheese now assholes?
Quote from: MrRoboto75
Always spaghetti, never forghetti

Reelyanoob

  • Bay Watcher
    • View Profile
Re: Creating a game with C++
« Reply #13 on: September 03, 2011, 05:36:20 pm »

If you grab Visual Studio Express CD image from MSDN, it's got VC++ and Visual C#, Visual Basic
Logged

SeaBee

  • Bay Watcher
  • Wolves are atheists
    • View Profile
Re: Creating a game with C++
« Reply #14 on: September 04, 2011, 12:22:54 pm »

The best thing about Java is the JVM. The worst thing about Java is Java the language  :-\ Scala is pretty good, though! (Disclaimer: my use of Java is only via the free computer science courses from Stanford University and some fun with lwjgl.)

Python makes it easier to get something up and running, and comes pre-installed on most (all?) Linux distros and Mac OSX. For Windows distribution, most people use py2exe or PyInstaller to give their users a single EXE that does everything, even if they don't have Python installed.

C# is a very good language, and .NET is very powerful on Windows. You can use C# on Mac and Linux via Mono, but it will not have the same performance as it would on Windows. Nor is it 100% compatible, yet. But it's used for serious apps on many Linux distros. It's a lot like Java in several sense, though Java has very good third-party libraries and C# has somewhat better language features. This, however, is a Holy War that I try not to get into much.

I really like C. I don't know enough C++ to comment on it, though, only what I had to learn in school. I tend use Python + C for most things on Linux.

All the languages are good in different ways, though. Learning about programming is the important thing, the syntactic sugar you use is up to you. The important thing is to choose one and stick with it until you learn it well. After that, learning other languages will be much easier and faster.

I recommend the Stanford and MIT computer science classes. They're free. Stanford starts with Java and moves on to C/C++, MIT uses Python and C/C++. Both are fantastic.
(Additional note: learning Python or LUA is a great idea if you're ever interested in offering a scripting platform for your game in the future. Many commercial games use one of these for game logic, interfaces or mod APIs, such as Civilization or World of Warcraft.)
Logged
Pages: [1] 2