Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (552)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 ... 32
1  Discussions / Miscellaneous Topics / Re: How do you make animated GIFs? on: 2014-08-08 12:33:56
I have recently needed to shrink a very large animated GIF I created:



Originally it was 28688KiB and I managed to shrink it down to 14340Kb by use of SuperGIF and GIFsicle.

For the gif capture, well it was the output of a java program I created for a competition on CodeGolf.stackechange but I have used Cropper to screen capture to GIF

2  Games Center / Contests / Re: Simple AI competition: Survival Game - Alienwar on: 2014-07-10 13:49:08
I am more than willing to succeed to a worthy opponent Smiley

The shame with this version of the competition is that some information that was present in the other competition (i.e. number of alien types and map size) is not present so I could not do more intelligent things like attempt to find other aliens of my species and co-ordinate attacks
 
3  Games Center / Contests / Simple AI competition: Survival Game - Alienwar on: 2014-07-09 23:35:15
http://codegolf.stackexchange.com/questions/32782/survival-game-alienwar

I had a lot of fun with the last AI competition that was held so I thought I would try again.\

After many unsuccessfuly idea, I have created an Alien AI which is currently the leader.

Any one want to knock me off my pedestal?
4  Game Development / Artificial Intelligence / Re: A* Multiple paths to goal on: 2014-06-24 01:12:28
Maybe I am getting confused, but there is only one shortest path for the images you have provided. Do you want instead to have multiple semi-optimal paths?
5  Discussions / General Discussions / Re: Embedded JVM for Windows Native Deployment seems viable on: 2014-05-09 06:07:31
It is not there... JavaFX is the future, did not you know that?

I do not discount that, but there is a lot of existing java swing applications out there.


Maybe it was just my ignorance but I am quite happy to see that there are quite a few valid alternative solutions out there now that java for the end user client is pretty much dead for the avgerage joe.
6  Discussions / General Discussions / Re: Embedded JVM for Windows Native Deployment seems viable on: 2014-05-08 22:14:22
Thanks for the reference to Packr. I did not find that in my investigations... looks like the tool that I would use
7  Discussions / General Discussions / Re: Embedded JVM for Windows Native Deployment seems viable on: 2014-05-08 22:13:35
I dont see awt in any of the compact profiles... maybe I am blind.

seems odd that open jdk which has not been trimmed of standard jre functionality (i.e. include awt ) when just simily compressed using 7zip is 17meg... what does the oracle version has that openjdk does not?
8  Discussions / General Discussions / Re: Embedded JVM for Windows Native Deployment seems viable on: 2014-05-08 21:28:12
Maybe you are right. And I am being a little too stingy but I guess I have always been embarrased about pushing Java over C++ and the like for a end product that was going to be a native executable on a system without java installed. The java version was always laughed at for being bloated.

But times have changed and doubling the size of the application is not the problem it used to be.

That being said, I do like the non-oracle-ness of the open jre windows port Smiley makes things a lot easier for the license ****s at work ;P

And that the open jdk jre compresses down quite nicely without any real effort is icing on the cake!

oh wow... i did not know that n.a.z.i.s was worth of censoring! crazy!
9  Discussions / General Discussions / Embedded JVM for Windows Native Deployment seems viable on: 2014-05-08 13:57:53
With more end users having no JVM installed on the windows platform, I have been investigating alternatives on providing a native executable version of my java application.

I have tried:

1. Excelsior JET but I will not be able to convince my work to pay for a license Sad
2. Java Native Compiler... but that is limited to java 1.5
3. Launch4J to make a exe-jar wrapper + embed a 1.7 JRE... way too large even when compressed using LZMA ( > 44Meg ) and the license is such that you cannot remove unwanted components.

Then I found that Azul Systems provide a Windows binary of OpenJDK (called Zulu).
4. Launch4J to make a exe-jar wrapper + embed 1.7 Zulu JRE .. getting better( ~ 17 Meg )
5. Launch4J to make a exe-jar wrapper + embed 1.7 Zulu JRE, but perform Pack200 on all the jars +  batchfile to unpack200 the jars.... better again!( ~ 12 Meg )
6. Launch4J to make a exe-jar wrapper + embed 1.7 Zulu JRE, but perform Pack200 on all the jars +  batchfile to unpack200 the jars + perform lossless shrinking of the JRE dlls,gifs,exes,etc... ( ~ 11 Meg )

That seems quite reasonable... and that is without stripping any of the actual JRE functionality.
10  Discussions / Miscellaneous Topics / Re: any good RTS 2d war strategy games? on: 2014-04-19 08:39:28
how about total annihilation?
11  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-11 08:48:15
i am not even sure that there is a end date... so more the merrier
12  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-10 23:16:25
I must admit i took his results on face value... my own limited testing of the deep wolf has similar results to you i.e. 70's
13  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-10 22:33:14
wowie the author of the DeepWolf is in a league of their own!

Not sure that I can do much to beat it... but will try Tongue
14  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-10 13:39:52
I see Smiley

It does seem to be quite effective. well done.

I am trying my hand at a rather more complicated Wolf than what I currently produced. I am not sure whether it will give any benefits however Tongue
15  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-09 20:54:25
Very nice! I dont suppose that you want do give a little explanation of how the wolf behaves?
16  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-08 22:01:08
Moogie, I'd be interested to see how Omega fares with more of the wolves in the simulation.

your wish is my command (avg of 100 rounds of 1000 iterations):

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
class animals.OmegaWolf - 85
class animals.HonorWolf - 82
class animals.ProAlpha - 79
class animals.AlphaWolf - 77
class animals.ShadowWolf - 77
class animals.LazyWolf - 62
class animals.CamperWolf - 61
class animals.StoneEatingWolf - 59
class animals.GatheringWolf - 48
class animals.Sheep - 42
class animals.EmoWolf - 34
class animals.LionHunterWolf - 28
class animals.GamblerWolf - 27
class animals.WolfWithoutFear - 11
class animals.MOSHPITFRENZYWolf - 5
class animals.Wolf - 3
class animals.Stone - 2
class animals.Bear - 0
class animals.Lion - 0
class animals.MimicWolf - 0
class animals.Wion - 0


note that for Gambler wolf i removed its cheating: changing the Math.random() behaviour

also for those who might want it... the following automatically adds all the animals in the animal package:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
private static final Class[] classes;
   
   static
   {
      File file = new File("src\\animals");
      System.out.println(file.getAbsolutePath());
      File[] files = file.listFiles();
      ArrayList<Class> animals = new ArrayList<Class>();
     
      for (File child : files)
      {
         String name= child.getName();
         if (!name.contains("1") && !name.equals("Animal.java"))
         {
            if (name.endsWith(".java"))
            {
               name=name.replace(".java", "");
               
               try
               {
                  Class clazz = Class.forName("animals."+name);
                  animals.add(clazz);
               }
               catch (Exception e)
               {
                  e.printStackTrace();
                  System.exit(1);
               }
            }
         }
         
      }
      classes= new Class[animals.size()];
      int i=0;
      for (Class animal : animals)
      {
         classes[i++]=animal;
      }
   }


17  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-08 13:11:48
just added my wolf. http://codegolf.stackexchange.com/a/25485/20193

so a quick test for the average living wolves over 100 rounds of 1000 iterations:
class animals.AlphaWolf - 72
class animals.OmegaWolf - 89
class animals.Wolf - 18
class animals.LionHunterWolf - 29
class animals.ProAlpha - 66
18  Game Development / Newbie & Debugging Questions / Re: Problems with Player Centering in Isometric Style Game on: 2014-03-30 21:41:07
This is actually more involved than you would imagine:

1. firstly how are you representing your map? i.e. is it a simple 2d array rotated 45 degrees? or a more memory efficient data structure?
2. do you have, and understand, the translation from map coordinate space to screen coordinate space?

centering the player on the tile should not be a conceptually difficult problem:
x = tile image width/2 -player image width/2
y = tile image height/2 - player image height

For outlining the player selected tile i would simply render another "tile" at the selected tile coordinates where the image is a mostly transparent image with the outline of a tile.

19  Game Development / Game Mechanics / Re: Connecting, stitching, and rendering your overworld areas together in a 2D RPG. on: 2014-03-28 05:08:27
yes, however the critical point is that if the connection points do not line up then manual intervention is required.
20  Game Development / Game Mechanics / Re: Connecting, stitching, and rendering your overworld areas together in a 2D RPG. on: 2014-03-28 03:48:28
if your area connection points do not visually match then you cannot directly nicely render them together as you have stated. You may need to render the overworld save it to a file and then manually make pixel-level changes to the image to smooth the transitions and the render that instead.
21  Games Center / WIP games, tools & toy projects / Re: Airships Engine on: 2014-03-24 09:03:39
For determining blocks that are apart of the ship you could use the algorithm I used to identify islands for the RTS i am currently making.

Note that i do not know the algorithm's name as i derived it myself:

1. determine whether the cell at 0,0 is either ship or non ship, record this as the region type
1. scan your grid left to right. for each cell:
1a. check to see if the cell's region type does not match the recorded region type. If it does not then:
1aa. update the recorded region type
1ab. increment the master id
1ac. set the current region id to the master id
1ad. set the initial regionIdMapping entry for this id to be this id.
1b. check to see whether the cell above's region type matches the recorded region type. If is does then:
1ba. set the current region id to the regionIdMapping entry of the region id of the cell above.
1bb. check to see whether the cell to the left's region type matches the recorded region type. If is does then:
1bba. iterate over the regionIdMapping entries and update those entries who map to the left cell's region id to be now mapped to the current region id.
1c. update the current cell's region id to be that of the current region id.
2. scan your grid left to right. for each cell:
2a. consolidate the associated region ids by setting each cell's region id to the regionIdMapping entry of the cell's region.

This is implemented in my code as below:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
         /**
          * Region identification
          */

         int id = 0;
         int masterId = 0;
         int regionType = improvements[0][0] & LAND_FLAG;
         int[] regionSize = new int[MAX_POTENTIAL_REGIONS];
         int[] cellRegionMapping = new int[MAX_POTENTIAL_REGIONS]; // TODO use temp[]

         for (j = 0; j < MAP_SIZE; j++)
         {
            for (i = 0; i < MAP_SIZE; i++)
            {

               // if the current region type does not match cell type then
              // set region type to the opposite type and update the
              // current region id
              if ((improvements[i][j] & LAND_FLAG) != regionType)
               {
                  regionType = improvements[i][j] & LAND_FLAG;
                  id = ++masterId;
                  cellRegionMapping[id] = id;
               }

               // check to see whether the cell above is the same region
              // type. If so then set the current region id to the that
              // cell's mapped region id
              if (j > 0 && (improvements[i][j - 1] & LAND_FLAG) == regionType)
               {
                  id = cellRegionMapping[region[i][j - 1]];
                  if (i > 0)
                  {
                     int otherId = region[i - 1][j];

                     // if the cell to the left is the same region type
                    // then ensure that any references to region id of
                    // that cell point to the current id.
                    if ((improvements[i - 1][j] & LAND_FLAG) == regionType)
                     {
                        for (k = 0; k < MAX_NO_POTENTIAL_REGIONS; k++)
                        {
                           if (cellRegionMapping[k] == otherId)
                           {
                              cellRegionMapping[k] = id;
                           }
                        }
                     }
                  }
               }

               // set the region id for the cell
              region[i][j] = id;
            }
         }

         // using the map of associated cell region ids, consolidate the
        // regions ids to one per region
        for (i = 0; i < MAP_SIZE; i++)
         {
            for (j = 0; j < MAP_SIZE; j++)
            {
               regionSize[region[i][j] = cellRegionMapping[region[i][j]]]++;
            }
         }


Note that this was code for a java4k game so is pretty rough. For your case I would suggest using a proper collection for the regionIdMapping.

Obviously you will need to change the
1  
 improvements[i][j - 1] & LAND_FLAG 
test to be your test for a placed block. But you can then use the regionSize array to pick the largest group of ship blocks (region) and make the assumption that they represent the ship.

This algorithm also assumes that only non-diagonally touching cells are grouped together... if you want to do that then you need to repeat 1b above for the cell to the above left of current and for the cell to above right of the cell.
22  Game Development / Networking & Multiplayer / Re: Good latency proxy? (TMnetsim causing stream corruption!) on: 2014-03-23 23:16:50
I agree, the code listed should always be in sync.

I am not familiar with TMnetsim but if I was to simulate latency I would do it very simply: extend Socket and override getInputStream() to return a wrapped parent.getInputStream(). This wrapped inputstream calls the inner inputstream methods but waits for the desired delay before returning the result.
23  Games Center / 4K Game Competition - 2014 / Re: Judging results on: 2014-03-23 04:21:22
Unfortunately, I cannot take the reigns from you appel... I do not have the spare time to give it its due service.

If no one takes the responsibility, perhaps it will regress to its origins... submissions just a bunch of posts on the forum.
24  Games Center / 4K Game Competition - 2014 / Re: Judging results on: 2014-03-22 04:33:17
Interesting.

Though both seem not mature enough to conceivably run a java 4k applet. (i.e. AWT/Swing support is not done) If Doppio was mature then it would be a no brainer! but I think it may be achievable to implement a subset of of AWT/Swing that is utilised by Java 4k Applets. e.g Graphics2D, double buffering, mouse/keyboard control and use something like GWT to compile it to javascript aka HTML5.
25  Games Center / 4K Game Competition - 2014 / Re: Judging results on: 2014-03-22 04:02:10
It’s a little bit sad, that only 11 Persons voted this year.
Is this normal or is it a sign that the interest in the event descend?
It is an unfortunate and expected consequence of Oracle's disinterest and seemingly abandonment of Applets/Webstart. And now with the forced signing of applets/webstart there is no way for client side code to run easily for end users.

I am seriously considering seeing what gaps in tool chains exist to automatically convert an applet to javascript. (purely from a Java4k perspective... i.e. not the general case) to allow the competition to continue to exist as it currently is but allow more users to experience the games.
26  Games Center / 4K Game Competition - 2014 / Re: Results due soon on: 2014-03-20 21:08:51
Quite interesting that the community voted for a movement puzzle game to be 2nd place.

First place was well deserved.

And well done for all entrants... shame that my entry is sill in progress Tongue
27  Games Center / 4K Game Competition - 2014 / Re: Results due soon on: 2014-03-16 06:57:16
Mandatory voting? Doesn't that encourage randomly voting without knowing who's who?
surprisingly it doesnt seem to, or if it does it is lost in the sheer volume of votes. We do practice proportional representation so voting for minor parties is not a waste so people can feel that their views can be represented, maybe that makes a difference?
28  Games Center / 4K Game Competition - 2014 / Re: Results due soon on: 2014-03-16 05:29:41
voting done!

much more pleasurable duty than the other voting i had to do this weekend: mandatory voting for a political party to run the state that I live in in Australia.
29  Games Center / Contests / Re: [IDEA] 1 Hour Game Jam on: 2014-03-10 05:14:23
expanding slightly: maybe make it more collaborative and make it so that all the games are put together in a "WarioWare" mini game style.

Perhaps max 60 seconds of game play?
30  Game Development / Newbie & Debugging Questions / Re: Path finder mob not working(reward) on: 2014-03-10 03:04:18
+1 for http://www.policyalmanac.org/games/aStarTutorial.htm

The tutorial is very well written and understandable.

I have used it for my 4X 4k game.

Not sure how much value the implementation will have for you but since people are posting them, why not add another Tongue

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
// unit has moved to the next tile in the path
if (unitMovementNextPathTileX[i] == startX && unitMovementNextPathTileY[i] == startY)
{

   // A*
  // determine the path to the target (in reverse order)

   int targetX = (int) unitMovementTargetX[i];
   int targetY = (int) unitMovementTargetY[i];

   // unit is not on the target...
  if (!(startX == targetX && startY == targetY))
   {

      tileX = new int[PATH_FINDING_MAX_TILES];
      tileY = new int[PATH_FINDING_MAX_TILES];
      fscore = new int[PATH_FINDING_MAX_TILES];
      gscore = new int[PATH_FINDING_MAX_TILES];
      openList = new int[PATH_FINDING_MAX_TILES];
      tileParent = new int[PATH_FINDING_MAX_TILES];
      tileIsClosed = new int[MAP_SIZE][MAP_SIZE];
      currentIndex = -1;

      int openListSize = 1;
      int tileId = 1;

      tileX[0] = targetX;
      tileY[0] = targetY;
      fscore[0] = 1;
      gscore[0] = 1;

      do
      {
         int currentBestIndex = -1;
         int currentBestScore = Integer.MAX_VALUE;
         // Look for the lowest F cost square on the
        // open list
        for (int ii = 0; ii < openListSize; ii++)
         {
            if (fscore[openList[ii]] < currentBestScore)
            {
               currentBestScore = fscore[openList[ii]];
               currentBestIndex = ii;
            }
         }
         
         // no path found/exists to the target
        if (currentBestIndex == -1)
         {
            break;
         }
         currentIndex = openList[currentBestIndex];
         int currentTileX = tileX[currentIndex];
         int currentTileY = tileY[currentIndex];

         if (startX == currentTileX && startY == currentTileY)
         {
            // We have found a path!
           break;
         }

         // if not in closed list
        if (tileIsClosed[currentTileX][currentTileY] == 0)
         {
            // Switch it to the closed list.
           tileIsClosed[currentTileX][currentTileY] = 1;
            // remove from openlist
           openList[currentBestIndex] = openList[--openListSize];

            // ensure that the tile is on the same
           // region
           if (region[currentTileX][currentTileY] == regionId)
            {
               // add neigbours to the open list if
              // necessary
              for (int ii = -1; ii < 2&&tileId<PATH_FINDING_MAX_TILES; ii++)
               {
                  for (int jj = -1; jj < 2&&tileId<PATH_FINDING_MAX_TILES; jj++)
                  {
                     int surroundingCurrentTileX = currentTileX + ii;
                     int surroundingCurrentTileY = currentTileY + jj;
                     if (surroundingCurrentTileX > 0 && surroundingCurrentTileX < MAP_SIZE_MINUS_ONE && surroundingCurrentTileY > 0 && surroundingCurrentTileY < MAP_SIZE_MINUS_ONE)
                     {
                        tileX[tileId] = surroundingCurrentTileX;
                        tileY[tileId] = surroundingCurrentTileY;

                        int moveCost = ((improvements[surroundingCurrentTileX][surroundingCurrentTileY]&MOUNTIAN_FLAG)>0)?4:1;
                        moveCost *=((improvements[surroundingCurrentTileX][surroundingCurrentTileY]&TREE_FLAG)>0)?3:1;
                        moveCost *=((improvements[surroundingCurrentTileX][surroundingCurrentTileY]&CORN_FLAG)>0)?2:1;
                        moveCost = ((improvements[surroundingCurrentTileX][surroundingCurrentTileY]&RIVER_FLAG)>0)?1:moveCost;
                       
                        int surroundingCurrentGscore = gscore[currentIndex] + moveCost;

                        gscore[tileId] = surroundingCurrentGscore;
                        //TODO change Math.abs to x<0?-x:x
                       fscore[tileId] = surroundingCurrentGscore + Math.abs(surroundingCurrentTileX - startX) + Math.abs(surroundingCurrentTileY - startY);
                        tileParent[tileId] = currentIndex;
                        openList[openListSize++] = tileId++;
                     }
                  }
               }
            }

         } else
         {
            // remove from openlist
           openList[currentBestIndex] = openList[--openListSize];
         }

      } while (true);

      unitMovementNextPathTileX[i] = tileX[tileParent[currentIndex]];
      unitMovementNextPathTileY[i] = tileY[tileParent[currentIndex]];
   }


*NOTE*
1. This implementation is highly computationally inefficient (it is geared for smaller class size ).
2. path searching is done in reverse (target -> start) to determine which way a unit should travel next
3. the path finding is run each time a unit reaches the next tile in the path.



Pages: [1] 2 3 ... 32
 

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

The first screenshot will be displayed as a thumbnail.

CopyableCougar4 (23 views)
2014-08-22 19:31:30

atombrot (34 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (28 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (27 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (41 views)
2014-08-06 19:49:38
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

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

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

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

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

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!