Slick Forums

Discuss the Slick 2D Library
It is currently Tue May 21, 2013 12:48 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: JPacman
PostPosted: Wed Dec 10, 2008 7:49 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1313
Location: Italy
Hi to everybody!


WebPage: http://code.google.com/p/jpacman/

DownloadLink:

Windows system : http://jpacman.googlecode.com/files/jpacman-win32-0.03-alpha.zip

Linux system: http://jpacman.googlecode.com/files/jpacman-linux-0.03-alpha.zip


Now a screenshot:

Image


every suggestion, bug reports and so on are welcome!

note: it's a package for win32, linux soon :d
note2: webstart soon too![/url]


Last edited by Gornova81 on Tue Dec 16, 2008 10:04 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 11, 2008 5:39 am 
Offline
Oldbie

Joined: Tue Jun 17, 2008 5:11 pm
Posts: 336
Hey Gornova looks pretty cool. Haha I didn't know I wrote the build file, when did I do that? :-)

Anyway, here are my thoughts:

* I think that you checked in the lib/native directory w/ some of the native libs but not all, I'd add the rest so that you can run the ant file w/o problems.
* I found I was frequently getting stuck on walls. Maybe you should move one tile at a time? If not then I think you should probably add a little more "fudge" factor so that I can just miss but not get totally stuck.
* I liked your AI, keep making it smarter!
* The first level was sort of weird, what's up w/ all the food being in a field like that?
* I think the second level was better, I would rework things to be more traditional -- i.e. maze-like.
* It's cool that you had a high score list? Is it online, can I compete against others? If not why not add that? It's easy
* Some sounds would be nice. At least add something to signal the start and end of a level.
* Hey, you can't keep adding red ghosts that's not fair!

That's all I've got for you now. So far I'm really impressed keep it up. Once the controls have been ironed out it will be a lot of fun and hopefully I'll make it past level 3.

_________________
My website about game development http://anotherearlymorning.com


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 11, 2008 12:19 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1313
Location: Italy
First, thanks for your suggestions :D

Quote:
Hey Gornova looks pretty cool. Haha I didn't know I wrote the build file, when did I do that? :-)


I've copy it from shade repository :D it's also GPLv2, right?

Quote:
* I think that you checked in the lib/native directory w/ some of the native libs but not all, I'd add the rest so that you can run the ant file w/o problems.


Into zip (jpacman-win32-0.2-alpha) there is only natives for win32 (dlls). I've already fix that my ant build copy also natives-win32.jar.
Next release will be for linux too, so into zip for linux will be only natives for linux, and so on.

Quote:
* I found I was frequently getting stuck on walls. Maybe you should move one tile at a time? If not then I think you should probably add a little more "fudge" factor so that I can just miss but not get totally stuck.


This is my MAIN problem for jpacman.. i'm using a simple collision/detection system. If you see in Player.trytomove method:

Code:
private boolean tryMove(float x, float y) {
        // REMIND: 25 is value for collision detection!
        Rectangle rect = new Rectangle(x, y, 25, 25);
        DummyBody dummy = new DummyBody(rect);

        if (Collider.testAndReturn(dummy, parent.getBlockingEntities()) == null) {
            return true;
        } else {
            return false;
        }
    }


I'm using your collider system.. how can i add this factor you mentioned?

Quote:
* I liked your AI, keep making it smarter!


Thanks a lot! I like orange: go random, when pacman are near, follow him! :D

Quote:
* The first level was sort of weird, what's up w/ all the food being in a field like that?


I don't understand this..

Quote:
* I think the second level was better, I would rework things to be more traditional -- i.e. maze-like.


levels are totally alpha :D pacman player like mazes? Good to know it :D
Code:
  * It's cool that you had a high score list? Is it online, can I compete against others? If not why not add that?
[url=http://anotherearlymorning.com/blog/global-high-score-lists]It's easy[/url]


I red your post some time ago.. main problem is php server :-/ where can i find someone free, and decent?

Quote:
* Some sounds would be nice. At least add something to signal the start and end of a level.


next to add :D

Quote:
* Hey, you can't keep adding red ghosts that's not fair!


not fair? really ? :P i think that a nightmare level with many, many reds give me suggestions about performances.. have you got some problems?

Quote:
That's all I've got for you now. So far I'm really impressed keep it up.


Thanks, really :D Sorry for not contribuiting on Shade.. too little time :(

Quote:
Once the controls have been ironed out it will be a lot of fun and hopefully I'll make it past level 3.


I agree.. but.. level3? really? it's so bad? :D I can finish all :P
Seriusly, my main problem is balancing difficulty of this little game.. i've learn a lot from pacman :D


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 14, 2008 9:44 pm 
Offline
User avatar

Joined: Thu Apr 24, 2008 4:28 pm
Posts: 66
Location: Germany
Hi Gornova81,

we have one communally: a heart for remakes -in Java ! :D

Why you don't move the native files to the main dir. So you don't need the .bat file anymore.

It's right:
Quote:
* I found I was frequently getting stuck on walls.

My tip:
1. Make pacman as big as the floor.
2. Don't check collisions with pixel accuracy:
Use a collision array with values for every 4th pixel. The x and y getters of game objects, have to return the position in the array (posX / collisionArray.lenght). In update you let mr. pac move to the next grid position. That's all.

Webspce with php.. google and you will find it.
eg. http://justfree.com or http://funpic.de
If you want I can host it on xswing.net.

Best wishes,
Tobse


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 14, 2008 11:25 pm 
Offline
Oldbie

Joined: Tue Jun 17, 2008 5:11 pm
Posts: 336
Hey Gornova, so I got excited when I started to look at your code last week and implemented some stuff on my own over the last week. What I've got here isn't as cool as what you've got but it shows off some of my suggestions. Please feel free to lift any of the code if you'd like it -- I certainly lifted a fair amount from you, as I think you'll see.

I spent most of my time on the AI and state machines. You'll notice that you can only move one tile at a time so there's no way to get stuck. (There's a bug if you run into a wall too much.) I've also implemented some different ghost brains following your model.

Let me know if you have any ideas on how to improve the AI? For instance, it might make more sense to allow the Red ghost to turn around (currently not allowed).

* You can find the source code here: Pacwhat source code
* Webstart is here: Pacwhat!?

There's only one level, if you get hit it will restart, move with the arrow keys.

_________________
My website about game development http://anotherearlymorning.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 15, 2008 3:18 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1313
Location: Italy
Quote:
Hey Gornova, so I got excited when I started to look at your code last week and implemented some stuff on my own over the last week.


Many, many thanks man! I also really appreciated your page abouts pattern in games: http://updownleftleft.com/wiki/.

I think that everybody in this forum could add something useful, so keep it working on! Maybe let know it to kev, so he can write on wiki ?

Quote:
What I've got here isn't as cool as what you've got but it shows off some of my suggestions. Please feel free to lift any of the code if you'd like it -- I certainly lifted a fair amount from you, as I think you'll see.


Maybe we can collaborate with svn/patch system ? I'll see your code tomorrow at home! Thanks!

Code:
I spent most of my time on the AI and state machines.


Good! Can you do a little brain with raycasting system? So i can plug-in into my code?
Maybe a little re-organization of my code so i can implement strategy pattern for Brains? Or for you was enough so? (bad english :d)

Quote:
You'll notice that you can only move one tile at a time so there's no way to get stuck. (There's a bug if you run into a wall too much.)


I must see it!

Quote:
I've also implemented some different ghost brains following your model.


very goood!

Quote:
Let me know if you have any ideas on how to improve the AI? For instance, it might make more sense to allow the Red ghost to turn around (currently not allowed).


turn around in wich sense?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 15, 2008 4:25 pm 
Offline
Oldbie

Joined: Tue Jun 17, 2008 5:11 pm
Posts: 336
Quote:
Many, many thanks man! I also really appreciated your page abouts pattern in games: http://updownleftleft.com/wiki/. I think that everybody in this forum could add something useful...


Thanks, the site really doesn't have too much on it yet so I've been quietly adding things as I discover them. I'd love help from the community.

Quote:
Maybe we can collaborate with svn/patch system ? I'll see your code tomorrow at home! Thanks!


Right now my code is far enough away from yours that the two code bases won't merge, later if there's interest I'd be happy to put my stuff under some form of version control.

Quote:
Good! Can you do a little brain with raycasting system? So i can plug-in into my code?


I considered using ray casting but ultimately ran w/ a simple path-map (for lack of a better word) to do the path finding. This is actually faster and works well for pacman.

I basically adopted your brain-strategy approach and implemented a few types that made sense to me. There are 5 types:

* Smart brain which tries to get to the target in the shortest way
* Rook brain which tries to get to the target in a roundabout way
* Dumb brain which moves at random unless it sees the target
* Scared brain which tries to stay away from the target
* Emergency brain, like the scared brain but the ghost can turn around. Active when powered up

The first four ghosts can't turn around meaning that if they just moved forward they can't move backward. I think this improves the look-and-feel at the cost of the smartness. In some cases it might make for a better game to let the ghost turn around (for instance w/ the smart ghost).[/quote]

_________________
My website about game development http://anotherearlymorning.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 16, 2008 10:05 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1313
Location: Italy
Into first post, everybody can now download jpacman 0.03-alpha, with:

- Win32 executable (thanks Tobse)
- Linux zip with a shell script
- minor enanchment on code

please everybody feel free to comment! :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group