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 10897 times)

eerr

  • Bay Watcher
    • View Profile
Re: Creating a game with C++
« Reply #15 on: September 07, 2011, 01:44:25 pm »

It should be noted that it's alot harder to screw something up in c++, or c, than in Java.

And anything you do screw up you should be able to find much easier.
Logged

Levi

  • Bay Watcher
  • Is a fish.
    • View Profile
Re: Creating a game with C++
« Reply #16 on: September 07, 2011, 02:22:24 pm »

It should be noted that it's alot harder to screw something up in c++, or c, than in Java.

And anything you do screw up you should be able to find much easier.

I don't know about that.  Java gives you those nice long exception strings.  c just likes to segfault with no hints, forcing you to guess or boot up a debugger.
Logged
Avid Gamer | Goldfish Enthusiast | Canadian | Professional Layabout

Normandy

  • Bay Watcher
    • View Profile
Re: Creating a game with C++
« Reply #17 on: September 07, 2011, 04:14:08 pm »

It should be noted that it's alot harder to screw something up in c++, or c, than in Java.

And anything you do screw up you should be able to find much easier.

While indeed you could conceivably construe this statement and the meanings of "harder" and "easier" to make what eerr said true, for most purposes it's a lot easier to screw things up in C/C++, and finding things that have screwed up almost entirely depends on programmer skill and what debugger/IDE combo you're using, not on the language you're programming in.
Logged

eerr

  • Bay Watcher
    • View Profile
Re: Creating a game with C++
« Reply #18 on: September 07, 2011, 09:18:51 pm »

It should be noted that it's alot harder to screw something up in c++, or c, than in Java.

And anything you do screw up you should be able to find much easier.

-,- derp I meant that backwards.

Java is verbose/harder to screw up

c++, c you have to deal with pointers is way easier to screw shit up.

Logged

Sim9

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

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.

Ditto.  If you're not familiar with the language, your first few tasks should be around learning the basics.  In fact, I'd recommend picking up a Teach Yourself <X> in 24 hours book, going through it and doing each of the lessons.  After you've written enough basic programs that you're feeling comfortable, then it's time to start learning common concepts in game development, like game loop, input handling, rendering, etc.  From there, you can create simple games and gradually build larger and more complex projects.  This is a much better way to learn than trying to understand everything with your very first program :)
Logged
8BitMMO, a WIP multiplayer game of fighting & building: Forum ThreadPlay In Browser

alfie275

  • Bay Watcher
    • View Profile
Re: Creating a game with C++
« Reply #20 on: September 08, 2011, 01:19:03 am »

http://dl.dropbox.com/u/4826080/C%2B%2B%20Primer.chm

You'll probably find that useful.
And yes, think small at first.
Logged
I do LP of videogames!
See here:
http://www.youtube.com/user/MrAlfie275

nenjin

  • Bay Watcher
  • Inscrubtable Exhortations of the Soul
    • View Profile
Re: Creating a game with C++
« Reply #21 on: September 08, 2011, 05:00:31 am »

I just got through a tutorial on pointers. I think I get it, I really do. It's funny because I remember my dad trying to explain pointers to me a long time ago and it sounded like gibberish. Now after years of screwing around with game .inis and crap like that, it's all starting to make sense. I got through tutorials on arrays, structures and file i/o and a few other things. Most of it is making sense, even though I have to hobble through the logic of the code when reading it and writing it is a really tedious process. I have no idea how long this particular tutorial goes on, but I'm pretty surprised at its depth, even if it's giving what I'm starting to see is some bad advice by relying on something like cin>> for, well, everything. It's a foundational oversight that I ran into immediately when trying to do something on my own with it.

Other than that though, I'm burning through concepts...so once I've got that down, I think it's time to move on to game logic and procedures....

On that note, anyone got some good reads on procedural maze generation?

http://dl.dropbox.com/u/4826080/C%2B%2B%20Primer.chm

You'll probably find that useful.
And yes, think small at first.

I d/l'd that and it told me to retype the address when I launched it. Am I missing something?
« Last Edit: September 08, 2011, 05:04:34 am 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

Shades

  • Bay Watcher
    • View Profile
Re: Creating a game with C++
« Reply #22 on: September 08, 2011, 06:01:06 am »

c++ you have to can deal with pointers which are way easier to screw up, but if you stick with references it's pretty hard to.

I rarely seem to use pointers in c++ these days, and when I do they tend to be std::unique_ptr, std::shared_ptr or std::weak_ptr wrapped as appropriate.
This also means I don't have to worry about memory management either.

The basic rule is use references where you can and wrapped pointers otherwise, leave raw pointers for when you have no other choice. It will make your life easy as tau.
Logged
Its like playing god with sentient legos. - They Got Leader
[Dwarf Fortress] plays like a dizzyingly complex hybrid of Dungeon Keeper and The Sims, if all your little people were manic-depressive alcoholics. - tv tropes
You don't use science to show that you're right, you use science to become right. - xkcd

Mechatronic

  • Bay Watcher
    • View Profile
Re: Creating a game with C++
« Reply #23 on: September 08, 2011, 09:14:24 am »

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.)
Stanford are taking things are step further by setting up some online classes with graded assignments and exams, that kind of run parallel to their actual classes this fall, i.e. starting next month.

http://www.db-class.org/ - databases
http://www.ai-class.org/ - artificial intelligence
http://www.ml-class.org/ - machine learning

Sign up for the AI class closes this week.
Logged

Alexhans

  • Bay Watcher
  • This is toodamn shortto write something meaningful
    • View Profile
    • Osteopatia y Neurotonia
Re: Creating a game with C++
« Reply #24 on: September 12, 2011, 10:03:59 pm »

And that class also requires solid Algebra and Probability knowledge so if you're a bit shaky on those subjects you can always just sign up for basic or not even and just watch when you can.

I've barely read this but my only advice is:

Take it slowwww...

If you rush into c++ you'll suffer big disappointments and do way too much trial and error.   Either you take the time to learn the basics slowly or you'll suffer.

It will be hard finding solid tutorials on c++ and learn a lot of wrong ways to do things.

I'd recommend python all the way for simple projects.  You have a much bigger chance of writing clean and proper code.  It might be harder to debug depending on how you set it up but it should be easier to test.

Anyway, whatever you use.  Know what you want to do.  Plan ahead.  Don't jump into the Non-ASCII Graphics wagon unless you're really really confident with your language of choice, no matter how tempting.  You'll HAVE to read documentation at some point to solve problems so find a way to enjoy it if you don't right now.  Most of all, take the time to have fun while learning.

Logged
“Eight years was awesome and I was famous and I was powerful" - George W. Bush.
Pages: 1 [2]