View previous topic - View next topic |
Author |
Message |
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Mon Dec 11, 2006 10:00 am Post subject: The NEW Allegro Game Programming Series |
[quote] |
|
Okay, I have rewritten my Allegro Game Programming Series articles
and you can find the new and improved articles here:
http://www.ccpssolutions.com/agps/
Each article now has 2 corresponding downloads: dev-c++ project & linux makefile
each download is a .zip file containing the source & data files required to build each project.
Please give me some critism and comments. :)
EDIT: I've written another article PART IV - It covers a much better scrolling method than Part III, and also adds a title screen to the project.
Part V is in the works, and I plan to cover using loaded tilesets, instead of hardcoded tilesets.
Let me know what you guys think! _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
|
RedSlash Mage
Joined: 12 May 2005 Posts: 331
|
Posted: Tue Dec 12, 2006 1:02 am Post subject: |
[quote] |
|
Umm... are these articles or are these code examples??
|
|
Back to top |
|
|
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Tue Dec 12, 2006 2:48 am Post subject: |
[quote] |
|
RedSlash wrote: | Umm... are these articles or are these code examples?? | Both. True, mainly a code-dump, however it has been my personal experience that it makes it easier to learn if shown a working example. I commented everything, so I figure that there shouldn't be much confusion. I do assume that the reader at least knows the basics of C++ programming.
I may write some lengthy explanations and add a few diagrams at a later date, but I do not really see the need for it, unless someone requests it, I don't think I'll spend the time doing so. _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
|
RedSlash Mage
Joined: 12 May 2005 Posts: 331
|
Posted: Tue Dec 12, 2006 7:03 am Post subject: |
[quote] |
|
From my experience, every time I get passed someone else's project (which is just source code and no documentation), I spend hours/days/weeks of work deciphering the code despite how well the code is commented. I find that the reason I could only do that without getting lost is due to my prior programming experience that I have built up through years of work.
Anyways, my point is, that without the explanation, a person who is in the process of learning game programming will have a hard time following your code. I think it would be a good idea to write a blurb which would go through a near line-by-line analysis of the code (like nehe's tutorials).
Quote: | I do assume that the reader at least knows the basics of C++ programming. |
Your source code consists of mainly C code. Making C++ a prerequisite may confuse people who learned C++ initially. The prereq should be knowledge of C code instead of C++.
|
|
Back to top |
|
|
DrunkenCoder Demon Hunter
Joined: 29 May 2002 Posts: 559
|
Posted: Fri Dec 22, 2006 12:43 pm Post subject: |
[quote] |
|
RedSlash wrote: |
Your source code consists of mainly C code. Making C++ a prerequisite may confuse people who learned C++ initially. The prereq should be knowledge of C code instead of C++. |
Quite horrible C at that. _________________ If there's life after death there is no death, if there's no death we never live. | ENTP
|
|
Back to top |
|
|
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
|
Back to top |
|
|
DrunkenCoder Demon Hunter
Joined: 29 May 2002 Posts: 559
|
Posted: Sat Dec 23, 2006 9:58 pm Post subject: |
[quote] |
|
DeveloperX wrote: |
I beg your pardon?
Enlighten me then. |
Almost total lack of abstraction.
Exessive commenting.
Language feature abuse.
Monolithic state handling.
Inconsistent naming convention.
And that's part one :)
Really in the days that I thought introductionary programming, that code would not receive a passing grade.
Im sure it serves you well and I admire the initiative and will to give something back to the community Im just dubtfull about how applicable it really is :) _________________ If there's life after death there is no death, if there's no death we never live. | ENTP
|
|
Back to top |
|
|
LeoDraco Demon Hunter
Joined: 24 Jun 2003 Posts: 584 Location: Riverside, South Cali
|
Posted: Sun Dec 24, 2006 7:01 am Post subject: |
[quote] |
|
I concur: that is really ugly code. However, I think the Blub Paradox will probably fit here: no matter what alternatives are shown, DeveloperX is simply programming in Blub. _________________ "...LeoDraco is a pompus git..." -- Mandrake
|
|
Back to top |
|
|
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Mon Jan 01, 2007 9:59 pm Post subject: |
[quote] |
|
DrunkenCoder wrote: |
Almost total lack of abstraction.
Exessive commenting.
Language feature abuse.
Monolithic state handling.
Inconsistent naming convention.
And that's part one :)
Really in the days that I thought introductionary programming, that code would not receive a passing grade.
Im sure it serves you well and I admire the initiative and will to give something back to the community Im just dubtfull about how applicable it really is :) |
abstraction is not for beginners. Do not complicate matters for people who do not understand. My goal was to teach the basics without confusing the reader. I've had several positive comments regarding my articles, and some have even requested one-on-one tutoring because of my style of teaching being easy to understand.
I commented excessively to communicate the different things in the article itself instead of breaking out of the code, and into another paragraph then back to code. I found it difficult to follow when people break the code listings into several sections.
Language feature abuse? WHERE??? Be more specific.
State handling was implemented in a simple, easy to understand method. I do NOT believe that such simple methods be used for "serious" projects, but for those learning, its perfectly fine to use.
naming convention is not inconsistent.
If you think it is, then show me where.
Because I did the best I could to avoid inconsistencies.
If that doesn't recieve a passing grade then you were a shitty teacher. To me, if it gets the job done, then it should pass.
You can be doubtful about how applicable the code is to you, but to others it has already helped them get started on their "journey" to becoming a game programmer.
I didn't say "this is how things SHOULD be done" in my articles, what I am giving isn't the "BEST way" to do something either, it simply WORKS, and can be used to LEARN how to do things.
I'm not a "standardized instructed programmer" one whom has been taught by others; I am a self-taught programmer from a variety of sources. I have many years of experience solving problems & producing working implementations in several languages.
I decided to help others to get started, to avoid having to go through the same troubles that I did. Look an Mr. Unknown (Jeff) I tutored him for a little more than a year, and now he has completed several projects in QBasic & PHP. I helped him from not knowing how to code a simple program to writing fun, playable games.
That in itself was a major accomplishment, and if you think that that doesn't qualify me to write articles to help others, then you can just go about your own business, and stop criticizing me. _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
|
RedSlash Mage
Joined: 12 May 2005 Posts: 331
|
Posted: Mon Jan 01, 2007 10:38 pm Post subject: |
[quote] |
|
I agree with not complicating beginners. DevX did not need to abstract or modulize the program due to the size and simplicity of the program. Though the code is over commented, I do agree that it helps the beginner. I would've liked to see some paragraph written explanations though.
However, I too can point out the example of inconsistant naming conventions.
Code: | BITMAP* DoubleBuffer;
// declare and initialize our game run-state tracking variable
int game_state = STATE_TITLE;
|
Here it is: DoubleBuffer vs game_state. To make consistant, either change DoubleBuffer to double_buffer or game_state to GameState. Same with functions:
Code: | void DebugBox (char* debugMessage);
// initializeGameEngine ()
// init Allegro, any game variables, and set the game run-state
void initializeGameEngine (); |
Capitalize "i" in initializeGameEngine to stay consistant.
One thing I was also confused about is:
What is this used for? I remember back in DOS programming days, we use this trick to lock memory pages a certain function was in. This doesn't seem to be applicable anymore.
As for language abuse, language abuse is almost a given to get anything done in C. Abusing the C language is what makes C so great. C++, on the other hand, is a different story.
Hope you don't see me as criticizing, I'm just pointing out a few things about what was said that does need some attention.
|
|
Back to top |
|
|
DrunkenCoder Demon Hunter
Joined: 29 May 2002 Posts: 559
|
Posted: Tue Jan 02, 2007 8:37 am Post subject: |
[quote] |
|
RedSlash wrote: |
What is this used for? .
|
It's an allegroism.
And in response to DevX:
Language feature abuse as in excessive use of defines like 'IF_EXIT_KEY' .
Also most of the time it's easier to understand code that exhibits good locality since it serves well to highlight what's important and lets readers narrow their attentionspan.
And really the commenting doesn't communicate diffrent things because it really just looks like this:
Code: |
// call our engine initialization function
initializeGameEngine ();
// call our engine process function
processGameEngine ();
// call our engine shutdown function
shutdownGameEngine ();
|
The only thing those comments do is add noise, loads of it.
DeveloperX wrote: |
If that doesn't recieve a passing grade then you were a shitty teacher. To me, if it gets the job done, then it should pass.
|
No actually I was one of the best regarded because I thought students how to think programming not how to get things working by coincidence. And as a professional that attitude should really be alarming.
Also note that although the code mostly lack abstractions, you've managed to violate what litle there was:
Code: |
IF_MENU_KEY
{
game_state = STATE_MENU;
DebugBox ("DEBUG: SPACE Pressed ON GAME. Suspending Game to MENU");
}
|
_________________ If there's life after death there is no death, if there's no death we never live. | ENTP
|
|
Back to top |
|
|
white_wolf Pretty, Pretty Fairy Princess
Joined: 13 Nov 2006 Posts: 10
|
Posted: Tue Jan 09, 2007 3:50 am Post subject: |
[quote] |
|
Ok, I can understand critiquing bad code, but give the guy a break; he's helping people who are looking to even get started--people like me.
I started off with Game Programming All in One, 2nd Edition, which helped a lot... but then, I got really stuck (with scrolling) and looked at DeveloperX's allegro tutorials; it was a great help to me.
DeveloperX, I have to give it to you for helping us newbs out. I am finding it hard to even create a demo, but I know I will be proud when I am done.
If you needed an idea, and I know it's a big leap, but how about a simple attack mechanism..? I.e. hero attacks enemy sprite with sword.
Anyway, good job and g'luck.
|
|
Back to top |
|
|
Ninkazu Demon Hunter
Joined: 08 Aug 2002 Posts: 945 Location: Location:
|
Posted: Tue Jan 09, 2007 6:08 am Post subject: |
[quote] |
|
In order to do an attack, he has to introduce better collision detection. I'd like to see where he goes with that, since it can be tricky with variable-sized objects. Even trickier at high velocities.
Right now he has an article on something so simple I could write it in 5 minutes.
What's next? I would suggest talking about AABBs' collision detection and response. I'm researching the topic right now (the separating axis theorem if you're interested) so I can implement it correctly in my own set of lessons I'm going to be giving at my university. I think I might record them so I have a complete record of what was taught.
I have to say that his method of checking direction and just one tile's solidity is a dangerous way of doing things. It's just not robust enough in most uses.
|
|
Back to top |
|
|
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Sun Jan 14, 2007 7:02 pm Post subject: |
[quote] |
|
Ninkazu wrote: | Right now he has an article on something so simple I could write it in 5 minutes. |
Considering you are NOT an inexperienced newcomer, this holds no merit. I did not write my articles for people who have the experience to accomplish the task without it. _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
|
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Sun Jan 14, 2007 7:04 pm Post subject: |
[quote] |
|
white_wolf wrote: | If you needed an idea, and I know it's a big leap, but how about a simple attack mechanism..? I.e. hero attacks enemy sprite with sword.
Anyway, good job and g'luck. |
I'll work on a new article as soon as time permits.
And, thanks for your support. I appreciate it. _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
|
|
Page 1 of 3 |
All times are GMT Goto page 1, 2, 3 Next
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|