Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Abandoned Projects

This thread is locked; no one can reply to it. rss feed Print
Abandoned Projects
Specter Phoenix
Member #1,425
July 2001
avatar

He thinks he's a failure, but I don't think he really knows the meaning of the word.

Quote:

fail·ure   [feyl-yer] Show IPA
noun
1.
an act or instance of failing or proving unsuccessful; lack of success: His effort ended in failure. The campaign was a failure.
2.
nonperformance of something due, required, or expected: a failure to do what one has promised; a failure to appear.
3.
a subnormal quantity or quality; an insufficiency: the failure of crops.
4.
deterioration or decay, especially of vigor, strength, etc.: The failure of her health made retirement necessary.
5.
a condition of being bankrupt by reason of insolvency.

Nope the definitions there sound like what I have in my mind.

Though many on IRC and A.cc, have said I excel at failure. I was reading a thread I made when I first joined where Matthew said "Ambition + No_Talent = Depression", but does that mean ML is saying I have no talent :-/. My ambition hasn't changed and nether have my goals, I just learned to never post my ideas or thoughts here in regard to video game programming. This is really the only place I ever asked questions at and now I don't ask questions at all :(. Oh well depression is many faceted, I'm int the "God, I suck!" stage safely away from the "God, I want to die!" stage out of the several stages.

AMCerasoli
Member #11,955
May 2010
avatar

Personally I'm doing pretty good. money is tighter than ever, but I'm scraping by.

"Money is better than ever, but I'm scraping by"... Ok I think this statement has no sense, if you're scraping by, but money is better than ever, then how the hell were you living before?.

Man, with your knowledge I thought you was working at a big company or something... Wth is wrong with you?, I always wonder why you don't have any game. Do you also have the Specter complex?. I think you guys talk all that shit here but unconsciously you're really happy with your life, otherwise I can't understand it.

What do you need? a Microsoft company to feel better?, I have just saw that Elias posted the changes that I did to make Ogre run on Allegro and Windows and I'm really happy, with just that I have like a year of "motivation gas" to move on...

Matthew Leverton
Supreme Loser
January 1999
avatar

"Money is better than ever, but I'm scraping by"... Ok I think this statement has no sense, if you're scraping by, but money is better than ever, then how the hell were you living before?.

Money is tighter => he has less money.

Dario ff
Member #10,065
August 2008
avatar

Man, with your knowledge I thought you was working at a big company or something... Wth is wrong with you?, I always wonder why you don't have any game. Do you also have the Specter complex?. I think you guys talk all that shit here but unconsciously you're really happy with your life, otherwise I can't understand it.

He worked on a big chunk of the library you're currently using. That's quite a big accomplishment. :P

TranslatorHack 2010, a human translation chain in a.cc.
My games: [GiftCraft] - [Blocky Rhythm[SH2011]] - [Elven Revolution] - [Dune Smasher!]

AMCerasoli
Member #11,955
May 2010
avatar

Money is tighter => he has less money.

Ohhh... My bad... :-[

Dario ff said:

He worked on a big chunk of the library you're currently using. That's quite a big accomplishment.

Of course it is! and he's comparing himself with Specter ::) it's impossible man, you can't do that...

Specter Phoenix
Member #1,425
July 2001
avatar

he's comparing himself with Specter it's impossible man, you can't do that...

He is comparing an aspect of him with the same aspect of me. That is completely different from comparing one's self with another person.

Thomas Fjellstrom: encouragement in this forums is lacking. The users now make Inphernic seem like a sweet guy when he tore into me ;).

AMCerasoli
Member #11,955
May 2010
avatar

He is comparing an aspect of him with the same aspect of me.

Hmmm... I hope so...

Your problem Specter is that you're too busy thinking that you can't do anything to actually do something...

And by reading your code above, it's like you sit in front of your computer every time you want to program something, and that's not the way it works.

What you have posted, it's already in your brain, you knew how to do it before writing it, for that reason you did it. In programming, and in other aspects, you need to think about what you're going to do before doing it, but in programming this is even more important.

You need to pass throw levels of abstraction before writing anything, if you know the language then you have everything, what you need is the logic, think about the behavior of your program. Before using the programming language use the human language, abstract your idea, then get a level down, for example:

I'm going to make a ping pong game:

First level:

I want two paddles with a ball bouncing, the ball is going to collide only with the paddles and I don't want scores or anything. It's very important in this step to know exactly what you want and what you don't.

Second level

How the user is going to see this game, fullscreen, windowed, static fullscreen, or dynamic fullscreen?. Mouse... Keyboard... Graphics... Sounds... Depending on this choice you might or might not need more abstraction levels.

Third Level

Ok I have chosen a windowed mode, and the game is going to be played with the keyboard. My resolution is going to be 640 X 400. With this info I already know that the paddle is going to stop moving if its position is equals to 0px, or 400px( y axis) less the height of the paddle.

Something like this:

move_paddle(ALLEGRO_EVENT *ev){

   if(ev.keyboar.keycode == ALLEGRO_KEY_UP && posiY != 0)
      posiY--;

   if(ev.keyboar.keycode == ALLEGRO_KEY_DOWN && 
      posiY != al_get_bitmap_weight(paddle_img) - 400)
   posiY++;
}

The same for the other paddle. Now the ball, the ball is going to change its Y position when its posiY is 0 or when is posiY is equals to 400 less its height:

if(ball.posiY == 0)
   falling = true;
if(ball.posiY == 400 - ball.height)
   falling = false

if(fall)
   posiY++; //See that I'm just moving pixel per pixel here... the same with the paddle
else
   posiY--;

The same with the sides, if the ball reaches less than 0 pixels... Game over, if it reach more than 640 pixel you win... and so on...

The collision detection for the paddles and the ball is very simple too. And everything depend in what you have thought before reaching this point.

My game is so simple that I know that my paddle has a margin of 20pxs from the borders, so if the ball is in 20px or 640px-20px-its_wight and the ball.posiY is bigger than paddle.posiY and smaller than paddle.posiX+its_height that means that you're colliding... So you need to change its X direction:

if(ball.posiX == 640-20-balls_width && ball.posiY > paddle.posiY && ball.posiY < paddle.posiY+its_heigh)
   left=true;

if(ball.posiX == 20 && ball.posiY > paddle2.posiY && ball.posiY < paddle2.posiY+its_heigh)
   left=false;

if(left)
   posiX++;
else
   posiX--;

Probably there are some errors, I just did it in some minutes, but what I want to say is that you need to think A LOT if you're not sure about what you're going to do before writing something. Try to abstract your ideas and then go down until you finally know how to write them using a programming language.

Thomas Fjellstrom
Member #476
June 2000
avatar

So far it hasn't been all that easy

It wasn't for me. Still isn't. But as I slowly work on it, it slowly gets better. It is incredibly frustrating. But I just have to keep at it, or it gets bad again.

Man, with your knowledge I thought you was working at a big company or something... Wth is wrong with you?, I always wonder why you don't have any game. Do you also have the Specter complex?. I think you guys talk all that shit here but unconsciously you're really happy with your life, otherwise I can't understand it.

BiPolar, Chronic Depression (for most of my life) and Social Phobia (with a healthy dose of Generalized Anxiety Disorder). aka: I'm nuts. Learning to manage it though. It just takes time. A lot of it.

Of course it is! and he's comparing himself with Specter it's impossible man, you can't do that...

But look how long it took :P If I was in a good mood, the work for Android would have been committed a week or three after I got the phone, rather than 6 months ;) The fshook and mode/fullscreen stuff for the a5 X port is about the same, I started the fshook stuff a year or two before I ended up finishing.

Huge issues with motivation when I'm depressed and anxious. But I'm getting better. Thats all that matters :D

To Specter: The only reason its getting better is because I truly WANT it. No, I believe I NEED it. I can't do the "FML" thing anymore. Failure on our scale is just not something I want to do anymore. I hope you have the same realization soon too. Sitting around complaining about it actually makes it worse, believe it or not. Its all about mind power. If you believe something, or tell yourself something enough times you will believe it. So stop it. (I know its hard, I have a hard time doing it). I'm not kidding. Its like trying to brainwash yourself, its quite hard to consistently retrain your thoughts to not be negative. Even the slightest bit of negativity has an accumulative effect on your state of mind.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Dario ff
Member #10,065
August 2008
avatar

encouragement in this forums is lacking

I disagree. You should have joined this last SantaHack regardless of "I can't make a game in 7 days", and plenty of people encouraged you there. [1] You'll be amazed of how much you can actually do in a small amount of time if you just let go of any fears about it. Even if you don't succeed in it, you still learn from any failures.

You can even cheat and set up some basic code for common game stuff in the previous days to the competition. :P Now I realize we're like 7 months away from another possible Hack compo, but it's just something to think about.

Instead of coding a game right away, you could try coding up some stuff like a basic game engine to handle resource loading, drawing, all that stuff. The motivation on it is that it will just make the process much easier later if you intend to make a game from it(and it's actually pretty fun too, at least the first time). Low-level stuff like that shouldn't get in your way when you WANT to code actual game mechanics.

References

  1. Heck, I joined with like 2-3 less days to code, and managed to make something.

TranslatorHack 2010, a human translation chain in a.cc.
My games: [GiftCraft] - [Blocky Rhythm[SH2011]] - [Elven Revolution] - [Dune Smasher!]

Thomas Fjellstrom
Member #476
June 2000
avatar

Yeah, you seem to have no problems with the really boring framework style code. Work on that, then when you get that stuff going, wrap it all up into a game with the framework. should be easier to get a working game done if you have most of it done before you start the actual main.c bit ;D

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Specter Phoenix
Member #1,425
July 2001
avatar

Yeah, you seem to have no problems with the really boring framework style code.

Yeah because it is the same boring framework taught by almost every book I've read and every tutorial I've done. When it comes to anything complex the tutorials and books really don't do a good job and preparing you because most of them are here is the concept, feature, and example code, next concept/feature and leave it at that. So the advance stuff confuses me because I never know where to start. With the pong clone I did I got as far as "I need two paddles and a ball bouncing around the screen" then breaking it down more was like me trying to speak japanese without ever learning it.

I've noticed that is one thing that is lacking in a lot of CS and such courses, they just assume you are top notch at problem solving and throw you into problem solving in software terms when most people are taught their entire school education how to do mathematical problem solving and real world problem solving. Even my problem solving course in both IVY Tech and DeVry were all mathematical or real world of "Susan is having a problem with Sarah at work. What possible ways could she approach the problem." The one that sticks out in my head is "You're the judge of a dispute. Jim is a farmer who has a family near a stream. Danny is the representative for a large company further up the stream. Proof has been given that the company is having run off in the stream which may or may not be dangerous during the high rain fall months. Read both sides and then come up with a solution that you think would benefit both sides." While it is great for problem solving in real world situations it sucks for programming so I don't understand the point of them in a computer degree.

jmasterx
Member #11,410
October 2009

I try to break it down into objects. Then I break those objects up into computer objects.

For example:
In Pong you need a PlayArea, a 2xPaddle and 1xBall.

You then need some things that will do stuff to your objects. Note that objects themselves should not necessarily have the logic. You always want to stay as generic as possible.

Now we need PongLogic.

The PongLogic's job is to keep track of the ball, handle user input, and collision.

If this were a larger project I would recommend you break those down into 3 separate objects to adhere to the single responsibility rule.

Right now, nothing happens. We need to feed user input to PongLogic.

When Allegro tells me the user has pressed a key, I will send this event to a new class called InputHandler. InputHandler's job is to translate key events into Pong usable input.

When I hit KEY_LEFT, this will cause InputHandler to call PongLogic->moveSecondPaddleDown(1);

You might also have a moveSecondPaddleTo(int y); if you use the mouse.

PongLogic will then check if that move results in the paddle being outside of the play area. If it is, it will not move the Paddle object.

When the Paddle is in fact moved, it raises a PADDLE_MOVED event. This will be useful when we want to add sound or respond to certain events.

Each logic iteration of the game, the ball is moved, if it collides with a paddle, its new velocity vector is calculated. If the ball falls out of the play area in the horizontal axis either a FIRST_PLAYER_SCORED or SECOND_PLAYER_SCORED event is fired.

We now need to handle the score.

We create a ScoreHandler class. This class implements the PongListener class. This means we can cleanly be notified when a player scores and respond appropriately.

We then store the score in ScoreHandler.

When a winner is determinable, you could either call PongLogic->gameOver(); or have a listener and raise an event.

Notice I have not mentioned drawing. This is because you should see a game as a system of objects. One of the outputs of this system happens to be video output.

You should have a PongRenderer class. Its job is to read attributes from the objects and display them on the screen. If you prefer you can give your objects a render() method but the former is usually a better idea.

To add sound, you can simply create a PongSound class. It will listen to events from PongLogic or other objects and play sounds when certain events are raised. This keeps it clean and modular.

Hope this helps a bit :)

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

jmasterx said:

make things really complex

Woah, woah, woah. That is seriously over complicating pong. At most, a basic OOP implementation of pong would have these classes {ball , paddle , game}, and these methods for each class {check_input() , update(double dt) , display()}.

K.I.S.S. F.T.W.

:o

jmasterx
Member #11,410
October 2009

Edgar Reynaldo said:

Hack away until you have a Pong game.

I'm well aware that it is way too complex for a Pong game, but it was to illustrate how a big project should be orchestrated. If you do not build a big game using this kind of design, it will become unmanageable very quickly.

Also, it's not that complex ::)

verthex
Member #11,340
September 2009
avatar

jmasterx said:

I'm well aware that it is way too complex for a Pong game, but it was to illustrate how a big project should be orchestrated. If you do not build a big game using this kind of design, it will become unmanageable very quickly

Usually you'd use UML to describe this stuff though.

jmasterx
Member #11,410
October 2009

verthex said:

Usually you'd use UML to describe this stuff though.

Yes, ofcouse, I use UML all the time. But I chose to explain it in words.

I'm quite certain that if a Pong game was made for something like Xbox Live Arcade, its design would more closely resemble mine than Edgar's.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

jmasterx said:

Also, it's not that complex ::)

When pong needs listeners and events, you might as well stop programming altogether, because You're Doing It WrongTM. :-/

Case(s) in point :

jmasterx said:

We create a ScoreHandler class. This class implements the PongListener class. This means we can cleanly be notified when a player scores and respond appropriately.

It would be simpler to give the Game class a ScoreTable, and manipulate it directly.

Quote:

To add sound, you can simply create a PongSound class. It will listen to events from PongLogic or other objects and play sounds when certain events are raised. This keeps it clean and modular.

OR, you could give the Game class some sound objects that it plays when it detects certain events taking place (not necessarily actually using events).

Listeners are classic over complication in my opinion. Events passed to parents are much simpler, and you don't have to keep track of some crazy inheritance tree created by making everything and its brother inherit Listener classes. Sure you only have to overload one method, but it's the same with events, and events keep things simpler.

jmasterx
Member #11,410
October 2009

Once again, for a small game like Pong, listeners would be overkill, but the pattern you're illustrating continuously adds more responsibility to the game class until eventually, in a bigger project, it would become unmanageable. The mediator pattern is also great to a certain extent. There are situations where letting the parent handle the event is easier. However, in games or applications with over 500,000 lines of code, you start to put too much responsibility on one class and it becomes messy. I find the observer pattern (listeners) very applicable for many situations. Especially many to many relationships,

In my card game, the server (which can be local) sends messages to the client. The client sends out all sorts of event messages. It also needs to receive certain messages too, thus a many to many relationship. I have an event handler that handles events from the client and updates certain gui components and whatnot. The client also listens to another class. This class listens for action events from certain gui components and triggers the appropriate action. Ex: when I get an action event from startButton, I notify the client to start the game which sends a message to the server to start the game.

Ex:

#SelectExpand
1 enum ClientIOMessage 2 { 3 UPDATE_ROUND_SCORES, 4 CHANGE_ACTIVE_PLAYER, 5 SET_PLAYER_BID, 6 ADD_TRICK_TO_PLAYER, 7 UPDATE_PASS_TWO_CARDS, 8 UPDATE_LAST_HAND, 9 SHOW_PASS_BUTTON, 10 SHOW_START_BUTTON, 11 SHOW_TRICK_COUNT_SELECTOR, 12 13 //inputs 14 RECEIVE_TRICK_COUNT, 15 PASS_BUTTON_CLICKED, 16 START_BUTTON_CLICKED, 17 18 };

For example, the client should not need to know anything about how I set a bid. The class handling bid assignment will listen for this event and deal with it.

If I went ahead and passed these events to the parent, it would get really messy in the parent because the upper level module is the game scene itself and there are far too many sub components to this scene to justify letting the game scene do all the logic.

I'm sure you think this is over complicated but it makes it very easy for me to manage, test, and debug the game.

One of the biggest reasons I put so much effort into making my game so object oriented is so that it does not end up in this thread with me saying it became unmanageable.

OICW
Member #4,069
November 2003
avatar

Yeah because it is the same boring framework taught by almost every book I've read and every tutorial I've done. When it comes to anything complex the tutorials and books really don't do a good job and preparing you because most of them are here is the concept, feature, and example code, next concept/feature and leave it at that. So the advance stuff confuses me because I never know where to start.

Think of it as Lego. You have lots of bricks and all you need to do is start taking these basic blocks and build a larger structure. There are generally two approaches a top-down and bottom-up. In the former you begin from the whole structure and fill in the blocks at the end.

Though, at first I'd recommend the latter, where you begin from the blocks and build the stuff up from the ground often using scaffolding code that will get replaced later. Richard Phipps had a great tutorial somewhere, where you've actually completed a whole game using this approach.

I like building stuff, I like thinking about solving engineering problems. Though I lack the motivation and time to actually do it. My sticking point is to begin. I have lots of ideas lying around, lots of building blocks to use, but no will power to actually begin.

EDIT:
Oh, I knew I saw them somewhere on the wiki:
http://wiki.allegro.cc/index.php?title=Create

though, they seem to be incomplete :-/

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

Specter Phoenix
Member #1,425
July 2001
avatar

OICW said:

Oh, I knew I saw them somewhere on the wiki:
http://wiki.allegro.cc/index.php?title=Create

though, they seem to be incomplete

Nice, the thing that made me laugh was the completion section.

Quote:

After 8 articles, Free Dungeons has gone from a concept and a design plan to a fully working and playable game. We have achieved everything we set out to do and I hope these articles have been motivational and useful in explaining how to make a more advanced game. Good luck for your future programming experiences!
Thank you. Richard.

Really? Guess he got busy. Two chapters is nice but would have been a good series to have been finished.

Thanks for the link though.

Thomas Fjellstrom
Member #476
June 2000
avatar

I think he actually finished the articles, just no-one finished importing them into the wiki.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

OICW
Member #4,069
November 2003
avatar

Actually they have been finished, but they haven't been completed on the wiki. The old page linked from the original thread from three years back is down - obviously, Phipps have moved along and now he's doing something else. Though you can check out his Chaos Groove. Kind of on-topic since we speak about abandoned projects. If I'm not mistaken he actually more or less finished it.

Anyway I am pretty sure me or somebody else should have all 8 chapters lying around somewhere. Any ideas where to post them?

EDIT: too late :)

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

Thomas Fjellstrom
Member #476
June 2000
avatar

OICW said:

Any ideas where to post them?

Either help to reformat for the wiki ;) ;) ;), or zip them all up and attach them to the Create page. That way anyone can download them and help to add the rest to the wiki.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

jmasterx said:

I'm sure you think this is over complicated but it makes it very easy for me to manage, test, and debug the game.

Well, I can't see your whole design inside my head, but I still think I would prefer to solve it with events and composition instead of listeners and inheritance. It seems like your method would end up with a lot of redundant references to other objects being stored in lots of other objects, when it seems to me that it would be easier to give a single object responsiblity for handling any messages from its subordinates. It just seems like your method would be more complex than mine, that's all.

jmasterx
Member #11,410
October 2009

Yes, it is more complex, but for me it is worth it to take the extra time in order to make debugging and refactoring much easier. Otherwise my GameScene (the parent) would be well over 4,000 lines of code with well over 100 methods (so far). There is quite a bit going on in the game scene.

I have made projects where I did use the mediator pattern in Java and they got out of hand and I had to stop. I made a Drawing Application where the Panels were responsible for the logic of their children. As I added more features I got lost. After that I started making lots of listeners and while it took much longer, I found myself able to manage much bigger projects.

I have not yet programmed professionally. I'm on my last year of college. Maybe writing code for a company will better enlighten me on the benefits of parents handling child logic, but as it stands, I find myself able to much more easily debug, test, and add features with listeners.

With C++0x, more references is not really a big deal for me.



Go to: