Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


BRAIN FART :D

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam
View previous topic :: View next topic  
Author Message
Evil_Intentions
Expert Cheater
Reputation: 65

Joined: 07 Jan 2010
Posts: 214

PostPosted: Thu Jun 30, 2011 10:13 am    Post subject: BRAIN FART :D Reply with quote

I found a new way to handle making the fractal string in FractalGen. Fractals that once took up to a minute to process (9th orders and up mostly) can now be done in about 5 seconds Very Happy
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Jun 30, 2011 10:25 am    Post subject: Reply with quote

bet i can get it down to less than 1 second
Back to top
View user's profile Send private message
Evil_Intentions
Expert Cheater
Reputation: 65

Joined: 07 Jan 2010
Posts: 214

PostPosted: Thu Jun 30, 2011 11:21 am    Post subject: Reply with quote

Slugsnack wrote:
bet i can get it down to less than 1 second


Pretty sure you could, But I'm not that much of a tinkerer. I used to have it iterate through the atom string and construct the next order string as it iterates. So character by character. Now it does them all at once, replacing all the Fs with it's string, Xs with it's string etc.

I'm also doing the drawing to a buffered image, then loading the buffered image into the panel so it isn't redrawing the entire fractal while you scroll. I believe that was something you had suggested I do right?

The only problem now is that I get out of memory errors when trying to create large pictures. The max I can get is around 4609X4609. Which is the normal size of the 8th order attached, although I'm sure the forum will resize it.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Jun 30, 2011 11:53 am    Post subject: Reply with quote

if you want to avoid the memory issues don't put the whole bufferedimage onto the screen. only show the part which is currently on there. cache the surroundings in memory then store the rest on disk or something. so you have a virtual image instead. i don't know if there's already an existing library to do this. probably there is
Back to top
View user's profile Send private message
Evil_Intentions
Expert Cheater
Reputation: 65

Joined: 07 Jan 2010
Posts: 214

PostPosted: Thu Jun 30, 2011 11:57 am    Post subject: Reply with quote

Slugsnack wrote:
if you want to avoid the memory issues don't put the whole bufferedimage onto the screen. only show the part which is currently on there. cache the surroundings in memory then store the rest on disk or something. so you have a virtual image instead. i don't know if there's already an existing library to do this. probably there is


The error isn't from displaying the bufferdimage, it's whenever I create it. See after I create the fractal instruction string, I iterate through it to create bounds so the entire fractal is visible. Then I create a bufferedimage with those bounds before drawing the fractal to it. It's whenever I create it:
Code:
image = new BufferedImage((int) refX2 + 1, (int) refY2 + 1, BufferedImage.TYPE_INT_ARGB);


That's when the error occurs.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Jun 30, 2011 12:01 pm    Post subject: Reply with quote

yes but if you store the image on disk, you can just read a certain portion of it out and display that as a bufferedimage each time. also you'd need to store it as you go along when creating
Back to top
View user's profile Send private message
Evil_Intentions
Expert Cheater
Reputation: 65

Joined: 07 Jan 2010
Posts: 214

PostPosted: Thu Jun 30, 2011 12:07 pm    Post subject: Reply with quote

Slugsnack wrote:
yes but if you store the image on disk, you can just read a certain portion of it out and display that as a bufferedimage each time. also you'd need to store it as you go along when creating


I see what you're saying now. I thought you meant just store the whole image to disk, not store it as I create it, presumably deleting the portion I don't need of the buffer.

I have a question though. I don't think it is entirely the image causing this problem, as the saved image(which uses the same buffer) is only 200 sumthing kilobytes. Do you think it could be the fractal string? It's a single string containing millions of characters.

EDIT: Just answered my own question. Millions of characters equals megabytes of memory. It's the string that I need to save to disk and parse is little bits, not the image.


Last edited by Evil_Intentions on Thu Jun 30, 2011 12:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Jun 30, 2011 12:11 pm    Post subject: Reply with quote

millions should be okay to be honest. you can test it out for yourself though. just comment out the code doing the image generation and see if it still throws the exception
Back to top
View user's profile Send private message
Evil_Intentions
Expert Cheater
Reputation: 65

Joined: 07 Jan 2010
Posts: 214

PostPosted: Thu Jun 30, 2011 12:16 pm    Post subject: Reply with quote

Slugsnack wrote:
millions should be okay to be honest. you can test it out for yourself though. just comment out the code doing the image generation and see if it still throws the exception


Read the edit above. I am correct that 1 character is 8 bits or 1 byte right?

I just tried commenting out the drawing portion. I still got errors, although I had to use a higher order to get them. Mostly because I think it was the little extra memory the image used up that was enough to cause the error.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Jun 30, 2011 12:20 pm    Post subject: This post has 1 review(s) Reply with quote

it's 16 bits actually since it's unicode:
http://download.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
Back to top
View user's profile Send private message
Evil_Intentions
Expert Cheater
Reputation: 65

Joined: 07 Jan 2010
Posts: 214

PostPosted: Thu Jun 30, 2011 12:27 pm    Post subject: Reply with quote

Slugsnack wrote:
it's 16 bits actually since it's unicode:
http://download.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html


Ah. So I need to stream the instructions into a file while creating them, and stream them out as I'm drawing.

Will work on that later, but for now, Katamari :3

Thanks slugsnack.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites