Resolution

Do you have suggestions or ideas for improvement, post them here and we will them out.

Resolution

Postby Draxus » Wed Dec 07, 2011 9:53 pm

Is there a way to force low or high resolution? I am here at work at a University Music Library and the supposed high speed internet is slow as balls. (Yes balls are slow unless the ONE you are talking about belongs to Lance Armstrong, his is FAST!) Would it increase the speed of moving units if it were on low res instead? At home it seems my units zip along but here I am watching step...step...step...step...

On the other side I have had a fast internet connection for some reason come up as low res when I load the game.

A way to force resolution, if it helps my problem at all, would be great.
Draxus
 
Posts: 104
Joined: Mon Nov 07, 2011 11:19 pm

Re: Resolution

Postby KGB » Wed Dec 07, 2011 10:31 pm

Draxus,

You can type low/high directly into the URL once you are into your turn.

I too experience this exact same problem (Firefox) where it can take 15 seconds to move a unit 5 squares. Except at work where I have a slow connection, the game is very speedy and at home where I have a much faster connection (not shared) it's exactly as you describe.

What I've found is that when I look at home, I see Firefox is using 50% of my CPU (one core) just 'sitting there' doing nothing not moving units. And it's only on games with Fog of War. Games without fog are 10x faster to move.

There are only 2 differences between my home and work machines

1) The CPU (home it's an AMD, work it's an Intel)
2) Windows (home it's 64 bit, work it's 32 bit)

My guess is one of those differences really matters for Firefox at least. My guess is that SnotlinG's code to do FogOfWar calculations must be repeatedly running over and over causing endless re-draws because it's the one thing that causes the game to run slow and if I minimize the browser during the movement phase and then maximize a second or so later the unit 'appears' at it's destination. It's literally the only way I can play now.

I've tried typing low/high and it has not helped me much at all. So I will be curious to see what you report and if you know what CPU/Windows versions you have on your two machines.

KGB
KGB
 
Posts: 3030
Joined: Tue Feb 16, 2010 12:06 am

Re: Resolution

Postby piranha » Thu Dec 08, 2011 7:49 am

The number of tiles on the screen matters very much so you can shrink the window size a litle bit and refresh, it will make big impact. If you have the ability to use Chrome or Opera that will also make it faster.
There is also some bugs, if you open a city and click the buy screen then close the city scrolling /moving units will become very slow. Open a city again and close it without going to the buy screen and it will be much faster again. Same thing with battles, open a battle without viewing the battle will cause slowdown. This is fixed in B5.

Highres / lowres only changes where the right side buttons are located. If the screen res height isn't high enough the buttons will be outside the screen with the highres setting.

We have tried a lot of different things with the drawing speed.
Fow of war is a transparent image and browsers aren't very fast at drawing that especially not with all the other things going on.
We have done some optimizations when it comes to drawing speed for Beta5 so hopefully it will be slightly faster + some bugs with cities/battles are fixed.

When you add the animated water and FOW thats when you get constant CPU load. It seems like transparent image over animated gif is heavy.
When we added deep water in B4 the CPU load went up a bit more so I have thought about removing deep water for performance reasons. I have tried many different ways of animating in the browser but we haven't been able to make it faster with other animation techniques.

There is one more thing I want to try which is changing from DIVs to the new HTML5 Canvas tag. It is supposed to be much better at graphics so it could be much faster. But that's a really big change. It will require to rewrite quite a lot of the draw engine. But I think we will check that out when some other things on the todo are completed.
User avatar
piranha
Site Admin
 
Posts: 1188
Joined: Fri Feb 12, 2010 9:44 pm

Re: Resolution

Postby KGB » Thu Dec 08, 2011 5:29 pm

Piranha,

Thanks for the explanation.

Screen size doesn't seem to affect me much in terms of speed. My work PC is 90% the size of my home screen and I doubt that last 10% makes a 10x speed difference. But what you say makes sense obviously.

The bugs you mention I have noticed as well. Basically any pop-up screen seems to cause everything to slow down afterward. Whether its replaying battles, the chat window, the city screen or the conquer screen. I've learned to always hit the refresh button after opening any pop-up.

The Fog of war transparent problem gets worse as the turn continues. In other words, when I start a turn my units move reasonably well. However, as the map unfogs the speed slows more and more for each movement of each unit. Once I hit refresh on the browser I go back to the original speed at the start of the turn. It's as if I've cleared something internally (I know I once had the debug consoles active back in beta2. Right now that option is grayed out and says it's off and I turned it off in beta3. But I wonder if it's still on for me and I need to clear my browser cache??) in terms of how much your code is 'remembering'. Also as long as I move units through areas that are unfogged the speed remains constant. It's only when unfogging that the slow down begins. The more units in the game, the slower things get (game isn't too bad in early turns with 10 units per player but when I get to 150+ units and all players have 100 plus things get slow very fast) which makes me think you must have to load a lot of info for the unfog routines to calculate whether something is 'being seen' or 'popping into view' for the first time ever/first time that turn. Typically now I am refreshing 4-5 times a turn depending on how many units I have to move.

Note: I have movement speed set to fastest possible (0 - I think).

I can use my phone and make a video of a turn to show what I mean if that would be helpful.

I would not remove deep water. The coloring is useful. The extra CPU load is really minor. You might eventually consider a water animation option for players to turn off if they need extra speed. But again I don't think this is the problem or much of an issue. On a map like Bullrun with little water I still see the slowdown. Fog of War is 90% of the problem so improvements elsewhere are going to yield little.

KGB
KGB
 
Posts: 3030
Joined: Tue Feb 16, 2010 12:06 am

Re: Resolution

Postby piranha » Thu Dec 08, 2011 6:08 pm

The reason it gets slower and slower is because of the minimap. What happens with the minimap is that when you start your turn its created as an image with all the fog / nofog drawn into the image. When you move into the fog tiny divs are placed on the minimap-image to give you the new information. As you uncover more and more fog more and more divs are placed on the minimap.

The same thing happen when you paint maps in the mapeditor and it becomes even more evident that the browser is slowing down there.
One thing on the todo is to recreate the minimap when a certain number of tiles have been unfogged to lift the slowdown. This is SnotlinGs department so he might be able to add some information. Could be that he have done something about this in B5 already. We have done some speed optimizations for B5.

There is an easier solution than refresh and very strange too. You can click anywhere outside the mainmap and the slowness from the popup will go away :-).

I don't want to remove the deep water either, I'm probably going to spend some time on the canvas thing again.
User avatar
piranha
Site Admin
 
Posts: 1188
Joined: Fri Feb 12, 2010 9:44 pm

Re: Resolution

Postby SnotlinG » Thu Dec 08, 2011 10:30 pm

Yes, that is unfortunately how the minimap works currently. Every tile that you unfog while exploring the map adds a new html element <div> to the minimap. So if you are exploring a lot, there will be a lot of new DIVs added, and this slows down the game (especially firefox/explorer).
I have been trying out a few different solutions, but so far I havent found any really good.
The one that I think could work is as piranha say, that at a certain point in tha game (say 20 new tiles explored), we make a new request to the server to re-create the minimap and then load it back to the minimap window.

As for the slowdowns after the popup-windows, this is (as far as we have been able to test it) fixed in beta5
SnotlinG
 
Posts: 2148
Joined: Sat Feb 13, 2010 12:42 am

Re: Resolution

Postby KGB » Fri Dec 09, 2011 2:56 am

SnotlinG,

SnotlinG wrote:I have been trying out a few different solutions, but so far I havent found any really good.
The one that I think could work is as piranha say, that at a certain point in tha game (say 20 new tiles explored), we make a new request to the server to re-create the minimap and then load it back to the minimap window.


That will probably put a big drag on the server to have to keep rebuilding the mini-map. Some units like Dragons can unfog 10+ squares per move so would be unfogging 20 in 2 moves.

I am guessing that what you can do in a browser is not like regular graphics where you can create a 2nd mini-map in the background and then simply point to it. Basically a double buffering technique where what's being created wouldn't have the DIV's and could be swapped in repeatedly?

What about a floating mini-map (Warlords IV used that concept). Basically a pop up window that is fixed in position where the mini-map is now. Then when a unit is moving you'd close the mini-map and re-open after the move finishes with a brand new mini-map. You'd have to store everything locally (to avoid killing the server) to create the map. Would that be do-able/save time?

KGB

P.S. I see now what Piranha means about water. I experimented by moving the map view around. When no water is in view the CPU load drops to 10%. When water is being animated on my 1900x1200 screen it goes to 50% (1 full core).

Maybe an option to turn off the animation of the water? I only suggest these things because right now, speed games are unplayable because it just takes too long to move more than a couple of units.
KGB
 
Posts: 3030
Joined: Tue Feb 16, 2010 12:06 am

Re: Resolution

Postby piranha » Fri Dec 09, 2011 7:10 am

Now that we are talking about it one thing that came to my mind. I think canvas could be used for the minimap to get rid of the fog/paint slowdown. It shouldn't require as much work as redoing the whole main map.
User avatar
piranha
Site Admin
 
Posts: 1188
Joined: Fri Feb 12, 2010 9:44 pm

Re: Resolution

Postby piranha » Mon Dec 12, 2011 1:49 pm

As a litle follow up. I've now changed the minimap to a canvas instead. Just created a map with 30 green dragons and moving them into new fow uncovering most FOW on a 100x100 map and no notable slowdown in fire Fox :D.

Also allowed me to remove all cities / buildings as div elements from the mini map so there is about 30-100 less divs which should give a slight performance increase.
User avatar
piranha
Site Admin
 
Posts: 1188
Joined: Fri Feb 12, 2010 9:44 pm

Re: Resolution

Postby kenc80 » Mon Dec 12, 2011 2:58 pm

KGB I dont understand why you are having so many drawing problems? The game runs just fine on Chrome and DSL?.Are you still using your soviet-issued Apple IIe? :mrgreen:
kenc80
 
Posts: 344
Joined: Wed Mar 10, 2010 9:16 pm
Location: South Carolina, USA

Next

Return to Wish list

Who is online

Users browsing this forum: No registered users and 39 guests

cron
Not able to open ./cache/data_global.php