Allegro 5 Book
AleX-G Squadron

Hi all!
I have like a year that i have stopped allegro programming for 2 big reasons:

1) Because i had to start web development for personal reasons
2) There was no book! If there was a book, i would have been using allegro.

Why do i need a book? Because if there is no book, there is no real guide.
When it comes to programming, you have to learn theory by the book and practice by videos and practice. I know that is the manual, but i only managed to add an icon to my game. The manual is not simple, really. It is like it was written by a robot. He will not understand what you want to. Does the manual tell me how can i make 2 doors that teleport the player?
I know it sounds stupid, but really, i see great potential in allegro and a book is ruining a lot of its brightness. Not to talk about 2 guide videos (mike geig and coding made easy)
Why only some people got the right information? Why i cant create the game i want only because i cant have a book? (and the book is only where it starts)
I hope you understand

Thomas Fjellstrom

Does the manual tell me how can i make 2 doors that teleport the player?

Get a general game programming book for that. That has absolutely nothing to do with allegro itself. The wiki has some tutorials that are a lot better for some people than just reading the manual.

J-Gamer

Edit: beaten

Arthur Kalliokoski

Does the manual tell me how can i make 2 doors that teleport the player?

That's way too specific for a game library. Google is your friend here. And have you noticed the wiki?

AleX-G Squadron

I dont know but your replies seem just for justification.
My question is: allegro 5 book. Any? NO! Epic fail.
Videos? Only 2 guys! I hope you find them!
Wiki is like a manual. I hate wiki. The manual is better.
This is why i wrote the sentence:
"I know that is the manual"
I learned to make great websites for a year whereas with allegro just a game with a ship.
Really, nothing else. There is a big problem. This is a great game engine. It got potential.
No books, 2 videos. Really, a year has passed, nothing changed.

The teleportation is an example, which you based all your reply on that.
I mean that is there a book to make a very very very very simple game?

My question is:
A book for Allegro 5?

[sidenote: I wrote things just to explain that i dont want to hear other things, except the book, as i have already have read a lot of other forums questions like this one]

amarillion

For there to be a book, somebody has to write it first. That is a lot of work. Not something that you do on a sunday afternoon.

Thomas Fjellstrom

I personally don't think the wiki is like the manual. There's a lot more information there.

But yeah, there isn't a book. As amarillion said, someone would have to write one.

Trent Gamblin

And yet lots of people are making games without a book. So it's just you who thinks you need one. All of the information that would go in a book about Allegro you could compile yourself from the manual, the wiki, wikipedia, and the rest of the internet. I don't really understand why you're complaining about this, as if you expect the Allegro 5 devs to quit their dayjobs and write you a book. If you want a book either hire someone to write it, or do what I said and compile the information and write one yourself. You'll learn more than just reading a book that way too!

AleX-G Squadron

I understand. Thank you for the replies.
I could even write the book myself as an online pdf for free, but i would need great help from the forum, or someone else who is friends with others in this forum can make the book. I dont know but the community has to make the book, it is like an emblem. After all, who makes it can make great money. I will surely buy it.
So i mean that it is a real loss not to make the book.
Please anyone make it! :'(

@trent
BTW i have already made a game man, i mean with a book you create more great games or learn the basics at least.

Trent Gamblin

I don't think I can make a useful book for new users myself. I don't know what is most important to cover and whatnot. It seems teachers make the best books. So I'm out.

Matthew Leverton

Complaining that "we" haven't written a book is as silly as complaining to your next door neighbor that he hasn't built a rocketship for you to fly around in. Just because "we" wrote a library on our on time for our own purposes doesn't mean we are obligated to provide any support to anybody in the form of a manual, a wiki, or a 1-800 number.

A book would be great, but what's the benefit to the person writing it? He already knows how to use the library. Sure he might make some money selling a few copies, but most people would probably just pirate the PDF and complain about how it doesn't cover the topics they want.

It's much easier for individuals to write wiki articles on topics that interest them. Sure it's not as coherent as a book written by a single expert author, but beggars cannot be choosers, eh?

AleX-G Squadron

The most important things are really easy.
I know them by heart even if i have one year i dont program with it anymore
I will sort them by chapters:

1)Installing Allegro
2)Creating your first program
3)Using text and fonts
4)Creating geometrical objects
5)Advanced objects
6)Input Keyboard
7)Input Mouse
8)Timer
9)Allegro for iPhone

There are a lot more, millions more! All this work has to built itself on a book!

Making a book makes a lot of sense, really. I can make the book myself man, it is not that i am really complaining. It is that i want to have all allegro programming basics in a book. It has to be made. After all, you have to share it with the world in a great way. For example, i see c++ in a lot of books, millions of videos (i have made my video tutorials myself), great community, all kind of jobs require it and lots more. Allegro has all of it. I know it. It has to be documented in a book.

Trent Gamblin

Wha? You could write each of those chapters in 1 page. ???

AleX-G Squadron

I mean, these are the basics. At least this is how i think about it.
If you know these, you are ready to make great games or applications yourself.
I dont understand why the idea of the book is kinda rejected from allegro programmers for years. Any explanation please? Maybe i can help. Really.

@trent
Not 1 page man. I didnt mean to write it all in 1 page. I mean i know the basics.
(i think these are the basics)
I can write the book, but that is all i know.

Matthew Leverton

I can make the book myself man, it is not that i am really complaining.

Go write the book then!

AleX-G Squadron

First of all, the only way of pirating the book is by buying it on pdf and posting it online, or buying a copy of the real book and scanning all pages. I am a php programmer and there is no way a cracker can get the book for free, unless he is php creator. So actually i can really make the book and post it after a year i guess?
;D, but really i am seriously going to make the book.
If anyone wants to help with something, pls contact me.

@math
I understand. But you could write the book better than me.
And really, it is a stormy welcome on this forum, after like a year.

AMCerasoli

I dont understand why the idea of the book is kinda rejected from allegro programmers for years.

The developers do their job. Writing a book in this kind of free project is not part of it. Suppose that I can't find a function in Allegro that I need, I can take 3 options;

  1. Make the function and submit it to the Allegro developers

  2. Make the function but already customized to your project, so no submitting

  3. Find another library if it's something that should be there...

Personally as a game developer I have no intention to write any addon or something I don't need and submit it to Allegro. And even if I need it I would find another library and just use that along with Allegro.

I'm concentrated in making games, and that takes a lot of time. Others are concentrated in making games but also support the library and other just support the library. Each of these takes time. And writing a book is not compatible with supporting + writing a book or making a game + writing a book. Maybe some tutorials, yhea it wold be good, but a book? What will be the next a movie?

If I manage to finish my game, and I see that it works I could try to make a library compatible with Allegro using enet and protobuf. But that's because I want to. That's how these projects works.

There are other libraries that give you a lot of info. A lot more than Allegro it's true. But never, will teach you how to make videogames, that's something that you'll need to learn by your own, not even a book.

Web development is a joke, compared to videogame development.

Matthew Leverton

And really, it is a stormy welcome on this forum, after like a year.

Your first post wasn't constructive. Saying "the manual sucks; somebody should write me a good book" isn't helpful.

Instead:

If you have concrete suggestions on exactly how and where the manual could be written better, then post them. Anybody who is offended by that is just being over-sensitive. (Note however, the reference manual will never be a substitute for a book that teaches game development.)

If you have encountered difficulties learning some high-level process and you don't want others to have to go through the same struggles, then you should document your findings yourself and create your own wiki article.

If you write a book and want people to help out, then post your chapters and ask for feedback.

AleX-G Squadron

Ok, i understood. Actually i understand the manual.
I even created an icon to my game, on both the game icon and on the task bar on windows. They both worked for all. But there was no guide for me to that logic, i had to logic it myself. You know that the icon is a stupid thing, but what if i dont understand it even from the manual? (as it firstly happened to me)

Web development is a joke compared to game programming, but what could happen if you put a game on your website? There is no jokes on programming. It would seem easy, but the more you work on a project the harder it gets. It is just your brain who lies to you and makes you think that web is easier. If it is easier why you choose the harder route?

@math
You mean after writting the chapters to post them here or just the titles so others can help?

AMCerasoli

If it is easier why you choose the harder route?

  1. Browsers currently doesn't have the potential to run real videogames.


  2. Then there is the "Compatible only with Chrome/Firefox" thing.


  3. All selling platforms have stuffs that you can download and play, that means that you should have something to upload and sell.


  4. I once downloaded a 3D game from the Chrome store and each time I wanted to play the game it was like I was downloading the whole again game each time. The game was simple and ran slower than Battlefield 2 on the same PC.


  5. If databases are currently too slow to store info, even when ran natively I don't want to imagine adding the connection speed and the rest of the factors.


  6. I want the freedom of having something that doesn't depend on any browser and its stupid standards that at the end are not so standard.

Basically that is why I chose the harder route? What about you?

AleX-G Squadron

My response will be simple:
Can your game run google?

I call a game programmer someone who has created Tomb Raider, "at least"
I call a web developer someone who has created a social network, "at least"

Basically, i have made the math and it turns out you need 2-3 years to make the social network and 5-10 years to create a Tomb Raider game. (talking on 8 hours each day learning basis)
I have made 3D terrains with XNA and i am not happy with it. Same with allegro.
The game i have made is total crap. At least for me. As for web development, i have already made the social network and this is why i am turning my back to web.
And btw, i saw your game...

Trent Gamblin

Where are you going with this?

bamccaig

I think that a book would be a big waste of time and money. I have always found the manual to be lacking though. It's more or less just a reference manual, which isn't a very practical guide to getting started fast, in particular for a beginner that doesn't know what they're doing yet. Nobody wants to read over a reference manual from cover to cover before they even really know what can be done. Hell, often you never read over the reference manual fully because often you're only interested in half of a piece of software's functionality anyway. Imagine having to figure out how to use Vim with only a reference manual. :o Besides, it can be hard to wrap your head around something new before you see it actually happening, so if you have to read the reference manual over to figure out how to use Allegro then you'll probably have to read it a second or third time to make full sense of things. In particular, the library is full of dependencies. You can't call X until you've called Y and created a Z by calling al_create_Z, etc. It can be easy to find yourself in a seemingly bottomless read. It's the same thing that makes people end up spending hours on Wikipedia or find themselves in the creepy parts of YouTube. Except those things are usually entertaining, at least. Reading reference documentation is usually pretty dry with a few exceptions; particularly when it isn't making sense or has you jumping all over the place with dependencies.

I think that adding a beginner's guide to the manual might be a good thing. I don't think we should go into detail about making games (e.g., the whole door teleporter thing). That's outside of the scope of the Allegro manual. However, giving a simple tutorial/walkthrough on the basics of the library, and where to go from there, and perhaps even working your way through a pong clone as an example might be a good way to get beginners using Allegro (and with fewer threads asking the very basic questions). It might also be a good place to document good and bad practices. I'm not opposed to working on such a thing myself, but I'm also not promising time or motivation to do it... The wiki is a good place to document intricacies or subjective topics, but I don't think people should depend on a community driven wiki to learn how to do basic things. I think that as a goal we should work to incorporate the most useful parts of the wiki into an organized guide for the manual. Something sequential that beginners can follow through and understand without having to jump all over the place.

  1. Introduction.

  2. Beginners Tutorial

  3. Dos and Donts?

  4. Reference Manual

Those are my 2 cents. :-/

AMCerasoli

Can your game run google?

If my game can run Google? Google is a website... I don't get it... I'm making a game not a browser...

Quote:

I call a game programmer someone who has created Tomb Raider, "at least"

Ok I think that is too much... That's like: "I call someone engineer if he had created a rocket and he had sent it to the moon"...

Quote:

I call a web developer someone who has created a social network, "at least"

That's like: "I call someone web developer if he had no life and he had created a social network just because everyone is talking about Facebook and Facebook is a super engine which would take me 30 Years to develop because its technology comes from Mars, there is nothing in the web more difficult to program than Facebook. You know chatting, pictures and friends oh wow that's so cool and new"...

Quote:

And btw, i saw your game...

Which one? 8-)

Matthew Leverton
bamccaig said:

I think that a book would be a big waste of time and money. I have always found the manual to be lacking though. It's more or less just a reference manual, which isn't a very practical guide to getting started fast, in particular for a beginner that doesn't know what they're doing yet

Summary:

  1. A book is a big waste of time.

  2. The Allegro reference manual is bad.

  3. The Allegro reference manual should be a book.

???

weapon_S

i have already made the social network and this is why i am turning my back to web.

Not to sound condescending, but why not put energy into promoting/expanding that? ???
A 'book' is an excellent project for the Wiki. Although, a separate book might have its merits too: more condensed an overview.
If you think you need a need a book, it apparently is hard for you to process the information you are looking for on your own. If so, I would say you aren't the right person to write that book.

someone972

The basic problem with a game programming book is that there is such a great span of game types, and they take an incredibly varied amount of libraries and coding strategies to implement. Covering everything you could ever need in a book is simply impractical. However, tutorials and examples on Allegro 5 definitely can help. Perhaps something more useful to focus on would be how to design a game. Determining what is needed to implement an idea and then how to find and integrate an existing library, or some guidance on how to begin to create one should one not fit the needs of the game, would be much more useful than showing how to do very specific things. That being said, it could use examples with specifics to help explain and enforce how the information presented could be used. It could even categorize and list some existing libraries/terms to aid in finding the right library.

Knowing the syntax of a programming language or the specifics of how to use a library is only part of being able to truly program. Most of the hard work is learning how to design and implement code within the restrictions of the programming language and libraries that gets one closer to bringing an idea to life. Programming languages and libraries are merely tools; someone can know how to use a saw and hammer, but if they can't think of a design for a cabinet the tools are useless.

Also, because tone and attitude are lost in text, I'd like to make that you know I am not directing this at you or trying to talk down to or criticize anyone. These are merely my thoughts and opinions; I recognize that just because I thought of them does not mean that they are truth. I would love to see someone's different opinion, and hope that you can find what you are looking for with Allegro :).

AleX-G Squadron

Ok, today i got up and started writing the book.
I guess no comments stopped me?!
Just kiddin.
I dont waste my time with the social network because i want the knowledge from computers and not money. People sell their info for paper. I am not that kind of guy.
Most of game programmers start selling their work during the journey to create what they really wanted. This is 100% true, especially with the games nowdays which are awful. And i call an enginner someone who makes a car. Really, these are very hard rules, but you cannot refer yourself as a web developer because you just made a website, or a registration form. Or a game developer because he made super mario. I apply very strict rules to get the knowledge. If you want to get the money, than a basic website, or super mario will make you millions of money. Or the engineer, if he knows how to format the pc.... than he is an engineer! He will get the money.
So judging by knowledge, only when you made a social network you know most things developing websites, after making tomb raider (at least IV) than you have great knowledge, meaning that is perfect, what else could you want more? Same with the car.
After writting the chapter, i dont know if anyone is going to help.
I assume 100 pages in total but it wont be made today!
Also, i tried allegro with visual studio 2012 using monolith of VS2010 installment and it amazingly worked! So i assume the tutorial will be made with visual studio 2012.

@bam
That helped

@am
Q1)Actually i am trying to learn as much as possible from computers

Q2)The game with network

EDIT: Just made the cover

Trent Gamblin

I thought it was a law of the universe that if you started a book with the cover (or a game with the logo) that you'd never finish.

Elias

What about starting the game with the title screen? I think I did that in some speed hack entry and finished it.

alehbeer

The manual is not simple ..[later on].. My question is: allegro 5 book. Any? NO! Epic fail.

Man, I completely disagree. I hold the allegro manual as one of the most well documented and organized library manual I know of. Not to mention the community has been amazing. Epic, no doubt.

Wha? You could write each of those chapters in 1 page.

Agreed. AleX! Write a 10 page document and fill the rest with a picture tutorial how-to! I would be sincerely interested in your picture tutorial on iOS dev.

There is no jokes on programming.

Oh, oh! I got this: "Programming is like sex: One mistake and you have to support it for the rest of your life." Find more at http://www.devtopics.com/best-programming-jokes/

Can your game run google?

Why yes, yes it can. I have made accounting software which could run google. And I have made a browser (early 90s) which could run google.com. Both have easteregg snake games. :o

Programming languages and libraries are merely tools; someone can know how to use a saw and hammer, but if they can't think of a design for a cabinet the tools are useless.

Very well said.

And i call an enginner someone who makes a car.

Sure... that makes sense. Let's forget the who definition of the word. Nevermind biomedical engineering, electrical engineering, chemical engineering, software engineering, etc. And about the not a game programmer thing, I think just about everyone on this site can fairly call themselves such.

As for web development, i have already made the social network and this is why i am turning my back to web.
And btw, i saw your game...

Social networking, huh. You might be doing it wrong.

Arthur Kalliokoski

I thought it was a law of the universe that if you started a book with the cover (or a game with the logo) that you'd never finish.

IIRC, I've read that back in the '30's, artists would paint science fiction themed subjects for the pulp magazines, and authors would have to craft a story around those.

AleX-G Squadron

The book is already 6 pages.... I thought it would take much more!
But i wont publish it immediately as i dont want to make any mistake.
I will try all code again, add some other things or chapters and more.
I laughed so much from the replies, as i knew none will give an opinion.
I will laugh again when i will come tomorrow! :)

Thanks for great replies!

GameCreator

{"name":"13214306211.jpeg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/c\/8c5e2db7a466321e0aa5b867fc729570.jpg","w":300,"h":300,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/c\/8c5e2db7a466321e0aa5b867fc729570"}13214306211.jpeg

http://www.amazon.com/Game-Programming-All-Jonathan-Harbour/dp/1598632892/ref=sr_1_1?ie=UTF8&qid=1345491954&sr=8-1&keywords=allegro+programming

someone972

I laughed so much from the replies, as i knew none will give an opinion.

It seems like there has been lots of opinions presented in this thread ???. Anyway congratulations on getting the first couple pages of the book done. If you need any examples double-checked or critiqued you can always post them here, but be warned: Allegro.cc is famous for being hard critics, as I'm sure you are aware ;).

bamccaig

Allegro.cc is famous for being hard critics...

606462

alehbeer

... These are merely my thoughts and opinions ...

... I laughed so much from the replies, as i knew none will give an opinion. ...

Indeed, indeed.

All joking aside, here is how you do that magical teleport. Simply have a condition, evaluate for its validity in the current game-state and then change the position values as needed.

#SelectExpand
1//Please add proper error checking, spacing, and formating in your own program - it is removed here for simplicity only 2#include "allegro5/allegro.h" 3#include "allegro5/allegro_font.h" 4#include "allegro5/allegro_image.h" 5#include <allegro5/allegro_primitives.h> 6int main(int argc, char **argv){ 7 int i_x = 50; 8 int i_y = 50; 9 int i_done = -1; 10 ALLEGRO_DISPLAY *display = NULL; 11 ALLEGRO_EVENT_QUEUE *events; 12 ALLEGRO_EVENT event; 13 ALLEGRO_KEYBOARD_STATE kbdstate; 14 al_init(); 15 al_set_new_display_flags(ALLEGRO_WINDOWED); 16 display = al_create_display(640, 480); 17 al_set_window_title(display, "Teleport: Use the arrow keys to put the triangle at the X"); 18 al_install_keyboard(); 19 al_init_image_addon(); 20 al_init_primitives_addon(); 21 events = al_create_event_queue(); 22 al_register_event_source(events, al_get_keyboard_event_source()); 23 al_register_event_source(events, al_get_display_event_source(display)); 24 while(i_done != 1) { 25 al_clear_to_color(al_map_rgb(255,0,0)); 26 al_draw_line(100, 100, 150, 150, al_map_rgb(255,0 ,255), 5.); 27 al_draw_line(150, 100, 100, 150, al_map_rgb(255,0 ,255), 5.); 28 al_draw_filled_rectangle(400, 50, 450, 75, al_map_rgb(0,255 ,255)); 29 al_draw_filled_triangle(i_x-10, i_y,i_x,i_y-20.,i_x+10,i_y,al_map_rgb(0,0 ,255)); 30 al_get_keyboard_state(&kbdstate); 31 if (al_key_down(&kbdstate, ALLEGRO_KEY_LEFT)) {i_x-=5;} 32 if (al_key_down(&kbdstate, ALLEGRO_KEY_RIGHT)) {i_x+=5;} 33 if (al_key_down(&kbdstate, ALLEGRO_KEY_UP)) {i_y-=5;} 34 if (al_key_down(&kbdstate, ALLEGRO_KEY_DOWN)) {i_y+=5;} 35 if (al_key_down(&kbdstate, ALLEGRO_KEY_ESCAPE)) {i_done=1;} 36 if((i_x>100&&i_x<150)&&(i_y>100&&i_y<150)){i_x=420;i_y=75;} 37 al_flip_display(); 38 al_wait_for_event(events, &event); 39 } 40 al_destroy_display(display); 41 return 0; 42}

bamccaig

"How to teleport" is a ridiculous thing to teach somebody. It's very context-specific. Figuring out how to solve these problems yourself is what programmers are for. If you can't think your way through a problem like that then you aren't a programmer. If that's the case then you should be using game maker software or hire programmers. The import things to teach are lower-level than that. Things like collision detection and resolution. :-/

AMCerasoli
bamccaig said:

Things like collision detection and resolution.

Yeah, like when you crash your parents' car and need to think how to fix it before they see it.

Arthur Kalliokoski

Yhea like when your crash your parent's car and need to think how to fix it before they see it.

Crashes can usually be figured out with a debugger.

AleX-G Squadron

Wow! Thanks for teleport! I will try to understand the code as i am not that expert. I am working hard for the book and i hope people will understand one day its need.
The forum is a big critic, i know :)
Who wants to give a helping hand i will be grateful! :D

AMCerasoli

Not these kind of crashes, my friend... Not these kind of crashes...

Do you know what is difficult about making a game?

media player

Do you know what is difficult about making a game
release the thing
make some fame
maybe sleep with some girls
have a name
see people reconigze my face
and walk on the street
and feal proud about me?
no cry 
no more bad thoughts about this
and the intrigue that all this causes
when you hear all those voices?

That nobody is helping you
Instead they're always questioning you
If you're able to do this
and if you really want to do this
and how much time are you going to spend on it
are you really motivated
are you really focused
Do you know this could take a lot of time
and you could gain nothing

Neil Black

This thread reminds me that I still haven't bothered to learn Allegro 5.

Is there, like, a book or something to get me started? :P

Don Freeman

I had plans to write a book for my war game engine, but sadly other things have taken over my life the last year or so...so it's been put on the back burner. I may try to find some spare time here and there, but with work and all...it will probably be a while before it comes anywhere close to being done. :(

Arthur Kalliokoski

It seems to me that writing a book is at least as hard as writing a computer program, after all, to write a good book about how to program is simply optimizing for a human, rather than a specific compiler. If your optimizations are crap, well then, your book can join all the worthless web pages already in existance.

AleX-G Squadron

I was writing about native dialog boxes and read in the manual about them. The manual is very good, but does not unveil you things, for example making a native dialog box upside down or creating a timer which stays for 5 secs than closes the native dialog box. One thing i dont understand is why it is called native?
Again the manual is perfect, but for those who know the beginning.

Arthur Kalliokoski

making a native dialog box upside down

Why would you do that?

Quote:

making a native dialog box upside down or creating a timer which stays for 5 secs than closes the native dialog box.

The native dialog box isn't meant to be a generic window, more like to alert the user of a problem or make a choice. Even if you'd want to close it in 5 seconds to some default, it's not that big a deal to require the user to click OK or something.

Quote:

One thing i dont understand is why it is called native?

AFAIK, it's because it uses OS specific features, hence, native to the OS.

Trent Gamblin

Why would you do that?

And how? Pretty sure that's just not possible :P.

AleX-G Squadron

Thanks for the replies!
I am not that expert, i have just created a stupid game a year ago so i dont remember everything. It is not that i am talking about the 5 seconds or upside down in specific, but i mean in the manual are the most common functions.
Anyway, there is no problem with that.
I came upon another thing which i wanted to ask. The return -1 what does it exactly stand for in the "allegro" programming.
Another thing is why the word monolith? What does it mean in programming?

Trent Gamblin

return -1 is often used as a "failure" return value in functions that return integers. It's not specific to Allegro but used in many C-like languages.

monolith means "all-in-one" I guess. The Allegro monolith DLL includes all the addons and dependencies in 1 single DLL.

AleX-G Squadron

Hi!
I came to another problem.
After looking at the manual i saw that the al_show_native_message_box()
has 6 parameters. What is the first parameter shown as: ALLEGRO_DISPLAY *display
What it will display exactly? The screen itself? What is drawing on the screen?

bamccaig

The display may be NULL, otherwise the given display is treated as the parent if possible.

AleX-G Squadron

I cannot understand it. I am not a native English speaker.
Also the 5th parameter is button. How am i supposed to modify it with a | in between buttons when you have them as a string?

Arthur Kalliokoski

I had to try it myself.

#SelectExpand
1#include <stdio.h> 2#include <allegro5/allegro.h> 3#include <allegro5/allegro_native_dialog.h> 4 5 6int button; 7 8int main(int argc, char **argv){ 9 button = al_show_native_message_box( 10 0, 11 "Warning", 12 "Are you sure?", 13 "If you click yes then you are confirming that \"Yes\"" 14 "is your response to the query which you have" 15 "generated by the action you took to open this" 16 "message box.", 17 "Yessir!|Nossir!", 18 ALLEGRO_MESSAGEBOX_YES_NO 19 ); 20 21 printf("button was %d\n",button); 22 return 0; 23 24}

The separator bar is part of the string, and the function looks for that and splits the string into two parts I suppose.

AleX-G Squadron

Where is the Yes sir! and No sir!
What is the purpose of the fifth parameter, i cannot find it.
I thought it renames the ok and cancel
And i got a very similar result:

#SelectExpand
1#include <allegro5\allegro.h> 2#include<allegro5\allegro_native_dialog.h> 3 4int main (void) 5{ 6 ALLEGRO_DISPLAY *display = NULL; 7 al_show_native_message_box(display, "123Hello World!", "3.8 Hello!", "How are you today?", "Hello|World", ALLEGRO_MESSAGEBOX_OK_CANCEL); 8 return -1; 9 if(!al_init()) 10 { 11 al_show_native_message_box(NULL, NULL, NULL, "Error", NULL, NULL); 12 return -1; 13 } 14 15}

Arthur Kalliokoski

{"name":"606466","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/6\/2604ad0e4d8ffc1399f33a672bf52ceb.png","w":351,"h":259,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/6\/2604ad0e4d8ffc1399f33a672bf52ceb"}606466

AleX-G Squadron

{"name":"295r6f8.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/7\/2705e6abbefbe570283fe8b47bbdddb8.png","w":1281,"h":418,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/7\/2705e6abbefbe570283fe8b47bbdddb8"}295r6f8.png
It doesnt show on mine. Very weird. Is there anything to do with visual studio 2012?
How can i add coding and image tags on here?

Arthur Kalliokoski

It doesnt show on mine. Very weird. Is there anything to do with visual studio 2012?

I don't have a clue, I don't use it. Anyone?

Quote:

How can i add coding and image tags on here?

{"name":"606468","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/0\/a03938535080105763dfcac1fe62f3cd.png","w":472,"h":149,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/0\/a03938535080105763dfcac1fe62f3cd"}606468

Trent Gamblin

I think the dialogs on Windows will only use names based on the last parameter (YES_NO). Winapi is a pain and the easy messageboxes don't allow changing those, and nobody wants to code a full fledged one.

AleX-G Squadron

Is it some kind or bug?

Arthur Kalliokoski

Is it some kind or bug?

Trent meant nobody's bothered to write an entire modeless dialog box framework for the odd case where somebody wants multiple buttons with custom text. When you get up to speed in Allegro, write one yourself for fame and fortune! OTOH, you might simply add a modeless dialog yourself with an #ifdef WINDOWS #elif section.

AleX-G Squadron

Ok, i got it. Anyway it is a bit weird it doesn't work.
I will report bugs during the journey.
I hope developers resolve this problem.

Thomas Fjellstrom

I don't think you can change the strings for the buttons on some Windows dialogs. So its not a bug in allegro. Just a feature allegro exposes but windows doesn't.

AleX-G Squadron

Looks like the book will be bigger than expected. I reached page 40 and still on the chapter text and fonts. It is 2:03 AM on here, so i am working very hard on this book. Hope anyone got any ideas or some diagonal text programming ;)
It is fun to give new ideas, seriously.

I have a big question. What is a backbuffer?

Specter Phoenix

I cannot understand it. I am not a native English speaker.

Okay, so your book will either be for a narrow non-English speaking audience or if you do it in English it will be possibly confusing at times due to, you yourself, saying your English is poor due to it not being your native language? Also, there was a book written back around Allegro 3.1.x and the author of that himself said Allegro didn't have a large enough of a following to warrant a new book for it. He said it was a niche library that no company would or could justify publishing a book about it.

To me, Allegro is for programmers, by programmers, and programmers that can't understand the manual or what it means shows how much more the programmer needs to improve.

My question is: allegro 5 book. Any? NO! Epic fail.
Videos? Only 2 guys! I hope you find them!
Wiki is like a manual. I hate wiki. The manual is better.

A5 Book. Any? NO! Reason: no one would read the stupid thing (ask Harbour, his A3 book only sold due to starry eyed programmer wannabes).
Videos? Only 2 guys? A YT search shows a few A5 tutorials especially from Coding Made Easy.
Wiki is a collection of links to articles, documents to help learn Allegro so I fail to even understand your argument on that.

1)Installing Allegro
2)Creating your first program
3)Using text and fonts
4)Creating geometrical objects
5)Advanced objects
6)Input Keyboard
7)Input Mouse
8)Timer
9)Allegro for iPhone

Each one of those could be an article on the wiki as a wiki is, in a sense, just a large table of contents with a search feature to help find the articles(chapters) you need.

Does the manual tell me how can i make 2 doors that teleport the player?

That has nothing to do with Allegro at all. The only thing Allegro would be doing in that case would be handling events, input, and displaying the doors and player. Otherwise that would be reliant on your abilities with the language you are using and math/physics skills.

Nothing you have mentioned in this thread has justified or warranted a book. Plus, as ML pointed out to Harbour when he did his A3 book, Allegro updates so rapidly that the book would be outdated by the time it was published and released.

I have a big question. What is a backbuffer?

That question just shows you aren't ready or the person needed to write a book about A5 or anything in programming.

AleX-G Squadron

Wow man, i see you like commercial.
I just think that allegro can be used for programmers and a book can make a big step.
I even dont want to sell the book. I wrote 40 pages today as i am at page 46. How comes allegro is so fast? A year ago it was version 5.0.5 now it is 5.0.7
What a little snail. I can write the book in a week, that means the book will resist for a lot of time, not because of allegro, but because of people who want money and dont write a book because they are lazy, want to win money fast. Than thanks for paving the way toward success. I see on youtube only mikegeig and coding made easy, which i argued to him about why he didnt make allegro 5 and than he made allegro 5.
Allegro seems to me an easy job man. After all, there is no need even to answer the backbuffer as i already found it and i know what it is. Now i am the right person to write the book i guess. After all, someone said "Go write the book then!"
so there is no time for talking. Help if you want, attack if you can. Allegro is going to be a good friend for me, no matter what his "owners" use against.
I am writting so fast, you dont have time to reinvent the wheel.
I would say that the book is dead when allegro 6 comes out and than still, i would copy paste things 8-)
So i have to sleep now, hope to see millions of replies tomorrow.
Also, find any grammar error above, if you can.
I think the manual has grammar errors as it doesnt make total sense.
Thanks for fireballs and storms attacks again.

Specter Phoenix

Wow man, i see you like commercial.

Nope, I only use Allegro, played with SFML and SDL and have never touched DirectX with plans to look into OpenGL at a later date.

Quote:

I just think that allegro can be used for programmers and a book can make a big step.

It is used for and by programmers and you are the only one whining about wanting a book for it.

Quote:

I even dont want to sell the book. I wrote 40 pages today as i am at page 46. How comes allegro is so fast? A year ago it was version 5.0.5 now it is 5.0.7
What a little snail.

What? ??? Allegro is on 5.1.3 :-/.

Quote:

I can write the book in a week, that means the book will resist for a lot of time, not because of allegro, but because of people who want money and dont write a book because they are lazy, want to win money fast. Than thanks for paving the way toward success. I see on youtube only mikegeig and coding made easy, which i argued to him about why he didnt make allegro 5 and than he made allegro 5.

I'm going to have to call bu||sh!t on that one. He started making those back in February of this year and you waited six months to post about a book?

Quote:

Allegro seems to me an easy job man. After all, there is no need even to answer the backbuffer as i already found it and i know what it is. Now i am the right person to write the book i guess. After all, someone said "Go write the book then!"
so there is no time for talking. Help if you want, attack if you can. Allegro is going to be a good friend for me, no matter what his "owners" use against.
I am writting so fast, you dont have time to reinvent the wheel.
I would say that the book is dead when allegro 6 comes out and than still, i would copy paste things 8-)
So i have to sleep now, hope to see millions of replies tomorrow.

Millions? You'd be lucky if you get 10.

Quote:

Also, find any grammar error above, if you can.

If I can? A blind man could find your errors above! You drop out words, use wrong words, put the word 'even' in the wrong spot in at least two sentences, 'i' should be 'I', I could keep going on just your post from above.

Quote:

I think the manual has grammar errors as it doesnt make total sense.

The grammar errors are in your head. If you can't understand the manual (which looks like every other manual I've ever seen for other libraries) then you definitely need to stick with web development and forget this whole book business as books take time, the faster you write it the more errors and just plain wrong it will be.

Quote:

Thanks for fireballs and storms attacks again.

Fireballs and storms attacks? It is called trying to talk sense into a delusional person.

We told John Harbour all this when he did the book that used A3.1.x and he made it, but when it came out no one used it that much because we were onto A3.3.x or such and most of the issues he pointed out in his book was fixed or changed so it was wrong. He still says A3.0.9 is the best Allegro version and refuses to look at A5 because he is in love with Commercial as it helps line his pockets.

Books fail because of internet! It is easier to find what your problem is (ie teleporting between two doors) and google it rather than go out finding books that cover that topic. One Allegro book has already failed, all you are doing is writing a second allegro book that will fail. Good luck in that though.

Oh, and you need to look at more than the first page of a search or at least more than the first few results. This has at least 3 or 4 different guys by the end of that page that have done allegro 5 tutorials of some sort. ::)

Thomas Fjellstrom

What? Allegro is on 5.1.3 .

Sorta. Thats the WIP version.

Specter Phoenix

Sorta. Thats the WIP version.

Yeah, I know, but if I remember right Harbour used the latest WIP at the time of writing his book. I try to always use the WIP so I can help find bugs and because of it having the latest bug fixes.

Trezker

The 5.0 branch is stable, so 5.0.x releases are only for fixing bugs.
If there's only been two bugfix releases in a year that sounds fantastic to me.

Thomas Fjellstrom

We don't restrict stable releases from getting new features, so long as it doesn't break source or binary compatibility iirc.

weapon_S
bamccaig said:

then you aren't a programmer.

Not you too! ::) Couldn't the purpose of the book be to make someone a programmer? Do you even have to be a "programmer" to want such a book? I certainly don't see myself as a programmer, let alone myself 10 years ago.

Help if you want, attack if you can

Attacks will most probably be all the help you will get from here, yes. What I mean is: it won't be lovey-dovey fluffed up "suggestions", but hard straight-forward in your face "accusations". And of-course you'll get a little whining nagging as well; that kind of place it is here.
If it is your dream to write a book that will enthral millions into using Allegro, good for you. If you think the pages you have produced right now are that book, wake up.
Going over each function in the reference and keeping notes on it can be very useful; in the very least useful for you, and likely there are things that can be added to the manual. This might also be a good start for the book (especially since you're motivated), but writing a book that doesn't bore and teaches understandably in a structured way seems out of the question at this moment.
By the way, I don't see any posts of the pages, so everything I'm saying is based on these forum posts of yours. The actual writing might surprise all of us. If you post that, first be confident, because you are going to get ripped on by a horde of frustrated geeks. (Maybe Phoenix and I alone already have the power of a entire horde ;D ) And be prepared to get your confidence decimated, no matter how sure you are you've written something good. Such is the creative process!
P.S. Sorry for the slightly long post. I don't come here as often as I used to.

alehbeer

AleX-G Squadron:

Please post what you have. You could name it "WIP", as in the expression "Work In Progress", to inform readers that the book is not yet finished.

For example: My_Allegro_Book_WIP-version-1.doc

Or, you could post it on the Allegro WIKI and people could help you along. Your readers could benefit from the book as it is made. You said you did not like the WIKI, so please help me by improving it.

While I know Allegro4 quite well, I am learning Allegro5 at the same time you are. Thank you ahead of time for your contribution to our community.

LennyLen

When writing an instrucional book (or pretty much anything else), there are two questions you should ask, and have detailed answers for, before you write a single word:

  1. What is the purpose of the book?

  2. Who is the target audience?

Now, any time you want to add something new, ask yourself "How will this help the people identified in question 2 achieve the goal identified in question 1?"

Some of the subject matter you seem to want to add is very situation specific, which means a very minuscule target audience. For such a scenario, a book is not the ideal medium. A guide to making a character teleport, for example, is better suited to an online magazine, a wiki or a youtube video. Information in a book should be as general as possible while still achieving the purpose of the book.

I think it would be great to have a book on Game Programming with Allegro 5. I personally like to use books when I'm first learning a new subject matter, then switch to specific tutorials, wikis, and other online references when I've mastered the basics. I'm sure there are a lot of other people out there that are the same.

Thomas Fjellstrom
weapon_S said:

I certainly don't see myself as a programmer

Have you programmed anything? More than one thing? Did it/they work? If the answer to at least two of those things are "yes" then you're probably a programmer. If the answer to all three is yes, then you are most definitely a programmer.

Specter Phoenix
weapon_S said:

Not you too! ::) Couldn't the purpose of the book be to make someone a programmer? Do you even have to be a "programmer" to want such a book?

Well, no, not for the purpose he is claiming he is writing it for. It would focus on Allegro (just an API) and make example games with it. You would have to make it a language specific game programming book that teaches game programming while teaching a language and using Allegro API (and that would make for a huge 1000+ page book.

AleX-G Squadron

I have included only the chapter 2, so no wise or clever people do anything with it. It is very short, 8 pages and you wont get bored reading it.
I made the text as an image, so you cannot copy paste it. Do the coding yourself as i have already tested everything. It is just 8 pages so it would waste 1 hour at max reading it. The copy i gave you is black and white, though in the book, the text is black and white and the header is a color. The text is very big so even blind people can read it clearer.
The book is made for those who dont know well programming or actually dont know anything at all. I even explain if statement which is ridiculous but i have to.
Please review the chapter 2 so i know i didnt do any mistakes and the hordes just tremble before they seek revenge.
I will add a new chapter today to the book about images which is very important.

J-Gamer

Sorry to say, but the your grammar actually sucks... The first paragraph in that chapter is enough to make me feel sorry for anyone who would buy it. And honestly I don't think anyone will if they get the chance to look in the book before buying it.

AleX-G Squadron

;D, ok, i understand you are out of topic.
Post in here a single grammar problem.

Elias

Maybe you should write the book in your native language (someone wrote a German book for Allegro 4 for example). Then have it translated once it's done. On the other hand, writing a book might be a good way to improve your English, so if you see it as an exercise for yourself, go for it anyway.

Post in here a single grammar problem.

Is a good example in itself as it uses a wrong word order, it should be: "Post a single grammar problem in here."

AleX-G Squadron

If i have any grammar error, please can anyone post at least a single error???
EDIT: Ok, i will go on writting in english anyway

Matthew Leverton

There are a lot of grammar errors, but it's easy to understand. I wouldn't really worry about it. (Of course if you plan on selling it, then you will need to find a good editor.)

Even if the book is nothing more than a collection of tutorials like that chapter, it might still help people out, so I wouldn't listen to any of the useless criticism. Just be sure the stuff is factually correct.

weapon_S

AleX-G Squadron is 99% understandable. But it is clear it is written by someone who isn't fluent in English.
Here are some things, but not all[1], which I noticed:

Quote:

Right now we have created nothing, but at least the error thing.

This is one of the cases where it is not understandable. This sentence could be 'corrected' in two different ways. Especially the use of "thing" makes it vague.

Quote:

two rows

"Two lines" would be the more common way to describe them.

Quote:

al_show_native_message_box(P1,P2,P3,P4,P5,P6)

Not my first choice to write it out like that. Still there is something to say for it. Have you explained the comma and function arguments in the first chapter?

Quote:

The same thing goes to the third parameter and the fourth.

Again the use of "thing". Doesn't hurt to be a little more explicit and descriptive in text.

Quote:

There are some options which you will have to recognize them

Bad English. Probably needs to be worded differently in the whole[2]

Quote:

These will make your day like a piece of cake if you learn them.

That's... actually... pretty funny. Missing a comma BTW.

Quote:

costume native box

Funny, but less tolerable.

if statement

Technically correct. My personal preference is "if-statement", though. On the whole, good use of italics and other typography can make it much more legible.

Quote:

wont

That won't do. :p
Using the message box as a starting point is interesting. Not in the least because you could illustrate the concept "differences between platforms". (Which is called a "bug" here :P)
I'm seeing a progressing story, which reads nice. Sometimes loses (logical) structure, though.
Hope this helps.

References

  1. Posting a picture isn't a very good way to get feedback. And bastards who wanna steal your stuff can still do that. It wasn't fun typing everything over.(I'm to lazy to use an OCR, but thieves might not be.)
  2. Is that English? ;D
AleX-G Squadron

The more i write, the more it gets complex. I have writen 68 pages in total. I wrote about math real numbers. I explain negative and positive numbers and what is an XY graph in math. The differences with Allegro. I dont want to let it just an example book. I want to add in great math and physic. I am very good at math and physic so it will be a very good bet from my side. I have one big question though:
I am writing the chapter of geometrical objects. When i write the chapter of advanced geometrical objects, i want to add a 3D object, for example a simple cube, pyramid or the max it could get a sphere. Is there a function to make it, or a way?
I even want to know if you can create an experiment using allegro for the Einstein theory, so objects will deform when a speed variable gets to a point with an if statement. I mean, can you deform objects, if you want to?

@weapon
Thank you very much! I was really afraid none was going to understand it!
I will add other things in the first chapter, after i finish.

J-Gamer

If you want to use 3D in your game, you'll need to use OpenGL/DirectX directly. Allegro only handles 2D stuff AFAIK.

bamccaig

You're using the wrong terminology. main is not a class. It is a function or subroutine. The editor is going to have a lot of work on his hands. He had better be a native English speaker...

Your al_show_native_message_box call seems wrong as well. You are passing the flags parameter as a string, but it is supposed to be an int. Also, the way you've described the arguments is strange. The reader will likely memorize the parameters by position all on their own. When describing them, you should associate the description with the semantic name to keep things easy.

It's ridiculous to say that the reader is adept at creating boxes. They aren't creating dialog boxes. Allegro is. They are just asking Allegro to make them. And it's only one function call. It's hard to be good or bad at that. You either do it or you don't. :P

I would suggest that you focus on the facts and avoid subjective content.

AleX-G Squadron

That thing "Allegro is" sounded like saying: "It is not you who lives, it is god".
WOW, slow down man, if they dont execute the code, your allegro will bark all day and night for thousand years. It is not allegro who is making them, it is windows operating system. After all if you dont make any mistake, you will never try something new. I am not a robot to COPY PASTE THINGS EXACTLY as other people mentioned them. Anyway i will revise the errors later on. You better give the book to a beginner next time to see the result, otherwise you will always argue.

Actually, i needed some help with the high scores board and saving the game.
How am i supposed to do that? ???

Specter Phoenix

Even if the book is nothing more than a collection of tutorials like that chapter, it might still help people out, so I wouldn't listen to any of the useless criticism. Just be sure the stuff is factually correct.

I fall under this comment, I think. If the book is just to teach Allegro 5 to programmers then that is fine. I just don't agree with the saying the wiki and manual are bad or saying they have grammar errors just because they don't make sense to him. A book of tutorials for doing things in A5 would be nice.

Now, let me re-iterate a previous comment. You cannot get a person into programming with just teaching them A5. You book would have to be written so that the first few chapters would cover a language you are using (C, C++, C#, D, etc.) and the basics of that language. Following chapters could cover setup, installation, and first test example to show A5 is properly installed and working. Then after that you would have to have examples that show A5 and the language features with it ultimately finishing in either multiple games or one complete game at the end of the book.

AleX-G Squadron

The book has math and physics inside, so don't expect it to be easy.
I explain everything possible, which is normally in my knowledge.
Otherwise the book wouldn't be complete.

Can anyone help with the spline?
I dont understand it.
I have already seen the examples.

furinkan

I explain everything possible, which is normally in my knowledge.

Late to the party, but I just got a sig quote! ;D

EDIT:

I see now what you were talking about on #allegro. I need to stop by more often; I miss all the juicy bits.

AleX-G Squadron

Thanks for stopping by. Can you help out with the spline?
Or the ribbon? Or with the vertexes? It is becoming complicated as i have never used such things.

alehbeer

AleX, I highly recommend you review pure C and C++. Before you do too much more with your book, you should check out http://www.cprogramming.com/tutorial/c++-tutorial.html and http://www.cprogramming.com/tutorial/c-tutorial.html . I think you would benefit from at least a quick review. If nothing else, it might help you better understand the terminology in English. You seem to be off to a decent start, but spending a day or two refreshing your c/c++ understanding may make your endeavor easier.

Also, I read through the pdf you uploaded. I think it could be useful to somebody, but you will need to editing and revising. However, since its a first draft don't worry about that yet. That said, you should be aware that when you are ready to finalize it in whatever your preferred format is, and after editing and correcting the font size, the book will most likely be about 1/4 its size as a draft. I say this because upon editing your work, the document becomes around 1 page + code.

Finally, you may be interested in using LATEX for layout. It will help make the images more standardized and there is a plug-in which will give your source code context highlighting.

AleX-G Squadron

Last time i read about C\C++ was when i left programming with Allegro. So basically i am not that great as i have a year i dont learn C++ and C.
I will listen to your advise.
Thanks!

Fishcake

Reading the draft you have attached reminds me of this wiki, which I wrote 2-3 years ago for my classmates (which is an epic fail because I suck at explaining, the tutorials are badly structured, and most of my classmates are not interested in game programming AT ALL). IMO, you should just turn your book into a wiki (or a website) for several reasons:

  • It mostly deals with practical stuff like how to initialize Allegro, popup a dialog box, etc. Things like these are more suitable to live on a website. I mean, ask yourself. If you don't how to use a specific function, or perform a specific action, would your rather google it, or flip through some random 69-pages book?

  • It is littered with code examples. Most programmers (or maybe just me) are lazy, and they don't like having to retype these code just to test them out. They'll just copy paste it. And you can't copy-paste it if it's in a book. And copying from a PDF is still annoying (not to mention it screws up the formatting). Oh, and what if you have a long code example? I don't think PDF supports scroll-able DIVs, so you're stuck with a block of code that spans over a single page, making it even harder to copy.

  • It makes it more accessible on mobile devices. I guess.

  • It's easier to update. If it's on a PDF, the readers have to re-download it.

superstar4410

Alex I definitely applaud your efforts to write this book.

This is really great. I like how you saw a problem and attempted to fix it.
In life it is often the one who has the problem that is burdened with finding the solution. We often can't wait for others to solve our problems for us. I like that you shared your concern. Often times when we share we find people more able than ourselves who are willing to work towards a solution.

I really do applaud you for working on this book, I just think its awesome. Often times people complain about something but do nothing, you my friend are taking action. We need more people like you my friend.

{"name":"applause.gif","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/9\/19c5066b2332d87b4b5f61e0bbeeb3bb.png","w":300,"h":314,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/9\/19c5066b2332d87b4b5f61e0bbeeb3bb"}applause.gif

Now my suggestion is that you start basic then refine.

Instead of just jumping into the book. I suggest going back over your outline.
Get it really fine tuned and even lay out sub headings to give you a blueprint of what the layout will be.

If you don't do that I fear you will end up trying to connect the dots as you go along or force dots to connect to which may lead you slightly off topic. I think a solid outline is very very very crucial. There is no need to set sails on the grandest ship of all if you have an incorrect map of the sea, the journey will be doomed before it starts.

Someone made a point about the topic of the book. I agree that you should not make the book too specific. Determine your audience first. My assumption is that you are not making the book for yourself but for others. So ask yourself am I writing this book for:

(a)beginners with basic C++ experience but not allegro experience.
or
(b)beginners with no C++ experience and no allegro experience.

Based on if you select A or B above, the book will be different. The main difference will be that for those with no C++ experience you would have to teach them C++ first before you can teach them about the Allegro library.

My recommendation is that you refer those that don't know C++ to a C++ tutorial to read first and just focus the book mostly on A5.

I think you should aim to teach basic concepts and you can be specific as in teaching specific algorithms or programming design modals.

For example, you said you do web programming. Something common in web design is login features. That is something one could teach in a web tutorial. With games something common may be a side scrolling game, you could teach how to create functions and classes to handle player movement. The danger though with being too specific is that you are assuming the reader wants to duplicate what you are doing.

Instead of teaching someone how to make a car game, it is better to teach them how to create an object, how to control objects, how to display objects to the screen, and how to create artificial intelligence for objects. With that knowledge the person can take those tools and make any game, a car, plane, boat, shooting, etc(just an example).

Yes for beginners I do think it is valuable to include for example a car game source code example to show how the components fit together, but don't make that car game(for example) the main point you are trying to teach them, make the components that make the game possible what the focus of the book will be. That way you foster creative thinking in the person and they can take the components and use them independent of the example in the book.

Once again good luck, I'm available to help with your book, email me at neh@dimdigital.com, I can help out on the outline and some theory and concepts and some code.

Good luck

AleX-G Squadron

Thank you very much!
Actually, i work until 4 AM to make the book. I started in an attempt to create a book where people who want to make games, can start making their dreams come true. It is not exactly for programmers. I am basing the book on 13 years old to advanced game programmers so they can both benefit and understand each other if they talk about the book. I have to include 1 or 2 chapters for C++, but i really need to learn C++ myself! I don't know which is the right one to go C or C++ to benefit the most from allegro 5. Since i am very keen on C++ i will try it. Unfortunately, i start test at college on September so it will take longer than expected. One thing to be noted is that when i started the book, i intended to make it to 100 pages at max with 10 chapters, but at the time of writing i am on page 105 explaining events which are on chapter 8. But i have added a lot more than expected so it is going to be around 15 chapters. I want to finish the book with 250 pages to include everything possible even C++ for total beginners. People can read the book and at the end they can combine the codes the way they want to create whatever game they want.
I was really considering the idea of the website and i think i will try it.
I will review the book when i finish it.
The questions for me, are the same on this forum. I will go and read C++ tomorrow and will write the book when i will feel more prepared.

Arthur Kalliokoski

It would be really difficult, if not impossible to make one single book so interesting that beginners as well as advanced game programmers would want to read it. And I think if you're going to include C++ programming for beginners, you're well on the way to writing an encyclopedia, not just one book.

bamccaig

C++ is an extremely complicated language. C++ is the kind of language where the more you know the less you know. And you can do everything in C that you would in C++, if a little bit more verbosely. You should focus on C and leave C++ to specialized books and resources.

Gideon Weems

First-timer in this thread.

I don't know X-G personally, but damn do I respect his drive. Keep it up; don't let naysayers get to you; and above all else, understand that most people here (and elsewhere) really are nice and would like to help.

Best of luck!

furinkan

Well if you get a portion written, I'll edit and index it. Maybe I'll contribute, in the unlikely event I have something intelligent to say.

bamccaig

I don't know X-G personally, but damn do I respect his drive.

FYI, there is a literal "X-G" member that has been away from the boards for a couple of years, but has been here for many years, is much more well known, and much more respected. You should refer to members with their full name to avoid such ambiguity.

AleX-G Squadron

@Gideon
Thank you!

@furinkan
If you are an english native speaker, it would greatly help if you translate chapter 2, which i have added as an attachment.

Whatever help anyone gives, it would benefit all allegro users.

Trezker

While I agree it's a good idea to step back and look at the big picture and structure the book properly. I think at this point it's best for the progress to keep bulldozing through all the features of Allegro, you building good material that you can use in the book puzzle.

Also if you should burn out and say screw this in a few days, you'll have written a whole slew of good material that you can put up right away even if it's not all polished to perfection yet.

Keep going, I think it would be great for Allegro 5 to have a book. You're a hero for actually working on it.

Gideon Weems

I assumed AleX-G was the original X-G's reincarnated version, having shifted his skill points from lingual mastery to drive and dedication... Is that not the case? If so, I apologize.

AleX-G: Do you think you could attach a more easily editable format than PDF? I'd be happy to help, even if just a little.

AleX-G Squadron

I am not the X-G you are talking about.
Mine is a nickname where G stands for Gangsta, but that is just for fun.
I hope all want to help, because i am not going to let the work in the middle.
I am on page 133, just for curiosity.

I attached the second chapter on docx format.
You can edit the second chapter now.
Thanks for consideration!

weapon_S

Everything that Trezker said I'd like to underline. I'm not very good at giving positive feedback... You seem to be going at an impressive pace. Don't forget to take a break after you have this job done.
Maybe I'll have a look at the docx.

AleX-G Squadron

Thanks. I was actually needing a lot of help with transformations.
I want to include it as a chapter, but since i only got the scale transform to work
I think it will not be done, unless someone can help with examples of all kinds of transformations, so i can verify they work and understand them better.
There is going to be a lot of work, but i think i will end working on the book on 1st September, because of the exams. I will work on the book in October after i am done with school. So, if you want the book as fast as possible and best possible, pls help!

GrantG

Hmm, maybe I'm in the minority when I say this, but I always thought books were kind of useless for APIs that are being continuously developed.

By the time the book is done, proof-read, published, etc. The library/language/whatever has another version already released, or in development.

I'd much rather have an online manual or wiki that can be quickly updated or split into versions, than a book that is already somewhat outdated from the day I buy it.

Mordredd

I learned programming with allegro 4. I think, back then, it was really what a beginner needs to know, I could paste some commands, allocate some memory, write to it, blast it to the screen and write messy code. It was ideal for hacking.

I remember that I tried allegro 5 once, it worked immediately, but I feel its concepts are (probably obviously) more advanced than those of allegro 4. For me the point is: when I am able to understand and use allegro 5, I am probably also able to use other advanced libraries to create games and "surpass" it. For example, I use a lot of Qt with OpenGL directly, so I have no reason to come back to allegro 5 again, althought in itself, it is not bad. Since a long time, Qt does the event loop stuff, platform-independent threading, networking stuff, GUI and a lot of other neat things for me. For an advanced game I probably would look into readily available engines and adapt them.

The "hacking it together"-mentality of allegro 4 gave it its own validity.

edit:
The whole point: allegro 4 was so simple you did not need a book to understand it.

Trent Gamblin

Qt is great for games. It has Android and iOS ports, 90% of the drawing operations you need in OpenGL for 2D games, the list just goes on. Oh wait, that's Allegro 5! :P

LennyLen

For fun, I reformatted the given chapter using a more standard textbook page size and formatting style. It reduces the chapter from nine pages to two and a half, which is still, in my opinion, a bit too long to devote to showing how to create a dialog box.

I was going to edit the text to a language style that I considered more appropriate for such a book, but then I realized I'd have to rewrite everything, so didn't bother. Especially since, as I already mentioned, I think this topic is given far more length than it deserves.

Also, the code sample given needs to be rewritten:

#include <allegro5\allegro.h>
#include <allegro5\allegro_native_dialog.h>

int main(void)
{
   al_show_native_message_box(NULL, "3.5",     "321World!",
   "Hello world!", "Whatever|Maybe","ALLEGRO_MESSAGEBOX_YES_NO");
   return -1;

   if(!al_init())
   {
      al_show_native_message_box(NULL, NULL, NULL, "Error!", NULL,
      NULL);
      return -1;
   }
}

I haven't really done any A5 programming, but I'm sure this is what you want:

#include <allegro5/allegro.h>
#include <allegro5/allegro_native_dialog.h>

int main()
{
   if(!al_init())
   {
      al_show_native_message_box(NULL, NULL, NULL, "Error!", NULL,
      ALLEGRO_MESSAGEBOX_ERROR);
      return -1;
   }

   al_show_native_message_box(NULL, "3.5",     "321World!",
   "Hello world!", "Whatever|Maybe",ALLEGRO_MESSAGEBOX_YES_NO);
   return 0;
}

Even then, will the al_show_native_message_box(NULL, NULL, NULL, "Error!", NULL, NULL); line even work if al_init() fails?

edit: Apparently the answer to that last question is yes, going by the manual.

Mordredd

Qt is great for games. It has Android and iOS ports, 90% of the drawing operations you need in OpenGL for 2D games, the list just goes on. Oh wait, that's Allegro 5!

I think you are not up-to-date. Qt also offers a powerful 2D object engine, btw. Forget about writing low-level object handling stuff, place your objects and run your game. What about networking in allegro 5?

http://sourceforge.net/p/necessitas/home/necessitas/

I have tested Necessitas and it works great. Afaik, there are also efforts to have Qt on the iPhone, but I am too lazy to google for it.

edit:
Another link: http://qt-project.org/doc/qt-4.8/QGraphicsScene.html

Trent Gamblin

None of that is actually good for games, aside from the networking. But I remember, you couldn't compile A5 yourself so you found something easier.

Just to demonstate. Here are the top rated games on qt-apps.org. These are the type of games you'd get with an operating system, but far from anything complex:

http://qt-apps.org/index.php?xsortmode=high&page=0&xcontentmode=4250x4251x4252x4253x4254&PHPSESSID=0a61f54cc58549290b8d0b8852c9e879

Dizzy Egg

As someone who has been using Allegro 5 for about 2 weeks, I can safely say from MY point of view that I wont ever want for another "games" library. It's easy to build under Windows with CMake, easy to link under Code::Blocks, and a pleasure to work with using events & blenders. Plus the options of integrating your own shaders makes it a 2D powerhouse. All input is handled, and addons include .ttf fonts and audio.

Anyone who doesn't like Allegro can't understand Allegro. No, can't build & install Allegro.

Mordredd

But I remember, you couldn't compile A5 yourself so you found something easier.

There is no reason to be that arrogant. I had issues with cmake, since I never used it before at that time. Of course, I got it to compile. I am not Super-Trent, sorry.

While it's true that not many people use Qt for games, it is more than capable for this. Look here for what's possible with Qt: http://qt.nokia.com/qt-in-use/ambassadors/showcase/ (Under Industry select "Games/Entertainment")

SiegeLord

The whole point: allegro 4 was so simple you did not need a book to understand it.

Yes, it's so simple nobody has written tons of tutorials on it and a book. Why would they? In addition, since Allegro 5 is so complex, that currently, without a book, positively nobody is using it.

While it's true that not many people use Qt for games, it is more than capable for this.

So's Excel, and it's hardly an alternative to Allegro :P. I really don't see your point... you can use OpenGL with Qt? You could use OpenGL with Allegro 4 too. The point of Allegro 5 is that you don't have to use OpenGL directly... Allegro will use OpenGL on Linux/OSX, Direct3D/OpenGL on Windows, OpenGL ES on Android/iOS... all while abstracting the differences between those frameworks.

As for there being high level engines out there (like QGraphicsScene), A4 had the same issue, so it's hardly a point of comparison between A5 and A4. If you liked using low level features in A4, you'll like using them in A5. If you don't like using low level features, then you weren't/won't be using A4 to begin with.

amarillion

Hey Alex-G, keep up the good work.

Here is some feedback on chapter 2:

Quote:

Being a string you will have to put between parentheses in order for it to work

-> I think you mean quotes: ", not parentheses: ()

Quote:

The same thing goes to the third parameter and the fourth

-> The same goes for the third and fourth parameters.

Quote:

in order for it to work

-> This is correct, but a very dense style that is more appropriate for scientific papers. It might be simpler to write "to make it work", or remove that bit of the sentence all together.

When I write code tutorials, I always like to give the code a distinctive style from the rest of the text. For example create a style in word for code, using a monospace font (such as courier new), and a light-grey background.

Final remark, you use a rather large font size. No wonder you write so many pages so quickly :) For the final version you will probably want to use a smaller font size.

Anyway, I applaud the effort. You probably won't make any money on this, but if it helps somebody, than it's totally worth it. I wrote a couple of tutorials myself a long time ago, and I still occasionally get positive feedback on it.

AleX-G Squadron

Thanks for the feedback.

I use large font size, because there may be people with problems in reading books
with little text. I myself hate little text because it makes your eyes dehydratate.

I think the text has to be big since there is no way the users will want to read
little text. The book is going great and i will try to include what i will learn on
this forum too. One think i am greatly keen on now is the transformations. I made
some nice mods to the old game i made last year and i think the work on the book has to go on.

There were some negative comments with the idea of the book, which i think were
extremely stupid and lowered the notoriety of the users writing them.

Again, thanks for all replies even to haterZ! 8-)

furinkan

I read quite quickly (compared to most people, not you guys :P ), and I find the font being this big an irritant. My eyes are getting sore from moving left to right so quickly, and its difficult to read at my normal speed.

If you want to please people with poor eyesight, then keep it at 12 or 14 pt for regular text. I wouldn't even print this out, because I'd have to use a LOT of paper to get the info I wanted.

I usually take normal-sized pdf books and print them 4-6 pages per sheet to save paper.

EDIT:

I know its asshole-ic of me to ask without reading, but what are you using to write this in? Spinning off of Amarillion, it may be beneficial to syntax-highlight your code, that way it can be analyzed easily. Line numbers are a must.

AleX-G Squadron

I am using word 2010 to write it.
The font size is 22 but i will reduce it to 16 and there will be much less pages than expected.

furinkan

If you write your code in an IDE, they usually have an export to rtf/html action. You can use that to copy your beautifully formatted (and dare I say functional!) code into word.

Personally, I still feel that 16pt is header sized font. There is the 'zoom' feature on the computer, and I'm pretty sure that anyone who has problems reading printed text probably already has reading glasses.

If you are using word 2010, I believe it has a way to index things. A book can never be better than its index!

LennyLen

16pt is still absurdly large. Fonts for print are generally 8 to 9pt. At the current rate, this book is going to be several thousand pages which means it would never be able to exist in physical form as the printing costs would be astronomical.

As much as I like the idea of a book for Allegro 5, I'm afraid I have to consider the current effort to be misguided and far too poorly written to be of practical use.

gnolam

Since everyone else is being too polite, I'm going to be the one to say it: if you're still at the level of asking questions like this one, you shouldn't be writing books about Allegro 5 or game programming.

AleX-G Squadron

I don't know what size is going to be the font then. I will let you guys choose it, as best as possible.

@gnolam
Actually, go ask other people, who are very polite to give prices to their books around 20$-60$.

EDIT: BTW, i now know how to make the autoshooter.... so i am the right person to make the book!

Thread #610865. Printed from Allegro.cc