Starting from scratch? (PHP Background)

Cronikeys
Unregistered
 
Post: #1
Hey, this is my first post at iDevGames and I am a complete n00b to Mac (and PC) programming. I have a HUGE background in PHP, but I just got a powerbook and I really want to get into game development. I realize that most everyone here knows something about programming, but I know absolutely zero (I have fumbled through some obj-c tutorials). I am using Xcode newest version and would really appreciate a nice starting point for understanding all this.

I guess what I am asking for is maybe an in-depth guide to getting started. I saw a "flip tile" tutorial or something, but that really isn't the kind of game that I would want to make. Are there any basic tutorials that just show you how to make an image move when you push the keyboard buttons?

Any advice? How did you get started in game development, or programming in general?

(If it means anything, I have used GameMaker for Windows before)
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #2
http://www.geocities.com/ed72678954/Grid...dBuild.tgz
http://www.geocities.com/ed72678954/Grid...Source.tgz

This is a more complicated example than what you are looking for probably but its still very simple. It can be used as reference on how to do events (Mouse and Keyboard), Graphics (Image drawing, Tile splitting) and it also implements scripting but thats easy to ignore if you feel like it.
If you know how to make an NSView and subclass it (You could learn that from fliptile I think). Then looking at the code for this should be enough for you to make a simple moving image game.

(Oh yeah, change that main.lua file to load different scripts to see what the program does first of all)

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Member
Posts: 168
Joined: 2004.10
Post: #3
Hi and welcome to idevgames! First off - don't say n00b as it doesn't actually mean newbie, but actually quite annoying and not very pleasant person; that is, to name two of the usual properties.

The first thing I would recommend to someone new like you would be PlayKode. Even though it is in beta, it's more than capable of being able to those things stated and teaches the basics of programming well, using an extended version of lua. It's also very fun Wink

Although, you say you know PHP - you may be slightly advanced for it Smile The mainly used language for mac games and applications is Objective - C. This implements the Cocoa API which is the norm for most new apps (and mostly the norm for games) in this day in age. The other API is Carbon, which uses C++ generally for it's main language. Both APIs use a form of C, which can most easily be learned from this article. It is from Cocoa Dev Central, a good resource for the Cocoa API. The particular article linked is specifically one for programmers of PHP to learn C. From then on you can learn Objective - C, OpenGL and GLUT, and SDL.

Like PlayKode, there is also some other scripting languages. Many types of BASIC such as TNT Basic, Future Basic, METAL (BASIC metacompiler), and REALbasic to name a few. Another scripting languages that is popular include Blitzmax. These are all beginner languages (although people who are very experienced can produce amazing products from them, just check out the gallery for Blitzmax!). I'm sure someone will jump up and say something about Ruby and RBuild, but I'll leave that to someone who has more knowledge. Used and made by Guru OneSadCookie (aka Keith) not a beginner language, but beginners can probably use it all the same.

If you chose not to go down the compiled languages route, or the scripting language route, then there is also the Game Engine way. Often in 3D, the game engines do the boring bits for you, with content creation up to you. From order of cheapest to err... not cheapest:
•Dim3 is a free game engine that is made by Brian Barnes. Even though the demo is a shooter, it is possible to make nearly anything, as long as you're good enough Wink It is open source so you're not restricted. Good for people with low budgets Wink The forum itself is on idevgames, here.
•Torque is an engine that you may have heard of before. The tools aren't too well supported on the mac and apparently you need to compile to get it running. Recently released is a much more friendly(apparently) Torque 2D. I believe Chris (crackbunny) is using it, so you should get better answers from him. Torque is around the cost of $100 USD
•Unity is a very promising looking engine that incorporates the very nice Novodex Physics engine. It is very flexible and is as easy to use as making a model and dropping it in to Unity editor. Very little code is needed to master and results are usually great Grin It's cost varies as there is an Indie and Pro version, but currently it's going at $250 USD with an early adopters cheap version. Get it whilst it lasts!
I did not include igame3d to this list, as a)you can't get it, and b)I've never used it. It's currently being debugged by igame3d ( the forum member).


All in all, I wish you luck with your time here, and hope you enjoy it. Smile

Note to self: Stop using so many smilies!
Edit: It seems that about two or three lines disappeared when I posted this, so I'm off to type them again...
Quote this message in a reply
Member
Posts: 198
Joined: 2005.01
Post: #4
socksy Wrote:I did not include igame3d to this list, as a)you can't get it, and b)I've never used it.

Also it gives angsty, Lewis Black-esque commentary on your game while you use it. I kid, I kid! Wink

Honestly if you are able to push your way through any of the Obj-C tutorials, it might be a good place to start off on the right foot to do the Cocoa GL tutorial in the Xcode docs. I'm speaking of the one where it shows you how to receive mouse and timer events, and draw a triangle to the window based on it. It's a good start. Of course once you start getting into things like loading textures/images, playing an audio track, etc, it gets much simpler to go with some pre-made toolkit like SDL (or Tiki if I ever get around to releasing it).

Cryptic Allusion Games / Cryptic Allusion, LLC
http://www.cagames.com/
Quote this message in a reply
Moderator
Posts: 529
Joined: 2003.03
Post: #5
socksy Wrote:Many types of BASIC such as TNT Basic, Future Basic, METAL (BASIC metacompiler), and REALbasic to name a few. Other scripting languages that are pop These are all beginner languages (although people

Yes...?

Although people... ?

Anywho, lets not forget BlitzMax

"Yes, well, that's the sort of blinkered, Philistine pig-ignorance I've come to expect from you non-creative garbage."
Quote this message in a reply
Moderator
Posts: 522
Joined: 2002.04
Post: #6
From what I've seen, PHP has C-ish syntax, so you might want to start with SDL or GLUT and C.

SDL - http://www.libsdl.org/index.php
GLUT should come with the developer tools.

Good luck and welcome.
-Jon
Quote this message in a reply
Moderator
Posts: 529
Joined: 2003.03
Post: #7
@Socksy BlitzMax isn't a scripting language. It compiles to a standalone app.

"Yes, well, that's the sort of blinkered, Philistine pig-ignorance I've come to expect from you non-creative garbage."
Quote this message in a reply
Member
Posts: 161
Joined: 2005.07
Post: #8
aarku Wrote:From what I've seen, PHP has C-ish syntax, so you might want to start with SDL or GLUT and C.
C is prodecural, so I wouldn't recommend it for games - use the object-oriented C++. I tried making a game using C once, and it was a bad idea. I quickly scrapped the idea and used C++, although technically C structs come in handy quite a bit.
Quote this message in a reply
Member
Posts: 168
Joined: 2004.10
Post: #9
Leisure Suit Lurie Wrote:@Socksy BlitzMax isn't a scripting language. It compiles to a standalone app.

Really? My bad. I don't like it too much...

Also, technically PlayKode has a build to standalone app option, yet it's still a scripting language.

How does Blitzmax work then if it doesn't use assembly? Is it really compiling it or is it linking to a compiled language modified with APIs and such?

C is good for simple games, and from there you should learn another language. C++ is known for not actually being an extension to C, whilst Objective - C is.
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #10
socksy Wrote:The other API is Carbon, which uses C++ generally for it's main language.

Carbon is a C API. No C++ involved.

imikedama Wrote:C is prodecural, so I wouldn't recommend it for games - use the object-oriented C++. I tried making a game using C once, and it was a bad idea. I quickly scrapped the idea and used C++, although technically C structs come in handy quite a bit.

C is perfectly usable for games. I've written several fully-fledged games entirely in C, and I never saw any need for C++. All you have to do is establish a few disciplines to follow, and you can write pseudo-object-oriented C code in a very clean and efficient manner. If C++ is more your thing, go for it, but there's nothing it can do that C can't.

- Alex Diener
Quote this message in a reply
Moderator
Posts: 529
Joined: 2003.03
Post: #11
@Socksy My idea of a scripting language is something that dumps a bunch of text files in a folder with some separate runtime that's required to execute it.

Blitz compiles all your code to machine language...somewhere under the hood it uses gcc...

"Yes, well, that's the sort of blinkered, Philistine pig-ignorance I've come to expect from you non-creative garbage."
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #12
C++ would really shine for more complex games where you have objects or characters or events that have similar actions. It also would help for more complex graphics engines. (such as having everything be derived from a "Drawable" class and have each have specific virtual drawing functions so you can put them in a container) For simple games, though, C should be fine.
Quote this message in a reply
Member
Posts: 198
Joined: 2005.01
Post: #13
akb825 Wrote:C++ would really shine for more complex games where you have objects or characters or events that have similar actions. It also would help for more complex graphics engines. (such as having everything be derived from a "Drawable" class and have each have specific virtual drawing functions so you can put them in a container) For simple games, though, C should be fine.

That's exactly what Tiki is. Smile It's got a Drawable class you can subclass, Animation classes, Trigger classes, and now Timeline and Timepoints. You can link all those together to form whole animation sequences and use them in an ongoing manner to make games. There are also utility classes for Texture, Sound, Stream, and an OggVorbis stream subclass.

I just need to get around to open sourcing it ^_^;; Blush

Cryptic Allusion Games / Cryptic Allusion, LLC
http://www.cagames.com/
Quote this message in a reply
Moderator
Posts: 3,574
Joined: 2003.06
Post: #14
akb825 Wrote:For simple games, though, C should be fine.
Ack! Stop! That's the second or third time in this thread I've seen that comment. Just as a reminder, id used C for all of their engines up until just recently with Doom III. If C is good enough for John Carmack to get all the way to Quake3, it's good enough for... well, any game you can imagine. Then there's always the next whining complaint, "but I don't know how to program C in an object oriented fashion". Hint: Probably the biggest concept that gets missed by many inexperienced C programmers is the technique of encapsulating function pointers in their structs. Whammo! You have an object. It's magic! Do a google on object oriented C if you need more ideas. [end rant]

To back up what aarku and Lurie mentioned, SDL or GLUT would be a fine place to start from scratch if you already know C.
Quote this message in a reply
Moderator
Posts: 529
Joined: 2003.03
Post: #15
AnotherJake Wrote:To back up what aarku and Lurie mentioned, SDL or GLUT would be a fine place to start from scratch if you already know C.

I omitted GLUT because you need to know OpenGL before Glut. Also it doesn't handle sound or joysticks. To further confuse you, in lieu of GLUT, check out GLFW.

SDL and PTK handle all that poop.

Depends how simply you want to start, I guess.

"Yes, well, that's the sort of blinkered, Philistine pig-ignorance I've come to expect from you non-creative garbage."
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Starting from scratch? (C Background) SLDCGG 6 3,854 Aug 9, 2005 01:13 AM
Last Post: sealfin