Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (537)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  King Charles is missing his gold!  (Read 2100 times)
0 Members and 1 Guest are viewing this topic.
Offline namrog84

JGO Ninja


Medals: 46
Projects: 4


Keep programming!


« Posted 2011-06-27 15:48:24 »

I ported this little pathfinding/game type demo.  

It originally was 100% in dutch, including variables and comments. Its 100% in english now.
It was also not in standard Java.
I have fixed most, but not all the bugs.
There were other misc changes I have made since the original.

Summary:
There are these knights that go out and find the random gold(random each time you load) and return it back to the castle.
There is no real "game" to it right now, its more of a learning/shared code type of thing.

Features, things to look at:
Java2D
Random tile variation(take notice of the grass, the slight variation in color makes it look good)
All graphics are made on the fly in game....no reference "image files"
The encapsulation of how they handle the graphics for different elements.
A different approach to path finding ( not better, but different, then typical types )
-Take note of "why" the knights get jammed about 15% of the time, its quite obvious if you see them get stuck and admire the pathfinding correction.

(They only have the foresight of a couple of tiles and don't know how well enough how to navigate around things, There needs to be either a "return home and try again" or "randomization" of where to go,  given the limitations of the current pathfinding.  Ideally youd want a different system all together though

Incorporates multiple useful elements,
--logging feature(disabled by default)(minor logging is enabled)
--swing buttons
--game window


The pathfinding uses a step pathfinding, and I wouldn't recommend looking too much at it, because its really finicky, and you should be using A* pathfinding anyways. The knights sometimes get stuck, I've fixed a lot of their jams, but they still get jammed sometimes, especially if you add more knights.

Pictures:
http://code.newrog.com/sites/default/files/1kc.png
http://code.newrog.com/sites/default/files/2kc.png

Demo:
http://code.newrog.com/sites/default/files/goldHunters.jar
http://code.newrog.com/sites/default/files/goldHunters-small.jar  (smaller window)

Source:
http://code.newrog.com/sites/default/files/goldhunters.rar




"Experience is what you get when you did not get what you wanted"
Offline ra4king

JGO Kernel


Medals: 342
Projects: 2
Exp: 5 years


I'm the King!


« Reply #1 - Posted 2011-06-27 17:29:55 »

Very impressive! I ran it a couple times but the knights never got jammed for me Tongue
However, the window was too big for my screen so the entire world wasn't visible. :/
I'm on a 1280x800 screen.

EDIT: My luck ran out after I posted this. In one try, two of the knights kept looping around each other forever, in another try, three of the knights were just frozen next to each other.

Offline namrog84

JGO Ninja


Medals: 46
Projects: 4


Keep programming!


« Reply #2 - Posted 2011-06-27 18:08:47 »

In the World.java on line 74, there is a "BOXSIZE" that can be adjusted. and it will automatically adjust the resolution and Everything in the game, even the window.


I have added an additional jar for demonstration purposes with a smaller box size, hopefully it will fit properly. Please see the original post

"Experience is what you get when you did not get what you wanted"
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ra4king

JGO Kernel


Medals: 342
Projects: 2
Exp: 5 years


I'm the King!


« Reply #3 - Posted 2011-06-27 19:16:44 »

Nice, thanks for the source Smiley

Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #4 - Posted 2011-06-27 20:32:04 »

Pretty cool. Smiley I'd recommend allowing the knights to pass through each other, which would solve your issue. To actually deal with it, I'd suggest giving each knight an ID, and then the one with the lowest ID always stops and waits until he is not adjacent to the the higher ID, or something like that. This stops them from constantly trading spaces back and forth.

See my work:
OTC Software
Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #5 - Posted 2011-08-06 20:31:07 »

This is a nice application of pathfinding, if we need short-sigthed enemies. I think it's cheating a little bit to tell them where to go though (coords of gold) Tongue

Offline Cero
« Reply #6 - Posted 2011-08-06 23:45:08 »

bug. never finishes, trapped forever

Offline ra4king

JGO Kernel


Medals: 342
Projects: 2
Exp: 5 years


I'm the King!


« Reply #7 - Posted 2011-08-11 20:30:05 »

bug. never finishes, trapped forever

The knights sometimes get stuck, I've fixed a lot of their jams, but they still get jammed sometimes, especially if you add more knights.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (16 views)
2014-08-01 22:53:16

CogWheelz (15 views)
2014-08-01 22:51:43

CopyableCougar4 (18 views)
2014-08-01 19:37:19

CogWheelz (19 views)
2014-07-30 21:08:39

Riven (27 views)
2014-07-29 18:09:19

Riven (16 views)
2014-07-29 18:08:52

Dwinin (14 views)
2014-07-29 10:59:34

E.R. Fleming (42 views)
2014-07-29 03:07:13

E.R. Fleming (13 views)
2014-07-29 03:06:25

pw (44 views)
2014-07-24 01:59:36
Resources for WIP games
by CogWheelz
2014-08-01 18:20:17

Resources for WIP games
by CogWheelz
2014-08-01 18:19:50

List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!