Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (115)
games submitted by our members
Games in WIP (563)
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 ... 34
1  Discussions / Miscellaneous Topics / Re: Whays the story behind your name on: 2014-09-21 01:31:11
<engage creaky voice> Back in the old days of main frames and CRTs, we were only allowed 8 chars for our names, and a common approach was to take the first four letters of the first and last name and paste them together. So, the name isn't just an uninspired act of non-creativity and boredom, it is referencing a bygone age.

I also use Adonax here and there. This is a shortening of "Arundo Donax" or, a. donax, the cane used to make reeds for clarinets, saxes, bassoons, and my main instrument, the oboe. Oboists get stuck spending a lot of time with a. donax, scraping reeds to play. It cuts into time I'd rather spend playing the instrument or programming, or in fact, into time where I'd rather being doing almost anything else.
2  Discussions / Miscellaneous Topics / Re: The price of Pizza and Games on: 2014-09-19 16:07:45
In a free and open market, price is a result of supply vs. demand. The affect of costs associated with making the product are secondary. But that doesn't stop manufacturers or fear-mongers from invoking the classic "they'll just pass the costs on to consumers" when some measure or another that will potentially lower a profit margin is proposed.

I say "secondary" because the costs don't directly affect demand, or what a consumer is willing to pay. But if the prospect of reduced profits ends up causing some manufacturers to drop a product altogether, then that does affect the supply. In other words, the ability of the producer to "pass on costs" is limited, despite the political/rhetorical threats. They can try to do so, but risk losing significant market share, unless there is a monopoly or oligopoly, in which case you have bigger problems that need to be addressed!

Given that software can be reproduced so easily, by both the producer and by illegal copying, the supply is virtually unlimited. It is hard, in such a situation, to avoid the "race-to-the-bottom" in terms of price competition. I guess the main thing that allows a price to stay high is if there is a sort of de facto monopoly. In other words, the price point can be maintained mostly to the extent that the game is unique or has unique qualities. As far as your average clones are concerned, the near-infinite supply can result in an situation where you can't give them away. Only Google profits from them because they profit from web traffic.

If you are looking for books, I think a basic Econ 101 or Intro to Econ would cover most of this.
3  Discussions / General Discussions / Re: Microsoft to buy Mojang for $2 billion? on: 2014-09-16 21:16:28
In trying to figure out if "luck" was involved or not, it might be useful to look at the discussion around "black swans".
The black swan theory or theory of black swan events is a metaphor that describes an event that comes as a surprise, has a major effect, and is often inappropriately rationalized after the fact with the benefit of hindsight.
4  Discussions / General Discussions / Re: Microsoft to buy Mojang for $2 billion? on: 2014-09-15 18:48:04
"Reputation" is a life-long project.

I'm certainly not in a position to judge, never having experienced the amount of responsibility that comes with that much wealth or having creative control of a product with that much mind-share.

Another thought: this is more a conversion of state than anything else, from Kinetic to Potential energy.
5  Discussions / General Discussions / Re: Microsoft to buy Mojang for $2 billion? on: 2014-09-12 22:06:20
It's clearly more than a rumor, though Reuters says it is not a done deal yet. They say there will be an announcement on Monday.

Microsoft needs MineCraft to boost mobile ambitions

Figures from article:
  • MineCraft has 100 million players.
  • MineCraft is being offered $2.5 billion
  • MineCraft is being offered about 1/8 of last year's sales <$312.5 million>
6  Game Development / Newbie & Debugging Questions / Re: Is it Possible to use Java and send sounds through the microphone? on: 2014-09-12 06:37:32
dont you think "send sounds through the microphone" sounds like a microphone acting like speaker, starting to talk ?
Most people understood it like that Tongue

That is what I was thinking when I wrote that. It's not entirely far-fetched as a possibility. I think a couple others also noted that the microphone can be made to vibrate and make a signal, although it isn't very efficient. I have a vague memory of hearing this done once on some crude equipment. And Java has some capabilities about identifying and accessing different lines.

I wasn't intending to be sarcastic, except maybe to poke at some folks that actually do think we are being taped via our speakers by the government. I've run across a few people like that.

I clicked an appreciation for Cero earlier for explaining the question. Thanks again.

Ah well, not every post is a success. I'll accept a face palm.
7  Game Development / Newbie & Debugging Questions / Re: Is it Possible to use Java and send sounds through the microphone? on: 2014-09-11 20:31:21
I'm still stuck at the concept of using a microphone for playback. Am I missing something? I can't imagine that even if the mic line could be manipulated, the physical microphone itself could make an audible sound. Shall we also discuss using speakers as microphones? (Or maybe the NSA/CIA already do this...  persecutioncomplex )

That was a joke.
8  Discussions / General Discussions / Re: Microsoft to buy Mojang for $2 billion? on: 2014-09-11 20:22:12
This might have more to do with access to the user base, not the actual income generated by the game. There is a whole generation of kids that just love Minecraft. That is all they want to do. It is truly huge.
9  Game Development / Newbie & Debugging Questions / Re: Referencing from one obj to another on: 2014-09-05 22:08:46
Or just don't require that the Map knows about the player. I don't see why one would.
When I program sometimes I have a camera object within my player object and then handle the render of tiles within the world map so the player would be required.

Perhaps the "player" can or should be a parameter to the various map methods rather than an instance variable. That would be more of a "Functional Programming" way of coding.

Seems like you are trying to do too many different things with one class. The Map sounds like it should be data-oriented. Another class could be responsible for the rendering, using the map as one of the input parameters.

If you are looking for Java books to read, I'd also like to recommend "Clean Code" by R.C. Martin. I happen to be rereading "Effective Java" at the moment, or rather, consulting it once again. It is a terrific book, but not an easy read at all. It took me 3 or 4 attempt and a couple years of experience to finally get to where I could make sense of the terminology and ideas. I still wouldn't say the book was entirely comprehensible to me.
10  Game Development / Newbie & Debugging Questions / Re: [solved] Updating & Rendering in a timely fashion on: 2014-08-31 04:04:57
I always found that quote from Eli to be very puzzling. So, util.Timer was not intended for heavy-lifting? How can a person tell this? It's just code. Nothing in the API warns about this, nor anything in Joshua Bloch's well-documented source code for the class. Code in the TimerTask runs the same as code in a game loop, as far as I can tell, though they rely on different native routines (wait vs sleep).

...doesn't the exact same thing happens when update() and render() take more than the allotted time: the next iteration simply gets pushed back? This is the same with the ScheduledExecutorService (as you configured it), with util.Timer and with a game loop. Yes?

But if the NEXT iteration after that takes less than 16 millis, with either the scheduler or timer's .sheduleAtFixedRate(), an attempt to recover the lost time, gratis, no extra coding needed.

I suspect that the poor reputation util.Timer has vs. coding one's own timing mechanisms into game loops has an element of "herding behavior" to it or some sort of echo chamber effect. I have yet to read one rational explanation or see a concrete example that justifies the preference. I point out again, even "Killer Game Programming" from way back when gets the same performance with util.Timer as with their preferred game loops, and then says well, we are going to stick with writing our own game loops anyway. (The book does an excellent job of demolishing the swing.Timer, though!)

But this is okay. It probably doesn't make a bit of difference, and my harping on this is an example of I don't know what. I certainly don't want to try and tell other people they should convert their game loops to TimerTasks.
11  Discussions / Miscellaneous Topics / Re: Music in games? on: 2014-08-30 04:36:13
I haven't really researched this as much as I should, but I think that sometimes a game maker and a composer can work out a mutually beneficial arrangement. For example, the game maker is allowed to use a piece, but provides links to the composer's site or to a place where the game player can buy an mp3 or song file that is an arrangement or version of the game music.

The one example I recall like this was in a game called "Entanglement".
Somewhere on their site, if I remember correctly, they talk about the music and give a link to the composer's site where a purchase can be made. They may have payed a small fee upfront. I can't recall the details--it was a couple years ago when I found this and filed it away as something to eventually try out myself.

The music for that particular game is NOT what you described as would fit your game. But maybe if the composer finds those sorts of deals work, chances are the composer can also write something more along the lines of what you are wanting.

If that doesn't work, or you find yourself still looking for music a few weeks from now, I have a special case situation that could allow some sort of trade off. I've been working on a procedural music engine, and am looking for an opportunity to give it a go. Your post reminds me of a poppy, driving synth piece I wrote a long time ago (played it in a rock band in the 1980's actually, but that band didn't make it out of the garage) that I think is exactly the sort of thing you describe. But this isn't a situation where I'd just record it and hand over cues. I want to have the game play the score procedurally. So, your game would have to have some slack processing capacity, and you'd have to have some time. (We'd work out an api between us customized for your game, and I'd supply the needed libraries.)

A very simple working example of the procedural music engine is at this link:
If you listen to the "SquareWave" and "Sawtooth" synths, and imagine that sound with a really punchy attack instead of a slow fade (very easy for me to reprogram their envelopes), those are two synths that can be run for pretty cheap (just two FM oscillators). I've also managed to get flanging/chorusing working and that does a great job of thickening textures. Of course, a circle of notes is a lot less interesting than a good rhythm, but this audio event system I wrote is capable of solid rhythmic precision. As I wrote on that post, that drone tool is a stepping stone project.

Ah, there is a lot here I really want to get to! If not your project, maybe in a few more weeks I'll have a better demo of what I'm talking about, and a proposal like this won't be so speculative. Cool But also, there do remain unproven aspects--I still need to tighten up the coding so it uses less cpu.  Emo
12  Game Development / Newbie & Debugging Questions / Re: *solved* Updating & Rendering in a timely fashion on: 2014-08-29 23:57:02
using Swing or other "timers" is fine. all of them use System.sleep(1) anyway.
Well, sort of. The util.Timer relies on native code implementing Object's wait(long) method. It is set to a value that corresponds to the schedule of the next TimerTask on its internal queue. Thus the wait is probably larger than 1.

Thread.sleep(1) uses native code for sleep(long).

But both do make use of the System Clock which is either limited by larger of the granularity of the milliseconds input parameter, or by the minimum interval at which the clock is updated (about 16 millis for some older Microsoft OS).

I don't think the util.Timer adds much in the way of overhead. The most significant addition is a very nifty queue implementation set up for the TimerTasks (I think it's set to a simple array of 128 unique tasks), but it is a model of efficiency (written by Joshua Bloch). I would guess having a single wait(long) is probably better than multiple calls to sleep(1). But these are quibbles to your main point.
13  Game Development / Newbie & Debugging Questions / Re: *solved* Updating & Rendering in a timely fashion on: 2014-08-29 07:38:08
Never, Never use Timer and TimerTask for game loops, they are mainly designed with Swing in mind and may not work well for a gameloop.

SHC -- Could you be more specific about your objections to the util.Timer? I've never had a problem with them, and there is nothing that I know about them that is specific to Swing. AFAIK, you can put any commands you want in them. You're not confusing the util.Timer with the Swing Timer, are you? I would agree that the Swing.Timer is not good for game programming due to performance issues arising from the potential EDT bottleneck.

Eventually, one can graduate to an Executor Service with a fixed schedule--that might be slightly preferable. But that would be a lot to learn for a Newbie. Better to get on with entity management, movement physics, collision detection, etc., imho.
14  Game Development / Newbie & Debugging Questions / Re: *solved* Updating & Rendering in a timely fashion on: 2014-08-28 23:04:24
In this section:
    while (System.nanoTime() < startTime + nanosToSleep) {
        try {
            } catch (final InterruptedException e) { }

...I'm not sure the Thread.sleep(1) command actually does what one thinks it should consistently on all systems. The sleep command depends on the system clock, which is a different time source than that of System.nanoTime(). (API for nanoTime() and Thread.sleep() elucidates this.) If you are on an old version of Windows, it might actually be sleeping longer than that.

Can also try the following:

// import java.util.Timer
// assumes also a reference to the "game"

    Timer timer = new Timer();
    TimerTask task = new TimerTask();

    timer.scheduleAtFixedRate(task, 0, 16);  

    class GameLoopTask implements TimerTask

It might be interesting to put in a counter to check the actual frame rate and compare.
15  Game Development / Game Mechanics / Re: Getting into multi-threading. on: 2014-08-25 21:21:43
I think princec's statement about restricting multithreading to situations that don't require synchronization or have dependencies is a good one. What I want to add is the point that if you learn more about "functional programming" techniques and use them, the set of possible situations that do not require synchronization or dependencies will grow, creating more situations where multithreading can be used without the synchronization headaches or complications.

Example of functional programming strategy: using an immutable object, from the Java Tutorials:
I often use a construction almost identical to this, collecting variables into one object. It's helpful, among other things, for keeping objects subject to multithreading in consistent states, and can work well with the paradigm of separating data/models/presentation.
16  Discussions / Miscellaneous Topics / Re: Best books for programming in general? on: 2014-08-22 23:03:49
LOL for ags1's recommendations!

I'm finding "Clean Code" by Robert C. Hunter helpful. Definitely the newer things I've written that follow his suggestions have proven to be easier to read and modify, and less buggy, than other code I've written.

I'd supplement his approach with learning more about functional programming techniques, but I don't know exactly what to recommend for that. A lot of the FP writing seems to take things to extremes, at least to my spotty programming knowledge and experience.
17  Games Center / WIP games, tools & toy projects / Tanpura / Drone / Tuning-training jar on: 2014-08-22 21:28:48
This is an alpha release of a tool/toy, not a game. The coding that went into it is also a stepping stone towards the goal of writing a real time game music engine. Procedural-generated tones respond to the real time tweaking of the controls, but the data structures used (for game music) could certainly be more sophisticated.

The jar file can be downloaded and tried from here:

The app produces a drone that can either be used for musical accompaniment or for intonation training. You can specify up to six pitches. I'd allow setting it for more, but the audio/synth processing needs to become more efficient first.

One thing that makes it different from most other drone tools is that it has very flexible tuning/intonation controls, allowing for easy "perfect intervals." It also allows you to tweak the intonation of a given note even further, as is often required when adjusting a Tanpura's tuning to a particular "shruti" of an Indian classical music scale/raga.

I've been using a prototype for intonation practice, setting the cycle to three notes (the tonic, fifth as a perfect 3:2 ratio, and octave) and playing pentatonic scales very slowly (on my oboe), pushing my intonation a little sharp or flat then honing in on the "sweet spot."

In the Options area, one can specify the type of notation used for the notes. I set the default to the Indian solfege system: "Sa Re Ga Ma Pa ..." but Western solfege or functional or interval or even absolute pitch names can be used. Changing the "root" on the front face transposes the entire drone.

Possible names (still deciding):
Shruti Devi (I don't know if this sounds okay to Indian ears--but I do hope to reach Indian musicians)
Drone Maester
Pitch Maester

I intend to put "Save/Load" buttons on the bottom. Was planning to use serialization of the data objects, but I want to first make sure I do this in a way that won't break if the feature set changes down the road!

I hope to add a couple more synths, e.g., a string synth patch. I also hope to improve the audio/synth engine performance, as there is stuttering when pushed.

Am open to more suggestions!
18  Game Development / Newbie & Debugging Questions / Re: Draw on an empty image... on: 2014-08-13 06:15:53
The usual way to draw and save images is with the BufferedImage object. You can get access to the individual pixels with a WriteableRaster. A BufferedImage can be drawn via the command drawImage.,%20int,%20int,%20java.awt.image.ImageObserver%29

19  Discussions / Miscellaneous Topics / Re: Life is like a strategy game sort off on: 2014-08-07 07:14:50
These arguments about "free will" trivialize consciousness, which is genuinely complex and problematic. Our actions are the result of many forces, most of them embedded in the environment and in over-learned, habitual behaviour, with only a tiny portion of consciousness able to review and try to change course. That ability is limited, and that ability is the most interesting aspect of "free will" to me.

If you want to consider something really interesting, check out the following article.

Experiment 1:

Subjects are given two paragraphs to read about a growing crime problem in a city called Addison. After they read the article, they are asked to make suggestions as to what might be done to address this problem. The answers differed measurably, affected by an embedded metaphor in the two paragraphs. Only a tiny fraction of the people taking this experiment listed this metaphor as having contributed to their reasoning process.

The paragraph was as follows:
Crime is a {wild beast preying on/virus infecting} the city of Addison. The crime rate in the once peaceful city has steadily increased over the past three years. In fact, these days it seems that crime is {lurking in/plaguing} every neighborhood. In 2004, 46,177 crimes were reported compared to more than 55,000 reported in 2007. The rise in violent crime is particularly alarming. In 2004, there were 330 murders in the city, in 2007, there were over 500.

Folks that read the "wild beast preying on" version tended to come up with "capture/enforce/punish" suggestions (e.g., hire more police, build more prisons, lengthen jail terms). Folks that read the "virus infecting" version where more likely to have "diagnose/treat/inoculate" suggestions (e.g., look for root cause, try to fix economy, improve education)  than the first population.

That's two measurably different responses on the conservative/liberal spectrum. Results were independent of politics, age or gender. In other words, self-identified liberals tended to suggest more of the punitive suggestions if they read the "wild beast" paragraph, and vice versa.

It is kind of astonishing to me how much the metaphor, a silly figure of speech, can have such a profound effect on the responses of people without them being aware of the manipulation.

You want to talk about "free will" and whether a brain can affect the position of atoms? I think it would be more pertinent to talk about our susceptibilities to such manipulations, to the strengths and weaknesses of conscious awareness. If you don't think this is much of an issue, I would point out that there are major think tanks devoted to crafting metaphors to use to frame discussions and thus influence political outcomes. We are subjected to this stuff all the time. We have it in out power to become more aware and less susceptible. That to me is a more important aspect of "free will." I really don't like the idea of being herded about this way or that without even aware of it.
20  Discussions / Miscellaneous Topics / Re: Life is like a strategy game sort off on: 2014-08-06 17:47:28
well i think it is like a strategy game, if you make the right choice/pick the right path you succeed, if you make the wrong choice or path you lose and got to face with the consequences of wrong thinking.

so before you make your choice, look at the consequences! Smiley

what do you think life is?

A really great game will either provide a rich mine of metaphors and ideas that one can apply to one's life, or it will be a much appreciated escape from the same.

There's no way of knowing how a strategy game's paths are mapped. There can be many different roads to success. The game can be tight or easy. There can be possibilities of redemption built in, or sudden death. A lot more depends on the game than the choices made.
21  Game Development / Newbie & Debugging Questions / Re: Why does my if statments stop working when I remove System.out statments on: 2014-08-01 18:37:56
@Kevin - I think you are right about this example. I just got triggered by the mention of Swing.Timers.

22  Game Development / Newbie & Debugging Questions / Re: Why does my if statments stop working when I remove System.out statments on: 2014-08-01 07:10:34
Yikes! Since when is it recommended to do the "update" part of a game loop on the EDT?  Shocked  The presentation layer has plenty to do without having to do updates as well. You lose multi-core benefits if everything is done on the EDT. This is a big reason why the Swing timer is so terrible for getting good frame rates. "Killer Game Programming" has a classic comparison of game loops versus the use of the util.Timer versus the Swing.Timer, and the Swing.Timer gets clobbered big time. It's really not a recommended option for a game loop control. (util.Timer passes their tests, though).

Ideally, the game loop update() code should not act on any Swing components directly. It should only be acting on the "model" layer, the underlying data. Sometimes we get lazy and and use the .value method of a given control, rather than posting that value to a model-layer variable. Sometimes we get away with it, other times it leads to debugging headaches.

The render() code (aka "presentation" layer) can refer to the model data as needed to determine how to render, but it should only read, never change anything at the "model" level. The render code can/should all be on the EDT. AFAIK this happens automatically when you act on a Swing control.

When I first saw the code you wrote, I was highly suspicious of some of the practices such as executing a function within the println method. It is kind of asking for trouble and difficult debugging. That function could easily be hiding side effects. If that function changes anything in your underlying data or game state, then deleting or commenting out that comment could have very unpredictable effects.

There is a really good book on Java coding style that I'm re-reading at the moment. I highly recommend it. The emphasis is writing code that you (or anyone else) can read and debug easily, even 6 months or 6 years after the code was written and it is stone cold in your mind.

Robert C. Martin "Clean Code -- A Handbook of Agile Software Craftsmanship"
23  Game Development / Newbie & Debugging Questions / Re: Paulscode - Soundsystem - Load from bytebutter? on: 2014-07-31 23:24:44
I had to search "wad file architecture" and found a reference to Doom. Is that what you mean?

How are you creating your jar? From an IDE?

If you are doing it from a command line, you can do so with the following syntax:
jar cf jar-file input-file(s)

input-file(s) can refer to a folder. But I've never done it this way. It might be a bit tricky figuring out exactly how to address the file via getResource() method.
24  Game Development / Newbie & Debugging Questions / Re: Paulscode - Soundsystem - Load from bytebutter? on: 2014-07-31 21:40:48
Maybe I don't understand the question. If your audio resources are in a subfolder of the source code, then it should be automatically packed inside of the jar.

For example, I have a package called pfaudio. In it is a class which is used to play wav files. The package also has a subfolder "audio" which has wav files in it.

The code used to get the wav file follows:

      URL url = PFAudioMixer.class.getResource(fileName);
      AudioInputStream ais = AudioSystem.getAudioInputStream(url);

where fileName = "audio/Boom.wav" and PFAudioMixer is a class in the pfaudio package.

To make the jar, I use Eclipse's functionality. There is a point in the process where it is possible to check or uncheck specific folders for inclusion in the jar. The default is to include all the subfolders of whatever folder you are in at the time you click on the utility.

A similar thing can be done with graphics resources.

I recall that princec has made the code available for his Titans game, and if I remember correctly, he may have had it setup more like you describe where the files loaded are raw PCM data, not actual wavs. My memory is hazy on that. There was something unusual going on, but I can't recall just what.

TinySound is a decent alternative to Paulscode, and afaik, Finn is still supporting his project.
25  Game Development / Newbie & Debugging Questions / Re: requst for newbie overview tutorial on porting options on: 2014-07-31 19:02:06
 Clueless  Huh  Clueless  Huh  Clueless
Ok, I understand that using LibGDX requires the use of graphics commands that are unique to LibGDX, that are built upon OpenGL. Correct? Now, if you have already written graphics via Java2D in a "core-Java" game, the rewriting for the graphics is kind of a big deal, due to the fact that OpenGL is not exactly object-oriented. There are structural differences. Correct?

If you use Avian as an embedded VM, does anyone know how graphics are done? Avian does not include Java2D. I'm sorry if this is a totally noob question, but I am new to the concept of embedding VMs.

Similarly, several have mentioned RoboVM. Is that also a VM? I got confused and thought that I could use it to crank out code that I could then deliver to an Obj-C programmer. Is it actually a VM that runs Java? The mention there is a Java-to-ObjC bridge, so does that mean one will be required to rewrite the graphics to make use of the graphics commands provided by that bridge? If so, how does that compare to rewriting to LibGDX/OpenGL?

My immediate concern is simple 2D stuff, no 3D.
26  Game Development / Newbie & Debugging Questions / requst for newbie overview tutorial on porting options on: 2014-07-28 21:13:32
It would be nice to have in one place a tutorial on the current porting options (java to android, java to ios).

I'm seeing, for example, in going from Java to ios:

 - hand write code yourself (maybe not a terrible option, given Obj-C has a fair bit structurally in common with Java due to SmallTalk roots, but of course depends on the scale of the game and the use of libraries)
 - Avian
 - RoboVM
 - LibGDX
 - java2objc
 - multistep sort of thing: java to javascript/android, then javascript to obj-c as there are possibly more JavaScript to iOS options than from Java?

But for a Newbie, there is a lot of issues and steps involved that aren't immediately made clear by going to the various home pages for these resources. For example, if an embeddable VM has a reduced set of Java implemented, how are graphics and other IO (sound, mouse, touchpads, etc.) dealt with in each option?

Just an overview would be good, no need to get too detailed.

I'd write it myself if I were capable, but I don't have the needed knowledge. I'm pretty sure there are folks here that are well acquainted with the options and pros & cons of each.

I can guarantee I'd be one of the first to "appreciate" this if it were available. (Maybe there is already link at JGO I've overlooked?)
27  Game Development / Newbie & Debugging Questions / Re: Can someone teach me Perlin Noise? for my 2d game? on: 2014-07-28 20:59:11
Roquen has a great tutorial post here on JGO.

SiVi is an open-source project of mine that uses Ken Perlin's 3rd version of random noise (known as Simplex Noise). There is not a lot of explanation, but it does have examples of different outputs (including a topo map), and a hands-on interface where you can vary parameters and see what effect they have.

SiVi also has a pretty simple working code example in the "help" area with lots of comments, including some notes on how to make a topo map. You can download a jar and get immediate access to this via the following link.

In the below image (not the greatest terrain example, I'll admit), is an example of a mapping to a color bar with 256 increments (on the right) to get terrain. The number ranges and colors I choose are arbitrary. You can define your own for game purposes (e.g., 0 to 63 = water, 64 to 127 = forest, etc., and map to graphics used for those topo features, rather than to color gradients.

More SiVi info & examples, but will eventually expire:
This post also has a link to an interesting slide show by Ken Perlin.

Since the project is open source, you can also sign up on github ( and poke around the code that way.
28  Discussions / Miscellaneous Topics / Re: Game art for programmers with non-existent budgets on: 2014-07-27 03:18:55
You can use SiVi to make some interesting textures. Either use the app settings to write code to recreate the textures procedurally or export them as pngs and import them as assets. Once in, you could, say, fiddle with their alpha channel and overlay them on other graphics, perhaps. The ColorBar that is used can be something simple like a progression from on solid color to another. Clouds, of course, but also certain waxy crayon-like texturing is also easy to do.
29  Game Development / Newbie & Debugging Questions / Re: Runnable jar doesn't play WAV formats on: 2014-07-25 21:42:40
FYI, just in case you aren't aware of this, there are a lot of issues pertaining to audio formats besides whether something is a WAV or not. I apologize if I am mentioning something you already know, but the posts you gave allow an ambiguous interpretation.

It can be stereo or mono, and the bytes can be in either little-endian or big-endian order. It can be 16, 24, or 32 bits encoding. And concerning frame rates, I think (I could be wrong) that 44100 is the maximum supported by Java, but some DAWs are now working at 48000 or 96000 fps. If any of these parameters are varying between the samples, then the formats could be an issue.

I think I also had some trouble once when I designated the 'compression' option when generating a jar in Eclipse for the resource files. This might make a difference as well, though admittedly WAV files are pretty large if they aren't compressed, and this might make using some sort of compression (at some stage or another) mandatory.
30  Game Development / Newbie & Debugging Questions / Re: Java Metronome | Visual Display Sync Problem on: 2014-07-17 23:33:07
I’m not sure I understand what you mean by the “standard technique of calculating the varying amounts of compensating Sleep” you mean calculating the delay by checking the system time and then sleeping for that amount of time, or something else?

It's a way of getting a "fixed time" loop. At the start of the loop, obtain the current nanotime. Do the loop's tasks: the update and render, then check the time again. If the "fixed time" amount has not elapsed yet, calculate and sleep the amount of time required to fill out the interval. Even fancier if you want to code it: if you have previously gone over in terms of processing time for a given frame, a fixed time loop algorithm can be written to "play catch up" by going a bit shorter (if there is time left over this iteration) than the required fixed time amount, until the frame loop is back at the correct time slot.

To a large extent, the timing issues that are discussed on that past thread that you quoted are no longer so important. AFAIK, the new Microsoft OS's use a faster system clock now. At that time, it only updated every 15 or 16 milliseconds. In other words, if you aren't expecting to market to Windows XP users, not to worry.

IMHO, the scheduleAtFixedRate type scheduling is perfectly adequate. Regardless of method, if the update and render takes longer than the scheduled time, you are going to get slippage in the frame rate. I don't see how the distinction "heavy lifting" actually means anything useful in this context. Either the tasks can be done within the designated frame rate or they can't. The wrapper for that code should have little or no influence on the execution speed of the tasks being wrapped.

A little slippage in frame rate may not even matter, as long as you are cleanly updating and reporting the metronome state at the time that the frame executes.

I continue to suspect that you might get more accurate scheduling with the scheduleAtFixedRate use of the util.Timer, versus calculating the variable sleep interval yourself, depending on how the Java engineers have implemented this internally. (I assume they know what they are doing.)

Maybe someone with a different opinion will speak up. Usually we hear something if I make an inaccurate remark. But given my tendency to tl;dr posts, perhaps my controversial statements are just be being overlooked.  Smiley

If you want to, you can also look at the ScheduledThreadPoolExecutor as an upgrade to the util.Timer. This gives you some additional exception handling capabilities (in case the TimeTask throws an unchecked exception). Learning about ExecutorServices and what Brian Goetz ("Java Concurrency in Practice") describes as "exploitable parallelism" is probably overkill. It would certainly be an interesting and very involved side trip! I'm in no position to evaluate the pros and cons.
Pages: [1] 2 3 ... 34

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

The first screenshot will be displayed as a thumbnail.

radar3301 (11 views)
2014-09-21 23:33:17

BurntPizza (29 views)
2014-09-21 02:42:18

BurntPizza (19 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (27 views)
2014-09-20 20:14:06

BurntPizza (30 views)
2014-09-19 03:14:18

Dwinin (47 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (102 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08 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!