The problem is that the official sprites are not really made for clarity - if you scaled them down even more, you'd be squinting to see where to click to select a unit, especially with all the shadows. The ideal solution (and one that wouldn't get you in legal hot water) would be to create a simplified sprite sheet that accommodates for a less protracted play style (given AoE matches can last hours) and remains easily identifiable even when scaled down using a nearest-neighbor or equivalent cheap downscaling algorithm.

As for downscaling performance, I need a comparison between per-sprite scaling and per-frame scaling. If per-frame scaling turns out to be faster, what can be done is that a frame larger than the active game window is rendered and then scaled down proportionally to the size of the active game window. Otherwise you'll end up making a procedure to load in sprites to VRAM and then immediately make a scaled-down version of them. If there's no space in VRAM to fit everything, just make an allocation system that works as follows:

For each object being drawn on the screen, check where it is in VRAM (based on scale) according to some table/index. If it is not in VRAM, try to allocate it in VRAM. If VRAM is full, first try to deallocate sprites that are a larger scale than the object being drawn (but if this is scale 1, then clear sprites from scale 4 working toward scale 1 until enough memory is available). In theory, deallocating just the larger scaled version of the object being rendered when working in a smaller scale should be enough. However, if there are too many objects on screen while a frame is being rendered (such that all the sprites can't fit into VRAM at the same time) and the renderer is double buffered, then no artifacting/flashing will occur, just a slight frame drop.
The last screenshot I posted was about 2 FPS (it took 20 million clock cycles), but I made some changes which speeds it up. First of all, I've decreased all buildings to 50%, to see more buildings at the screen. This lifts the FPS up to about 9. Next, I heard Runer112 and Mateo are writing a new TransparentSprite routine, which could lead to an FPS of maybe 20 or even more. But while that routine is not available yet, TheMachine02 decided to write a special routine for me, which displays only the isometric tile, not the transparent corners. The unclipped version was about 7 times faster than the clipped TransparentSprite routine, but he needs to add clipping to it, so I don't know how much faster it would be. My last point is that I'm now going to write a routine to display only a part of the tilemap. My current routine is just 2 For-loops, but that is bad, because with large maps 90% of the tiles will be entirely offscreen, so if my routine just stops with drawing if the tiles are offscreen, I could save a lot of time, which lifts the FPS again up! Rolling Eyes
Are you going to implement all of the terrain types as well, PT_? and water and ships and stuff?
Terrain types: yes, I think so, because rendering is just the same. Water and ships: yet not, very maybe in version I, and otherwise in version II.

Good news: I found this thread: http://www.java-gaming.org/index.php?topic=24922.0 which explains pretty well how to draw only a part of the isometric tilemap, and hopefully it is enough to speed it up a lot Smile
That looks like it will be quite helpful to you PT_! Very Happy
PT_ wrote:
Terrain types: yes, I think so, because rendering is just the same. Water and ships: yet not, very maybe in version I, and otherwise in version II.

Good news: I found this thread: http://www.java-gaming.org/index.php?topic=24922.0 which explains pretty well how to draw only a part of the isometric tilemap, and hopefully it is enough to speed it up a lot Smile


There is another problem: these algorithms do not account for the height of each tile. You could have a very tall tile but it would just "pop" in only when its base is within the bounds of the camera.
Oh wow yes you definitely want to limit overdrawing!
oldmud0 wrote:
There is another problem: these algorithms do not account for the height of each tile. You could have a very tall tile but it would just "pop" in only when its base is within the bounds of the camera.

Yes, but I never said heightmaps will be implemented Razz These are way too hard to implement now, so I will just leave the map flat.
tr1p1ea wrote:
Oh wow yes you definitely want to limit overdrawing!

Yes exactly Wink
PT_ wrote:
oldmud0 wrote:
There is another problem: these algorithms do not account for the height of each tile. You could have a very tall tile but it would just "pop" in only when its base is within the bounds of the camera.

Yes, but I never said heightmaps will be implemented Razz These are way too hard to implement now, so I will just leave the map flat.

That isn't what oldmud meant. Your sprites for your buildings are huge. You can't just use tile calculations to figure out which ones should be drawn; because you *do* have height in your tilemap.
So I think the problem is that I can't know if a building is partially on-screen or not, but I guess that has nothing to do with tiles. I can maybe just set a common heigth for all the buildings, so if the Y coordinate is more than 239 + <standard height = 200 or so>, that I won't be drawn, and if the building is exactly 199 pixels height, and it will be drawn at Y coordinate 240, then I will still display it, although it's fully offscreen. That is I think the fastest way to do it, and the only other way I can think of, is first checking the height of the building, and then check if it's entirely offscreen.
'Long' time no update, I was pretty busy with exams and stuff, but I picked it up again, now that I have some more free time, and decided to implement the algorithm I already mentioned before. But the problem is that that algorithm doesn't work fine, and I don't know how to quickly solve it Sad

The algorithm is basically like this:


with this code:

Code:
{...}
        boolean nBump = false, mBump = false;
        int n = 1, nStart = 1, nBuffer = 1;
        int m = 1, mStart = 1, mBuffer = 1;

        for (int i = iStart; i < iMax; i++) {

            // Testing Purposes
            // Sleep 1 second each i iteration and paint the screen
            // TODO
            // .......


            for (int j = jStart - n; j < jStart + m; j++) {
                // paint the column
                colArray[ hWrap(i)][ vWrap(j)].paintAll(g);
            }
            // adjust m and n to keep us within the screen

            // adjust n
            if (!nBump) {
                //we have not yet reached the lowest j point
                // increment n to go even lower next iteration
                n++;
                // Check if we have reached the lowest j point
                if ((jStart - n) == jMin) {
                    nBump = true;
                    //System.out.println("Bump N");
                }
            } else {
                // we have reached the deepest j and are now going back
                // start decreasing after the buffer is gone
                if (nBuffer > 0) {
                    nBuffer--;
                } else {
                    // The buffer is gone, start decreasing n each iteration
                    n--;
                    // check that n never exceeds its starting point
                    if (n < nStart) {
                        n = nStart;
                    }
                }
            }

            // adjust m
            if (!mBump) {
                // we have not yet reached the HIGHEST j point
                // increasee m to go even higher next iteration
                m++;
                // Check if we have reached the highest j point
                if ((jStart + m) == jMax) {
                    mBump = true;
                    //System.out.println("Bump M");
                }
            } else {
                // we have reached the maximum j point
                // and are now moving back.
                // start decreasing m after the buffer is gone
                if (mBuffer > 0) {
                    mBuffer--;
                } else {
                    // The Buffer is gone
                    // decrease m each iteration
                    m--;
                    // check that m never exceeds its starting point
                    if (m < mStart) {
                        m = mStart;
                    }
                }
            }
        }
    }
}


But if I do almost the same steps in my own tilemap, I get this:

(I assume now that the blue rectangle is the visible screen)

The orange line is how it should be, but the yellow line is the outcome of the algorithm.. Anybode that can help me out? Smile

EDIT: 1 minute after posting, I got the solution... I need to change nBuffer to be not 1, but the amount of tiles that can fit horizontally in the screen... Sorry for disturbing you Wink Rolling Eyes
Wow, this game has incredible graphics! Is it 3d, or 2d with very 3d looking sprites?
Got a non-working homescreen done! Very Happy



Total size of the images is around 15K.
Thats really awesome looking! Very Happy
I've uploaded all the files to Github, in case anyone wants to help or give tips.

https://github.com/PeterTillema/Age-Of-CEmpires-I

Pass one...
Pass two...
Size of graphics appvar 1: 21696
Assembly time: 0.018 seconds
Pass one...
Pass two...
Size of graphics appvar 2: 42498
Assembly time: 0.030 seconds
Pass one...
Pass two...
Size of main program: 1311
Couldn't open listing file 'bin\aoce.lst'
Input File: bin\aoce.8xp
Output File: bin\aoce_.8xp
[err] Unable to open input file.
The system cannot find the file specified.
The system cannot find the file specified.
Press any key to continue . . .


What am I missing?
I have everything the readme says I need to have.
well, as the errors suggest, the system cannot find some files. Double check you have apce.8xp in /bin/ and aoce.lst in /bin.

I don't know much ubout compiling asm, but it seems like it cannot find those files, so check if they are there. also, if they are there, that may mean that environment varibles are being used, and you don't have them set, and and if that is so, i assume arent mentioned in the readme. (?)
TheLastMillennial wrote:

Pass one...
Pass two...
Size of graphics appvar 1: 21696
Assembly time: 0.018 seconds
Pass one...
Pass two...
Size of graphics appvar 2: 42498
Assembly time: 0.030 seconds
Pass one...
Pass two...
Size of main program: 1311
Couldn't open listing file 'bin\aoce.lst'
Input File: bin\aoce.8xp
Output File: bin\aoce_.8xp
[err] Unable to open input file.
The system cannot find the file specified.
The system cannot find the file specified.
Press any key to continue . . .


What am I missing?
I have everything the readme says I need to have.


You've gotta make a new bin folder inside of Age-Of-CEmpires-I-master and put aoce.asm inside of it
Yep, you have to make an empty bin folder before, I didn't mention it sadly, and Github doesn't like empty folders Sad

EDIT: I added something to the batch file such that it checks if the bin folder exist, and if not, it will create it.

Pass one...
Pass two...
Size of graphics appvar 1: 21696
Assembly time: 0.021 seconds
Pass one...
Pass two...
Size of graphics appvar 2: 42498
Assembly time: 0.033 seconds
Pass one...
Pass two...
Size of main program: 1311
Assembly time: 0.142 seconds

Input File: bin\aoce.8xp
Output File: bin\aoce_.8xp
Calculator Name: AOCE
Archived: No
Success!

Decompressed Size: 1298 bytes
Output Size: 1162 bytes
Press any key to continue . . .


Success! Thank you everyone! Very Happy
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
» View previous topic :: View next topic  
Page 2 of 10
» All times are UTC - 5 Hours
 
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

 

Advertisement