Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Deluxe Pacman 2 (Allegro 5) source code released

This thread is locked; no one can reply to it. rss feed Print
Deluxe Pacman 2 (Allegro 5) source code released
Neil Roy
Member #2,229
April 2002
avatar

I decided to finally release the code to Deluxe Pacman 2, the last version I made.

I haven't worked on the game in a long time now, so I am releasing it under the MIT license (https://opensource.org/licenses/MIT), which is pretty liberal in how you can use it. I hope someone gets something out of this, if nothing else, than an example of how not to do it, I don't know. But I would hate for the game to stagnate when perhaps someone can improve it, or whatever. You can download it on the games page, right under the last Deluxe Pacman 2 release is a download button for the source code. I won't apologize for my coding style, i don't tend to follow the crowd, so be prepared. I have notes in the docs folder in the zip with more information.

It uses Code::Blocks with MinGW and Allegro 5. There's probably some good examples of programming Allegro 5 in there, maybe bad examples too, I don't know, I just know it works. I test compiled this with the last version of Allegro 5 and it runs just fine. Just need allegro and it's deps as usual and you're good to go.

It's kind of sad to be doing this honestly, but I am not getting any younger so...

https://nitehackr.github.io/games_index.html

---
“I love you too.” - last words of Wanda Roy

GullRaDriel
Member #3,861
September 2003
avatar

Nice move Neil and don't be so sad, someone may take your code and may make it live longer than you :-p

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

bamccaig
Member #7,536
July 2006
avatar

If the game was still bringing in a solid income then you might not want to do this, but honestly if you aren't earning an income selling copies of the proprietary game then open sourcing it makes perfect sense, and you should be happy and proud that you've done this. Open source projects are full of imperfect code, and games especially often have poor coding practices. You have nothing to be ashamed of even if you would have been. If desired, the community can take the time to clean the code up. The hard part was making it in the first place. :)

Neil Roy
Member #2,229
April 2002
avatar

I put a link with the precompiled DEPs up there as well. The Allegro 5 deps which were compiled by people in these forums. I direct people to these forums for help etc. I also have my own personally compiled version of Allegro 5, which isn't too different, except I compiled it with -std=gnu11, which indicates the 2011 version of C with GNU extensions. Also my release version of Allegro actually is a release with no debugging information in it. I have a debug, profiling and release versions, both static and dlls. I done this so people could download the libs I use to be sure it works.

I also got a request from a DOS gaming group I am a member of for the DOS source code... which is worse and older than the DP2 by far! ;D. So I managed to track it down and release it. Link is at the bottom of the same page. Now that source may give you nightmares, but it works. I used WAY too many globals in it, but I was still fairly new to C at the time. It's Allegro 4, compiled with DJGPP originally (I didn't realize just how far back Allegro 4 went, forgot).

I would have put it all on github as a project, but I am not too familiar with that.

Hopefully someone can use it all anyhow, maybe give Allegro 5 a little boost.

---
“I love you too.” - last words of Wanda Roy

piccolo
Member #3,163
January 2003
avatar

ill get you to remake it on my new game platform when i am done developing

wow
-------------------------------
i am who you are not am i

Eric Johnson
Member #14,841
January 2013
avatar

Thanks for sharing, Neil. I've been curious as to how a Pac-Man game might work under the hood, and this will surely satiate that curiosity. And man, that's one lengthy journal. :o

bamccaig
Member #7,536
July 2006
avatar

Oh man, I just watched the YouTube video. I love it. You're just so Canadian. So Ontario. :D Honestly, don't be so insecure about the coding style. I haven't looked, but it's hard to criticize anybody that has made a game, let alone one that is allegedly so popular. Anybody that has spent time programming for a living knows that most of the industry is lazy and careless, and getting to a goal line matters more than doing it with grace or style. Ultimately, what I'm trying to say is stand up proud and don't instruct people to hate on it before they've even seen it. Just put it out there and let people judge for themselves. I've read through the source code of very impressive projects and either see preprocessor Hell or code that is difficult to understand or could be improved or whatever. It all depends on the needs of the project ultimately, and the resources behind it. Just be proud. You did good, "kid".

Peter Hull
Member #1,136
March 2001

I have taken a quick look at the code and I don't think there's anything you need apologise for. I don't know what the folk at Epic Games would make of it but most of the code I see is for embedded firmware - nothing clever-clever but consistent, well-documented and rock-solid - and the Deluxe Pacman 2 source reminds me of that.
Thanks for sharing!
Pete

Neil Roy
Member #2,229
April 2002
avatar

And man, that's one lengthy journal. :o

;D, yeah, I've been adding to it every time I worked on the game, the ups, the downs, when I was annoyed etc... it's a LENGTHY read for sure. I have a similar one for Deluxe Pacman 1, and actually, every one of those games I have always included that journal, just most probably never noticed it in the startup menu for the game (or in the folder). It has actually helped me to go back and see what I was doing and why.

The DOS source (also available on that same page, which is the oldest I have for the game) has a journal that goes back to 2001, but anything before that was lost when my hard drive died. So it documents me recoding the game back up to the state it was in before the crash. Its too bad, because I would have loved to go back and look at my earliest journal I kept from day 1.

bamccaig said:

You're just so Canadian. So Ontario.

Born in Quebec, raised in Ontario ever since. Thanks anyhow.

, well-documented and rock-solid

Thanks a lot. When DP2 I tried harder to comment it like crazy and stick to a certain style.

I do tend to have a lot, probably too much in the main file, but I tend to use Code::Blocks bookmark function to jump between places in the code, so even though it was large, it was never a problem for me.

Oh, my version number, in case nobody has already guessed it, is simply YY_MM_DD (TIME). Made more sense, so you know exactly when I compiled it.

Anyhow, thanks for all the kind words. I hope this can help someone, especially if people want some ideas on how to use Allegro 5, this could be good for that.

I already had someone use my level loading/saving code as they are new and it helped them, which was nice to be able to help.

---
“I love you too.” - last words of Wanda Roy

bamccaig
Member #7,536
July 2006
avatar

NiteHackr said:

;D, yeah, I've been adding to it every time I worked on the game, the ups, the downs, when I was annoyed etc... it's a LENGTHY read for sure. I have a similar one for Deluxe Pacman 1, and actually, every one of those games I have always included that journal, just most probably never noticed it in the startup menu for the game (or in the folder). It has actually helped me to go back and see what I was doing and why.

It's really impressive that you keep a journal of your development time. I haven't looked at it, but it's a super neat concept. Just imagine if every other developer did that. Surely we can all think of somebody that we'd love to read the journal for (in addition to yours..!).

NiteHackr said:

Born in Quebec, raised in Ontario ever since.

Hence, you sound like Ontario. :P You certainly do not sound like Quebec. I've played Counter-Strike with enough Quebequers to get the accents down. >:(

The real question is whether you speak fluent French or French-Canadian. My mom was fluent and my mom's side has French coming from New Brunswick, but that generation never taught us kids so none of us speak it. It's a real shame to have lost that (but on the plus side I wasn't sent to a Catholic school [seems the two often go hand-in-hand]!).

Neil Roy
Member #2,229
April 2002
avatar

My father is 100% French, born and raised in Quebec. Actually, my family on my father's side came to Quebec from France in the 1600s. But my mother is 100% English and she left my dad when I was 5, so I never learned French until I went to public school. It was one of my better classes in school because when I do speak it, I seem to have a natural accent. I am not fluent though, wish I was. I was complimented when visiting my father that I spoke it well though. My dad learned English while he was in the Armed Forces and speaks English fairly well, but is natively French. I could probably get by in a pinch, but still couldn't really carry on a conversation in French. Wish I could though! Hard to learn without full immersion. Move to a French speaking area and you will pick it up fast.

Your background sounds VERY similar to my own. Quebec is very Catholic. My parents married in a Catholic church, baptised me in one, but my dad is an atheist, which I found amusing. He loves to tease me, but he's a great guy, a fun person to drink with etc.

I'll say one thing about Catholics, they know how to keep records. Thanks to them we have been able to trace our family history quite far back, to around 1100. Our family came from France where we were from 1100 until the 1600s. Not bragging, but we had royal blood, so I found the timing perfect to get out of France before the revolution! ;D. But what really surprised me, and what my dad didn't know was that I found out that we came to France in 1100 and that we came from either Scottish or Irish descent. Which is about the same as the Scotts and the Irish are both offshoots of the same family. So.. kind of funny, long French history that started in Scottland or Ireland. Then I learned that the gene for red hair comes from the Scotts or the Irish only, and when I told my dad about that, he informed me that we have had red hair in our family.

Anyhow... more info than you asked, but family history and ancestry fascinates me. :)

---
“I love you too.” - last words of Wanda Roy

Go to: