Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (725)
Games in Android Showcase (216)
games submitted by our members
Games in WIP (791)
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 ... 50
1  Game Development / Newbie & Debugging Questions / Re: Curious about loopy loops on: 2017-04-26 17:35:44
Have you come across the term "Big O notation"?
That's a conceptual framework that is very helpful for discussing and analyzing exactly these sorts of issues.
2  Discussions / Miscellaneous Topics / Re: Annoying Interview Q on: 2017-04-26 17:28:42
I seem to amplify ambiguity--am always having to expend energy cutting away options. I'd do pretty bad with an interview question like that. But to be honest, a lot has to do with not sharing the same experience or context or points of reference with the other party.

Such a situation might not be the best fit anyway. Employers with not a lot of expertise in what they are hiring for probably really do need someone who's seen it all and can easily suss out their intentions and correct for their mistaken or limited ideas.

In other words, sometimes stupid questions are useful screening tools. I'm thinking, for example, the Nigerian Prince type scams: might as well make the initial proposal/contact full of obvious signals of the fraud involved because that fails faster with people discerning enough to likely reject the scam as they learn more about it.

In the music biz, it's kind of like being just good enough to play really well if people around you aren't making mistakes but being thrown if they get off, versus being good enough not to maintain and play well even when others bungle something in their parts.
3  Discussions / Miscellaneous Topics / Re: Annoying Interview Q on: 2017-04-26 17:07:02
If you get into a situation where you need to pump up your credentials due to a lack of college degree, going the "Certification" route might be a reasonable option for bolstering the work experience. But there are things that a college degree offers that are good to have, too, if you can manage to find some time. (I'm thinking about "breadth" requirements like Civics, History, foreign languages, basic writing skills, mathematics background.)


I want to work where you work. I don't have a college degree but I do have two years of professional experience now and it worries me to no end that no one will consider me after I leave my current company. I've gained a lot of great experience here as we're a relatively small company and we work on some very complex software that millions of people use every month. Because of that I've been forced to learn rapidly and be able to teach new hires. But I feel like all of that will fall to the wayside if someone with a degree applies to the same position I did.

I guess it doesn't help that I would really love to work a remote position, from what I can tell those are even harder to get a hold of...
4  Game Development / Newbie & Debugging Questions / Re: JavaFX: Draw Polygon on Canvas on: 2017-04-25 01:38:06
In the JavaFX tutorial on our tutorials page, they draw and animate a Circle.

Just swap in Rectangle for Circle in the code examples and it should work out okay.

              Circle circle = new Circle();


5  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound tool recommendations and/or javax.sound problems on: 2017-04-07 02:38:50
The good news is that you can improve your performance a couple orders of magnitude over what you have coded.

Clips were designed to be loaded separately from the act of playing them. If you combine loading and playing, the playing won't even commence until after the slower process of loading the sound file into memory completes.

There's other code that looks kind of superfluous as well (surely there is a way to avoid having to do any synchronization), but I'm not able to straighten it all out by eyeballing. My brain is too full of other stuff at the moment.

When you want to play a clip, do only two things:
1) set the cursor back to 0, as in clip.setFramePosition(0);
2) then call

Things like hooking up the volume line and loading the data (you only have to do this once) can be part of the construction/instantiation process of whatever class you are using to wrap the clip.


I am going to tinker with maybe making an open source SoundCue class that combines elements of Clip and SourceDataLine. I'm thinking it should be able to do the following:

play on demand, play from a given position within the cue, loop (n times or continuously), loop with overlap-smoothing at the edges, play concurrently (up to n copies), play at different velocities (faster or slower, using linear interpolation), continuous/smooth volume, velocity, and pan controls, and a customized Listener that can send notifications when the cue starts or stops (and no blocks or synchronization)

If it works, it might serve as a intermediate/stopgap step to making use of nsigma's forthcoming library. If it shows up before 4/15 it means I am procrastinating dangerously on finishing taxes and other deadlines that seem to be besieging me at the moment.
6  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound tool recommendations and/or javax.sound problems on: 2017-04-06 15:28:10
One day I'll get around to exporting the pure Java audio library from Praxis LIVE ...  persecutioncomplex
Wish to encourage this. (Not the sense of persecution/paranoia, but the release of a better Java audio library.)

Maybe it would be good to start a wish list/feature list of a minimal but genuinely useful library?
7  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound tool recommendations and/or javax.sound problems on: 2017-04-06 05:28:20
Problems with closing a large number of Clips?
I'm surprised this is an issue. Could we see more?

Volume clicks:

Yes, a very real problem. I decided to write a clip-equivalent, and output the data from memory to a SourceDataLine. Volume changes are spread out over 1028 samples on a per sample basis. With a Clip, the changes can only occur with each buffer playback, and a large jump creates an audible discontinuity. You can get a bit more granularity by reducing the buffer size and spreading the changes out over time. But making the buffer too small leads to dropouts.

Design around the problem? Have your Clips only play back at fixed volumes, but maybe allow files (SourceDataLine) to be opened up and given the per-sample spread of volume changes. The code for getting at the individual sound frames can be found on the Java Tutorials in the first code example, at the point where there is a comment "//Here do something useful".

I do not know how TinySound handles this. It seems to me he has some provision for fading in and out smoothly, but I am not up on specifics of using this library.

OpenAL probably requires using a wrapper like Libgdx. if you are going to LIBGDX anyway, it makes sense to use it. There are lots of good features and some annoying liabilities and limitations. FMod is expensive if you are going commercial. There might be a free version though. I was told there is another library that is competing but I've lost my notes on this. Sorry.
8  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-03-22 19:02:13
What I'm about to do today: heading to downtown SF where I will meet the project lead of a recently formed game-making team and get set up with a workstation.

(1) will be set up with C++ and Unreal, a chance to learn these without having to layout funds myself for compiler/IDE/etc.,
(2) focus will be audio, my main interest,
(3) excellent position from which to achieve some sort of audio director or music director post as the company grows,
(4) the company is pretty solid in its main line of work (related to supporting VR) and has credible resources to risk branching into creating product as opposed to just supporting it.

(1) have to work with C++, not Java (welcome to the "real world"?),
(2) no pay for several months (pay contingent on our demo being accepted by Sony, at which point there will be back pay--I am mentally adding the word "maybe"),
(3) the audio I have to do initially will be primarily related to analyzing sounds (I have done very little of this), with only a bit of sound design and production added on (more my interest). Sound analysis requires things like getting a better grip on DFT and FFT, and it is going to take some serious cramming to "get" this.
(4) No guarantees the company will succeed.

Once again, am putting off work on Hexara.
 Smiley Huh Sad
9  Java Game APIs & Engines / Java 2D / Re: Particle System without libraries? on: 2017-03-20 01:59:36
I don't know any way (or reason) to use JavaFX and Java2D at the same time in the same stage/window. JavaFX has ways to running Swing controls, I think. I really haven't looked closely into this.

If you want an easy intro to JavaFX, this Java-Gaming tutorial could be helpful.

Otherwise, I recall that others have made particle systems and posted code here before, a few years back.

I tried a search on "particle system Java2D" in the local search box. Several threads came up. Maybe StumpyStrust's tutorial will be a help get you what you want.
10  Game Development / Newbie & Debugging Questions / Re: JavaFX audio not working properly? on: 2017-03-20 01:43:13
I've not used AudioClip yet, myself. I'm puzzled about a couple of things.

For starters, the following from the API seems contradictory.
Playback behavior is fire and forget: once one of the play methods is called the only operable control is stop(). An AudioClip may also be played multiple times simultaneously.

How do you play an AudioClip concurrently if the only operable method after a play is stop()? Maybe the intention was to say each play() is fire and forget?

Secondly, why test for isPlaying() in your code before executing Play()? Do you get an illegal state exception if you call play and it is already playing? There's no illegal state mentioned in the API. Even if the AudioClip does allow concurrent playback, then this test will definitely prevent it. (And if there is silence at the end of the cue, the point where it actually finishes may be beyond the point where the cue goes silent.)

I'd try losing this test before getting into creating a pool of AudioClips. The pool should not be needed if the second line quoted above was written in plain English. (Pools can help if working with, as they don't allow concurrent playback.)

Another approach is to stop and restart with each play. Then, when the plays are coming faster than the cue can end, the cue will stop without finishing and restart immediately. This can work reasonably well in a lot of circumstances.

In other words:
    public void play()
       this.sound.stop();  // no need to test isPlaying();

Else, if concurrent playback works, seems like simply this should work:
    public void play()

The only hitch here is if the distance between the play calls is only a couple millis, the two playbacks could cause artifacts resulting from comb-filtering.
11  Java Game APIs & Engines / Java 2D / Re: Particle System without libraries? on: 2017-03-19 03:47:28
This is a nice one.

Okay, it isn't Java2D. It's better than's JavaFX.
JavaFX is standard with Java now. It has many advantages over Jav2D/Swing, including being much more aligned with the functional programming paradigm and many new Java features like lambdas.

The code for this program is worth checking out.
12  Game Development / Newbie & Debugging Questions / Re: JMonkeyEngine on: 2017-03-15 08:51:59
I haven't used it myself, but @FrozenShade has done a nice job with SkullStone.
13  Game Development / Newbie & Debugging Questions / Re: Java 2D on: 2017-03-13 02:06:30
You know about our resource page, right?

The two books listed at the top both use Java2D, as do several of the tutorials. They are a little dated, though. I'm wishing for more JavaFX tutorials myself, as JavaFX is much better than Java2D, from what experience I've had with both, so far.
14  Discussions / General Discussions / Re: JavaFX/Eclipse: Java(TM) Platform SE binary not responding on: 2017-03-08 19:02:23
I think what is going on is that the start() method wants to complete before it will display. Having your game loop as a while() construction delays that moment indefinitely.

The easiest way to handle a game loop is to use an AnimationTimer(). You can define and start the timer prior to the end of the start() method. You can check out this Java-Gaming tutorial , Section III "Basic Game Loop" for an example.
15  Java Game APIs & Engines / Java Sound & OpenAL / Re: VOSIM on: 2017-03-06 01:56:25
I added a very simple function--when a button is selected, the "gap" (silent) portion of the constructed wave will be filled with a random number of silent frames up to the number specified by the slider. In other words, each iteration of the wave is a different length. This leads to some interesting distortiony noise.

Example--pretty dang gritty, maybe useful as some sort of interior to a fast vehicle making turns (wheels screeching?) The background grit may overshadow the part where the screech happens. It is intense. It could also be too ugly.

I should have taken a screen shot while recording. Here's something pretty close for getting the same sounds.

Either 2 or 3 pulses seems to work. Various squeal pitches give or take around 275-300 microseconds for the pulse widths.
To make the squeal in the recording, I manually took the gap width from around 4000 microseconds to 150-250 or so and back.
Various pulse-amp-dropoff percentages affect the sound but I'm not sure how to describe this--it kind of works (or doesn't work) at any spot.

So, what is needed is a 2d controller, a vector for velocity and a vector for turning angle, so as to control more than one parameter at a time. Use a smaller number of pulses or pulse widths for when the vehicle is at a higher velocity, and a lower setting for the gap width for the higher turning angle.

To get the above code to include randomizing the gap width, line 162 was replaced with the following:
      if (noiseOn) gapFrameCtr = random.nextInt(Math.max(1, curGapFrames));
      else gapFrameCtr = curGapFrames;

Of course, you'd have to initialize "random" and add a public setNoiseOn() method as well.
16  Java Game APIs & Engines / Java Sound & OpenAL / VOSIM on: 2017-03-03 03:06:21
jar: javavosim.jar
example audio file: vosimexample.ogg (Two jars playing at same time, same pitch, different number of pulses, etc.)

I just programmed a basic working VOSIM synthesizer, or at least, the bare minimum. I was interested in giving it a try as it might prove to be a "cheap" ways to get interesting sounds, especially procedural sound effects. Code for the main unit follows. Each read() outputs one frame of stereo audio data as PCM in the range [-1..1]. The GUI is just minimal JavaFX. There remains much to do to make this into something useful: e.g., fixing the "zippering" when changing settings, and implemented various modulation/interpolation pieces as described in the main paper, as well as packaging this in a sensible delivery system of some sort. (The authors later used something called MIDIM which I have yet to investigate.)

What is VOSIM?

From the Journal of the Audio Engineering Society, JUNE 1978, vol. 25, no. 6.:
VOSIM--A New Sound Synthesis System by W. Kaegi and S. Templaars.

VOSIM (VOice SIMulation) sound synthesis is based on the idea that by employing
repeating tone-burst signals of variable pulse duration and variable delay, a sound output of
high linguistic and musical expressive power can be obtained. Conventional means such as
oscillator and filter banks were therefore entirely dispensed with, basically simpler apparatus
being used instead: two tone-burst generators and a mixer. Starting with these rudiments, the
aim is an optimal representation of the input data and a progressive application of logical
calculus to the sound-synthesis process.

The audio output is derived from iterating through a series of N "pulses" decreasing in amplitude, followed by a short duration of silence. Together, the pulses and silence constitute a single wave, and the frequency is determined by their combined duration. The "pulses" are made from a sine2 function. Instead of calculating the sine and squaring the value during the playback, I create a cursor that progresses through a LUT of 1024 values. (Only 0..Math.PI radians are needed as input to the sin2 function creating the pulse, and all the audio values are positive.)

I'm not great on the details of the rationale, but it seems having this shape as a pulse creates a fair number of overtones, and the width of this pulse (and the factor by which the pulses decrease in amplitude) determine what they call a "formant"--a region in the spectrum where any waves in it are boosted relative to other frequency components.

AFAIK (guessing) a true pulse would be too rich, probably leading to aliasing or some other problem, and a sine "pulse" wouldn't have enough harmonics for the "formant" to matter. Will have to experiment to learn more.

The setting I have as the default in the jar is the first one described in the linked article: the vowel /a/ (or at least, a tone with the first format of this vowel).

If you vary the "gap width" (the article refers to this a M), the frequency will change but the formant area will remain at the same frequency region. If you vary the amplitude dropoff factor (the article refers to this as "b"), you can hear the formant area change in frequency. I'm still figuring this out. Changing the pulse count or width (T) also seems to affect the formant frequency location but alters the main pitch at the same time. So for either to be used as a timbre control, a compensating change has to be made with the silent gap width to maintain the wave's period.

Vowels are said to be recognizable when one can hear the first two formants. This indicates that at least two of these VOSIM generators would be needed to work in tandem to duplicate a vowel. The authors claim musical instruments can be synthesized with three generators (three formants) but I regard this as somewhat dubious. I suspect you might be able to get sounds that "sound like" they have qualities of a particular musical instrument, but nothing that anyone would mistake for the real thing.

Very intriguing is the idea of randomly varying the silent-portion width (M) to create noise with a formant. I haven't experimented with this yet. This could be a computationally cheap way to get some nice percussion effects or noise-based sound effects. But I could also see that if you go to this much trouble, you might ask yourself: Why not just use a software filter that is easier to understand and control?

import com.adonax.pfaudio.core.PFMixerTrack;
import com.adonax.pfaudio.core.PFPeekable;
import com.adonax.pfaudio.functions.VolumeMap;
import com.adonax.pfaudio.functions.VolumeMapMaker;
import com.adonax.pfaudio.synthParts.SineSquaredTable;

public class VosimPlayer implements PFMixerTrack, PFPeekable
   private boolean running;

   public boolean isRunning() { return running; }

   public void setRunning(boolean running)
      if (running)
         this.running = true;
         this.running = false;
   private float[] synthBuffer;
   private int nPulses, curNPulses;  
   private int gapFrames, curGapFrames;
   private int gapFrameCtr;
   private float topPulseAmplitude, curTopPulseAmplitude;
   private float amplitudeDropoff, curAmplitudeDropoff;
   private float pulseIncr;
   private float idx;
   private boolean inPulses;
   private float masterVolume;
   private VolumeMap volumeMap;
   private boolean updateRequired;
   private float[] ampValues;
   private int ampValuesIdx;
   public void setNPulses(int nPulses)
      this.nPulses = nPulses;
      updateRequired = true;

   public void setPulseWidth(double pulseWidthMicroseconds)
      // Convert microsecond amount to a pulse width
      // Table is 1024 increments for a single cycle
      // 44100 (fps) comes to 44.1 frames per millisecond.
      pulseIncr = (float)(1024 / (0.0441 * pulseWidthMicroseconds));      
      updateRequired = true;

   public void setMGapWidth(double mGapMicroseconds)
      gapFrames = (int)Math.round(mGapMicroseconds * 0.0441);
      updateRequired = true;
   public void setTopPulseAmplitude(double topPulseAmplitude)
      this.topPulseAmplitude = (float)topPulseAmplitude;
      updateRequired = true;
   public void setAmplitudeDropoff(double amplitudeDropoff)
      this.amplitudeDropoff = (float)amplitudeDropoff;
      updateRequired = true;
   protected volatile float volIncr;
   protected volatile int volTargetSteps;  
   public void setMasterVolume(double targetVolume)
      volIncr = (volumeMap.get(targetVolume) - masterVolume) / 1024;
      volTargetSteps = 1024;
   public VosimPlayer()
      synthBuffer = new float[2];
      volumeMap = new VolumeMap(VolumeMapMaker.makeX3VolumeMap());
   public float[] read()
      if (inPulses)
         idx += pulseIncr;
         // set up for next pulse?
         if (idx >= 1024)
            idx -= 1024;
            if (ampValuesIdx >= curNPulses)
               inPulses = false;
               curGapFrames = gapFrames;
               synthBuffer[0] = 0;
               synthBuffer[1] = 0;
               return synthBuffer;
      else // in silent gap portion
         if (gapFrameCtr-- > 0)
            synthBuffer[0] = 0;
            synthBuffer[1] = 0;
            return synthBuffer;
      if (volTargetSteps > 0)
         masterVolume += volIncr;
      synthBuffer[0] = SineSquaredTable.get(idx) * ampValues[ampValuesIdx];
      synthBuffer[0] *= masterVolume;
      // no panning implemented yet
      synthBuffer[1] = synthBuffer[0];
      return synthBuffer;

   private void resetVariables()
      if (updateRequired)
         updateRequired = false;
         curNPulses = nPulses;
         curGapFrames = gapFrames;
         curTopPulseAmplitude = topPulseAmplitude;
         curAmplitudeDropoff = amplitudeDropoff;

         ampValues = new float[curNPulses];
         for (int i = 0; i < curNPulses; i++)
            ampValues[i] = curTopPulseAmplitude *
                  (float)Math.pow(curAmplitudeDropoff, i);
      gapFrameCtr = curGapFrames;
      ampValuesIdx = 0;      
      inPulses = true;

   public float[] peek()
      return synthBuffer;

I'm curious if anyone has played around with this. I think that it has been implemented on various synth systems that are more involved.

As always, any suggestions on code improvements are welcome.
17  Discussions / Java Gaming Wiki / Re: SF/X Libraries on: 2017-03-01 20:20:24
I thought it worthwhile to start this list when the Yellowstone Park audio library was announced. It is probably worth putting up favorite paid sound effects services, too. Feel free to add more categories as well.
18  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-03-01 01:11:30
Got a good start on the cover for my next concept album of instrumentals.

Nice concept! It reminds me of a cover I was working on for a project that never got completed. I had a person sleeping on a mattress on the floor with a "thought balloon" of a dream of a person sleeping on a mattress on a floor with a "thought balloon" of a person sleeping on a mattress on a floor, etc. In one of the deeper layers, the sleeper has a single eye open. Derived from an actual multi-layer dream occurrence.

One of these days, maybe.
19  Discussions / Miscellaneous Topics / Re: Programming in schools - opinions? on: 2017-02-26 22:21:42
There is an old adage... those who can, do, and those who can't, teach. Anyone with any serious skill or ability in computer science will be doing computer science, and being paid 3x as much. This leaves a rather small pool of actually talented people altruistically prepared to sacrifice their financial status to teach kids programming.

Cas Smiley

Times change. There are a lot of very talented people unable to get work in their fields these days, as well as people who are dedicated to "giving back" or helping the next generation. There are many good reasons to teach, not just monetary ones.
20  Games Center / WIP games, tools & toy projects / Re: Hexara rewrite with Java 8 & JavaFX on: 2017-02-26 22:12:49
Added a glow animation to the capabilities. Jar is here: testglow.jar

The "glow" is a graphic that is made with a tool I wrote called an OvalBandGradient. This is basically a radial gradient, but where you can specify a uniform center region. Thus, the taper can start at a point that is certain distance from the center, rather than exactly at the center.

I'm animating it with an envelope from the audio envelopes I wrote for my synths. The envelope value is being used to update the ImageView.setOpacity() method.

In this jar, I set the envelope to first "flash" and then do a gradual fade-in and fade-out. The only reason for this is to show the envelope can loop and have multiple stages (6 levels/rates in this case).

I'm not totally convinced. Not sure what is bugging me about it. Will have to play with it some more but am also open to comments.

The lighting is kind of "domelike" at the max levels that I use. I'm wondering if instead of a linear gradient in the oval band I should do something like with the smoke particles and have the slope of the gradient be exponential, e.g., a function of the square of the distance from the top edge rather than just a linear calculation. Also wondering about adding some sort of randomization or disruption to the effect, so it isn't quite so uniform.

I just overlay the glow and change the alpha. Maybe more needs to be done, such as adding another color transform limited directly to the pot, to make this more effective. But I don't plan to actually glow the pots in the game. This is intended more for the Hex and glyph icons.

In any event, this accounts for most of the "presentation" layer at this point. I need to start focusing on the model and control layers now.

As usual, there are interruptions and distractions. This time, the possibility has opened up that I might be able to join a team working on a demo/proposal (bringing sound/audio expertise to the party) for a VR contract for a classic SciFi story (has been done as film and computer game but not 3D/VR). As a result, am putting energy into audio research: reading up on 3D audio issues, investigating some older voice-simulation tech (e.g., VOSIM), designing some speculative "useful" sounds with my FM synth and "box-filter-noise" tools. (Also: rereading the novel, have watched the film/tv-series anew checking out the use of sound, and need to check out the already existing games.)
21  Game Development / Newbie & Debugging Questions / Re: rectangle getBounds() method not available on: 2017-02-26 02:26:27
Does your Asteroid class extend java.awt.Shape? java.awt.Polygon? There are a few other classes that also have a getBounds().

If it does, then your code should be able to find the method .getBounds().

Also, it should find the method if it were explicitly defined within the Asteroid class.

22  Discussions / Miscellaneous Topics / Re: Programming in schools - opinions? on: 2017-02-23 02:42:36
My brother is a programmer and immigrated to Germany, He had met a German national in SF and married her--they decided to make Germany their home. They decided to not expose their daughter to computers until into her teenage years. Instead she spent her extracurricular time learning things like origami, juggling, playing flute, horse-back riding, gymnastics. This year, though, I received a pretty slick Calendar she made herself, presumably with the assistance of a computer graphics program. AFAIK, waiting until she was into the equivalent of Junior High before getting into computers and the Internet has worked out just fine. I don't know if this is common in Germany or not, to limit exposure to computers until after social and intellectual skills have had a chance to develop.

I wouldn't be so strict about the no-computers rule if I were a parent. (They also severely limited TV time.) But in her case, it certainly seems no harm was done by waiting.

I don't know that trying to teach "logic" at an early age is necessarily going to take. "Logical thinking" may have requirements that don't develop right away, kind of like trying to teach a kid about "object permanence" before they've recognized that Peek-a-Boo is a playable game.

Efforts were made to make Mathematics more about abstract principles and higher thinking ("new Math") and success was definitely mixed at best. Since computers are everywhere, a certain amount of computer literacy and ability makes perfect sense. There's nothing like running experiments, trying different teaching strategies and seeing what actually works, as opposed to getting stuck on an ideal or notion of what is best and pushing that on everyone.
23  Games Center / WIP games, tools & toy projects / Re: Hexara rewrite with Java 8 & JavaFX on: 2017-02-16 00:03:27
Some progress made this week to post. Continuing to work on "presentation layer." Worked on the glyphs or beads or whatever these piece tokens are. Below is a set testing some colors. I won't use all the combos, and might tweak them some more. But am trying not to get too nit-picky, as they are in the ball park.

The glyphs themselves are pngs, where the data in them is being used as a stencil. They were inspired by some religious and mystical symbols as well as scientific symbols and icons. I have this notion that each corresponds to a part of life--and the puzzle is to get all of them to fit together.

The colors and shapes are procedurally made. I took a Photoshop tutorial on how to make "gems" and tried to implement it in Java, putting in things like edge darkening, a top-down whitening (Y-axis), and an "inner glow" (made from an oval-band-gradient tool I made). Was able to come up with some significant improvements on the code I originally wrote. For one thing, I only load the "glyphs" once now instead of every time a new bead is made. For another, making the oval-band and the edge-darkening cutout for the hex, I realized that it was possible to take advantage of horizontal and vertical symmetry, and only calculate 1/4 of the area values.

Also, added to the "Pavilion", including animated incense/smoke pots. Can be seen in the latest in-progress jar on the first post. But here is a graphic.

Was pleased to get what were previously rectangular supporting beams to be round columns. I don't know why that defied me originally. Then again, I've already forgotten how I did it. Would have to read the code to see how the shading and angles of the contact points (roof, floor) were done.
The smoke is a simple particle system. The particles are 40x40, ranging from 1 to 0 over distance = 20. I originally was using a simple linear interpolation, where the value from 1 to 0 was directly proportional to the distance. These values are used as the alpha track on the smoke color that fills the rectangle. But it looks better (I think) when squaring the values. This makes the taper fade better at the transparent end. Again, figured out I could use quadrilateral symmetry and only calculate 1/4th of the rectangle.  Also, the base array (a double[][]) is only made once. The 72 or so (haven't entirely settled on the count yet) progressive images make use of ImageView, and scale the base array, by giving each a gradually diminishing overall alpha and by compressing the early particles on the x-axis and widening them progressively on the X-axis for the later stage particles. The "smoke-genies" have some real time controls for how much they wobble and how high they go. It is possible to introduce a leftward or rightward "wind". I plan to make the smoke pots get more "active" as the user gets closer to solving the puzzle.

A lot of little touches that really have nothing to do with the puzzle mechanic itself, I know. But my idea is that the puzzle-game is as much about the setting, creating an appealing/peaceful/mysterious place that also supports mental concentration.

I have a bit more to do on the presentation basics: the panels and the hex grid. Then move on to working on the "model" layer, and "controller" layer. There remains implementing some glow sequences, as well.

[EDIT: Not sure if there are limits on the number of posts I can put in a row, and this is a minor update. Managed to finish some work on the "presentation layer" : the hex grid and the panels/scrolls. The blank forms are shown below. In the puzzle game, the icons will populate these structures. I also finished working on a glow-animation. That might be worth an example--will post in a bit.]

24  Game Development / Newbie & Debugging Questions / Re: External class error on: 2017-02-15 05:37:15
OK, I see the init (line 57). Not clear to me when Slick calls Init (I don't know slick very well, haven't used it in a long time), but it seems to me that the root of your question is elsewhere.

Is there a particular reason you want to create MyClass instead of just having card2 be an Image?

If your goal is to create a "wrapper" class for Image, following are two approaches. The problem I am seeing is that your original MyClass combines the two approaches in a way that isn't working.

1) MyClass 'contains' an Image.

In this case, do not Extend Image. Just hold a copy of the Image and provide a means for populating MyClass with the desired Image (either hardcode in constructor, or pass an argument in the constructor or a set() method) and a draw method that calls the draw method of the image.

For example:
public class MyClass
   Image cardImage;

   public MyClass() throws SlickException
      cardImage = new Image("img/card.png");

   // alternative constructor for allowing different images to be specified
   public MyClass(String imgAddr) throws SlickException
      cardImage = new Image(imgAddr);

   public void draw(int x, int y)
      cardImage.draw(x, y);  // I'm guessing this is the Slick syntax for an image draw method.

   // Additional code that provides functionality that is not part of slick.Image


2) MyClass extends Image.

In this case, you will want super(cardImage); in the MyClass constructor. As for drawing, if you don't override the draw method of Image, you can call it directly on MyClass.

public class MyClass extends Image

   public MyClass() throws SlickException

   // alternate constructor, allowing you to specify different cards
   public MyClass(String imgAddr) throws SlickException

   // Additional code that provides functionality that is not part of slick.Image


25  Game Development / Newbie & Debugging Questions / Re: External class error on: 2017-02-13 03:13:06
Did you instantiate card2? I don't see this happening.

The error message refers to an NPE on line 47, which is why I am asking about the card2 variable.
26  Discussions / General Discussions / Re: Steam Greenlight to be replaced with Steam Direct on: 2017-02-12 02:02:17
I read and commented on the article on GamaSutra.

Taking the stated goal at face value (to improve quality of submitted games), it seems to me it would be good to get some data on the distribution of how many games sell in a fixed period (say, three or four months--time enough for comments to affect sales) and what the comment rating average is and how it correlates to sales.

IF there is some sort of correlation, poorly rated games selling poorly, then they could make the deposit that corresponds to that magic number of games just beyond where the majority of poorly rated games peter out. Maybe it is 100 units?

Take that 100 and multiply it by the selling price of the game. Then, a $1 game would require a $100 deposit and a $50 game would require a $5000 deposit. These figures just happen to correspond to the range of deposits they are discussing. And I suspect there is a general correlation of game price with the resources of the team making the game and their ability to cover the deposit.

Some games are made with a minimum of creativity or effort, e.g., quick or easy variations on an existing mechanic requiring some surface graphics or programming changes. If there is a risk/reward ratio that can inhibit people that post things with the idea "nothing to lose" then maybe that would help fulfill the goal of reducing the massive number of games being entered.

I am not in a position to advance more than a couple hundred dollars at this point for an entry. I'm thinking about Hexara as being perhaps my first effort going to Steam. It is going to appeal to a subset (puzzle game players) and as I have no previous entries or track record, I don't expect to sell a whole lot of units. Putting up more than a couple hundred dollars would be a considerable strain and risk. I will probably go to other venues rather than try to sell Hexara at Steam.

Anyway, these were my first reactions. I'm not sure if the intended consequences would play out as hoped.
27  Discussions / Miscellaneous Topics / Re: Saving, loading—oh no! Semi-tutorial? on: 2017-02-09 03:02:28
When I think about implementing saving and loading, I am also including things like figuring out how to set and update a default file folder. Is it so obvious how to do this? I would include this aspect in a tutorial. The short answer is that this can be provided via util.Properties, but I probably overthought it and got a little complicated with coding the default to be updated whenever a new file folder is used. Also, tutorial would include how to set up a MenuBar correctly with a save/load and import/export. Making space for a MenuBar on a game screen (if you use one) can be annoying. Also, little things like tracking high scores or other user properties for different users might also require management and all this is separate from storing the state of a game.

As for storing game state, for the simple stuff I am doing, XML is working. I went through a bit of a quandary before deciding what forms to use for incoming and outgoing. I got scared off of using Serialization, in part because of a nightmare story from a friend working on a contract on a Java project with faulty Serialization that was crashing the program, and not wanting to maintain or upgrade "older version" save files. (At least with XML, you can always inspect the contents easily, even if you can't load the files.) But from what princec says, a lot of the fears about Serialization are overstated, and it actually works fine.
28  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-09 02:45:50
I finished and submitted a web article. It's about the physics of the oboe, a sort of intro level thing, discussing the basics. If it gets posted, it will be on a site called HyperPhysics. I was invited to submit something when I pointed out a few corrections, a couple months ago, to statements on their oboe page. Couldn't resist the opportunity, but writing sure is difficult! It is especially so when your knowledge is more geared to working with the ideas, not knowing who came up with what and when, and how this theory is different from that, and providing citations for all assertions. I hope it turns out to be interesting and useful to at least a few people, and not just a glorified "book report."

Am going to get back to working on Hexara, now, and hopefully this time won't allow myself to get derailed with any other projects.
29  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-03 20:42:52
I was working on saving and loading for my game—it turns out I’m not capable of such a simple thing. Here is absolute proof that years of experience doesn’t help you in your dragon-slayer-kill-them-now-epic-stuff quest to ultimate game development mastery! Pointing

I know what you mean. (I think.) It was a significant chore figuring out how save/load settings for the simple sound apps I've been working on. I'm happy to share what I figured out if you start a new thread on this question.
30  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-03 20:38:34
Thanks everyone!  Smiley  Smiley  Smiley
@philfrei great work not dying so far!
Seriously. Knock on wood.
Pages: [1] 2 3 ... 50
Archive (54 views)
2017-04-27 17:45:51

buddyBro (266 views)
2017-04-05 03:38:00

CopyableCougar4 (689 views)
2017-03-24 15:39:42

theagentd (690 views)
2017-03-24 15:32:08

Rule (734 views)
2017-03-19 12:43:22

Rule (708 views)
2017-03-19 12:42:17

Rule (713 views)
2017-03-19 12:36:21

theagentd (723 views)
2017-03-16 05:07:07

theagentd (656 views)
2017-03-15 22:37:06

theagentd (496 views)
2017-03-15 22:32:18
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 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!