Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (686)
Games in Android Showcase (198)
games submitted by our members
Games in WIP (758)
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 ... 46
1  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-08-23 21:20:59
Started rewriting my entire graphics engine , to be perfectly honest the previous one was pretty shoddy now looking at it...
It is so much better to have tried, and learned from the process, than done nothing at all.
2  Game Development / Newbie & Debugging Questions / Re: getters and setters vs public vars on: 2016-08-22 00:13:39
A setter/getter construction ensures that every time the information is accessed, it goes through a single, centralized set of rules established by the instance of the class itself. These rules can even be written to reflect state changes of the class instance which would complicate the coding needed from classes that access these variables.

Also, it allows you to freely change what is behind that wall or api without having to track down every instance in which you access that class from other classes. Suppose you do something simple like change from doubles to ints or vice versa. The setter/getter can allow the input and output to stay the same (perhaps employing a cast) while the innards change. Then, you don't have to find and change every instance where the method is being called and change each one.

(The nature of external classes is that they tend to multiply in quantity, and it can become increasingly hard or annoying to track down every place where the direct access is made.)

Using setters/getters is a looser form of coupling between classes than allowing direct access. Loose coupling between classes can be a big benefit, especially when getting into multiple-thread programming.

In general, I'd recommend only using direct access to variables if:
* they are in a private inner class or an additional class on a class and are only accessed directly by the outer or main class on that file;
* they are a class that consists only of fields and values, where instances serve as arguments to a more "functional" class or method and are tightly managed.

But maybe, since you are curious and skeptical, it would be good to just go ahead and do it (skip the setters/getters) and see what sort of trouble you get into (or don't get into) down the road. Sometimes the only way to understand is to do and grapple with the consequences.
3  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-08-21 20:08:47
Young barista at the coffee shop where I often do my morning coding wants to "learn everything there is to know" about game coding. Shades of Dunning-Kruger! He is very much into playing games, and looking at saving up to attend some tech school specifically for game coding. I tried to suggest a decent community college (more affordable) and free online courses of study (e.g., w3.org tutorials) while he is saving up money to start the private college. Also, the importance of a strong math background.

But he seems mesmerized by the promise of the private school to help graduates find actual work in the industry. He is a nice fellow and was polite, but I think pretty set on his plan and is putting me into a old fogey category of unsolicited advice giving. I assume that as he starts to learn more about programming, he'll get a better concept of just how big the field is and the impossibility of "knowing everything there is to know", and also that there are decent strategies for various degrees of specialization.I don't know if anyone "gets" that trade schools generally fall short with "placement" promises until they actually experience this for themselves.

Just saw DVD of "The Big Short". Highly recommended. I identify (more Dunning-Kruger, but on my part?) with the fellows that are sticking to their long shot strategies despite people telling them they are crazy, in my going all-in on Java procedural audio. I don't expect a huge payout, but advancing my capabilities with it still seems like it could lead to something real.
4  Game Development / Newbie & Debugging Questions / Re: How Do I time events? on: 2016-08-16 04:10:07
@philfrei

Any chance you could provide a simple example?
I feel this would be the best way going about things since I wish to sync to an audio clip.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
import java.awt.Color;
import java.util.Timer;
import java.util.TimerTask;

public class Avatar {

   public enum EmotionalState { GLOWING, DEPRESSED, ENVIOUS, EMBARRASSED };
   
   private EmotionalState currentEmo;
   private Color avatarColor;
   private volatile boolean changeEmotions;
   
   private Color golden = new Color( 248, 248, 0 );
   
   // This next method is the "loosely coupled" hook.
   // We don't DO anything here except flip a switch.
   // The thread with the game loop updates and renders in its own time.
   public void setChangeEmotions(boolean bool)
   {
      changeEmotions = bool;
   }  
   
   public void update()
   {  
      if (changeEmotions)
      {
         // clear flag
         changeEmotions = false;

         int random = (int)(Math.random() * 4);
         switch (random)
         {
         case 0: currentEmo = EmotionalState.GLOWING; break;
         case 1: currentEmo = EmotionalState.DEPRESSED; break;
         case 2: currentEmo = EmotionalState.ENVIOUS; break;
         case 3: currentEmo = EmotionalState.EMBARRASSED ;
         }        
      }
   }
   
   public void render()
   {
      switch (currentEmo)
      {
      case GLOWING:
         avatarColor = golden;
         break;
      case DEPRESSED:
         avatarColor = Color.BLUE;
         break;
      case ENVIOUS:
         avatarColor = Color.GREEN;
         break;
      case EMBARRASSED :
         avatarColor = Color.RED;        
      }
     
      drawAvatar(avatarColor);
   }
   
   private void drawAvatar(Color color)
   {
      // draws avatar based on current emotional state
   }
}
   
   
class GameLoopThread
{
   private boolean running;
   private Avatar avatar;
   
   public GameLoopThread(Avatar avatar)
   {
      this.avatar = avatar;
   }
   
   public void run()
   {
      while (running)
      {
         // ...code to regulate frame rate to 60 fps...
         
         avatar.update();
         avatar.render();
      }
   }
}


class LaunchTimerTask
{
   Timer timer = new Timer();
   
   public void launchTask(Avatar avatar)
   {
      EmotionTrigger triggerTask = new EmotionTrigger();
      triggerTask.avatar = avatar;
     
      timer.schedule(triggerTask, 1000 * 60, 1000 * 60);
   }
   
   
   class EmotionTrigger extends TimerTask
   {
      public Avatar avatar;
     
      @Override
      public void run()
      {
         avatar.setChangeEmotions(true);
      }
   }
}


The main tools for triggering from audio are the Listeners that monitor when a Clip or SourceDataLine opens/starts/ends/closes, that sort of thing. The design pattern, I think, is called "Observer". Check the method:
javax.sound.sampled.line.addLineListener

Also this:
http://docs.oracle.com/javase/7/docs/api/javax/sound/sampled/LineEvent.html

For more granularity, I count sound frames and have rolled my own "Listener" equivalent.
For the following link, see the last section "Manipulating the Audio Data Directly"
http://docs.oracle.com/javase/tutorial/sound/controls.html
5  Game Development / Newbie & Debugging Questions / Re: How Do I time events? on: 2016-08-14 19:15:30
...Or you could just use the java.util.Timer class, which allows you schedule delayed events. However, this happens on a different thread, so I don't know if the Timer class is what you want...

When triggering events from another thread, which I do a lot (e.g., between the GUI and my audio-processing thread, or the audio-processing and the game loop thread), a good technique is to have one thread throw a flag on the other, often via a volatile boolean. The other thread spots the flag and acts accordingly.

I'm not sure if this is strictly the design pattern named "loose coupling" or just one form of it. But it is good to understand patterns for messaging between threads. If one is worried about opening up a can of worms by using another thread, maybe the real concern should be that one is holding a can of worms, and that looser-coupling/better messaging would improve the structure of the code.
6  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-08-09 18:41:48
On Sunday I figured out enough about MIDI to set up a Receiver and obtain real-time messages from my synth keyboard (a Yamaha DX-7S), intercept and use them to play one of my Java FM synth patches. I'm only responding to key-on and -off, making use of the MIDI key and velocity data.

There is a bit of lag, but it is not terrible. Could still work for someone playing solo, or playing ambient or in a situation where being "in the pocket" is not required.

Next step is to interpret MIDI sequence files, where the timing info is included.

"Master plan" : to have some degree of parallel development in DAW and Java available, having the same "patches" available in both (have about a dozen so far, aiming for more like 60). Then, can compose music in the DAW, save to MIDI, import the MIDI into Java for procedural playback. TODO steps include translating the midi into the event system I've written, as well as dealing with unanticipated pitfalls. Lot's to do still.
7  Game Development / Newbie & Debugging Questions / Re: writing xml file to jar location on: 2016-08-05 01:39:18
@Ecumene
Thanks, but getResource() vs getResourceAsStream() is not the issue for me. I've been able to load from jars with both forms. It's the task of saving within the jar that I wanted to solve.

As I look into this further, I am finding advice that says saving to within a jar is not a good nor a common practice. It can only been done with considerable hassle: making and saving a new instance of the jar!


http://stackoverflow.com/questions/4056682/how-can-my-java-program-store-files-inside-of-its-jar-file
8  Game Development / Newbie & Debugging Questions / writing xml file to jar location on: 2016-08-04 22:57:11
Problem: I'm having trouble trying to figure out how to save an xml file to within a jar. It seemed to me that this would be a reasonable form of persistence for some settings data. The file is of xml settings for an audio mix. There are currently two files: day.xml and night.xml for two different mixes.

@tldr:
If these is no way to save to the internals of a jar or if doing so is a bad plan, no need to read further. But a suggestion for an alternative plan would be helpful. I'm wanting to ship the jar for use as a library, and want the owner of that library to be able to save/load settings that they set up. The Java Properties solution was discarded because of the hierarchical complexities and multiple settings docs that will probably be needed down the road.


I have managed to read and write xml files to a user's directory, and I can read xml files from the jar. I specify the read from within the jar as follows:
1  
2  
    URL url = this.getClass().getResource("res/day.xml");
    document = builder.parse(url.toURI().toString());


where builder is a valid DocumentBuilder.

For output, which doesn't work, I first tried the following:

1  
2  
    URL url = this.getClass().getResource("res/day.xml");
    writer = factory.createXMLStreamWriter(new FileOutputStream(new File(url.toURI())));


The error message says that the URI is not heirarchical on the above writer assignment.

I also tried this:
1  
2  
    URL url = this.getClass().getResource("res/day.xml");
    File file = new File(url.getFile());


This gives a FileNotFoundException. The error message:
1  
    file:\C:\Users\Owner\Desktop\vangardaudio.jar!\com\adonax\pfaudio\vangard\res\day.xml (The filename, directory name, or volume label syntax is incorrect)


When inspecting the jar file (by changing its suffix to .zip and drilling down) I can verify that the file exists.

Is there a way to save a file in this manner?

Was looking for a tutorial on our site pertaining to saving settings but came up cold. Is there one that I overlooked? Seem like there probably is one somewhere, since it is a pertinent topic to game making.
9  Java Game APIs & Engines / Java 3D / Re: How much time will it take me to learn 3d game programming ? on: 2016-08-03 23:44:37
Actually that's exactly what it involves. And in a funny coincidence, why I was hired, which was to help design a system that doesn't kill every whale within 5 miles.

Cas Smiley

I wish you every success!
10  Java Game APIs & Engines / Java 3D / Re: How much time will it take me to learn 3d game programming ? on: 2016-08-03 08:40:05
And it really isn't. Not even close. And not by any CS i know and I know a lot since it is my day job.
It's the second most complex* and difficult field I've encountered in my 37 years of programming. I think you may be being dismissive of the effort and knowledge and belittling the sheer brainpower that has gone into it... it ain't remotely easy. Not by even the most fanciful imagination.

Cas Smiley

* The most complex field I've been involved in is marine seismic exploration, where I am now

Please tell me the job doesn't involve blowing cetacean's ears out with loud sonic blasts.
11  Java Game APIs & Engines / Java 3D / Re: How much time will it take me to learn 3d game programming ? on: 2016-08-02 02:04:16
JavaFX 3D is pretty easy to learn and get started. I made the following program in about two weeks after starting JavaFX. I had been using Java 2D for many years, but wanted a 3D working world as a way to test out some 3D audio code algorithms. http://www.java-gaming.org/user-generated-content/members/27722/test3daudio.jar Give it a minute or so and these rumble-producing purple cylinders will start to rise up. You can tool around the chess-board with the arrow keys and the sounds will shift in location (best with headphones).

I wrote a short tutorial to help get past some gotchas that might make it hard to get started with JavaFX. http://www.java-gaming.org/topics/getting-started-with-javafx-game-programming-for-java-programmers/37201/view.html This will get you going with the basics for a game loop and logic of graphics display. For some reason it is kind of hard to find good beginning tutorials for JavaFX game graphics. (Part of it: Java 8's version of JavaFX is vastly different than the first go at JavaFX a few years back.)
 
The 3D stuff I used in the 3D-sound-test mostly came from reading the 3D chapter in "JavaFX for Dummies" and common sense. The "for Dummies" series is not known for straining brain cells.

I think it is a reasonable way to get going quickly and still learn a lot of basic 3D concepts. However, there seem to be larger and more active communities for JMonkeyEngine, LibGDX and of course some non-Java engines mentioned above.
12  Games Center / WIP games, tools & toy projects / Re: Vangard on: 2016-07-26 21:30:37
Hi - I'm really pleased to hear the first cut has some positives. For some reason, the posts from the last three days (including ags1's first mention of my jar) didn't appear for me until today.

Doh! I realize why. I was relying on mail notification rather than coming to JGO, and I don't have this thread set to notify me. Sorry for the delay in response!

The "first cut" that I just sent over was simple volume-panning stereo. There are some sound that are in fact stereo ("Wind-in-trees" and "forest-crackle") which are allowed to stay as is, and others that are treated as mono point sources (fox and owl cries) so that they could be set to originate from different distant points as time passes.

My plan is to institute delay-based stereo at a later point if the benefits justify the required increase in demand of cpu. I'm not sure if I'll attempt anything more than adding the delay-based stereo. I'd like to do something with the whole surround-sound thing, but I haven't looked into how to output to audio systems that have more than two tracks, and I don't really understand the math behind the fancy HTC-whatsis stuff. [What is that acronym? For sound that is stereo but gives the sense of above, below, behind, not just left-right.]

As far as I can tell, it might be possible to get some of the behind/above/etc. effects via a subtle use of filters, and I do hope to learn enough to implement same and experiment with this. In that case, the point source sounds, like the fox or owl, could perhaps be treated with some filtering to create more of a "surround-sound" illusion. But this is going to take a lot of study and work for me to figure out, and there is a lot on my queue.

@FabulousFellini Can I quote you on that? Grin Thanks for the compliment.
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-07-20 09:16:05
If this code is useful to anyone, I can post it, but I want to handle the license and permissions stuff correctly.

Basic usage:
1  
    float[] audioFloats = OggVorbisToPCMFloats(URL oggUrl);

How do I know how many channels the audio stream is comprised of?

Maybe you could return float[][] or an actual POJO with some meta-data like sample-rate.

Transforming all samples into floats, only to have them converted into bytes/shorts again to play it seems a bit cumbersome. It may also be disadvantageous to be forced to decompress the entire file before you can play it. For long audio files this means significant decoding time and serious memory usage (especially due to the floats).

@Riven
Good points. I could see where that would make the code I just wrote more generally useful. It would not be hard to do if there is a use or request.

"How do I know how many channels..?" I have been assuming the programmer and the sound designer have an agreement to stick to a single format or set of formats. Audacity works great for converting formats. I've actually been prepping wildlife cues (owls, foxes, crows, woodpecker, wind-in-trees) for the last few hours. My last step is to convert to "CD-quality" wav, then turn that to ogg/vorbis.

As far as I can tell, OGG/Vorbis works with audio data in the form of normalized PCM floats. Conversion to shorts or bytes happens after the decompression. I intercept the normalized float data before these later stages, as normalized floats are also format I'm using for most of my audio work. So actually a lot of thrashing is avoided.

The audio mixer I wrote expects normalized PCM floats. All synth output, clip-data, processing, mixing that I do happens with normalized floats. The conversion to bytes only occurs if the "wrapper" (bridging the audio mixer output to the sound system input) requires it. Android allows normalized floats for audio output as an option. I'm hoping to work soon with @ziozio who may have already written code that allows normalized floats to output via OpenAL as part of a OggVorbis decoder he previously wrote. I suspect his code does convert to bytes, but puts off the conversion to the last possible moment.

There is a lot I don't know about memory management. I failed miserably earlier this evening when trying to read and understand Spasi's article on LWJGL's use of memory mgmt. Could use some coaching or recommended articles to get more background knowledge. I try to keep my learning on a need-to-know basis as otherwise there is no time for coding. But I really would like to know more about memory mgmt at this point.
14  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-07-20 03:59:56
Debugged and got working some code to take an .ogg file (ogg/vorbis) and turn the PCM contents into a float[] array. Am using the JOrbis library and based the code on two decoding examples (one a "tutorial") that come packaged with the library. It's not the most efficient, as I'm opening the file twice, once to get a length in frames for the target array, the other for the actual data extraction, and some changes I made in loop nesting may make it a couple microseconds slower than its true potential.

I'm unclear on which of the example authors need to be acknowledged. Use of the library itself requires a license, that is clear. The copied code is basically the setting up of the main variables and loops, and is very similar in both examples (two different authors, neither acknowledging the other). Their code is nearly identical except they name their variables differently. I vary by dropping all the code pertaining to converting the extracted normalized floats to bytes. (I am neither outputting bytes to System.out nor playing back the audio as the two examples do). I also alter the nesting of a couple inner loops to make it simpler to transfer the data channels into the target float[].

If this code is useful to anyone, I can post it, but I want to handle the license and permissions stuff correctly.

Basic usage:
1  
    float[] audioFloats = OggVorbisToPCMFloats(URL oggUrl);
15  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-07-14 21:15:15
Defined more tree types in vangard, including ancient pine and ancient oak... Chopping down ancient trees is bad karma.

I have added more plant products as well.

Pine trees make pine cones but I can't think of any practical uses for pine cones. I suppose you could gather lots of pine cones and sell them as firewood bundles.

I read that acorns are poisonous but can be converted into edible food by leaching the toxins out. The downside is they don't taste very nice but the vikings did eat them occasionally. I guess they are free food for the viking underclass.

Vikings loved hazelnuts so I had better add those tonight.

Hazelnuts? Doh. Sure, why not. (I momentarily got them confused with macadamia nuts and was wondering what the Vikings were doing trading with Hawaiians.)

Last night fell asleep after the beginning of what seemed to be a remarkably bad film: "The Norseman". Newfoundland scenes shot in Florida? Leader Lee Majors with a slightly Southern accent, everyone dressed in horned helmets with big ear muffs.

Native American Indian of CA used to "process" and eat acorns. Can read about them at various parks around here. Am surprised to hear Vikings did as well.
16  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-07-14 20:58:01
I thought I'd take "a day" to learn how to save and load XML files of settings for a Java app. I chose the theremin I wrote as the target for this. If it is to become a useful program, it should have the ability to allow one to save settings for the various types of sounds it can make, ranging from classic theremin to space ships or the industrial-echo-overdrive effects.

It turned into a three day job. (Could have been worse!) Unanticipated or partially anticipated sub tasks included: getting JavaFX MenuBars working, getting Swing's JFileChooser working (including dealing with suffixes, warnings for overwriting files) Swing JOptionPanes (seems easier to work with than JavaFX where you have to build your own, AFAIK), and doing a bit of cleanup of my code separating "model" from "presentation".

Success.
17  Game Development / Newbie & Debugging Questions / Re: getters and setters vs public vars on: 2016-07-11 00:36:37
The only exception I have to using setters and getters is when I am able to wholly separate some functionality into the mutable and immutable components. The intent is, in part, to help with concurrency issues. I got the idea from reading about functional programming. But that doesn't mean I'm implementing it correctly. In this case, the class with the variables only has variables and no functions whatsoever.
18  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-07-07 18:16:35
@Brynn Congrats!!
19  Discussions / Miscellaneous Topics / Re: MP3 Specification on: 2016-07-06 08:18:26
@ziozio I'm impressed you've been able to figure out ogg and other formats. I recall trying to figure out OGG/VORBIS several years ago and was unable to get any traction and gave up.

I just went to the wikipedia entry for MP3, and am seeing that the patents expire in 2017 in the USA, but have already expired in the European Union. I'm wondering if there are some European sites that have information, such as an academic site for New Music, like Stanford's CCRMA.

I tried doing a search at CCRMA for "MP3" and it looks like there have been talks and courses, but I didn't see any online documentation.
https://ccrma.stanford.edu/search/node/mp3

But I do think there is a big New Music site in Paris, IRCAM.
http://www.ircam.fr
Might find something poking around there, but it will probably be written in French.

I used to know how to get to lots of great tutorials at CCRMA, on digital music tech and math. The links I had are on a browser on an old PC that I rarely use now. Maybe they've made things harder for freeloaders, and want students and income for the information they teach. I remember working through sections that they had explaining the math behind e^i*PI = -1 and briefly being able to hold it in my head. I don't know if that stuff is still available from them.
20  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-07-03 23:45:14
Spent time on updating the AndroidOpenAL project, now updated the OpenAL Soft sources to 1.17.2. Today was a tough day, because I had failed to compile it since last four days, and my only successful compilation was a month ago with 1.12 version. Finally, I made it!

...

Is this an audio library?
Have you implemented a better performing method for streaming PCM than Android's AudioTrack?
21  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-06-30 18:16:12
Sunday/Tuesday worked out the kinks of converting a Yamaha DX7 patch called "CHROMA  5B" to Java. I want to use it in a game design I am currently working on. The interesting feature of this synth patch is that the shorter the amount of time before the release is triggered, the brighter the decay. In other words, when you play it on a keyboard by holding the key down, the tone color quickly becomes damped, but if you play super staccato (releasing very quickly) the tone color is quite bright, with qualities of a hammered metal string.

The last kink to work out was implementing "frequency scaling," so that the harmonic content of the higher frequency notes would balance with that of the lower notes. I hadn't yet added this to my synth as a general feature, and was worried it would be tricky. But it turned out to be easier than expected. A nice sounding roll off to the "modulation index" (a factor that determines the amplitude of the modulation) was achieved with a simple Math.log10(frequency) function.

Late Tuesday and most of Wednesday was spent working on getting a queue of sequences to run. I had previously gotten multiple instances of what I call PulseMotif to play in the "CircleSounds" demo, where multiple sequences loop concurrently and have their pan and volume altered by the position of circles on the screen. But I hadn't done the thing of having a new sequence start when another ends. The bigger goal is to have not only sequences possible, but real-time branching in the selection of which sequence to play next.

Anyway, I got a simple chain of three sequences to run smoothly yesterday. It is a bit clunky, but I think the key idea is a good one. Instead of focusing on various Sequence queueing/handling objects, I wrote a PulseMotifListener interface, and the player-code for the PulseMotif objects now sends out messages marking the beginning, looping and ending of a sequence to registered Listeners of that PulseMotif. (A similar thing happens with individual Notes played by my FM Synth implementation.) The testing code had an inner class that implemented PulseMotifListener, and it handled the removal of the finished sequence and the start of the next within the implementation of its pulseMotifDone() method. And it ran successfully, as far as I can tell.

Today, I plan to work out the logic where instead of a simple chain, I have a pool of options and state variables are used to select a sequence from the pool to chain when a given sequence ends. I'll try and get a demo of this up soon if it works.
22  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-06-26 02:38:38
There was a time when PHP had a reputation for hackability. Maybe its been addressed since and is fine now. I really don't know. But when I was looking into it, about 7 or 8 years  ago, it seemed like an awful lot of the code you had to write was explicitly protective measures such as counteracting code injection. Did that ever get fixed?
23  Discussions / Miscellaneous Topics / Re: Is it possible to get sued by Donald Trump if..... on: 2016-06-24 06:52:44
Ah, Reagan... If this is accurate, Trump following in his footsteps might be... Well, completely unsurprising.  Roll Eyes

Interestingly enough, there's an article like this with equally valid points for almost every president to ever run America. Lol

True enough.

Of the first point, though, I disagree with the author. The number of investigations is no longer a valid signifier of anything, except that someone wants to bring down a given target. The tactic of smear-by-investigation has been so overused that it is pretty much meaningless at this point. Actual indictments do count, though.
24  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-06-24 06:43:24
Been working on a few different ideas this last week or so. I already mentioned the forever non-repeating campfire SF/X.

1) got a "cluster-synth" abstract synth working with two synths based on it. I'm calling a cluster synth one where a collection of pitches are played as a single cluster, sharing their envelope and other components. The play command sends in a pitch array rather than a single pitch. Part of the benefit is that there is an efficiency in eliminating duplicate envelopes and other components for each contributing tone. It is for certain types of sounds that seem to work better as clusters than as single tones. One of the two is simply a collection of sine waves, the other a sort of deep whoosh, kind of hard to describe. When I get a chance I'll make a little demo gui with a way to make and save wav assets.

2) in the process of building this abstract synth, I was able to improve the abstract version of my more normal synths, and went back and revised a couple dozen existing synths.

3) got a "flibberillator" (flibberator?, flibbulator? -- my friend Ian had a term for the effect, I need to settle on its name) working. This takes some sounds and intermixes them instead of mixing them. We are talking about going back and forth between multiple sound sources in rapid succession. I don't know if this is a valid term, but I think of this sort of sound as a manifestation of a "glitch" aesthetic. Ian had remarked that the effect (when applied to multiple clusters of his sine waves), that it sounded like a computer thinking. (Ian Allen used a few examples on some of the cues he left on his account on SoundCloud: "Ian Allen") I hope to get this effect available to hear/generate via a simple gui too. The algo isn't generalized yet for any sound source; it is only working (first pass) via the abstract cluster synth.

4) back to trying to get a simple playback of the "Maggot Brain" (George Clinton) accompaniment going via my event system. There were a couple curious things to fix, as the "Event System" I wrote is still a bit complicated and I'm continuing to work out the kinks. This is a step towards being able to score a piece for real-time playback and towards making branching scores.

This next few weeks though, looking to spend some time on projects for a couple other members! Collaborating, once again. It has been a long time.
25  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-06-16 23:31:02
Because you ask the player to make a choice, up front, about how good they think they are, at a game they've never played before, using criteria they don't yet know. And they cannot choose the right answer! They'll feel like they're missing out if they choose "pweez don't hurt me"; they'll moan vociferously but refuse to back down if they choose "kill me now!!"

Far better to just design a game at which everyone has fun and sort of creates the difficulty level of their own making, so to speak.

Cas Smiley

It occurred to me the other day that the good old pinball machine might be a nice model, when it comes to difficulty issues. There's enough variety and randomness that a novice can have fun, but room for skillful play such that an aficiondo will not be bored.

***

My WIDT: again, a task that I thought was going to take three hours took the better part of several days. I made an endless torch/fire, derived from a 5-second sample, and added it to the peacefulbrook "sound demo" jar.

In the process of working on it, discovered that several other things were broken and had to fix them, mostly pertaining to the synths and the event system.

I discovered an article describing how to output a stream of PCM data via OpenAL. LWJGL streaming sound with OpenAL. Am looking forward to digesting it. But there are several other things on the queue as well.
26  Games Center / WIP games, tools & toy projects / Re: Skullstone - a dungeon crawler game on: 2016-06-16 22:58:53
Quote
I think I'll stay with current solution, I have too many other things to code Wink

A totally sane response!

I did get a bit piqued, though, and added a "campfire" to the peacefulbrook sound scape jar, just to prove to myself the technique would work. It uses a 5-sec sample lifted and tweaked from a longer free SFX. I think it sounds pretty convincing as a non-repeating, endlessly varying fire. The torches in your hallways would be a bit different, but this should be close enough to extrapolate.

A couple things on the queue but hopefully before long I will attempt to build a LWJGL/OpenAL direct audio-streaming tool. It seems to me something like that could be a nice step forward for procedural audio on LWJGL-derived engines.
27  Games Center / WIP games, tools & toy projects / Re: Audio library demos on: 2016-06-16 22:40:34
I just added a newly revised peacefulbrook demo jar.

The main difference is that there is now a campfire. I wanted to show an example of a fire that would go on endlessly without looping. For example (with a bit of modification or a different sample): a torch on a wall in a 3D game.

The recording consists of 5 seconds lifted from a free sound effect, and processed a bit in Audacity. The effect could probably be just as effective with a couple fewer seconds in length, which would have shaved off several hundred KB. As it stands, the file is 2.7MB now, with just about all of it coming from the stream and the fire recording.

With more stuff happening at the same time, the volume controls take a bit more tweaking to get a nice mix. My wife thought the fire was a bit low, and when I turned it up, like the frogs were in the fire. So, consider bumping the fire up a tad, and putting the frogs more in the distance (lowering the volume).
28  Games Center / WIP games, tools & toy projects / Re: Skullstone - a dungeon crawler game on: 2016-06-15 02:49:48
Quote
@philfrei:
I don't know if I can output a PCM stream, to be honest my knowledge about audio is very little. The engine uses OpenAL for audio and all I'm doing is playing samples in proper location, environment etc.

I took a look at JMonkeyEngine, and as far as I can tell, it is probably using LWJGL for its audio (which implements OpenAL) but it could be using JOGL as an alternate way.

I found an article that looks like it might lead to making a way to hook in streaming audio. Whether this can be done while preserving the environments and 3D location functions, I don't know. I'm a bit backed up with tasks at the moment, but if I get the chance to make a wrapper and a perpetually changing torch-burning sound, would you be interested in testing it out?
29  Games Center / WIP games, tools & toy projects / Re: Vangard on: 2016-06-14 20:44:21
I have several working tools written for controlling ambient sound playback. If you send me a desired api for how you'd like to access them, I bet I can make a jar/library to your specs. Message me if you'd like to give it a try.
30  Java Game APIs & Engines / JavaFX / Re: JavaFX For Pixel Games on: 2016-06-02 05:21:53
Concerning the Plan B (reading the pixels) I found this tutorial, which makes use of PixelReader and PixelWriter:
http://docs.oracle.com/javafx/2/image_ops/jfxpub-image_ops.htm

It is not as easy as expanding the image and having it work automatically, but maybe will suffice. Going from a reader to a writer to make a 2X image or 3X image would only require going once through a pretty straightforward for loop to create the new version of the image.

It seems like there could be some other layers or levels where some type of smoothing is being applied, assuming you have set the smoothing to false. But maybe just making new images is cleaner anyway. IDK.

Neat that JavaFX works on Raspberry!
Pages: [1] 2 3 ... 46
 
roseslayer (393 views)
2016-08-06 11:43:29

roseslayer (362 views)
2016-08-06 09:43:11

xTheGamerCodes (436 views)
2016-08-04 15:40:59

xTheGamerCodes (429 views)
2016-08-04 15:40:24

orrenravid (780 views)
2016-07-16 03:57:23

theagentd (855 views)
2016-07-11 14:28:54

Hydroque (953 views)
2016-07-06 05:56:57

Hydroque (981 views)
2016-07-03 08:52:54

GrandCastle (793 views)
2016-07-01 09:13:47

GrandCastle (634 views)
2016-07-01 09:09:45
Rendering resources
by Roquen
2016-08-08 05:55:21

Rendering resources
by Roquen
2016-08-08 05:52:42

Rendering resources
by Roquen
2016-08-08 05:50:38

Rendering resources
by Roquen
2016-08-08 05:49:53

Rendering resources
by Roquen
2016-08-08 05:32:39

Making a Dynamic Plugin System
by Hydroque
2016-06-25 00:13:25

Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42
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!