Page 1 of 2

Newbies to programming, just left GML.

Posted: Sun Jul 11, 2010 4:27 pm
by seamuslee
Greetings, fellow programmers. I have hence forth left the world of game maker, and have decided to learn a real mans language. Well, i was starting on a pretty big project with GML (game maker language, note i do not use any of the D&D = drag and drop functions of game maker, i only use GML. Yes i understand there are structures that are already there for you like objects and room and views.) when i started to realize that there is a bunch of crap wrapped up in GM that really decreases performance speed, as well as the fact that GM is just slower than C++, or any other language. So instead of writing my own object and room/views code for optimization, i decided i would just go learn a language and expect better results from my work...

Well, i come to you a noob, i have watched lusikkamages how to get into game development series, and gyrovorbis's series of the same purpose. I was thinking of a few choices, i will tell you why i picked them, then you can correct me and tell me what i should choose :)

Mostly i was thinking about starting out with python and pygame, for the follow reasons. One, it will be easier to start off, and i can move to c++ later to program my engine, but still handle most stuff in python. (Is that a correct assumption? Basically how much is too much use of a scripting language?)

Second was probably c++ (because GML is a variant of C, i can read c++ syntax quite easily, where as python is still a little bit shaky.) Although i cant decide one what i should use for graphics/input/audio/blah
I know i should use SDL for everything but graphics, but ive also heard you can use SDL for graphics, is this true? And what are the drawbacks if any? And whats the difference between directx and opengl? Preference?
I know directx is what big budget game studios use for graphics, and i also understand i am never going to do something like that (i may be part of a team of 50 people that does that, but i myself never will). So is directx more powerful and more complicated than opengl/sdl?

And more importantly... HELLO (programming) WORLD!

Re: Newbies to programming, just left GML.

Posted: Sun Jul 11, 2010 4:51 pm
by eatcomics
? who said don't use SDL for graphics? Lots of us here use SDL for graphics input sound and all that junk. Another choice is SFML which is object oriented, where as SDL is not. SFML also is harware accelerated and you can do things like shaders in it which is a plus :D So really SDL would be a fine choice for graphics, but I thought I would advice you to also look at SFML and just choose what you find the easiest to understand or the most beneficial. As for Python and Pygame I say go for it!

My personal preference between OpenGL and DirectX is OpenGL because its powerful and multiplatform, whereas DirectX is windows specific.

Re: Newbies to programming, just left GML.

Posted: Sun Jul 11, 2010 5:02 pm
by Milch
Hey and welcome to the forum!

If you want to work in the gaming industry you should learn C++, because its the most used language ( for game developing )
But Pygame is also a great choice for starting out!

Okay, I think you got something wrong with DirectX and OpenGL.
DirectX and OpenGL are both free.
DirectX and OpenGL are feature wise pretty much the same ( avoiding flamewar here :lol: )
OpenGL has the big plus for beeing cross plattform - so you can also use it on Mac/Linux - and DirectX is only for Windows/Xbox
Most Indie Games use OpenGL because they want to reach out for as much people as possible with their games.

SDL:
SDL is pretty damn old and its written in C ( neutral )
SDL uses software rendering for 2D rendering, so its slower than hardware accelerated stuff ( DirectX,OpenGL )
SDL makes a lot of stuff cross-plattform, like input/window creation/setting up OpenGL.
SDL has many tutorials ( because its old )

SFML:
SFML is new ( neutral )
SFML uses OpenGL as its backbone for 2D rendering ( so its hardware accelerated )
SFML is written in C++ ( I think this is positive )
SFML has the best docs I've ever seen and a well written source.
SFML also makes a lot of stuff cross-plattform, like SDL.

So, the choice is yours :D

Re: Newbies to programming, just left GML.

Posted: Sun Jul 11, 2010 5:04 pm
by eatcomics
Thanks you for elaborating :D I really didn't feel like it

Re: Newbies to programming, just left GML.

Posted: Sun Jul 11, 2010 5:22 pm
by dandymcgee
Welcome to the forums and welcome to "the real world". Glad to see you've made it out of the matrix.
seamuslee wrote:Mostly i was thinking about starting out with python and pygame, for the follow reasons. One, it will be easier to start off, and i can move to c++ later to program my engine, but still handle most stuff in python. (Is that a correct assumption? Basically how much is too much use of a scripting language?)
You can use the two together, but it isn't something you'll likely need to worry about any time soon as it's an advanced topic and not a recommended place to start out (that is, combining C++ with any scripting language).
seamuslee wrote:Second was probably c++ (because GML is a variant of C, i can read c++ syntax quite easily, where as python is still a little bit shaky.) Although i cant decide one what i should use for graphics/input/audio/blah. I know i should use SDL for everything but graphics, but ive also heard you can use SDL for graphics, is this true? And what are the drawbacks if any?
Yes, SDL works perfectly fine for 2D graphics. While there are certainly drawbacks of using SDL instead of OpenGL (which can handle both 2D and 3D graphics), again this isn't something you need to worry about as it won't apply to any of your projects for quite some time, if ever.
seamuslee wrote: And whats the difference between directx and opengl? Preference?
I know directx is what big budget game studios use for graphics, and i also understand i am never going to do something like that (i may be part of a team of 50 people that does that, but i myself never will). So is directx more powerful and more complicated than opengl/sdl?
DirectX is an entire SDK for graphics, sound, networking, etc. OpenGL is a graphics API, and as such has nothing to do with physics, audio, networking, GUI, etc. Direct3D is the graphics API in the DirectX SDK, and would be what you would want to compare with OpenGL. OpenGL is also used in industry quite often, so don't underestimate it on that front. They both do similar things, but there are some major differences when start getting into much more advanced aspects of 3D graphics programming. I know I keep saying this, but you're nowhere near the point where you would need to research the differences between the two as they would both work fine for anything you're ready to work on (but please don't let me stop you if you wish to read more, the internet is a wonderful resource and you can learn a lot from it). As for the difficulty, I've used the basics of both Direct3D and OpenGL, and they're learning curves seem to be close enough for me not to recommend one over the other.

I much prefer DirectX when coding in C# since they are both Microsoft products and as such are much easier to integrate with one another. I prefer OpenGL and SDL when working with 3D applications in C++, and just SDL when working with most 2D applications (I have used OpenGL for 2D before as well, as it is a lot more powerful and fun to play with).

If you want more information I would recommend you either google Direct3D vs. OpenGL or simple search these forums as this questions has been asked multiple times before. Those topics hold quite a bit of really good information. (As a rule of thumb, it's a good idea to search before you post just about anything programming related here, as many of your question have likely already been posted and answered here before).
seamuslee wrote:And more importantly... HELLO (programming) WORLD!

Code: Select all

<?php
     echo "Hello seamusless!";
?>
I hope I've answered your questions. ;)

P.S. - [SDL fanboy] Damnit guys stop trying to sell SFML to all the newbies. If they wanted that crap they'd use C# and XNA. [/SDL fanboy]

Re: Newbies to programming, just left GML.

Posted: Sun Jul 11, 2010 5:29 pm
by eatcomics
I'm an SDL fanboy, but he should really look into it and see if he likes it. We're not supposed to hold back new programmers we're supposed to help them see what's out there, so knock off all your SFML hating, I've never used it, but I have to say it deserves more popularity than it gets from what I've heard

Re: Newbies to programming, just left GML.

Posted: Sun Jul 11, 2010 6:42 pm
by seamuslee
Thanks for all the replies guys :).

Im thinking im going to try c++ and sdl right now, cause i tried to use pygame and it didnt work.

I DLed python, off of http://www.python.org/ and then i DLed pygame off of http://www.pygame.org/download.shtml then i took the Lib and include folders and merged them with the python folders of the same name, then i tried running an examle program on the site, and it gave me this error. Where should i put the stuff that i got from the pygame install? Pygame forums might be a better place to ask this, but im sure there is a super easy solution...

Traceback (most recent call last):
File "C:\Python27\Pygameballdemo", line 1, in <module>
import sys, pygame
File "C:\Python27\lib\site-packages\pygame\__init__.py", line 95, in <module>
from pygame.base import *
ImportError: DLL load failed: The specified module could not be found.

NEways should i go into c++ and sdl (which im thinking about doing) or should i stick with pygame? (or if you have a solution to this problem.)

thanks

Re: Newbies to programming, just left GML.

Posted: Sun Jul 11, 2010 9:27 pm
by wearymemory
Odds are, when you try compiling your first C/++ & SDL program, you'll run into a problem as well. What happens then, will you move on to something else?

You should learn how to effectively utilize the concepts, fundamentals, and standard API of the language you choose, before attempting to grasp another architecture. Just because you can identify its syntax, doesn't mean you know how to program in the language.

If Python was your first choice, then you should stick with it, but forget about pygame for now.

Re: Newbies to programming, just left GML.

Posted: Sun Jul 11, 2010 10:24 pm
by eatcomics
If he's been using GML then he's probably alright to move onto pygame, I think that's what he was getting at... But I agree you will run into more problems with C++ and SDL than you will with Pygame

Re: Newbies to programming, just left GML.

Posted: Sun Jul 11, 2010 11:42 pm
by wearymemory
eatcomics wrote:If he's been using GML then he's probably alright to move onto pygame, I think that's what he was getting at... But I agree you will run into more problems with C++ and SDL than you will with Pygame
I wouldn't recommend using pygame to someone who hasn't demonstrated sufficient knowledge in the most common, integral aspects of Python. I doubt that two separate languages, designed with different goals in mind, are similar enough to make it "probably alright" to move from one language, straight into using an architecture that relies on the fundamental concepts and API of another language that the OP has yet to fully comprehend.

Re: Newbies to programming, just left GML.

Posted: Mon Jul 12, 2010 10:18 am
by seamuslee
I learned python a few years ago. Granted most of the easier stuff, like basic syntax for declaring variables, loops, and stuff. I never really did anything that great with it, but i made a few simple text rpgs haha. Of course i need a refresher, but if i could just get this damn pygame to work, i could get started on a project within a few days of tinkering, IMO. So i guess i will get off my ass and post on pygame.org (or look around, some other newbie ought to have asked the same question as me)

As for concepts, i really learned alot from GML, despite what alot of cpp/java/c# programmers think... It really teaches the basics and how to think like a programmer. Of course it does non of these while your using drag and drop, you have to move up to GML or else your wasting your time. Also the syntax some people use on the gm forums is just horrid, i dont think gml syntax should be that loose, makes it confusing to read noob code.

Anyways, i actually have to go to class here in a bit, but when i get back i will do some searching thru docs and forums.
Thanks

Re: Newbies to programming, just left GML.

Posted: Tue Jul 13, 2010 2:41 pm
by eatcomics
Trust me, python is similar enough to most other scripting languages, if I can go from Blitz Basic to python I think he's good too

Re: Newbies to programming, just left GML.

Posted: Tue Jul 13, 2010 4:45 pm
by seamuslee
I have successfully downloaded pygame (stupid mistake last time lol) And im now wading through tutorials and docs trying to figure out how the hell stuff works lol. I basically get the whole x and y, and i get blit, and update, but 2 things i dont get.

how to i init/write/read a 2d array? Ive seen it done like this,

myvar = (2,3)

But thats a list right? Cause for it to be a 2darray it needs to be like this

myvar(2,3) = 5

But yea... With some poking around i have discovered this

>>> a = []
>>> for i in xrange(3):
... a.append([])
... for j in xrange(3):
... a.append(i+j)
...
>>> a
[[0, 1, 2], [1, 2, 3], [2, 3, 4]]
>>>

I have to say i cant read this at all. I vaguely know what append means, but why cant i just call a 2darray like a normal person lol...

Ah, i miss the good old days of myarray[0,0] = 0

Also, what does "i" mean? I see it all around as a kind of everyvar, but i dont really know if thats what it is. Is i to programming like x is to algebra?
Sorry again for my noobiness...

I also have some confusion on how i will create an animated sprite, but i have a feeling it will be covered when i implement the Sprite class (its a class right?)

Re: Newbies to programming, just left GML.

Posted: Tue Jul 13, 2010 6:36 pm
by eatcomics
yes on the x to algebra thing, in a loop people usually use i. So people loop through arrays with the variable i

and append just puts a number on to the end of the array

as for sprites in pygame I have no clue

Re: Newbies to programming, just left GML.

Posted: Tue Jul 13, 2010 6:54 pm
by seamuslee
Thanks :)

My first project is going to be very simple... As suggested by many a source. Im going for a sort of ultima 1 clone. Shouldnt be that hard, but if i cant get an array to work i cant do it, cause there are hundreds of tiles that are stored in an array, having 2 vars for each tile is not doable.

So ive heard of this module (or lib, i cant remember the dif haha) called Numpy, thats supposed to facilitate easy array calling, supposed to be alot faster too. So im going to DL and hopefully learn that.
Of course for collisions in an ultima 1 clone all you need to do is check your position in the map array and see if there is a wall in the next tile you would be moving to, and if there is dont move.
Also i dont need animations, so thats a plus i guess.

I will be writing a map maker in GML, cause i dont really need speed from a map maker, and i know how to use GML much better :P.

NEways...

My last question :P. How would one read variables from an ini (or txt if it cant read ini) file in python? I know how to write to these easily in GML.