Help - Search - Member List - Calendar
Full Version: Fireworks thingy
Krazy Letter Forums > Members stuff > Computer Programs
Mynck
Ok Ok Ok OK
So the thing is at http://myncknm.bravehost.com/Fireworks

I've been having problems with the saving of random bytes into a string that can be copied-and-pasted. I'm thinking instead of just having the ppl copying and pasting text, I'll have to store these things into a file. But that means the thing will have to be an executable jar file, or stored on the client's computer in some other way. I don't know how to write to or read from a file on the client's computer from an applet yet, and I frankly don't want to, because it's probably way overcomplicated. So I guess it's time to re-write a bunch of this to make it open in its own window.


-----Edit-----

Updated version loaded, now in a non-executable jar file for faster loading!
Mynck
*bump*
Um yeah. I seem to be getting an "out of heap space" error. Anyone tell me how to use less heap space?
Mynck
New applet uploaded, now with variable frame rate! That way, even if the thing lags horribly, the fireworks will keep moving at an approximately constant rate. Also, it looks cooler if you have a fast computer. Also the thing is now partially buffered bit by bit to prevent most out-of-memory errors. It still has a bit of a problem with them, though, so if the thing suddenly stops, it's most likely an OutOfMemoryError.

Oh yeah, and if the applet ran out of time or space to do its buffering, then the tails of the things show up as white.

http://myncknm.bravehost.com/Fireworks


-----Edit-----

If you get an OutOfMemoryError (you can tell by right-clicking and clicking on "Open Java Console"), then you must click "Stop." If it unloads before you do this, the applet will not work again until the browser is restarted.
If you don't get the option to option java console, then your version of Java is outdated. Use Sun Java 2 1.5.0
Mynck
*bump*
Updated again! The variable frame rate thing has been improved, the fireworks are no longer so huge, the buffering is done so that how much information will be buffered each time is known so that it doesn't overuse the memory, and a error handler has been added, so that it tells you when an error happens, which would usually fix itself, especially if it was an out of memory, which have now become much rarer. Woah, long run-on sentence. Oh yeah, and the general speed and memory efficiency has been improved by a little bit too.

http://myncknm.bravehost.com/Fireworks


-----Edit-----

Please report all errors (except for the out of memory one) to me, including all information shown on the error report.
lappy512
besides that it flickers and lags and uses too much CPU? not really. biggrin.gif

Try using OpenGL on top of Java.
Mynck
I already fixed the flickering. I was testing out something I thought might reduce lag. It didn't work. And I think the main reason it lags so much is that I wrote the code to create and discard too many objects, and the garbage collecting takes longer than I thought it would.
lappy512
impressive, the flickering is much less, but still noticable flickering in some parts. MUCH FASTER, what did you do to optimise it?
Mynck
Um, I don't remember that I did much to optimise it, except cut out a few variable, lower the types of the most created variables, and make the frame rate changing thing more sensitive.
lappy512
hmm, seems much better now, but it still lags a bit on some graphics.
Mynck
Well, after some inquiery at the Sun Java forums, it turns out that the reason that the values of Color objects cannot be changed after the creation of the Color, is one that doesn't apply to how I'm using it. So I went and subclassed Color, and added a few functions to lessen the amount of processing done, and dramatically reduce the amount of memory that's used and then cleaned up by the CPU-consuming garbage collector. Also allocating memory takes time. This means an estimated 36B/c * 1000c/f * 30f/s = 1.08MB/s, where c=Color and f=frame.

So in summary, this saves me, and the CPU-consuming garbage collecter, from dealing with a little more than one whole megabyte per second. However, I've not fully implemented this yet. It's going to take a lot of rewriting, but I'll be done with these changes within the week.
Mynck
*bump*

I've decided to discontinue this thing because... well... the whole original idea was flawed (creating thousands of objects a second). I also have better things to do now... more useful things... things that'll attract millions of people to a website (i hope)...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.