SFML community forums

General => SFML projects => Topic started by: easy on September 04, 2011, 11:05:47 pm

Title: Pacaman [Demo]
Post by: easy on September 04, 2011, 11:05:47 pm
Hello fellas!

Here's what I'm working on since I've joined the SFML community (copied from readme.txt):


Pacaman is a free, open source Pac-Man like game-and-tutorial project in one that uses SFML (Simple and Fast Media Library). "Paca" means splotch in Hungarian.


Project goal:

The goal is to make a proof-of-concept game with educational purposes, that has a more complex source code than the standard pong example that comes with the SFML libraries. The source code was created in a (relatively) nice coding style with a lot of comments to ease understanding.


Screenshots:

Single player mode:
(https://legacy.sfmluploads.org/cache/pics/111_screenshot-20110906-231410.png)

Cooperative mode:
(https://legacy.sfmluploads.org/cache/pics/112_screenshot-20110906-231732.png)


More info & downloads:

Download the game from Pacaman website (http://pacaman.blogspot.com) and leave a comment! Thanks! :)

Cheers,
easy
Title: Pacaman [Demo]
Post by: Groogy on September 04, 2011, 11:30:25 pm
Really nice! I appreciate the graphical design of the whole thing. Keep up the good work
Title: Pacaman [Demo]
Post by: Lo-X on September 05, 2011, 08:32:23 am
Really nice :D
Title: Pacaman [Demo]
Post by: easy on September 05, 2011, 02:55:17 pm
Thanks guys! :D

I want to finish the game in a month (max. 2) and shoot up a little Blogspot website for it, maybe with a github repo. Though I have no experience with the latter (I might need some help on that).
Title: Pacaman [Demo]
Post by: eXpl0it3r on September 05, 2011, 05:00:09 pm
Nice graphics!
Will be interessting to see the finished work.

About GitHub, I created a repo just yesterday, but it wasn't the easiest task, since I tried to use first TortoiseGit, which is pretty ugly to use with GitHub (SSH & key problems).
So I clicked around on the website and found this link (http://help.github.com/):

I don't know what OS you're using, but there are tutorials for Windows, OSX and Linux.

The GUI maybe a bit confusing at the beginning, but play a bit around and you get it to work.
Also don't forget to set your name and email address in the GUI->Edit->Options, otherwise it gets uploaded as 'unknown'...

Hope that helps.

eXpl0it3r
Title: Pacaman [Demo]
Post by: easy on September 05, 2011, 08:15:47 pm
Thank you eXpl0it3r! :)

And thanks for the link too! This will come handy. It looks more complicated than I first thought. I'm on Linux, by the way.
Title: Pacaman [Demo]
Post by: easy on September 06, 2011, 11:34:39 pm
I've updated the screenshots!

As you can see, I've added a timer to the game, which is interesting only because I had to use different layouts for the upper bar:
- In two player mode, the clock is always in the middle, while the player variables are centered ont their own half view,
- In one player mode however, the whole upper bar is centered (and in different order).

A timer would make no sense without a Game Over screen so this one is also added. Also when all the players die, the game is over then.

Other stuff: Pausing the game is now possible (P), and also taking screenshots (F12).
Title: Pacaman [Demo]
Post by: Kian on September 07, 2011, 03:57:22 am
Nice, looks pretty cool.
Title: Pacaman [Demo]
Post by: easy on September 07, 2011, 07:22:28 pm
Thanks Kian! I hope it'll be fun! Making it is certaily being fun! :D
Title: Pacaman [Demo]
Post by: easy on September 07, 2011, 11:38:31 pm
Today I've bumped into a bunch of tourists when crossing the main square of my town, and I just realized they move exactly like the blue ghosts in my game: they wander around aimlessly...

So then I've renamed my blue ghost from Pacifist to Tourist! :D

Meet da team:

(https://legacy.sfmluploads.org/cache/pics/114_enemies.png)

The Maniac is very red and very fast and likes to chase players.
The Stalker is purple and mean and slow and follows you almost everywhere, he's always in yor heels.
The Survivor is the green one he has a nasty weapon: two lives!
And the Tourist who's just likes to walk around...
Title: Pacaman [Demo]
Post by: Kian on September 08, 2011, 02:46:32 am
That's a pretty cool, that they each have a 'personality'. :D
Title: Pacaman [Demo]
Post by: easy on September 10, 2011, 12:39:43 am
Quote from: "Kian"
That's a pretty cool, that they each have a 'personality'. :D


Yeah, and actually this is what you can make use: you can predict their movement after playing a couple of rounds! As I recall the ghosts in original Pacman game also had different personalities.

-----

Today I've managed to port the game to Windows! Yay! :D It was easier than I thought, so I've added Win32 debug and release build targets to the project file. I've also found some SFML related bugs, so I'm gonna go and report them right now.
Title: Pacaman [Demo]
Post by: Haikarainen on September 10, 2011, 01:56:17 am
Quote from: "easy"
Today I've bumped into a bunch of tourists when crossing the main square of my town, and I just realized they move exactly like the blue ghosts in my game: they wander around aimlessly...

So then I've renamed my blue ghost from Pacifist to Tourist! :D

Meet da team:

(https://legacy.sfmluploads.org/cache/pics/114_enemies.png)

The Maniac is very red and very fast and likes to chase players.
The Stalker is purple and mean and slow and follows you almost everywhere, he's always in yor heels.
The Survivor is the green one he has a nasty weapon: two lives!
And the Tourist who's just likes to walk around...



Dude! You're one hell of a games designer, even if its something as simple as pac(a)man ;) Looks very nice, will try it out soon
Title: Pacaman [Demo]
Post by: easy on September 10, 2011, 03:15:19 pm
Quote from: "Haikarainen"
Dude! You're one hell of a games designer, even if its something as simple as pac(a)man ;) Looks very nice, will try it out soon


Haha, thanks! :) By the way, you cannot try it out as I haven't shared it yet! :P

Demo will be available when the basic gameplay is done.
Title: Pacaman [Demo]
Post by: easy on September 11, 2011, 08:37:40 pm
When the game starts, there will be a little demo scene where the basic game elements will be shown. The game title and the menu will be on top of this. I always loved this from the good old Doom era. :D

Okay, but of course the user cannot control pacaman when setting the options or selecting a game type to play, so obviously I needed some basic AI to take control of the main character.

There were already a chasing mechanism for the ghosts, but ghosts should also be able to escape from players, when they use the ring. Escaping is one of the main characteristic of a pacman movement, so to cut it short: I've melted the two AIs into one.

I've captured a video of the welcome-screen, where you'll see there's plenty of room to improve the AI, because currently it isn't a genious... There are evident possibilities he misses, and also makes dumb choises sometimes, but it's funny anyway! :P

Youtube video:

(https://legacy.sfmluploads.org/cache/pics/118_pacaman-ai-thumb.png) (http://www.youtube.com/watch?v=3qHJNpYbT5g)
Title: Pacaman [Demo]
Post by: easy on September 19, 2011, 10:26:41 am
Hola!

Yesterday I've finished a very important part of the game, I've finished adding more items! :D

(https://legacy.sfmluploads.org/cache/pics/124_moar-itemz.png)

Here's the list of items in the game:
The star is the most common item and is worth 10 points.
- The apple is 20 points.
- The pear is 30 points.
- The grape is 50 points.
- The melon is the best fruit and scores 100 points.
- Picking up the ring makes pacaman faster and able to eat ghosts.
- The heart gives +1 life.
- The clock adds 30 seconds more to finish the level.
- Use the teleport to escape from ghosts.
- You need to collect all the keys to open the lift door.
- You can go to the next level by stepping onto the open door.[/list]

Originally, I wanted the items to inherit from CEntity class, as it'd be logical, at least, to me. Logical in terms of the entity is an object that you can do something with it. However, I've realised there're a lot of items in the game! Almost exactly as many floor tiles there are. So that's why I've decided to use this solution about items: they're an other layer on the level, similarly to the layer of walls and floors. Pacaman is probably not the best example of item and entity handling, as the only entities are players and ghosts, and all the items are a more static part of the level itself...

Now that I've reached this little milestone (items done), I can finally improve game balance, AI, and seek for songs and sounds! :)

Cheers,
easy
Title: Pacaman [Demo]
Post by: easy on September 21, 2011, 03:54:32 pm
***** Pacaman has a website now: pacaman.blogspot.com (http://pacaman.blogspot.com) *****
Title: Pacaman [Demo]
Post by: easy on September 26, 2011, 02:10:02 pm
A new video has been released on the website! Enjoy! :)
Title: Pacaman [Demo]
Post by: easy on October 22, 2011, 07:41:22 pm
The alpha demo is released! Download it from the website: pacaman.blogspot.com (http://pacaman.blogspot.com/)
Title: Pacaman [Demo]
Post by: Veenr on October 22, 2011, 09:00:10 pm
Cool game! As most of guys here, I especially like your design, it's so bright and yummy! When a game is that simple, the graphics is what attracts most of all :)
Title: Pacaman [Demo]
Post by: Haikarainen on October 22, 2011, 10:01:03 pm
Really friggin cool so far!

Some issues I noticed;
perfectly
 Download-link on the page should be https://legacy.sfmluploads.org/file/85/download  and not just /file/85
 The awesome scorecounter at end of each map sometimes randomly hangs, giving you awful noise. You have to move the window for it to stop, so I think it has to do with frametimes.
[/list]

Couldn't stop playing til the end. VERY nice work, there should be more quality products made with this much love here on the SFML forums!


GREAT SCOTT!
Title: Pacaman [Demo]
Post by: keyforge on October 23, 2011, 12:34:07 am
This is a true piece of artwork! The graphics and gameplay are good and everything flows smoothly! Playing the game I observed the small details and the movement of the map and character and everything was very cool. The input was kinda glitchy because sometimes I pressed a button and it didn't respond until I pressed it again or I held it down longer. Are you using sf::Event or sf::Input for key inputs? sf::Event is more reliable and sf::Input is known for missing key events every once in a while.

Edit: The FPS counter flickered so much that I couldn't even tell what the current FPS was, especially without VSync! Maybe update the FPS counter at a slower rate. Also for co-op you might want to make it so that the game only ends once both pacaman characters get to the exit, this adds challenge that you have to get both people to the checkpoint by the end of the time and lets the other person get to finish up what they want so that they can get all of the stars and fruit they wanted to get before it ends. Either that or add a time limit for the second person after the first person gets to the checkpoint they have like 10-15 seconds to get what they want before the level changes (and if they die it either just ends or it restarts the level). And lastly I had a problem with the ghosts spawning in front of the spawn point with no way to escape and me being trapped there so they could make me loose a life. This could annoy some people trying to do a playthrough of the game without loosing a life or something like that. I know it's only alpha version and it's subject to a lot of change but these are just a few suggestions!
Title: Pacaman [Demo]
Post by: Nexus on October 23, 2011, 03:14:16 am
Nice pacman clone! I like the GUI, especially the score summary at the end :)

Two things keyforge mentioned also got my attention: The flickering FPS counter (I guess it was always 500 or 1000) and the impossible situations where ghosts appear in front of your house door. And I think the first few levels are far too easy and thus boring (no enemies, very much time)... Just collecting all fruits isn't that funny ;)

30 seconds given by the clock are too much in my opinion, 10 seconds are already much time in this game.
Title: Pacaman [Demo]
Post by: easy on October 23, 2011, 10:36:56 am
Wow! Thank you guys for your kind words and also for the constructive critics! :)


Quote from: "Veenr"
Cool game! As most of guys here, I especially like your design, it's so bright and yummy! When a game is that simple, the graphics is what attracts most of all

Haha, thanks! I like this "bright and yummy" phrase. By the way, I guess it comes from web design, because that's what I usually do.


Quote from: "Haikarainen"
Really friggin cool so far!

Some issues I noticed;
Gamemusic doesn't loop perfectly
Download-link on the page should be https://legacy.sfmluploads.org/file/85/download  and not just /file/85
The awesome scorecounter at end of each map sometimes randomly hangs, giving you awful noise. You have to move the window for it to stop, so I think it has to do with frametimes.

Thanks man! :)

- I know about the game music; it's because it was cut by me: Read the issue here. (http://pacaman.blogspot.com/2011/10/and-action.html) But I'll try it again.
- Download links: Ok, thanks, I'll do that.
- Noisy score counting: Hmmm, I need to investigate this!


Quote from: "keyforge"
This is a true piece of artwork! The graphics and gameplay are good and everything flows smoothly! Playing the game I observed the small details and the movement of the map and character and everything was very cool. The input was kinda glitchy because sometimes I pressed a button and it didn't respond until I pressed it again or I held it down longer. Are you using sf::Event or sf::Input for key inputs? sf::Event is more reliable and sf::Input is known for missing key events every once in a while.

First of all, thank you for testing!

- Other people have also reported this input problem, which is actually due to that I only check input when the player is more or less in the middle of a tile. I'll try to come up with a solution for this issue. BTW, I'm using sf::Input.
- Update FPS counter on a lower rate: Ok!
- I like the idea of the Co-op mode, that both players need to reach the elevator, but what if a player dies? Hmmm... I think that this solution would actually punish the player who could make it to the elevator in time...
- Ghost spawing in front of you at start: Yes, others also had problems with this one. But I have an idea to solve it!


Quote from: "Nexus"
Nice pacman clone! I like the GUI, especially the score summary at the end  

Two things keyforge mentioned also got my attention: The flickering FPS counter (I guess it was always 500 or 1000) and the impossible situations where ghosts appear in front of your house door. And I think the first few levels are far too easy and thus boring (no enemies, very much time)... Just collecting all fruits isn't that funny  

30 seconds given by the clock are too much in my opinion, 10 seconds are already much time in this game.

Thanks Nexus!

- These levels are just tutorial levels, but you're right: I'll need to make the game more difficult. Although it was even more easier before yesterday. :) On the other hand, later you'll have to gain X number of medals to procceed to the next level, so it'll be more difficult.
- 10 seconds instead of 30 seconds: Good idea! Thanks!


I've added your ideas to my TODO list, guys!

What are your computer specs? Which OS did you play the game on? I'd like to figure out the minimum requirements for the game.
Title: Pacaman [Demo]
Post by: Haikarainen on October 23, 2011, 02:43:55 pm
Quote from: "easy"
What are your computer specs? Which OS did you play the game on? I'd like to figure out the minimum requirements for the game.


Well I guess this doesn't say much regarding minimum requirements, but it might help debugging the problems i noticed;

Windows 7 Ultimate x64
AMD Athlon II X4 645 @ ~3.2GHz
8192MB DDR3 XMS3 RAM
AMD XFX Radeon 6870 Black Edition
Title: Pacaman [Demo]
Post by: easy on October 24, 2011, 01:28:23 pm
Thanks Haikarainen! Well your specs are definately not the minumum requirements :) But it's good to know that it runs on Windows 7 Ultimate x64.
Title: Pacaman [Demo]
Post by: keyforge on October 26, 2011, 05:15:04 pm
It runs fantastically on my Windows 7 32 bit, 3 GB RAM, 512 MB GPU, 2 GHZ dual core CPU laptop. I'll have to test it on my 900 mhz 1 GB RAM netbook!
Title: Pacaman [Demo]
Post by: easy on October 26, 2011, 06:37:46 pm
Oh, cool! Thanks keyforge! :)
Title: Pacaman [Demo]
Post by: Haikarainen on October 26, 2011, 09:28:25 pm
Do you have any sourcecode download for this yet? I'm pretty interested on how you coded certain things ;)
Title: Pacaman [Demo]
Post by: keyforge on October 26, 2011, 10:25:31 pm
Tested it on my netbook and it ran good, just a little choppy but I had steam running too so that probably explains it. But when I closed the app it gave me an error.

"pacaman.exe - Application Error

The instruction at "0x100453cc" referenced memory at "0x0120e386". The memory could not be "read".

Click on OK to terminate the program."
Title: Pacaman [Demo]
Post by: easy on October 27, 2011, 12:58:10 pm
Quote from: "Haikarainen"
Do you have any sourcecode download for this yet? I'm pretty interested on how you coded certain things

Not yet, because there are a lot of placeholder/ not final stuff, and some parts are not very well organized currently. But I can send you the source via email if you're interested.

Quote from: "keyforge"
Tested it on my netbook and it ran good, just a little choppy but I had steam running too so that probably explains it. But when I closed the app it gave me an error.

Thanks for the netbook test! I guess you had no VSync on, so that the game was choppy isn't the best news for me. Maybe I should add a "delay(1);" to the main loop, so that the system could do it's own work too. About the error on exit, it's present since I've added sounds and music to the game (on WinXP), and I think this is either an SFML bug, or that I've compile the game inside VirtualBox. I'll need to find a solution for this...
Title: Pacaman [Demo]
Post by: black_light_g on November 19, 2011, 07:27:49 pm
I just played your game and I must say its really good. I would like to see your source code as I am learning sfml and it would be helpful to see how you have coded pacaman.
Title: Pacaman [Demo]
Post by: easy on November 19, 2011, 11:55:07 pm
Thanks black_light_g! Well it's not finished yet, and I'm currently reorganizing the code, but if you're still interested, I can send you the code via email.
Title: Pacaman [Demo]
Post by: black_light_g on November 20, 2011, 07:59:53 am
I'd really appreciate it if you could mail it to me. Thanks.
Title: Pacaman [Demo]
Post by: easy on November 20, 2011, 05:24:03 pm
I've sent the mail!
Title: Pacaman [Demo]
Post by: keyforge on November 20, 2011, 05:47:52 pm
I'd also be interested in reading through the source code. I'm interested on how you did the AI.
Title: Pacaman [Demo]
Post by: black_light_g on November 20, 2011, 06:15:18 pm
Thanks a lot easy!! Received the mail. Will  go through it now.
Title: Pacaman [Demo]
Post by: easy on November 20, 2011, 07:58:29 pm
@black_light_g: You're welcome!

@keyforge: I've sent it to you. However, I'm not sure Hotmail can handle 20+ Mb emails, as I've packed everything into a zip file... Anyway, if it does not make it through, just tell me and we'll figrure out an other solution! :)
Title: Bug
Post by: Loronix on November 20, 2011, 10:53:16 pm
I was testing out the demo and I must say it's pretty fun. However, I kept seeing this same graphic glitch over and over, couldn't think of what would cause it.

http://i.imgur.com/3wolb.png

Specs are:

Windows XP SP2
448mb of ram (graphics card eats some)
AMD Sempron 3200+ 1.79 GHz
ATI Radeon XPRESS 200

Resolution is
1680x1050 @ 120 hz

don't laugh .

Also, this glitch only happens when moving up and down.
Title: Pacaman [Demo]
Post by: easy on November 21, 2011, 05:27:50 pm
Thanks Loronix!

This glicth is something I thought I have already eliminated... It's due to floating point rendering. I have it on my TODO list anyway as it occoures on the texts from time to time as well.

It's good to know ithe game runs on your computer with these specifications! I was looking for the lowest specs anyway. But I've seen on your screenshot that it runs on 18 FPS, which is low, in my opinion. Maybe turning VSync off in 'config.ini' can speed it up a little bit.
Title: Pacaman [Demo]
Post by: Loronix on November 21, 2011, 10:20:49 pm
It actually runs just fine and just happened to drop the moment i took the screenshot (it was a little tricky).

I usually get about 160 fps on it.
Title: Pacaman [Demo]
Post by: easy on November 22, 2011, 10:09:58 am
Wow, 160 FPS sounds much better :) I'm glad, I thought you had to play the game in 'slide-show mode'.

By the way, you can make screenshots by pressing F12 in the game.
Title: Pacaman [Demo]
Post by: easy on December 10, 2011, 04:31:23 pm
*** New video of the fixed AI: Clickey! (http://pacaman.blogspot.com/2011/12/ghosts-runaway-video.html) ***
Title: Pacaman [Demo]
Post by: dreta on December 19, 2011, 07:45:09 pm
Quote from: "Haikarainen"
Dude! You're one hell of a games designer, even if its something as simple as pac(a)man ;) Looks very nice, will try it out soon


The original Pac-Man was very complicated, especially the AI, it's something most people don't know. Here's a break down of the game by Jamey Bittman. Assuming that Pac-Man was simple is very ignorant and uneducated on your part.

http://home.comcast.net/~jpittman2/pacman/pacmandossier.html
Title: Pacaman [Demo]
Post by: Haikarainen on December 19, 2011, 08:19:52 pm
Quote from: "dreta"
The original Pac-Man was very complicated, especially the AI, it's something most people don't know. Here's a break down of the game by Jamey Bittman. Assuming that Pac-Man was simple is very ignorant and uneducated on your part.


You're ignorant and uneducated. I understand that you still need some more advanced algorithm's to make it happen, but from a designers point of view the game is rather simple. Hence game designer. Twat.

-

Btw, meant to ask you; is the movements tilebased or pointbased?
Title: Pacaman [Demo]
Post by: easy on December 19, 2011, 09:22:45 pm
Please don't fight guys! :)

It was an interesting read, although I've only read through the AI part. It's not so complicated as you've stated. As a matter of fact, I'm surprised that it was so basic. In the meantime, I can fully understand why: they must have had several hardware limitations, had no video games with good AI beforehand, and overall, it was just enough.

It also answers why none of the mazes has dead-ends: the AI wasn't build for that. While the ghosts in the original Pacman thinks forward for only one tile ahead, my ghosts have the luxury to store the whole path to their target location in their slightly bigger brains.

I acknowledge the original authors' tricks and that the final result is so convincing: "Itawani's team created the illusion of complex pathfinding by using very simple logic and very little code."
Title: Pacaman [Demo]
Post by: dreta on December 19, 2011, 11:31:46 pm
Quote from: "Haikarainen"
Quote from: "dreta"
The original Pac-Man was very complicated, especially the AI, it's something most people don't know. Here's a break down of the game by Jamey Bittman. Assuming that Pac-Man was simple is very ignorant and uneducated on your part.


You're ignorant and uneducated. I understand that you still need some more advanced algorithm's to make it happen, but from a designers point of view the game is rather simple. Hence game designer. Twat.

-

Btw, meant to ask you; is the movements tilebased or pointbased?


That's confusing. So you think the original game was simple to design, but a simpler copy of it makes the author a "one hell of a game designer".
Title: Pacaman [Demo]
Post by: Haikarainen on December 20, 2011, 02:13:47 am
Quote from: "dreta"
That's confusing. So you think the original game was simple to design, but a simpler copy of it makes the author a "one hell of a game designer".


All I'm saying is he took a simple concept thats been greatly overused, and turned it into something rare and uniqe, to extend and "renew" the simple basic foundation it stands on.
Title: Nice Video
Post by: justcolorado on December 21, 2011, 02:33:41 am
Really liked your AI video!
Title: Pacaman [Demo]
Post by: easy on December 21, 2011, 05:21:35 pm
Thanks! The AI is final now because I like it too! :D
Title: Pacaman [Demo]
Post by: easy on December 23, 2011, 01:04:55 pm
***** Here's a Christmas present for you: Click here! (http://pacaman.blogspot.com/2011/12/ho-ho-ho.html) *****
Title: Pacaman [Demo]
Post by: Tank on December 23, 2011, 03:36:19 pm
Haha, that's sweet. :)
Title: Pacaman [Demo]
Post by: keyforge on December 23, 2011, 06:32:46 pm
Really cool! I love the Christmas design on this, it's great!

Ran great for me, smooth at 60 FPS (Might have vsync enabled, not sure), on my modest single core desktop. 2 GB RAM, 2.8 GHz Celeron, 1 GB Radeon HD 4200, if that information is important.

When I have time I'll be sure to play every level, maybe you could pull a Valve and make a lot of hats!
Title: Pacaman [Demo]
Post by: easy on December 24, 2011, 08:08:02 am
Thanks guys! I'm glad you like it! :D