Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (565)
Games in Android Showcase (151)
games submitted by our members
Games in WIP (605)
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 ... 10
1  Game Development / Game Mechanics / Re: Making my GUI right on: 2015-03-29 02:05:34
Essentially what you're talking about is a scene graph. Your "another solution" that uses callbacks is the way I approach GUI interaction in my applications. It has its disadvantages, but it's a fairly sane approach. You're still in good shape in regards to the MVC pattern if you consider your visual element as your view and your callback as your controller. At worst you've created a loose coupling.

When it comes to games, if it works for you and you can grep what's going on, it's good enough. It's a far different beast than writing libraries for others or "mission critical" systems. Wink
2  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-19 16:53:34
Working on creating a custom control for one of the guys in our transportation division. (Warning: 2.3mb gif file.)

Click to Play

When it's finished, it will be used to provide a visual representation of curent shipment locations using tracking information provided by the shipping companies. Unfortunately, I'm still waiting for them to get back to me with some details.

For now it's pretty much eye candy. Its looks can be customized and it supports auto rotation/rotation via mouse drag. Built using "old school" visual trickery in Java2D mostly to prove to a manager that it could be done. Not a 100% perfect effect, but good enough for its intended purpose.

Since it's a slow day at the office I think I'll tie it to a METAR parser I've been developing and turn it into a weather widget while I have some idle time. I love my job most days. Pointing
3  Discussions / General Discussions / Re: What's your day job? on: 2015-02-16 21:10:32
I've worked as a contractor for a Japanese auto manufacturer for the last decade or so. My days are usually split between running the POD system for replacement parts, generating reports for upper management, supporting a myriad of in house solutions written in Access/Excel, and doing evangelism/development in Java of some more advanced tools that work with legacy systems like CICS and our DB2 based data warehouse. The formal stuff can be a bit boring at times, but there's enough freedom to get involved with projects from other departments, like an in house logistics/yard management package that I get brought in to consult on from time to time, that it's not a grind. Cool
4  Game Development / Newbie & Debugging Questions / Re: Minimap using tilemap! on: 2015-02-16 20:45:54
You do the same thing you'd do when drawing your full map. Determine where the character is, and render x amount of "tiles" around him on the mini-map. The only difference between a mini-map and your regular map is that your regular map renders tiles at full size, but your mini-map renders the tiles at a scaled down size or representation. Beyond that, the logic and underlying data sources are the same. Wink
5  Discussions / General Discussions / Re: Anyone with knowledge on Cygwin? (+Shogun) on: 2015-02-02 05:01:26
Sorry about the delay in this step. Had a pretty rough weekend, and I just now got the chance to post.

I've found that JBlas has a .jar distribution, so we can sidestep building it. You can download the jar file from here. Just grab the latest version (1.2.3).

So here are the steps to include it in the build:
1. Copy the downloaded JBlas jar file to your <cygwin>/shogun-4.0.0 directory.
2. Open the CMakeLists.txt file in your favorite text editor.
3. Locate the line that looks like the following:
FIND_JAR(JBLAS NAMES jblas jblas-1.2.0
and update it to reflect the downloaded version of the jar (for example):
FIND_JAR(JBLAS NAMES jblas jblas-1.2.3
4. Directly below that line will be a line that contains paths that will be searched for the jar file. Edit it to look like the following:
/usr/lib/java /opt/local/share/java ./
Basically were telling it to search the current build directory.
5. Save and exit the file. You are now ready to run the build procedure again.

Fair warning, I received a compile error somewhere in the 70% completion range. Since it was more code related than configuration related, I can't say for certain where the fault lies. Google may be your best bet if you get the same issue. Either way, give it a shot, and let us know how it goes. Smiley
6  Discussions / General Discussions / Re: Anyone with knowledge on Cygwin? (+Shogun) on: 2015-01-31 02:23:56
Well, the good news is that I figured out how to hack, and when I say hack I mean Amazon deforestation levels of hack, around the JNI issue. The bad news is that there's another required library that will need to be built. persecutioncomplex

Note: You may want to delete and re-extract the shogun source directory before doing the following.

Anyway, this is the hack to get around the JNI issue:
1. In windows explorer, go to the directory you installed cygwin to and create a new folder named opt.
2. Copy your C:\Program Files\Java\jdk1.8.0_25 folder into the newly created opt folder, and rename it to jdk. Your directory structure will then be <cygwindir>/opt/jdk.
3. Open the FindJava.cmake file located in the <shogun source dir>/cmake directory in you favorite text editor.
4. Locate the section that has the header comment # environment can always override hard guesses. You'll see a list of paths below it surrounded by a set(...) statement. Add the path, /opt/jdk/bin to the bottom of the list before the closing parentheses, then save and close the file.
5. Get ready for the real fun to begin. Open the FindJNI.cmake file located in the <cygwindir>/usr/share/cmake- directory in you favorite text editor. (The fact that we're editing system files in this manner should be a red flag that there may be a more sane way to approach this, but it's Friday night, so yeah...)
6. Locate the line that says if(APPLE) and insert the following lines directly above it:
set(JAVA_INCLUDE_PATH "/opt/jdk/include")
7. Close and save the file then pray that the elder gods' slumber was deep enough for them not to notice this transgression. persecutioncomplex
8. Go to your source directory in cygwin and issue the cmake -DJavaModular=ON command again.

If all went well, you'll be informed that JBlas is a required dependency. (The rabbit hole gets deeper.) Give the above a try and let me know where you end up. If you get to the same point that I did, try building JBlas. If that one gives you trouble, we'll break out the bloody axes again and hack it till it works.

In all seriousness, you may have an easier time doing this on an actual Linux distro running in a virtual machine or off of a live cd/usb. There would be a lot less hacking of core files. Either way, I hope the above helps you around the current situation. Smiley
7  Discussions / General Discussions / Re: Anyone with knowledge on Cygwin? (+Shogun) on: 2015-01-30 18:45:57
Ok, looks like it's still having trouble locating the includes. I have cygwin installing here to try out a few things, but it's taking a while. Let me make another "shot in the dark" suggestion. Modify the CMAKE_CXX_FLAGS line in your CmakeLists.txt file to the following:
SET(CMAKE_CXX_FLAGS "-U__STRICT_ANSI__ -IC:/Program\ Files/Java/jdk1.8.0_25/include ${CMAKE_CXX_FLAGS}")

This should tell the compiler and linker to look in the JDK include directory for the jni and awt header files.

Once cygwin finishes configuring here, I'll have a crack at compiling Shogun if the above change still doesn't resolve the issue for you. Smiley
8  Discussions / General Discussions / Re: Anyone with knowledge on Cygwin? (+Shogun) on: 2015-01-30 18:03:06
Idk What he meant.

He's just giving you an another way to set the JDK path from the cmake command line.

Anyway i tried what you said and got this...

That's my fault. On a *nix like environment, you'll need to escape any spaces with a backslash. To combine what I told you along with what the guy in #shogun said, try this:
cmake -D_JAVA_HINTS=C:/Program\ Files/Java/jdk1.8.0_25 -DJavaModular=ON
or alternately:
JAVA_HOME=C:/Program\ Files/Java/jdk1.8.0_25 cmake -DJavaModular=ON
9  Discussions / General Discussions / Re: Anyone with knowledge on Cygwin? (+Shogun) on: 2015-01-30 17:35:31
It appears that it's failing to find the jawt.lib and jvm.lib files. Looking at some postings about the issue, maybe the following will help it find what it needs:

JAVA_HOME=C:/Program Files/Java/jdk1.8.0_25 cmake -DJavaModular=ON

My hunch is that it's searching for the libraries in the jre folder instead of the jdk folder. Setting the environment variable before starting the build process should cause it to look in the correct location. Tracing down compilation errors can feel like going down a rabbit hole at times. Shocked
10  Discussions / General Discussions / Re: Anyone with knowledge on Cygwin? (+Shogun) on: 2015-01-30 16:29:55
Looking at line 1052 in the file that you posted last, it would appear that cmake is referencing the FindJava.cmake file in the shogun-x.x.x/cmake folder. Editing the "set(_JAVA_PATHS ... )" section of the file should allow you to add the path where you have your copy of Java installed into its search locations. Once that's done, give the compilation process another shot.
11  Discussions / General Discussions / Re: Anyone with knowledge on Cygwin? (+Shogun) on: 2015-01-30 15:06:16
Six of one, half a dozen of the other. Wink Live CDs/USBs just tend to be less intrusive and a lot more portable since there is nothing to install on the hard drive. I've had good experiences with both. Smiley
12  Discussions / General Discussions / Re: Anyone with knowledge on Cygwin? (+Shogun) on: 2015-01-30 14:37:51
Hm, looks like I may have grabbed a different version of the lib. The CMakeLists.txt posted on the paste bin is different from the copy that I had here. Either way, ziozio is correct. Cmake is appending values to the flags variable, so adding the line before the # CCACHE section would probably be an optimal placement.

Since I'm assuming you're doing some *nix based programming, I'll pose this thought. Have you considered creating a live CD/USB with a base version of Linux and the development tool chain? It's not guaranteed to keep issues like this from happening, but it does provide a slightly more reliable environment.
13  Discussions / General Discussions / Re: Anyone with knowledge on Cygwin? (+Shogun) on: 2015-01-29 15:44:09
I believe the easiest approach in this situation would be to edit the CMakeLists.txt file in the top level Shogun source directory. Do a search for a line at the top that looks like:

You can add the flag there which would make the line look like:

This should apply the flag to the compiler as well as the linker for the build process. Unfortunately I don't have a full cygwin environment installed here at work, so I'm not able to test it at the moment.
14  Game Development / Newbie & Debugging Questions / Re: Best way to deal with infinite elements? on: 2015-01-20 04:54:10
I could be mistaken, but it sounds like a circular buffer could be useful in this circumstance. The Apache Commons Collection has a CircularFifoBuffer class, or you could roll your own.
15  Game Development / Shared Code / Re: An easy way to count up at a constant (frame-independant) rate. on: 2015-01-16 15:34:24
Fair enough; however, I think the initial point was to make it a tad more robust for others who may wish to utilize your code. Their use cases may not be the same. It's just a suggestion though. Sharing with the community is always an appreciated gesture and people can modify as their needs dictate. Smiley
16  Game Development / Shared Code / Re: An easy way to count up at a constant (frame-independant) rate. on: 2015-01-16 14:27:40
I think Riven meant a little stricter than a System.out.println(...) statement. Something along the lines of throwing an actual exception so the code can gracefully fail instead of continuing to run in an erred state. Wink
17  Discussions / Business and Project Management Discussions / Re: [Charity][Due to Sunday] Noble Santa on: 2014-12-07 04:02:58
No worries. Go ahead and email me. I just sent you a PM with the address. Cool
18  Discussions / Business and Project Management Discussions / Re: [Charity][Due to Sunday] Noble Santa on: 2014-12-07 01:03:31
Sounds like a plan. Always happy to help, especially when it's for a good cause. Smiley
19  Discussions / Business and Project Management Discussions / Re: [Charity][Due to Sunday] Noble Santa on: 2014-12-07 00:55:52
Sure, 3 hours from now for me is about 11:00pm. I tend to be a night owl, so just post here when you're ready, and we'll get you set. You need me to create an installer package as well, or are you good to go on that? Either way, let me know and we'll go from there. Smiley
20  Discussions / Business and Project Management Discussions / Re: [Charity][Due to Sunday] Noble Santa on: 2014-12-07 00:50:54
Worked a treat on my end. It will take a few to upload to my host. The size comes out to ~56mb once you include the bundled JRE. I'll post the DL link once it's uploaded. Cool
21  Discussions / Business and Project Management Discussions / Re: [Charity][Due to Sunday] Noble Santa on: 2014-12-07 00:28:43
Launch4J spits out that error, or the .exe does when you double click on it? If you want, I can shoot you my email address and have you send me the files and I can try to create the .exe on my end. I can do a quick turnaround since your deadline is looming.
22  Discussions / Miscellaneous Topics / Re: The C family, should I dig deeper? on: 2014-12-05 19:41:31

23  Discussions / Business and Project Management Discussions / Re: [Charity][Due to Sunday] Noble Santa on: 2014-12-05 17:51:43
As far as I know, there should be no issues with using LibGDX and Launch4J together. You'll just have to make sure to copy the needed files (natives and libs) to the output directory where your .exe file is created.

I just did a quick test with a Slick2D based application and it went without a hitch. Once you have everything working from the output directory, it's just a matter of using Inno Setup to package the contents of the directory into an installer. If you run into problems, feel free to post the issue in the thread, or send me a PM and we'll try to get you over the hump. Smiley
24  Discussions / Business and Project Management Discussions / Re: [Charity][Due to Sunday] Noble Santa on: 2014-12-05 16:42:53
Also, i need help with some other things:
-(Startable from disk) installer which installs the game and checks if you have java installed (but wait, i can bundle java with the .jar file, right?)
-Making a .exe starter file for starting the game.

While I can't help with the music, I suggest you download Launch4J to create your executable/jvm bundle. There's a set of instructions here that should get you started.

Instead of performing the "bonus step" from those instructions, grab a copy of Inno Setup, and use that to create a self contained Windows installer. It looks a little intimidating at first, but unless you have to use advanced features such as creating registry keys and such (you probably won't have to), it's a fairly straightforward process. The site has plenty of information to assist with most common tasks that you're most likely to perform.

Both tools are free, and I can say from experience that both work well for the type of deployment you want. Cool
25  Game Development / Newbie & Debugging Questions / Re: Bitshift Operators in RGB values? on: 2014-11-10 17:28:27
@CodeHead Math.random() returns a value less than 1, so it does need to be multiplied by 256 to produce values in the range 0...255.99999, which then give equal probability of 0...255 when cast (truncated) to int.

Quite correct. I blame it on not having my morning caffeine fix when I typed that. I was forgetting a type cast to an int functioned more like a floor than a round. My apologies. Smiley
26  Game Development / Newbie & Debugging Questions / Re: Bitshift Operators in RGB values? on: 2014-11-10 15:28:56
Just to add to what SHC posted, the bitwise OR operator will look at two numbers and combine them based on the rule that for the same bit position in any two numbers, if one or both of the numbers contain a one at the position, the output number will contain a 1 at that position, otherwise it will contain a 0.

It probably wouldn't hurt to look into bitwise operations to get a better grasp of the overall general concepts. You may not find yourself using the information on a daily basis, but there are some neat tricks that can be performed at the bitwise level in certain situations.

One other note, the code you posted has a small bug in it. The maximum value for an 8 bit number is 255, not 256, so the code should be changed to:
int a = (int)(Math.random()*255); //alpha
int r = (int)(Math.random()*255); //red
int g = (int)(Math.random()*255); //green
int b = (int)(Math.random()*255); //blue
27  Game Development / Newbie & Debugging Questions / Re: Confused with BufferedImage on: 2014-11-07 14:01:51
At the moment Im guessing it creates a blank image onto the canvas but obviously theres more to it? Why do they setup a pixel array when you could add sprites with Image?

The second block of code does indeed create a BufferedImage, but actually painting it to the canvas is handled elsewhere. Taking a stab in the dark here, I'd say they're setting up a back buffer to draw to which will later be drawn to the canvas via the canvas' Graphics object.

As for the pixel array, it's useful for per pixel manipulation. Some things can be handled perfectly well by blitting sprites to the back buffer, but some effects require access to the individual pixels of the buffer. Both are valid approaches depending on your needs, although you risk de-accelerating your graphics objects when working on a per pixel level.

You may want to do some reading about the BufferStrategy class which dovetails nicely into these types of topics and overall may be a more straightforward approach to what you're working on.
28  Game Development / Newbie & Debugging Questions / Re: Mouse input, finding tile below mouse. on: 2014-10-21 13:17:15
Just a hunch, but shouldn't:
tileX = mouse.getX() + xScroll/ 32;
tileY = mouse.getY() + yScroll / 32;

be changed to:
tileX = (mouse.getX() + xScroll)/32;
tileY = (mouse.getY() + yScroll)/32;

The way it's written, it divides the x/yScroll variable by 32 before adding it to the mouse X/Y position (order of operations still apply in Java). Be careful when relying on implicit behavior. It's better to be as explicit as possible both for the benefit of the compiler and the maintainer. Smiley
29  Discussions / General Discussions / Re: RSA direct bypass on: 2014-10-16 19:12:00
...if some complex math was used knowing the logic behind how it works the value could be resolved.

Good encryption techniques live and die by the rule that even if a method of encryption is known, the encrypted data should still remain secure. If this were not the case then public review of encryption techniques would always invalidate their effectiveness. If you can resolve the value based on what you've said either a)the encryption method is seriously flawed, or b)your testing methods are flawed.
30  Game Development / Networking & Multiplayer / Re: Server UI - graphical vs command line on: 2014-10-16 13:45:49
I like the *nix style approach. Command line interface that you can build a GUI on top of if desired. Depending on the approach, it should work equally well with a local or remote/web GUI.
Pages: [1] 2 3 ... 10
theagentd (11 views)
2015-03-27 23:08:20

wxwsk8er (52 views)
2015-03-20 15:39:46

Fairy Tailz (46 views)
2015-03-15 21:52:20

Olo (28 views)
2015-03-13 17:51:59

Olo (30 views)
2015-03-13 17:50:51

Olo (37 views)
2015-03-13 17:50:16

Olo (43 views)
2015-03-13 17:47:07

ClaasJG (40 views)
2015-03-10 11:36:42

ClaasJG (41 views)
2015-03-10 11:33:01

Pippogeek (47 views)
2015-03-05 14:36:23
How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

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