Ill cut this short: Im thinking about learning a programming language so Im able to prototype game ideas I think of in my spare time, on a amateur kind of level. So, I was wondering if any other artists here had experience with learning a programming language, and how hard the learning curve was. Did you give up? What programming language/tools did you find hard/easy to learn?
Two programmer friends of mine and coders at work tell me it's really not THAT hard to learn, but I am still curious about the trials and errors of other artists before I start ordering/borrowing/reading those mammothsized programming books :P
edit: I forgot to mention this: Im not looking for tips about stuff like game maker, as I want to be able to code for multiple platforms
Replies
If you find any good programming tutorials that actually explain what you're doing rather than just "type this code in, compile and your done!", let me know!
because at some point unless you have a natural aptitude for it then it just becomes too
much.
The part I struggled with is that you actually have to be creative with the code at some point ie
knowing enough about the language to think laterally and use that to produce what you want.
might be better to get an established game engine and learn some scripting like unreal or similar
You can also try the Blender Game Engine, it's built right in, and you can use your models instantly without writing up a loader. You just program behavior in. It uses Python, which is also a great beginner language.
The problem is, you have to really WANT to learn programming. You wouldn't be a very good modeler if your mindset was that you just wanted to learn to click a few buttons and have your scene materialize. Lots of people give up because they are impatient and thing that after reading every single paragraph, they know enough to get by.. then they get stuck on trivial things and give up.
My advice for you would be to come up with something you want to do with some code or scripting language, and have at it. If you really are interested in doing it, you will figure it out. Just like people who wanna learn 3d. If someone is really into it, that person doesn't need to take a class, just a solid drive and a willingness to make mistakes. Good luck with it.
EDIT: caseofchill somehow always seems to say the right thing
I advise against using internet tutorials for learning programming. Go get a good book and read it all the way through. NOT A LEARN C++/C# IN 24 HOURS book either. Get a proper book. Do the exercises, and make sure you understand each chapter.
Here's are MS's C# tutorials if you want to jump in. But I still advise getting a book intended for a programming newbie.
http://msdn.microsoft.com/en-us/library/aa288436.aspx
I tell people on the XNA forums not to take art advice from programmers, and I'll tell you here not to take programming education advice from artists. You get the exact same half informed quality of input in both cases.
Heh, like in art tutorials where they go from having 4 lines in step 1, to a complete city in step 2.
The trick there is to read multiple books, and understand programming as a whole, instead of just the single minded view of any one author or language.
I had to kill some time in a library one day, and casually read through a C++ beginner programming book by John Smiley. It was written like you were sitting in a class, and the chapters were written like actually days in the class, with students asking the questions you are probably going to ask when reading that stuff.
He won't teach you to be the best programmer in the world, but he writes very casually, and makes you understand all the basic stuff very well. He doesn't cover everything, but the stuff he covers is very thorough, and you'd feel confident enough to jump off from there into more complicated stuff.
That Visual C# 2008 book he lists on that link is probably a very good bet.
High level languages and scripting languages are easier to learn, and usually easier and faster to use. They usually focus on Object-oriented coding methodologies.
Low level languages are much more focused on efficient memory management. They are harder to learn and use, but they get you closer to the actual hardware. Because of that you can wring more power out of them. Most graphics drivers and rendering engines are written in low-level languages. Anything that is performance intensive benefits from low-level languages. Low level languages include C and C++. One of the lowest languages of all is Assembly. (coding for specific hardware)
For the purposes of game prototyping, I would definitely recommend a high-level or scripting language. If you aren't trying to code your own rendering engine, there's no need for a low-level language. And there are plenty of rendering engines available that support the use of high-level languages. C# is a good choice. It isn't that hard to learn, and is nicely object-oriented. Also, it is one of the .NET languages. The principles you learn for C# translate over to all the other .NET languages. If you can code in C#, it is just a matter of syntax to code in any of the other .NET languages.
If you want to try a scripting language, I would recommend Python or Actionscript. There are several existing engines that support Python, like the Blender Game Engine and Panda3D. Actionscript is great for making quick simple web games.
Haha very well said, Daaark. Thanks for the links!
C++ is both high and low level, and getting higher level (optionally) with each new update of the standard. It's also multi-paradigm (modular/OOP). But it's mostly geared towards OOP these days.
It would be like making a post that asks "I want to make game art, how should I learn?" Well, that DEPENDS on what sort of game art, doesn't it?
Don't make the mistake in thinking that you need to "learn how to program" in some sort of general sense to get your ideas working. You will pick that up along the way in doing something that you care about. The best way to learn is to start doing, and there are tons of ways to do that nowadays. You will learn how to program along the way of hacking your cool ideas together with the best available tools.
So, what is it you want to make?
Daaark, I think you underestimate the experience level of a lot of the artists on these boards. I know of plenty of people here who have written shipping code for games, even though you may only know them from their artwork.
A person who learns how programming works knows how to use the features of the language to get their job done. Because they have an understanding of what they are actually doing.
A person who didn't learn to program instead starts a new thread on some programming forum asking how to do every one of these trivial steps and then gets taken for a ride by the answers of those who realize what this 'programmer' is doing. And the end result is 'All I ever learned to do was paste code, LOL'.
I've seen some of the stuff here when it comes to coding. Impressive. That's not what I meant. But you need to know how to filter the advice you get. Someone who is taking all the posts HERE at face value won't be able to separate the good from the ones who are clueless.
In fact, Richard Kain once posted something about C++ in the engine thread that was nothing but paragraphs of mis-information. It was an 100% misunderstanding of OOP and the use of header files. No one called him on it. How many people will here in kwakkie's situtaion will read that and take it at face value?
You don't ask how to program on an artists site, for the same reason you don't go to the butcher to align your satellite dish or fix your breaks. It'll be a bumpy road.
I tried to learn a bit of modern programming several times, and was overwhelmed by the learning curve, but when I tried to learn it via C#/XNA, I was able to make good progress and get over the initial hump.
Hey! I never claimed to be an expert in this area. I learned what I know of C++ from an older book on C++ programming. I didn't bother learning any of the more updated standards of the language because I didn't enjoy coding with it. And I never claimed to fully grasp how header file references and OOP work in C++. In fact, that was why I stopped using C++, because I couldn't figure out how to properly code with it in an OOP approach.
If no one but you called me on it, it just means that there are precious few C++ coders on these boards. And what does that tell you about how artist-friendly that language is?
Modern, free stuff means taking that approach is no longer obligatory. An artist at work here was raving to me about Unity the other day because he was able to put together a little interactive 3D scene with little work. He posted a link in IM and I was able to play it. Did he read a programming book to do it? No. Does that mean he is on a "horrible" path to making whatever game he wants to? Absolutely not.
Here's a path I've seen lots of people take to low level languages:
HTML->Java->C
There are a million variations on that. Lots of game artists take something like:
Game Engine->Scripting->C++
Flash is more popular than anything these days and you don't need to read a fucking book to get your feet wet. Is it nice to have one on the shelf to reference? Yes.
But, again, what is best for the OP depends entirely on what specific type of project he has in mind.
its a professor at my uni
you can learn about the basic problems when programming and stuff
but when it comes to graphics you mostly already know the algorithm and spend your time in the helpfiles for the libraries your using to find the function for this except for c, i c im doeinig every algorithm by hand, because one does not use c for big projects anymore
and i hate c++ because of the syntax, i havent found any tutorial about the c++ syntax, kinda seems like "hmm we have ti make classes and not mess up our c... bl bla bla"
Okay, simple enough. But this is what it leads to.
Simple really. You tell the closest unit to blow up. Why is that even a question?
Whhaa? Sort them by distance.
Your objects have a location, which is of type Vector3. The vector class has a member function that get get the distance to another vector. Use the location of the enemy unit as the argument.
You need to store the return value.
(and this continues for 20 years)
This is what programs like Flash, Unity 3D, and Blender try to address. Instead of having to do coding for everything, they give you the ability to construct your objects visually, and then apply simple conditionals to specific instances of your objects. They provide a more visually approach to setting up scenes, while handling a lot of the organization for you.
Of course, we're still not quite there yet. And the industry has been leaning so heavily towards specialization that is unlikely to happen anytime soon. An ideal "artists" game development solution would require that all necessary elements be packaged together. But it is common for most game development elements to be addressed separately.
Maxscript. My scripts are the equivalent of a stick figure.
As to kwakkie's question, cross-platform compatibility can be a bit tricky. If you go for C or C++, you won't have any problems. Those languages are compatible with pretty much every platform.
If you are going the .NET and or C# route, you will be a little more constrained. (a lot of the guys here have been recommending C#, myself included) Thankfully, there is still a viable solution for this. http://mono-project.com/Main_Page Mono is a runtime that allows .NET programs to run on most platforms. It will allow you to develop C# programs and run them on Windows, Mac, and Linux. Do keep in mind that Mono is not compatible with XNA. XNA is a Windows-only development library, and if you want to use it, XNA is constrained to that platform.
Python is cross-platform, and I don't believe you will have any problems there.
Actionscript runs with the Flash Player or AIR, so it is as cross-platform as those solutions. Thankfully enough the Flash Player and AIR run on quite a few platforms. The biggest issue is that the performance you will get from the Flash Player is not going to be very high. On the plus side, games developed with it can be run in any browser with the Shockwave plug-in installed. Actionscript 3.0 can handle 3D graphics, but you would be developing for a very low-poly spec if you go that route. If you want to learn AS3, download the Flex 3 SDK from Adobe's site, and download the latest version of FlashDevelop. You will also need to download the latest Java runtime if you haven't already. (the Flex 3 SDK's compiler requires Java)
The real artist code I think comes from visual shader editors. There are tons of articles with coders lamenting what the artists did with them.
Only at their basic level. Everything else is implemented in libraries, which have their own platform issues. You can also run into the big and little endian thing. You have to purposely write 'multiplatform code' in order to not have any troubles. In some cases, you have to write a different version of some things for each platform (if not using a library that obscures that away).
also, I'm a sad panda that I lost my disks for Game-Maker. I can't find it anywhere on the internets
It could lead to that, if the person involved is a giant fuckface that doesn't want to try. If that's the case, he won't get through your book either.
Anyway, the reason I started this post was not to ask for support or anything, but to learn from experiences of other artist that have tried the same. In my opinion most artist have a very different drive in creation of game assets. It's hard for an artist to work an entire day on something, and not have SOMETHING to show for it in the end, while a coder has the discipline and patience to work on some code all week that is optimised like the effin matrix, and still get it's drive from that
Also, I dont want to program a single game thats multiplatform, but if I happen to think of a game that would work great on the iPhone, I'd like to have the option open to actually code for it, if you know what I mean (ie: probably going with C, still need to decide what version specifically).
Anyway: all of your comments have helped a lot, thanks! I think I'm going to wait with learning to code untill I get 'that' one great idea that wouldn't be too hard to code, and try to accomplish it step by step(I learned myself to script ASP and PHP webshops, sites, newsletter systems, sql querys, so Im not a total noob, I even had turbopascal classes for two years at high school lol :P).
I think that C# can be used for iPhone apps through Mono, but I'm not certain of that. I know that iPhone games can be made using Unity 3D, and Unity 3D is programmed using Mono.
There are a few existing engines that can already be used for iPhone development. You might want to look into those, as they would probably allow for much faster prototyping.
Anyway, I'm surprised at all the drama over this, but I agree with much of what Daaark said. Personally, I think working from a book is much better than the web. That isn't to say that they should be used together, but I find it hard to switch back and fourth between a webpage and my code. Web sites also tend to leave out the description and just post the code and show you the expected outcome. Books tend to explain and break it down.
Again, C# is a great learning language, and if you need to go lower level (c++ or c), you should have a good base, but you'll proabably never have a need to go that deep unless you really get into coding. But, based on your iPhone comment, I would research the tools and code necessary for it, if that's where you want to go.
Good luck and feel free to ask questions. One of my degrees is in Computer Science, and I code in C# for my job. I'm sure others here do code for a living too
programming is problem solving, so if you're having a problem, you must try your best to solve it, by any means.
another very good thing to do, is a lot of trial and error. find code that works, then try and change various things and see if you broke something after compiling, and learn it incrementally like that.
also, don't be afraid to test your knowledge. if it looks like you think you understand something, try it out. if it doesn't work, well, its your job to change it around until it does.
a third very important thing with programming is learning to think in numbers, instead of words,
and translating things in real life into lists.
say you have 3 objects, a hammer, a sledge and a fork.
how would you do that in code?
well, you'd do this:
hammer is 1, sledge is 2 and fork is 3.
so you'd tell in your code, if equippedobject = 1 attack damage = 50,
if equippedobject = 2 attack damage = 75, etc.
fourth, to learn to program geometry, you need to know trigonometry, calculus, algebra, and stuff like that. i haven't properly learnt it, so i'm not sure how everything holds together exactly.
also, you need iron-handed focus on what you're doing. programming fucking hurts your brain the first times you do it, because of all the variables and shit you need to focus on.
but just remember that the pain means you're pushing your limits, and learning something
most programming languages has some common things that runs through them all.
these things are in short order, functions, loops, variables, arrays, and statements.
functions for example is probably the single most important part of any programming language. and understanding functions is VITAL to being able to program.
C++ is a good place to start learning the very basic stuff,
as you'll get to know the components of programming which goes through most of the programming languages, but i only recommend you learn command-line C++ at first,
since doing stuff like windows programming or game programming will require external libraries that rarely work the way you want them to, and will take considerable amounts of energy and time to understand through C++.
i think you'll be surprised how enjoyable it can be to make your own command line programs that do stuff you want them to do.
i warmly recommend starting off GUI programming and basic geometry and graphics programming with visual basic, i was literally able to make a web browser with MS visual basic in less than an hour, with one of the tutorials. there's an express edition available from MS for free, which you can download.
just beware that the new 2008 version of VB is incompatible with old VB, so some tutorials on the web won't make functional code anymore.
oh and last, get some good programming books.these books double as reference, so you don't need to read them cover to cover.
herbert schildt's C++ the complete reference pretty much contains everything you'll ever want to know about the basics of C++, and with it you'll be able to do some pretty cool command line stuff, which is vital for the "under the hood" workings of a game.
the item list example above is just one use.
My favorite language to learn is Python. It's easy to understand, and quick to write. Also, it's very powerful, widely used, and cross-platform.
I've been slowly making my way through this book in my free time.
http://www.amazon.com/Python-Programming-Absolute-Beginner-Second/dp/1598631128/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1239763026&sr=8-1
It starts at the very beginning, and gives clear explaination as to why things are, and what is happening. The best part...every example and challenge in the book is a game of some sort. Mostly command window games...but the ending introduces GUI and a the use of Pygame for creating an Asteroids clone.
After I'm done, I'll probably move on to this book for more advanced study:
http://www.amazon.com/Beginning-Game-Development-Python-Pygame/dp/1590598725/ref=pd_sim_b_6
If I'm still feeling comfortable with code, I'll make the switch to a C language. They say once you learn one language, picking up another is simple.
Just for the record: no I dont want to program for the iphone specifically(I work on iPhone games as my daytime job ), but I used it as an example. Who know what great piece of hardware will be released in a year or two, and what amazing new functions it has that could be used for some great games, i just want to learn a common language and be prepared for when that hardware comes.
I once helped someone do their python assignments for school, and I had never seen python code before.
As for C. You should learn C++ or C#, not just C. Unless you want to do iphone stuff, in which case you need to use Objective C as Kain said. The biggest differences are that C uses {}s for scoping, where python uses whitespace, and that C++ and C make you have to manage your own pointers and memory.
I moved directly from C++ to C#. There was only a few syntactical differences, but it's really not the same language underneath, and I still have to learn over time to write code that is better suited to C#'s ways of doing things. There is a nice book for that.
Trying to move from Basic to C was not pretty at first. I tried to do too much in C before I fully understood it all.
Python IF you have other products that can use it, like Maya, simply because it will pay off in more ways then one.
I'll be learning Python myself soon so that I can start adding some custom tools to Blender. I just put it off because I'm doing too many things at once, and the Blender Python API will be changing with the upcoming 2.5. My only experience with it so far has been helping someone do some assignments a few years ago, but I didn't actually have to learn anything about how stuff worked, it was just simple data assignments and operations.
Just make sure to stick with what you pick! So many people flounder back and forth between a few languages every time they hit a gap in one of them, and then years pass and they never learn anything. I imagine that learning C# and Python at the same time would be killer, especially since tabs in python are used for scoping, and tabs in C like languages (which are freeform) have no meaning, and just help human readability.
I know you don't want to learn c++ but just for anyone else reading. I would recommend c# or python but c# comes with a framework and python might be a little harder to prototype a game.
Edit: don't learn C it's old, whatever Daaark said about it is correct.
GL.
Might as well just read about them.
!~CLICKY~!
C
C++
C++0x
C#
Python
Tim Sweeney's anti C++ stuff...
basic - just very very simple stuff at school, I wouldnt consider coding now
java - at university, courses... we learned a lot about algorithms and data structures. Java or C# make it easier to do this, as they take care of memory management.
maxscript - doing very simple stuff, but also reimplementing some things learned in Java.
C - first diving a bit into quake2/3 sourcecode, then custom engine coding
Lua - for game/tool scripting, like it a lot. Very powerful but "simple/minimal" concept language.
C++ - for 3dsmax SDK coding, nowadays more generally applied, although I still like "raw" C.
The last three I use on daily basis
While I dont have much experience with c#, due to similarity to Java, I would recommend it or even a simpler script stuff for starting. Fpr c# probably tons of tutorials, and also a bit more "officially pimped" game tutorials/frameworks (XNA..).
As for iPhone, you can use regular C/C++ just fine. Only little code has to be done with objective-C (mostly getting input and display setup) and there are open source frameworks for that.
--
as for learning programming, I would start simple and really go thru the basic stuff. I think its not good to say "bah skip the boring stuff, like creating a list class or sorting algorithms". Many might just "read" those coding books, and skip over all the beginning stuff, as they read it as "oh I get it, its simple". However its really important that you actually type stuff yourself, as simple as it looks, and then expand from that / play with it.
And once a certain knowledge of how to create algorithms (dissecting problems into small problems...) and how to manage data (not memory, leave that to high-level language), how to "reuse" code for different problems... once it made "click". Go beyond.
The problem is that if people skip basics, and want "fancy" stuff, they go to "api learning" to quickly. Ie looking thru code libraries to find out how to display stuff, get mouse coordinates, draw lines...
Evolution vs Revolution imo is the key, grow with the tasks you set yourself.
At the end the "language" learning is often basically syntax, while "programming" is the content. Language is often interchangeable and doesnt "break" your thinking. It's not like you will have to decide now which language you learn, and that's it forever. Use any "high-level / script" language which you get into easiest, get the basics laid down and then go along.
If you really want to do take it to professional level in PC/console games you will end at C++, but you dont have to start with, nor does this have to be your goal. Learn what makes you happy and gets the job done you want to do.
Similar how people will almost always recommend people to try the mainstream modelling apps to decide which one users like/get the most success/fun at the beginning.