Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (582)
games submitted by our members
Games in WIP (503)
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: any good RTS 2d war strategy games? on: 2014-04-19 10:39:28
how about total annihilation?
2  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-11 10:48:15
i am not even sure that there is a end date... so more the merrier
3  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-11 01: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
4  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-11 00: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
5  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-10 15: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
6  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-09 22:54:25
Very nice! I dont suppose that you want do give a little explanation of how the wolf behaves?
7  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-09 00: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;
      }
   }


8  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-08 15: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
9  Game Development / Newbie & Debugging Questions / Re: Problems with Player Centering in Isometric Style Game on: 2014-03-30 23: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.

10  Game Development / Game Mechanics / Re: Connecting, stitching, and rendering your overworld areas together in a 2D RPG. on: 2014-03-28 06:08:27
yes, however the critical point is that if the connection points do not line up then manual intervention is required.
11  Game Development / Game Mechanics / Re: Connecting, stitching, and rendering your overworld areas together in a 2D RPG. on: 2014-03-28 04: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.
12  Games Center / WIP games, tools & toy projects / Re: Airships Engine on: 2014-03-24 10: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.
13  Game Development / Networking & Multiplayer / Re: Good latency proxy? (TMnetsim causing stream corruption!) on: 2014-03-24 00: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.
14  Games Center / 4K Game Competition - 2014 / Re: Judging results on: 2014-03-23 05: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.
15  Games Center / 4K Game Competition - 2014 / Re: Judging results on: 2014-03-22 05: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.
16  Games Center / 4K Game Competition - 2014 / Re: Judging results on: 2014-03-22 05: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.
17  Games Center / 4K Game Competition - 2014 / Re: Results due soon on: 2014-03-20 22: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
18  Games Center / 4K Game Competition - 2014 / Re: Results due soon on: 2014-03-16 07: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?
19  Games Center / 4K Game Competition - 2014 / Re: Results due soon on: 2014-03-16 06: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.
20  Games Center / Contests / Re: [IDEA] 1 Hour Game Jam on: 2014-03-10 06: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?
21  Game Development / Newbie & Debugging Questions / Re: Path finder mob not working(reward) on: 2014-03-10 04: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.



22  Game Development / Newbie & Debugging Questions / Re: Academic Java Knowledge, Problems with Movement in Games on: 2014-03-10 02:44:19
The easiest way to get an arc is to accelerate the player downwards by a constant factor when the player is not standing on a blocking tile (e.g. ground)

To perform a jump, you would then add an initial impulse upwards and allow the downwards acceleration to erode the effect of this impulse. Eventually the impulse is countered entirely... this would be the top of the arc. Then the downwards acceleration will dominate and start to move the player back down.

i.e.

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  
double myX,myY;
double accX,accY;

double ACCELERATION_INCREMENT=0.1;
double GRAVITY_ACCELERATION=0.1;
double MAX_ACCELERATION_X=5;
double JUMP_ACCELERATION=10;


while (gameIsAlive)
{
      myX+=accX;
      myY+=accY;

         if (!player.isOnGround)
         {
             accY-=GRAVITY_ACCELERATION;
         }

      // draw player
     
      // sleep
}

public void movement(KeyEvent e) {
     
      switch(e.getKeyCode()) {
     
      case KeyEvent.VK_RIGHT:
         accX+=ACCELERATION_INCREMENT;
         if(accX >= MAX_ACCELERATION_X) {
         accX=MAX_ACCELERATION_X;
           
         }
         
      case KeyEvent.VK_LEFT:
           accX-=ACCELERATION_INCREMENT;
         if(accX <= -MAX_ACCELERATION_X) {
         accX=-MAX_ACCELERATION_X;
           
         }
     
      case KeyEvent.VK_SPACE:
         if (player.isOnGround)
         {
             accY+=JUMP_ACCELERATION;
         }
         
         
      }
     
   }
23  Games Center / 4K Game Competition - 2014 / Re: Community voting on: 2014-03-04 06:00:35
I think that is a good idea... better than advising reducing java security privileges or similar.
24  Games Center / 4K Game Competition - 2014 / Re: AgeOfCivilizations on: 2014-03-04 00:54:42
@Jacob Pickens: i am not sure what you mean by packets...
25  Games Center / 4K Game Competition - 2014 / Re: AgeOfCivilizations on: 2014-03-04 00:46:29
@zeroone hehe maybe... if the bytes allow it Tongue
@Jacob Pickens I user GifCam. Very simple to use. I then used File Optimizer to shrink the gif down by about 25%)
26  Games Center / 4K Game Competition - 2014 / Re: AgeOfCivilizations on: 2014-03-03 09:54:43
-Added initial different terrain
-Now can use mini map for instant view port navigation
-reduced size of world to 100x100 (to make the game finish sooner)

27  Discussions / General Discussions / Re: 4.8 MT System bus.. Big deal? versus 5.2 on: 2014-02-26 04:47:58
that is quite a specific hardware question to ask in these forums... i am not sure that you will get any useful responses. However in my experience the difference in performance between motherboards are negligible. i.e. around 5%. That is unless you are wanting to over clock which is another matter entirely.
28  Games Center / 4K Game Competition - 2014 / Re: AgeOfCivilizations on: 2014-02-26 01:32:06
Whilst i have made (and still making) good progress on my entry, I doubt that I will make the dead line.

But I am committed to finishing my entry so I will make it available after the end of competition.

@appel: is there a way to submit out-of-competition entries to java4k site?
29  Games Center / 4K Game Competition - 2014 / Re: Raid On Java 4K on: 2014-02-17 04:29:18
no problems, it really does come down to trial and error as to what heuristics will yield extra byte savings.

I have an really old tool which is entirely automatic which i can resurrect if you like.
30  Games Center / 4K Game Competition - 2014 / Re: Nearing end... need couple of volunteers on: 2014-02-14 03:18:58
I hope 15, i just need to get my butt in gear... Real life always gets in the way!
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.

xsi3rr4x (72 views)
2014-04-15 18:08:23

BurntPizza (68 views)
2014-04-15 03:46:01

UprightPath (79 views)
2014-04-14 17:39:50

UprightPath (65 views)
2014-04-14 17:35:47

Porlus (80 views)
2014-04-14 15:48:38

tom_mai78101 (104 views)
2014-04-10 04:04:31

BurntPizza (164 views)
2014-04-08 23:06:04

tom_mai78101 (260 views)
2014-04-05 13:34:39

trollwarrior1 (210 views)
2014-04-04 12:06:45

CJLetsGame (220 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!