Hexara -- work in progress

I was doing pretty much as you suggested up to Level 4

  1. Count the number of squares
  2. Count the number of unique shapes and determine whether one or more must be repeated.
  3. Look for repeated shapes on the scrolls and note which shapes are repeated
    (You can’t use the same shape twice in a sequence, as the score doesn’t illuminate)
  4. Look for repeated shapes on the board and note them as well
  5. Count the number of times each shape appears on a scroll
  6. Count the number of neighbours and then determine how many unique neighbours
  7. Sort the resulting list by number of unique neighbours
  8. Any shape having more unique neighbours than the most connected cell on the board must have at least two occurrences
  9. Shapes with a lot of neighbours are constrained to cells with at least that number of linkages
  10. Starting at each shape already placed on the grid, place its unique neighbours on adjacent cells.
  11. Look at the grid and rearrange those shapes so as to facilitate linking them up with other islands of shapes so as to complete a scroll
  12. Do what-if’s particularly when you don’t know which shapes appear multiple times. While duplicate shapes with lots of occurences and linkages are more likely, don’t discount the less obvious sneaky choices.
  13. Don’t use 9) twice when writing lists.

Another clue to possible duplicate shapes, is where two shapes are adjacent on a scroll, but other scrolls have them adjacent to shapes prefixed on the board. At least one shape must be a duplicate.

Excellent! Another friend was asking for a scratch pad for building sub-structures. That got me thinking of maybe a popup where one could place the entire substructure into the puzzle. I want to spend some time considering how to do this. Or maybe find some screen real estate where a substructure could be staged. I think there are a couple higher priorities first, though, like the hex switching/rotating and of course, solving the sound/download time situation.

Another general issue to consider: how many of the clues or strategies should be presented. Some might prefer a discovery process. Thinking, too, how wide is the gap between beginning and advanced sudoku players? How wide will the gap be with easy and hard Hexara puzzles? I suppose someone who considers themselves a “Friday” player won’t normally do a “Monday” puzzle and vice versa, and this sorts itself out. (I’m thinking, to eventually make and present a puzzle a day, like with the NYTimes crosswords–Monday is easiest, Friday hardest.) But I get ahead of myself. First make a working, presentable program.

Nice game. I like the overall look and feel of the game. Loaded fine and worked as advertised.

Firefox 4 beta 12
Windows Vista

Hi,

I tried out the game and liked it a lot :slight_smile: Nice concept and nice designing too…

I am not sure if work is still in progress for this game, but would like to point out a problem nevertheless :

  • After I complete one level, everything glows and disappears. After everything disappears completely and then I click ‘Load’ from ‘File’, it works fine. But when I click ‘Load’ while the disappearing act is still in progress, the new level is not loaded properly !! (the main structure in the middle does not appear).

Thanks for the compliment and thanks for the suggestion! Yes, it’s “in progress” but maybe “in stasis” makes more sense. Am working on a lot of background learning & projects that should ultimately be very useful for this and a couple other ideas for games I have designed.

I agree the way the puzzles come up is lame, and plan to entirely redo that on the next iteration. I wasn’t aware of the bug you caught though. Thanks for pointing it out, though I will probably chuck the entire design for something else. Definitely open to suggestions. I’m thinking of having a screen with icons representing the puzzles and their status (solved or not). I’d also like to set up something where I can add a new puzzle a day, Monday puzzles being easiest, Saturday being the hardest, and Sundays have actual words on the scrolls instead of icon strings.

The scrolls could use some texture and animation for when they get “activated” via completion on the center grid. (Part of what I want to learn, like how to make them swing a bit like a real hanging cloth thing, with tassels.) Other ideas welcome.

Great ideas !! :slight_smile: I observed one more thing… You have provided a ‘Design’ option in the ‘File’ menu. Are you planning to let users design puzzles themselves? Or is it for you only?

BTW : I reached the last level… maan I havnt yet figured out teh solution for that… ???

even if that post is old, I use Oggenc http://www.rarewares.org/ogg.php
which just converts raw pcm wav to ogg at a quality you desire. I only use ogg for sound after switching from FMOD to slick audio

btw FMOD is free and as long and your game is free aswell / not commercial in any kind, you can use it. FMOD being an industry standard obviously can play many formats and very nicely, like mp3 and so on.
NativeFMODEx is what you would want then

otherwise Slick uses JOrbis/Jogg, which you can of course also use by yourself

Yes, I plan to make the designer available. One of the slick things in it is a tree-search algorithm that I use to show all solutions to a given puzzle. I use it to make sure the puzzles I make only have one solution.

It would be nice to have a way for people to share the puzzles that they make. I’m also thinking about ways to allow folks to use their own icons.

Grand plans…

Yes, the last puzzle is very difficult. I was envisioning making top-level puzzles about “Friday” Sudoku level difficulty, as in taking an hour or so to solve, and requiring a lot of precision in the process, having developed something of a skill set with the patterns, tricks and dependencies. (Curiously, the symbols of the last puzzle also work as a cypher–you can substitute letters and get 6 words on the six scrolls that are thematically related. But I didn’t want to get into that as a standard feature as those puzzles are significantly harder to design.)

@cero: I hadn’t heard of rarewares. I’ll take a look. I’ve been using Audacity to convert .wav to .ogg. My goal is to stay within core Java, and the various ogg players I’ve found give me grief with things like memory leaks and lots of cpu consumption. To push the sound like I want to, I need as close to raw PCM as I can get away with. Just a design decision/goal. But thanks for the suggestions!

Fun game.

The sound adds a lot to the atmosphere of the game. It will defenitely be a lot better with ogg support as the load time is a considerably excessive.
That said with all the graphic effects, I didnt notice any lag or flickers.

Running on:
OS: Win7
Browser: mozilla firefox.

@bobjob – Thanks!

Actually, I’ve decided to abandon OGG entirely. No more “Vorbis, the fearsome OggMonster” to battle. I’ve been making really good progress with coding for FM generation on the fly, which I am going to do, instead.

All the sounds you hear in the game were made by a 1980’s Yamaha DX7. Well, actually, the patches were ported to a softsynth (FM7) and recorded from there as wav files. So, since they are FM, and I know FM pretty well, it made sense to try and make a Java version.

Anyway, I’ve got the “windchime” chime patch pretty well nailed this week, and aspects of the drone working as well. The bigger gongs are yet to do. The drone will need a flanger, but I think that will be doable. I’m told flangers are not much more complicated than an echo with a very short delay time (that varies), and I managed an echo on the Theremin project.

But, yeah, now that I have a mixer and FM happening, I think I’ll be able to recreate the audio that took 15 MB of sound files with less than 150 KB of pure Java. (100:1 savings.) So I am psyched. Looking forward to solving that and getting back to finishing the game!

Side issue, I’m hoping (perhaps in vain) that I can use some of this sound programming expertise in android. But I haven’t really looked closely enough at Android yet. Most of the books and tutorials I’ve come across just cover some simple ways to do sound, nothing low level.

If you ever want quick android assistance, like copy and paste code snippets and such. Feel free to add me to MSN (msn contact link is under my image on the forum post).

If you can use GPL with CPE code, there’s a chorus in Gervill you could extract (it has a flanger mode - a flanger basically being a chorus with attitude and tattoos :wink: ). I’m just in the process of forking this out myself for JAudioLibs - basically need to change the parameter calculations to be something sensible as opposed to MIDI values.

If that license is no good for you (or you just want the fun of coding it yourself), then it’s basically a delay where the delay time is controlled by an LFO. You’ll need a delay where the delay time changes on a per sample basis - once per processing block would probably sound odd. They’re also usually done with a delay on either stereo channel with the LFO’s out of phase with each other to give that “thicker” sound.

Sorry if that’s going over what you’d already been told.

Best wishes, Neil

@bobjob – Again, thanks! I probably will, sooner rather than later.
@nsimga – Also, thanks! I think the flanger is going to be fun.

You’ve inspired me to start a thread on public software licenses. “Yet Another…” discussion on this contentious issue.

Request: Move to “in progress” area. [NOTE: link to project is on the start of the thread.]

I’ve restarted work on this project after a long break. Unfortunately, I think I’m overtaxing the cpu with the result being that the sound occasionally breaks up, sometimes stuttering rather badly for an extended period. I have a pentium 4, 3.2 GHz, 3GB of RAM. This was purchased almost 10 years ago, so maybe most other folks won’t have the problems I’m having? The game usually is consuming from 60%-80% of my home computer cpu.

I have questions about possible strategies for optimization:

How much of a pickup might there be, going from passive (currently) to active rendering, using Java2D? Should I instead go straight to Libgdx or Lwjgl?

I’m wondering if maybe the Java2D can still be made to work and leave enough cpu for smooth audio. There are a few things that I’m doing that may be needlessly adding stress:

(1) separate drawImage() methods for the stars, there are 600–though StumpyStrust tutorial (http://www.java-gaming.org/topics/java2d-clearing-up-the-air/27506/msg/246444/view.html#msg246444) suggests that this shouldn’t be too much of a problem until you get to 4k image particle systems and the like. (Could just print as a single graphic, but I don’t want to lose the twinkling animation if I can avoid it.)

(2) redrawing the “scrolls” every frame with their vibrating Simplex textures.

(3) There is a fair bit of drawing over existing drawings–hitting some pixels two or three times when only the last will show.

Thoughts? Encouragements? Thanks!

Moved to WIP :slight_smile:

Request: Move to “in progress” area. [NOTE: link to project is on the start of the thread.]

I’ve restarted work on this project after a long break. Unfortunately, I think I’m overtaxing the cpu with the result being that the sound occasionally breaks up, sometimes stuttering rather badly for an extended period. I have a pentium 4, 3.2 GHz, 3GB of RAM. This was purchased almost 10 years ago, so maybe most other folks won’t have the problems I’m having? The game usually is consuming from 60%-80% of my home computer cpu.

I have questions about possible strategies for optimization:

How much of a pickup might there be, going from passive (currently) to active rendering, using Java2D? Should I instead go straight to Libgdx or Lwjgl?

I’m wondering if maybe the Java2D can still be made to work and leave enough cpu for smooth audio. There are a few things that I’m doing that may be needlessly adding stress:

(1) separate drawImage() methods for the stars, there are 600–though StumpyStrust tutorial (http://www.java-gaming.org/topics/java2d-clearing-up-the-air/27506/msg/246444/view.html#msg246444) suggests that this shouldn’t be too much of a problem until you get to 4k image particle systems and the like. (Could just print as a single graphic, but I don’t want to lose the twinkling animation if I can avoid it.)

(2) redrawing the “scrolls” every frame with their vibrating Simplex textures.

(3) There is a fair bit of drawing over existing drawings–hitting some pixels two or three times when only the last will show.

Thoughts? Encouragements? Thanks!

Moved to WIP :slight_smile:

Progress report: The applet loads quickly. (To load, see first post on this thread.) ALL the sounds are now procedurally generated instead of being loaded from .wav files. The file size went from about 18MB to under 400KB. :slight_smile: But it takes about 5-10 seconds to get going while the audio clips are built. It’s close to time to figure out how to code a proper splash screen.

I am having a problem with some occasional garbage appearing on the “scroll panels”. They are animated via a Perlin algorithm, but for some reason the smooth “energy patterns” get messed up. Maybe it has to do with the refresh rate? My game loop is set to run relatively slowly, as the animation needs are low.

http://hexara.com/Images/HexaraPanelGarbage.JPG

I have some code in place monitoring the game loop time, how much is consumed, how much is slept. As far as I can tell, I never overrun the amount of available time for a game loop–there is always some sleep occurring every iteration.

My next task is to switch over to active rendering. Maybe that will eliminate this graphics problem.

Progress report: The applet loads quickly. (To load, see first post on this thread.) ALL the sounds are now procedurally generated instead of being loaded from .wav files. The file size went from about 18MB to under 400KB. :slight_smile: But it takes about 5-10 seconds to get going while the audio clips are built. It’s close to time to figure out how to code a proper splash screen.

I am having a problem with some occasional garbage appearing on the “scroll panels”. They are animated via a Perlin algorithm, but for some reason the smooth “energy patterns” get messed up. Maybe it has to do with the refresh rate? My game loop is set to run relatively slowly, as the animation needs are low.

http://hexara.com/Images/HexaraPanelGarbage.JPG

I have some code in place monitoring the game loop time, how much is consumed, how much is slept. As far as I can tell, I never overrun the amount of available time for a game loop–there is always some sleep occurring every iteration.

My next task is to switch over to active rendering. Maybe that will eliminate this graphics problem.

[A long time ago, I started making a puzzle game called Hexara. That thread is now locked and I don’t have the admin rights to unlock it. Would it be possible to have it unlocked? This post could be moved to that thread.]

http://www.java-gaming.org/user-generated-content/members/27722/hexaragamesoundtester.jar

There’s going to be a seminar on composing music for games at the SF Conservatory of Music and I’m hoping to have a working jar with the game and score for their Nov. 16th deadline (seminar is a week after that). The sound here is all procedural, no wav or ogg files involved.

This “tester” was made for profiling a newly upgraded procedural sound engine. My goal is to keep the cpu usage under 5% even when the sound is most active.

OPERATION:
The “in/out” tells the audio mixer whether or not to even bother reading the track.
The subtracks of the chimes synth (its polyphony–the number of chimes that can play at the same time), can also be tweaked. Changing that number (have to hit enter to complete) requires the mixer be programmatically stopped and restarted which results in an audible pause.

The “Tension Level” is going to be linked to the number of “scrolls” that are completed in the puzzle. Completion of a scroll triggers a gong. When all the scrolls are solved the “gong completion” cue plays.

An increase in “tension” (as more scrolls complete) has the following effects:
(1) increases the density of the chimes,
(2) makes their volume/timbre a little brighter,
(3) makes the flanger modulation on the drone tone sweep more quickly.

Am considering other things to change (e.g., add new or slightly more discordant pitches to be played by the windchime).

This stuff hasn’t been fully implemented in Hexara itself yet. First tests show that it can still stutter, but only very occasionally. The Java2D graphics badly need a rewrite and I suspect doing so will reduce cpu enough to clear that up.

I think it might be worthwhile putting a bunch of volume/pan/timbre controls in this “tester” to help with the design and with making sure the volumes don’t overload (currently possible). But my first priority was to just make sure I had a way of testing the cpu usage.

RESULTS OF PROFILING / QUESTIONS:
Profiling, using JVisualVM, or even just using Windows Task Manager, gives somewhat inconsistent cpu % readings. This morning, I ran it full out (at Tension 5, all tracks on, completion cue playing) and it stayed below 5% the entire time. ;D But while running the same file at other times, the cpu sometimes spikes at 15-20%, . These spikes are weird though in that they don’t consistently follow the duration of the ‘completion cue’. For example, it can hit a high and drop back down below 5% for a majority of the time the cue is playing, and the spike can come in the middle or the end of the cue (as the notes are fading away).

Is the cpu usage a reasonable gauge? I finally figured out that some usage is caused by my cursor interacting with the Swing controls (about 5-6%). Also, it seems if FASTFIND or some other program starts running in the background, that increases the likelihood of the program’s tendency to spike. What is that about? Can it be dealt with?

My computer is circa 2004, so maybe this is all moot for new computers. However, I do want this engine to be able to run on Android, so keeping the cpu usage low is important.