Game Programming and Development Tools

Hello World for Games – samw3

samw3

Member

Posts: 542
From: Toccoa, GA, USA
Registered: 08-15-2006
In another post the highly revered HanClinto just posted the following wisdom:

quote:

1) If you haven't created a single player game, you're not allowed to create a multiplayer game.

2) If you haven't created a 2d game, you're not allowed to create a 3d game.

3) If you haven't created a functional game, you're not allowed to create a game with a plot/story. Focus on making *just a simple game*, then build from there.


My Question is this. Does any one have "Hello World" type ideas if someone is solid in programming but new to game programming and would like to tackle these objectives? (i.e. a single player 2D functional game)

This would be good for someone switching langs too.


------------------
Sam Washburn

[This message has been edited by samw3 (edited January 22, 2007).]

Ereon

Member

Posts: 1018
From: Ohio, United States
Registered: 04-12-2005
One thing that I sort of consider to be my personal game "Hello World" is a sprite based movement system. I try to set up a tiled game system in a language with simple movement of a player sprite. I've used this as my "Hello World" in Qbasic and DarkBASIC, and am currently in the process of doing it in C.

------------------

The time for speaking comes rarely, the time for being never departs.
George Macdonald

InsanePoet

Member

Posts: 638
From: Vermont, USA
Registered: 03-12-2003
Well, I'm no programmer, but from my experience it's best to work in groups. Game development projects have teams of coders.

To bring some spirituality into this, there is no solo mavericks in the Kingdom. Even if just for learning, I feel that working cooperatively will enhance the learning experience.

I feel that the things we see in the world reflect the nature of the spiritual world.

Prov. 27:17
As iron sharpens iron, so one man sharpens another.

Plus, if you work with people that produce something, you can put it on your resume.

I guess that really didn't answer your question, but those are my thoughts.

Cheers!


------------------
"I find myself a desire which no experience in this world can satisfy, the most probable explanation is that I was made for another world!"
-C. S. Lewis


IRISH PIRATES

jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
i have some "hello world" style code for the GTGE (java based game engine). you only need some basic java knowledge (and some OOP knowledge) to use it.

example stuff would be:
Sprite sprite = new Sprite( getImage( "guy.png" ) ); // Create a sprite
sprite.move( 0, 10 ); // there are other simple ways to move sprites
..
sprite.render( g ); // 'g' is passed to the function automatically (its simpler then it sounds)


but the tutorials on the site are simple enough to use...

samw3

Member

Posts: 542
From: Toccoa, GA, USA
Registered: 08-15-2006
Hmm.. thanks for the comments. I was thinking more along the lines of what game should a veteran programmer/budding game programmer write to start with?

@insane I realize the benefit of project management and accomplishing large goals. If I were to program games, it would be for a hobby. I have a day job coding in a government research firm... believe me I know project specs and I don't need middle management for my hobby. No offense.

@jester I will check out GTGE as I am well versed in java.

But for the rest, are there any creative minds out there that may have an idea for a basic game (as outline in Clint's post) to jump start my brain?


------------------
Sam Washburn

[This message has been edited by samw3 (edited January 22, 2007).]

InsanePoet

Member

Posts: 638
From: Vermont, USA
Registered: 03-12-2003
None taken, I know exactly what you mean. People come here for different reasons.

------------------
"I find myself a desire which no experience in this world can satisfy, the most probable explanation is that I was made for another world!"
-C. S. Lewis


IRISH PIRATES

CPUFreak91

Member

Posts: 2337
From:
Registered: 02-01-2005
quote:
Originally posted by samw3:
My Question is this. Does any one have "Hello World" type ideas if someone is solid in programming but new to game programming and would like to tackle these objectives? (i.e. a single player 2D functional game)

This would be good for someone switching langs too.


In python/pygame it would be:


import pygame
from pygame.locals import *

pygame.init() #Initialize all Pygame modules
screen = pygame.display.set_mode((YOUR-SCREEN-WIDTH, YOUR-SCREEN-HEIGHT),32) #Set screen size, and bits-per-pixel (32)

Image = pygame.image.load("path to image")
Image.convert() # convert the image into a format that Pygame understands from the beginning so that pygame does not have to do it each time the image is blitted to the screen.

screen.blit(Image,(0,0))
pygame.display.flip()

That would be the simplest "Hello World" in Python/Pygame

------------------
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2

[This message has been edited by CPUFreak91 (edited January 22, 2007).]

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
Hey Samw3!

I'm glad you found that interesting enough to break out into a separate discussion.

You asked,

quote:
Does any one have "Hello World" type ideas if someone is solid in programming but new to game programming and would like to tackle these objectives? (i.e. a single player 2D functional game)

My answer to this question might feel trite or lame, but generally what I do is just write the game I want to play. Am I in the mood for a top-down space shooter? Then I'll write one. Getting a moving spaceship in the style of Asteroids is a fair bit of work if you're not brushed up on your trig. Then you can build on it by adding enemies, or asteroids, or a scrolling starfield, bullets, planets to land on, warp holes to take you to new levels, an inventory system, money, fuel, etc etc etc. The list goes on and on as far as how you can expand it. And then when it gets too big and clunky to keep adding stuff on, get it to a stable position, freeze the code, and start work on another project (whether it's a better-structured rewrite, or another project entirely).

But space isn't your bag? Well, a top-down infantry shooter can be fun, and again doesn't need too many graphics (just shoulders and a head, and spin it 'round). It's expandable in the same way, but can still be a very basic (but complete and fun) shmup without very many features.

You like platformers? They take a little more work, but are still very doable, especially if you use a well-made game engine (like the Torque products or Blitz or something). Even just using a nice graphics library like Allegro is nearly essential with a starting project -- if I had to add a 4th one to the list it would be:

4) You are not allowed to create any kind of game engine until you have created something playable in a an existing framework.

Don't take this to mean that you have to start with Irrlicht or Torque or Ogre or something -- I don't mean that at all. Even just making something in Visual Basic and moving picture boxes around on the form is an existing "framework".

I'm sure I'm not the only one who's created a generic game engine here, and I must say I never fully appreciated existing game engines until I tried to write my own. Biting off more than one can chew is a great way to encourage stagnation and frustration.

I guess that's what all of this comes down to -- just keep moving, and that's why I say to write something that you'd enjoy playing. Do something that makes you squeal with a bit of delight when you get it working, and you waste the next 30 minutes playing around with your game's latest feature. Take the kind of game you've always enjoyed playing and make your own little version of it -- even if it just recreates your favorite feature from a game. For instance, if your favorite kind of game is Final Fantasy style RPG, then a way to write a very simple game in that style might be to just create the walk-around engine. But even better than that in my opinion, would be to create just a battle engine where your guy fights monsters that come up, you pick attacks, they attack, etc. Just the RPG battle screen, and make a little game about it. A problem with making the RPG walk-around game is that it asks for a lot of content up front, and a small version of it isn't that interesting. The battle engine gets things started off with a bang, and is a pretty manageable game.

As far as what to write it in, some of my first graphical games were written in Visual Basic with moving picture boxes around the screen. I learned a ton, and didn't get bogged down with trying to learn DirectX or Allegro or SDL -- I just wrote a game, and as it progressed, I slowly upgraded each component. That's such an ideal situation for learning graphical games -- I totally encourage people to start with something like that. Don't try to hit a home run right off the bat -- don't even start in the batting cages. Play tee-ball and make sure you can hit the ball there, and then move on.

</rant>

This post wasn't as organized as most of my others, but I hope it gave you an interesting opinion to think about.

The important thing really is just to keep yourself moving and motivated, and I tend to let myself wander and do whatever interests me. I try to make games a fun way for me to stay sharp as a programmer -- in the past couple of years I've used hobby game-programming to learn SQL, Regex, Telnet/VT102 network protocols, pathfinding, weighted-tree decision AI, dynamic code compilation/linkage, and a couple of new languages. I try to pick something that's a little stretching (but not too much), and work at it as long as I'm interested in it, then I move on. Pick from the start if it's going to be a project you see through to the end or if it's just a fun little jaunt that you don't expect to publish -- it makes a big difference, and both kinds of projects have their uses.

Cheers!

In Christ,
clint

[This message has been edited by HanClinto (edited January 22, 2007).]

D-SIPL

Moderator

Posts: 1345
From: Maesteg, Wales
Registered: 07-21-2001
quote:
Originally posted by samw3:
In another post the highly revered HanClinto just posted the following wisdom:

My Question is this. Does any one have "Hello World" type ideas if someone is solid in programming but new to game programming and would like to tackle these objectives? (i.e. a single player 2D functional game)

This would be good for someone switching langs too.



I couldn't agree more with HanClinto. The thing is you have to start somewhere. I remember Peter Molyneux from Lionhead Studios talking about how he started Populous. Basicly he was messing around with lego and decided to code something similar for fun, then someone thought it would be fun if it had people and it just grew from there. He could hardly program, he just picked it up as he tackled each new problem. He went onto sell that game and make a LOT of money.

Start simple and build it up from there. I have seen so many times, people jumping into massive projects, getting discouraged and then jumping into another massive project, and repeating the cycle. They never learn to program well and spend all of their time talking about all of the great ideas that they have. What they should have done, is kept the idea in incubation and actually start working towards it.

If people set aside an hour every day to learn 1 new concept and practice it within months they would be a lot better programmer for it. Just nail one thing at a time. Practice, practice and practice some more and suddenly it will all make sense.

In summary my advice would be to start TODAY. Make some milestones and keep to it, make some time everyday to go over/learn a new concept (be it pointers, message handling, vectors, etc etc). Start with putting an image on the screen. Then move that image with keyboard input. Then add some coins so that when the image collides with it, it adds to your score. Just build it up slowly, understand what is happening and then add a new feature.

When you have done all that, you'll know that you have the ability to write a good 2d game. Hope this helps.

------------------
"One World. One Web. One Program." -Microsoft promotional advertisement
"Ein Volk, ein Reich, ein Fuhrer!" -Adolf Hitler
"I believe in freedom... not freedom like America, freedom like a shopping cart"

jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
what if one of us created a list of milestones for a basic game? sort of like a primer course for making a mario bros. game (a little complex but it doesn't have to be all at once) or pacman.
AndyGeers

Member

Posts: 45
From: London, UK
Registered: 06-20-2005
When I was growing up, the game I ended up coding in each new language I wrote was a hopelessly over-ambitious Age Of Empires type RTS game (though this was before AOE got released) - first in Quick BASIC, then in C, and finally in C++ with Allegro.

Whilst I wouldn't necessarily recommend stretching beyond your reach, the advantages of a particularly ambitious project is you usually get pushed to try out all of the language features available to you, and even if you will inevitably fail to finish, it will definitely teach you a lot about how to program in that language. I also find lots of interesting whizzy things to try out a great motivation to keep programming, even if it doesn't help the game itself get finished.

------------------
http://www.geero.net/

CPUFreak91

Member

Posts: 2337
From:
Registered: 02-01-2005
quote:
Originally posted by D-SIPL:
Start simple and build it up from there. I have seen so many times, people jumping into massive projects, getting discouraged and then jumping into another massive project, and repeating the cycle. They never learn to program well and spend all of their time talking about all of the great ideas that they have. What they should have done, is kept the idea in incubation and actually start working towards it.


I try to learn a language well, and I'm still trying to learn the whole Programming Philosophy well (some may argue that there is no one Programming Philosophy but I've chosen the UNIX one to start with)

quote:
If people set aside an hour every day to learn 1 new concept and practice it within months they would be a lot better programmer for it. Just nail one thing at a time. Practice, practice and practice some more and suddenly it will all make sense.


Same thing goes with music instruments, you gotta practice a lot. That's probably why I haven't mastered the Violin yet, I practice more coding than I practice an instrument.

quote:
In summary my advice would be to start TODAY. Make some milestones and keep to it, make some time everyday to go over/learn a new concept (be it pointers, message handling, vectors, etc etc). Start with putting an image on the screen. Then move that image with keyboard input. Then add some coins so that when the image collides with it, it adds to your score. Just build it up slowly, understand what is happening and then add a new feature.


Very good points. I like them. It's hard to convince people to slow down though.

------------------
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2

Nomad
Member

Posts: 63
From:
Registered: 06-29-2004
I remember seeing something to this effect on gamedev.net (I think it was there), just a list of "clone" games to make to get yourself warmed up.

1) Tetris (boo yeah) - concepts are just images, game goals, etc.
2) Breakout/Arkanoid - concepts along the lines of level design now
3) Pac-Man - AI is introduced, along with more levels
4) Platformers (say Mario) - bigger levels, bigger AI, scrolling stuff
5) RPG (say something early, like Dragon Warrior) - complicated event systems, etc.
6) ??? (maybe something else here, but I think here is where they let you loose)

I know many people aren't exactly satisfied with a "clone", but obviously no one is grading you on precision. Make tweaks as you please, just have some extremely clear, blatant goal in mind.

Like I said, I ripped this list off of an article I found almost certainly on gamedev.net in the beginner articles section. They explain more, and there might be stages I'm skipping.

For myself, I did the Tetris knock-off with C and SDL, then the breakout with C++ (ooh, OOP) and SDL (which somehow ruined itself on my Mac), and my last bit was an Asteroids game with C++ and OpenGL (not in the sequence, but still great, seeing all the power of modern graphics programming going into little white lines). Currently, I am planning a platform game in the vein of Donkey Kong, to keep it more at the level of a Pac-Man game rather than the full-on side-scroller.

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
quote:
Originally posted by jestermax:
what if one of us created a list of milestones for a basic game? sort of like a primer course for making a mario bros. game (a little complex but it doesn't have to be all at once) or pacman.

I did something similar to this, and gave a workshop on it at the last CGDC. Lemme' see if I can find the link...

Ah yes. Here it is.

It's about as simple as one could get and still have what one might call a "complete platformer". There's a zip file with a short Powerpoint and a series of Python files that show the gradual progression from one step to the next. It's an extremely basic progression, and shows how someone can learn to program just like D-Sipl said -- putting a picture on the screen, moving it with keyboard input, and slowly adding more things. I show step by step how to do something like that.

Is that sortof what you were thinking, Jestermax? Maybe I should take all those files and create a webpage out of it so that people would be able to follow it easier, I dunno'.

Cheers!

--clint

jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
yeah, thats great!
i was more thinking of a guideline of milestones for a sample project without providing code. so that someone could create a game using their own code but get used to a development cycle that works.

however your idea is better

Something like this could give CCN the image of being a wicked-awesome source for learning how to code games (not that i'm saying it isn't already... lol)

samw3

Member

Posts: 542
From: Toccoa, GA, USA
Registered: 08-15-2006
Thanks for all the great comments!!

I particularly like IdolSMASH! ) I have only read the readme however.

And the five from gamedev.net seem like a good start.

I think I will apply the "One thing" rule to these however.

Take something that already exists and add "one thing" and only one thing to it to extend it a little.

I have a lot of experience with project management. As I work through these, I think I will try to build jester's milestones to help future game coders.

God Bless!

------------------
Sam Washburn

jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
stylin'. i would've killed for this sort of thing when i was starting out. well... by kill of course i mean...not kill...or kill if it was a robot or something...
Calin

Member

Posts: 358
From: Moldova
Registered: 12-04-2006
I think you should take the bull by it's horns (Romanian saying). Learning hello word games would be a waist of time. You can pick a free rendering engine like Ogre or Irrlicht (you could pick Torque as well but it has a step learning curve at least) and start working with that. All you need is to get accustomed with various techniques used in game dev: camera, character moving , ray picking, collision detection, etc. As HanClinto mentioned think of a game you'd like to make and start making it. With 30 years of programming exp I'm sure you won't have any problem using a full blown engine.

Calin.

[This message has been edited by Calin (edited January 23, 2007).]

jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
30 years of programming experience?!?! how old do you think we are??? (well... some of us...lol, i remember having certain conversations with TwoBrothersSoftware about microprocessor programming back in nam...)
Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
Yeah really, thats 3 lifetimes of experience. hmmm...

------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto

samw3

Member

Posts: 542
From: Toccoa, GA, USA
Registered: 08-15-2006
I believe Calin was slightly exaggerating my claim here of 20+ years programming experience. Actually it would be 24 years exactly. I started when I was ten on an Atari 800XL. I count my pre-teen years since I spent more time coding then than most people would at a full-time job. By sixteen I was working with my aunt doing unix sysadmin, coding unix shell scripts to parse weather satellite data on silicon graphics machines. Then the Internet happened and its been a blur since then. I'm currently working with a government research company doing weird things. Not weird like black helicopters or alien space ships, but more like AI systems for machine analyzed tuberculosis testing. Not the most adventuresome work, but it pays well.

I have high hopes for all the young coders here. It reminds me of younger days. The best advice I could give is: Give God the priority and he will lead you down a path that your wildest dreams could never imagine.

------------------
Sam Washburn

[This message has been edited by samw3 (edited January 23, 2007).]

Calin

Member

Posts: 358
From: Moldova
Registered: 12-04-2006
quote:
Originally posted by jestermax:
30 years of programming experience?!?! how old do you think we are??? (well... some of us...lol, i remember having certain conversations with TwoBrothersSoftware about microprocessor programming back in nam...)

that's what I recall, sorry if I'm mistaken.

jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
@samw3: then i shall call you "Zero Cool"

as for Calin: i'm not even 24 yet! lol, so all of you old-timers have a bit of an advantage over me

Calin

Member

Posts: 358
From: Moldova
Registered: 12-04-2006
it's 20+ not 30. I wasn't way off =]

http://www.christiancoders.com/ubb/Forum6/HTML/000259.html

Calin

Member

Posts: 358
From: Moldova
Registered: 12-04-2006
gee guys I can't keep up with you at posting.
Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
I started at 9. I just realised I've done more than a year of coding. I thought my date was last year in march. But it goes back to 4/6/05 was one of my first days.

------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto

jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
ohhhh, i think i see whats going on here. if i'm not mistaken, samw3 or "Zero Cool" was talking about gaming sources for others that are just starting out in game programming, not necessarily for himself.
samw3

Member

Posts: 542
From: Toccoa, GA, USA
Registered: 08-15-2006
@mene I must say that you have done a fantastic job at tackling coding problems and you quickly pick up on new concepts.

The best thing for me was to learn to understand programming as a general practice that could be expressed in several different ways and languages. Coding is a tool to teach a computer to solve problems.

Languages change, the stuff I started in nobody has ever heard of today, but the principles I learned when I was young gave me a head start for my career.

Let me know when you want to tackle object oriented programming and I will introduce you to GoF's design patterns. I wish I had those when I was learning c++, but then again.. that was when they invented c++ so.

------------------
Sam Washburn

samw3

Member

Posts: 542
From: Toccoa, GA, USA
Registered: 08-15-2006
no, actually, Jester its for me. I was kind of farming for methodologies and trying to find the hangups that people have run into with game programming. I haven't done any of that for about ten years and even then I didn't have any structure to it... just kinda coding from the hip if you know what I mean.

This thread has given me some great methodologies to build off of to hone my skills towards games. You see my company might be submitting a proposal for work in the "serious games" arena and I feel a little rusty there.

------------------
Sam Washburn

jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
delicious object-orientedness...


EDIT: @samw3: oooo thats shiney

[This message has been edited by jestermax (edited January 23, 2007).]

Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
Wow, I don't know what to say. Other people can compliment me in academics/all that other stuff. But saying that from a 24 yr guy...

I would like to return that I'm grateful that you've taken time with a guy like me who started out thinking that WaitKey was End. I've noticed that most, if not all of my threads you've replied and answered, you've offered solutions to my problems as well as answered my PM's. God bless you and do the same for you 7 times over.

As for the OOP, thanks. Thank You. TY. Tanks. Tank You. Thank U. TU. Tank Koo. Tank U...

------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto

[This message has been edited by Mene-Mene (edited January 23, 2007).]

samw3

Member

Posts: 542
From: Toccoa, GA, USA
Registered: 08-15-2006
Well, just keep up the good work. I guess that can be said to everyone!

The computer field could use a lot more salt and light. Stick with the truth and do your best.

Here is a thread fork to ponder.

I believe God has a programmer's heart

In fact in John 1:1 in the SWV (Sam Washburn Version) of the Bible reads: In the beginning was the code...

If you look at physics on the smallest level. Concepts like string theory compare all of existence with organized vibrating pools of energy. Energy is nothing but force applied over time. Organization with a purpose is code.

In the beginning... (Time)
God said.. (Code)

Quantum physics is biblical and exposes God's "code".

------------------
Sam Washburn

Xian_Lee

Member

Posts: 345
From:
Registered: 03-15-2006
I'm a long time gamer, long time semi-casual programmer, but I've never had much luck breaking out of the command line. Right now, I'm focusing my programming efforts in Java, and I'm looking for Java game dev basics. I would prefer to work in applications instead of applets, but it's not impossible to move from one to the other. Anyway, does anyone have a recommended starting point (in terms of tutorials) for getting into graphical game design in Java? I feel like I have general understanding of Java, and I've had experience in command-line C, BASIC, PHP, and other odds and ends.

I'd appreciate being recommended to any tutorials or getting started guides that target my demographic that you may know of. Thanks!

------------------
If games please me, and if it's possible to please God with games, why on earth wouldn't I make games?

Tonnyx

Member

Posts: 140
From: Indiana, USA
Registered: 08-02-2005
Hunt the Wumpus.

quote:
Originally posted by samw3:
In another post the highly revered HanClinto just posted the following wisdom:

My Question is this. Does any one have "Hello World" type ideas if someone is solid in programming but new to game programming and would like to tackle these objectives? (i.e. a single player 2D functional game)

This would be good for someone switching langs too.


------------------
it's pronounced "tonics"

samw3

Member

Posts: 542
From: Toccoa, GA, USA
Registered: 08-15-2006
@tonnyx Can you believe I had to google "Hunt the Wumpus"? In my defense it is two years older than I. Could one implement a graphical version, or would that be too disrespectful? hmm..

@Xian_Lee I don't have much experience with games yet, but I heard on the forums here that GTGE is a good engine to start with for game development. Also, try searching the forums for "Java" as game dev is what is mostly talked about around here.

God Bless!

------------------
Sam Washburn

Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
Hey - Xian! About time you started posting more.

Tic-Tac-Toe is always a good 2D sp game to make - although it's boring beyond belief.

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
Don't have the time to read all the posts... lol.. so don't know if this was already mentioned but...

The Hello World, in my mind, for games would be the Guessing Game...

EDIT: reason, due to it teaching about the game loop and taking input from the user, game logic and finally output to the user. It is the simplest complete 'game', and teaches you the basic structure of a game.

------------------
www.auran.com

[This message has been edited by dartsman (edited February 15, 2007).]