Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (524)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (593)
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 ... 33
1  Game Development / Game Mechanics / Re: Packing data on: 2014-11-09 12:00:44
Moogie, if the data is just a couple of numbers and a short string, compressing the data will make it larger.

of course that is true, however the OP has stated large amount of data... so if there is any simple correlation within the data then simple GZip streams would work as a quick and simple starting point Smiley

Elaborating on Cas's idea... if you know the probabilities of the data then huffman encoding... or better yet arithmetic encoding might yield better compression.

How much data are we talking about? What is the context of both the data and the situation that the data is being sent in? compression only really works when you know the data.
2  Game Development / Game Mechanics / Re: Packing data on: 2014-11-08 08:18:06
Not sure how you would even achieve bit packing.... floats are 32 bits and java chars are 16bits.

Depending on the nature of the data and any latency requirements... it might be as simple as just using GZipOutputStream and GZipInputStream.
3  Game Development / Networking & Multiplayer / Re: Java not allowing anything from any website. on: 2014-11-04 08:53:58
Unfortunetly java client side applets have been completely neutered in later versions of Java 7 and Java 8. The short answer is no you cannot Sad
4  Game Development / Newbie & Debugging Questions / Re: Isometric game get what tiles to draw to the screen on: 2014-11-04 08:00:10
I am not I can help you... it looks like you have changed the algorithm significantly...

However from looking at your code I am not sure how you are correctly rendering your tiles... it looks like you are just rendering tiles in a grid.... there is no concept of alternating rows of tiles that are out of phase such that they completely cover the screen with no gaps.

But ignoring that issue, you need to be scrolling in isometric space not cartesian space.
5  Game Development / Newbie & Debugging Questions / Re: Isometric game get what tiles to draw to the screen on: 2014-11-03 06:24:17
Here is a standalone version of the program using the code above that was used when making the animated GIF.
6  Game Development / Newbie & Debugging Questions / Re: Isometric game get what tiles to draw to the screen on: 2014-11-02 12:04:00
I can provide complete source of my implementation if desired. Be warned, however that it is probably only going to confuse you more due to the fact that a) it has not been cleaned up in any form, b) it is not completely finished so has a lot of commented out code and c) it was for a java4k entry... thus it is using hacks, dodgy inefficient code so it is not the best to learn from.
7  Game Development / Newbie & Debugging Questions / Re: Isometric game get what tiles to draw to the screen on: 2014-11-01 20:37:06
Have you used the debugger at all? i.e. have you determined where the problem is occuring? what values does scrollMapX and scrollMapY produce? is it within the range of your tile map? they both should be 0 if no scrolling has occurred.

How about the isoX and isoY values that are passed into the getTile(x, y).render(isoX, isoY, screen) call... are they within the range of pixels of the screen's width and height?
8  Game Development / Newbie & Debugging Questions / Re: Isometric game get what tiles to draw to the screen on: 2014-11-01 11:44:32
1  
2  
3  
public void renderTile(int xp, int yp, Tile tile) {
      xp -= _xOffset;
      yp -= _yOffset;


exactly as I had mentioned might be the case... you are doubling applying scrolling... remove this as it is not necessary
9  Game Development / Newbie & Debugging Questions / Re: Isometric game get what tiles to draw to the screen on: 2014-11-01 09:15:51
Quote
I am not sure what effect the call to screen.setOffsets(xScroll, yScroll) has...
xScroll and yScroll is the top-left corner of the cartesian map, with the player centered.

Quote
I am suspicious of what getTile(x, y).render(isoX, isoY, screen)
This method gets the Tile at x,y (cartesian) in the map array, and on that Tile it calls the renderTile method on screen, which draws it to the screen in isometric coordinates.

sure, but how do the two methods interact.... i.e. does calling setOfffsets mean that the later render call has these offsets applied to isoX and isoY? if so then you are doubly taking scrolling into account. The isoX and isoY values already have scrolling taken into account and should be used directly when rendering.
10  Game Development / Newbie & Debugging Questions / Re: Isometric game get what tiles to draw to the screen on: 2014-10-31 22:03:44
Well, it does not scroll due to the fact that scrollYScreenUnit is not being updated. What unit is the yScroll in? if it is in pixels then:
1  
2  
scrollYScreenUnit = ((float) yScroll) / Tile.HEIGHT*2;
scrollXScreenUnit = ((float) xScroll) / Tile.WIDTH;


I am not sure what effect the call to screen.setOffsets(xScroll, yScroll) has...

I am suspicious of what getTile(x, y).render(isoX, isoY, screen); does... it should be simply drawing the tile at the isoX, isoY cooridnates. These are in screen co-ordinate space... meaning that 0,0 will be the top left corner of the screen.
11  Discussions / General Discussions / Re: Worried, Scared. Life wasted? [ANSWERED] on: 2014-10-31 20:19:51
The best advise I can give is to be "true" to yourself. You will know what will make you happy and what will make you feel guilty. The trick is to know what you want to be satisfied. Exceeding this point will usually mean you will feel guilty about one or more aspects. Under achieving this point will mean you will feel less happy.

Remember every decision you have made and will make will be the best decision at the time. There is no room in life for regret. Learn and move on.
12  Game Development / Newbie & Debugging Questions / Re: Isometric game get what tiles to draw to the screen on: 2014-10-31 09:59:57
VIEW_PORT_HEIGHT is the "size" of the screen as a multiples of tile height. Similarly with VIEW_PORT_WIDTH is multiples of tile width. Note that my code assumes that the width and heigh of the tiles are the same, however the actual opaque pixels comprising the tile occur from 0.25 to 0.75 of the height of the tile:


 
MAP_SIZE_MINUS_ONE  is just the size of the map array minus one... i.e. int[][] map = new int[100][100] would mean MAP_SIZE_MINUS_ONE is 99

scrollYScreenUnit - yes i believe it is the top left corner... but that can come later... leave as 0 for now.
13  Game Development / Newbie & Debugging Questions / Re: Isometric game get what tiles to draw to the screen on: 2014-10-29 11:59:52
This is the stripped down version of my isometric rendering code I have used for a java4k entry that is on the back burner:

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  
   private static final int VIEW_PORT_HEIGHT = 20; // in cartesian map scale
   private static final int TILE_SIZE_DIV_2 = 16; // in pixels. half of the tile size
   private static final int MAP_SIZE_MINUS_ONE = 99; // maximum size of the map to be rendered minus one. assuming square map.
   private static final int VIEW_PORT_WIDTH = 30; // in cartesian map scale

   {
      float scrollYScreenUnit=0; // should be updated when scrolling the view port. the unit is in cartesian map scale. i.e. 1 unit = 1 tile  
      float scrollXScreenUnit=0; // should be updated when scrolling the view port. the unit is in cartesian map scale.
     
      int alternateScanline = (int) ((scrollYScreenUnit%1) * 2); // determine whether to start on an "alternative" line. i.e. offset x by half the tile width
      int scrollMapX = (int) ((scrollYScreenUnit+0.5F)+0.5F*(scrollXScreenUnit)); // determine the cartesian co ordinate of the top left corner of the current view.
      int scrollMapY = (int) ((scrollYScreenUnit+0.5F)-0.5F*(scrollXScreenUnit)); // determine the cartesian co ordinate of the top left corner of the current view.

      // iterate over the view port
      for (int vy = -1; vy < VIEW_PORT_HEIGHT*2; vy++)
      {
         alternateScanline=(++alternateScanline)%2;
         int xGame=scrollMapX;  // cartesian co-ordniate of current tile to be rendered
         int yGame=scrollMapY;  // cartesian co-ordniate of current tile to be rendered
         for (int vx = -2; vx < VIEW_PORT_WIDTH ; vx += 2)
         {
            int x = (int) ((xGame-yGame-scrollXScreenUnit-1.0F)*TILE_SIZE_DIV_2); // convert to isometric X
            int y = (int) ((0.5F*(xGame+yGame)-scrollYScreenUnit-0.25F)*TILE_SIZE_DIV_2); // convert to isometric Y
           
            // is the tile visible
            if (xGame > 0 && yGame > 0 && xGame < MAP_SIZE_MINUS_ONE && yGame < MAP_SIZE_MINUS_ONE)
            {
               g.drawImage(images[map[xGame][yGame]], x, y, null); // get the tile from the map at the cartesian co-ordniate and render at isometric coordinates.
            }
   
            xGame++;
            yGame--;
         }
         scrollMapY+=alternateScanline; // update the statring point of the next line of tiles based on whether it is an alternative line
         scrollMapX+=1-alternateScanline; // or not. if it is then the line is shifted out of phase by half.
      }
   }


it may or may not help you as it is not the nicest code around. however it does work (well at least for me Tongue ) as proven by the following screen capture:

14  Discussions / General Discussions / Re: painful maths that will hurt your brain... on: 2014-10-12 07:15:45
well i aint no fancy pants skolar with dem book smarts...

so I turn to wolframalpha for these sorts of problems Smiley

so it has given me:

x = 0.285842 or 5.9836 as possible values for x

source: http://www.wolframalpha.com/input/?i=logx%28274625%29+mod+17%3D7
15  Game Development / Newbie & Debugging Questions / Re: I'm desperate on: 2014-10-09 21:04:18
There is a set of tutorials by a forum member that would seem to perfect for your skill level (i.e. know java but not game concepts)

http://www.cokeandcode.com/main/tutorials/
16  Discussions / Miscellaneous Topics / Re: Name that Poker hand - Tiny Code Challenge on: 2014-10-08 21:06:10
That's kind of the point  Tongue

Ah, if that is the case then I think I may not have the "correct" competition psyche... I personally like arriving at a solution in a collaborative manner.

If it offends I can remove the solution.
17  Discussions / Miscellaneous Topics / Re: Name that Poker hand - Tiny Code Challenge on: 2014-10-08 20:57:47
yep Smiley

it frustrated me that I could not look at other submissions to see if there is any other "tricks" I could utilise! I try to share my insights to help others avoid similar frustration.
18  Game Development / Newbie & Debugging Questions / Re: Generate Platforms (Rectangles) Randomly on: 2014-10-08 05:38:56
Clarifying BurntPizza's explanation:



The reachable platforms are those which are to the left of the apogee of the arc or left of the arc past the apogee. i.e. those platforms that are ORANGE. Unreachable plat forms are in PINK.

To illustrate a possible implementation, I have knocked up a simple platformer:

http://pastebin.com/jPqihGKY

Keys:
Left
Right
Up for jump
19  Discussions / Miscellaneous Topics / Re: Name that Poker hand - Tiny Code Challenge on: 2014-10-08 05:37:35
I WILL NOT BE DENIED



Yay i also achived 7.0.

I would be interested in seeing how our implementations differ...

my solution:

1  
class S{public static void main(String[]a){for(int i=0;i<100;)System.out.println((++i%3<1?"Fizz":"")+(i%5>0?i%3>0?i:"":"Buzz"));}}
20  Game Development / Game Mechanics / Re: Detecting islands on a 2d map? on: 2014-09-21 00:36:02
I have a slightly different way of identifying islands.

Basically i perform two passes of the provided map:

1st pass:
 - build up a map of smaller connected regions with each cell given a region id of these smaller connected regions
 - maintain a look up table from the ids of these smaller connected regions to the id of the connected region that was last processed for that connected region.

2nd pass:
 - using the lookup table, set each cell's region id with the last processed connected region's id


See the example code here:



http://pastebin.java-gaming.org/82f8e7f7a0710

Note that this was copied from a Java4k entry i was making so it is not OO or particularily friendly but should give you the idea.
21  Discussions / General Discussions / Re: Performance Test for the Voxel Thing on: 2014-08-29 12:17:37
35 fps

------------------
System Information
------------------
Time of this report: 8/29/2014, 21:45:40
       Machine name: GENKI-DESU
   Operating System: Windows 7 Enterprise 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.140303-2144)
           Language: English (Regional Setting: English)
System Manufacturer: To Be Filled By O.E.M.
       System Model: To Be Filled By O.E.M.
               BIOS: Default System BIOS
          Processor: AMD Athlon(tm) II X4 640 Processor (4 CPUs), ~3.0GHz
             Memory: 4096MB RAM
Available OS Memory: 4096MB RAM
          Page File: 5451MB used, 2737MB available
        Windows Dir: C:\Windows
    DirectX Version: DirectX 11
DX Setup Parameters: Not found
   User DPI Setting: Using System DPI
 System DPI Setting: 96 DPI (100 percent)
    DWM DPI Scaling: Disabled
     DxDiag Version: 6.01.7601.17514 32bit Unicode

---------------
Display Devices
---------------
          Card name: AMD Radeon HD 5800 Series
       Manufacturer: Advanced Micro Devices, Inc.
          Chip type: AMD Radeon Graphics Processor (0x6899)
           DAC type: Internal DAC(400MHz)
         Device Key: Enum\PCI\VEN_1002&DEV_6899&SUBSYS_29721682&REV_00
     Display Memory: 2809 MB
   Dedicated Memory: 1017 MB
      Shared Memory: 1791 MB
       Current Mode: 1920 x 1080 (32 bit) (60Hz)
       Monitor Name: Generic PnP Monitor
      Monitor Model: G225HQ
         Monitor Id: ACR0108
        Native Mode: 1920 x 1080(p) (60.000Hz)
        Output Type: DVI

Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
22  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

23  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
 
24  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?
25  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?
26  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.
27  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
28  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?
29  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!
30  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.
Pages: [1] 2 3 ... 33
 

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

The first screenshot will be displayed as a thumbnail.

toopeicgaming1999 (38 views)
2014-11-26 15:22:04

toopeicgaming1999 (33 views)
2014-11-26 15:20:36

toopeicgaming1999 (8 views)
2014-11-26 15:20:08

SHC (24 views)
2014-11-25 12:00:59

SHC (24 views)
2014-11-25 11:53:45

Norakomi (25 views)
2014-11-25 11:26:43

Gibbo3771 (23 views)
2014-11-24 19:59:16

trollwarrior1 (36 views)
2014-11-22 12:13:56

xFryIx (75 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!