Advice for my application
I know I may be asking a lot of questions (but I am getting the hang of the program for the most part). I have solved a number of my problems with trial and error, and have received a lot of help from both here and from The Daily Click. But I need advice on something:
My application has the following specs:
Main application is run from Frame 1, with 2 sub-application objects which link to separate frames in the application.
Sub-application 1 is a popup menu with the following:
--110 counters (all of which link to global values)
--61 Active picture objects
--6 string objects
--3 text blitter objects
--3 buttons
--2 active system boxes
--2 active objects
sub-application 2 is a tiny popup, and contains:
--14 active system boxes
--12 buttons
--54 counters (also linked to global values)
--6 edit boxes
The main frame which houses these 2 sub-applications also has:
--100 active objects (which constantly obtain external pictures at runtime based on counters)
--25 active pictures (which constantly change pictures at runtime based on a counter's value)
--about 100 active system boxes and bg system boxes
--2 screenshot capture objects
--2 txt blitters
--104 counters (each set to retrieve global values at runtime)
--3 color selectors
--10+ edit objects (which send data to global values and strings)
--20+ active picture objects (11 of these constantly change pictures at runtime based on a counter)
This is 90% of the program. My application relies heavily on counters to alter everything. Everything works (for the most part) as I want it to. But my biggest problems are:
--the application only uses up to 30K memory
--It uses a lot of the CPU and it slows way down the longer it is running.
I'm sure that I'll be told I am pushing the application way too hard by having built this thing the way I did. Can someone offer some advice to speed it up and use less CPU?
Please help me :(
Re: Advice for my application
Cpu usage mostly depends i think on the code.
And memory usage is mostly for graphics.
So you should probably go through your code and optimize stuff.
Re: Advice for my application
that would require me to rewrite the entire application XD...which would be its fourth rewrite. Maybe this will help:
almost every object has its own set of behaviors
Re: Advice for my application
What are you using all of those counters for? Why so many? If it's just variables you're after, use an array, or even a handful of actives and use their 26 alterable values instead of 100+ counters.
Just judging by the amount of objects you're using, it looks like you're doing things extremely inefficiently. What exactly is the application doing? Can you shed light on that or is it a secret? =p
Re: Advice for my application
It's not really that big a secret. Alright I'll level with you:
I am trying to recreate this program:
http://www.youtube.com/watch?v=UGmASy1LlIw&NR=1&feature=fvwp
http://www.youtube.com/watch?v=zRCMNzuOEks&NR=1
These YouTube videos demonstrate exactly what I am trying to accomplish....down to the basics.
This program requires an MMORPG to be installed into your computer, which some people do not have--additionally it takes up to 5 B of space in the hard drive. Another program, just like it, can also load the images (which are located in inaccessible archives in the game folder). However the creators of the game did not compress the images (ALL BMPs) and the archives range upwards into the GBs. I wanted to make it possible so that people did not have to rely on having to download one or more 3 GB+ games just to use the character creator. It was essentially supposed to combine two games' characters and equipment into one mega program.
I wanted my version of the program to be much more compact in that it did not have to sort through a 300 MB archive to display the images. But I cannot seem to get mine to run as smooth as this program.
Is there some kind of example I might be able to follow?
Re: Advice for my application
One thing that would speed it up a lot would be to lessen the need for these "constant" updates. What exactly is required to load constantly? Having hundreds of images loading externally every loop is going to slow things down quite a bit.
From those youtube videos I'm not seeing a reason to be loading images constantly. The item list just has the same images displayed unless the user changes what items to display. The character only changes when selected from a list. I suppose if each animation frame is a separate image that needs loading, you'd have to account for that and load each frame in over time... but I don't think that alone would cause a huge slowdown.
Re: Advice for my application
There is a 'play' button, stop button, forward one and backward one frame buttons. This was the reason for the counters. I tried to use the animation object but it did not allow me to replace colors like an active object, which is what I want it to do