800x480 resolution

@ Roman: 800x600, the resolution of IQ 701 is actually the default resolution of the game, so I guess you won’t need to worry about “GUI crop”. Porting to Android though it’s another story. Not sure if anyone attempted it to give you some advice.

[size=75]Regarding forum registration, what’s the error that you get?[/size]

I can try to port VCMI to Android. I think is not difficult. But support of 800x480 resolution is needed. It’s most resolution for Android devices.

well look to mobile mode topic - there are considered some ways to provide sub-800x600 resolutions

also there considered that something has to be done to memory support

also there is general talk about vcmi on smartphone

when i’ve copied these files from first post, i can’t start the game.

i have **N900 **and game works on 800x600 but i can’t start new game, because i don’t see Start button :slight_smile:

So my problem is:

After command vcmiclient it starts, but after line:
Loading default system settings: 30
there is:
Segmentation fault

and program stops. What should i do to play in 800x480?

800x480 is NOT functional (NOT supported) resolution in VCMI yet. Remember that VCMI is still ALPHA, and running it on platforms like your phone can cause additional problems.

But 800x480 is functional on N900 (package from maemo dev extras repository)! Someone has rebuilt interface and most buttons are visible.

I’m pretty convinced that if it was functional, I’d know something about it. Adding proper support would require significant changes in the engine.
Yes, the adventure interface has been rebuilt to fit 800x480 (the screenshots can be seen on the first page of thread) but it’s not enough. There are other parts of game that also needs redesigning or scrolling support, like pregame (main menu and scenario selection), battles, towns…

Anyway, our the first priorities ATM are making game playable and achieving feature-parity with OH3. Without that not only N900 owners but no one can actually play.

i believe the bugs.vcmi.eu/view.php?id=821 feature will be crucial to use 800x480 as some windows (eg battle screen) can’t be redesigned freely

its very easy and very quick sort of scaling feature

http://img32.imageshack.us/img32/4919/hommbattle.png

?

fullsize

That looks like a nice solution. The main thing we’re missing is the battle log, but perhaps that could be somehow integrated in the Console? However that’s not a core element (I rarely read it, but I can imagine it can be frustrating that one time you want to read what happened exactly).

Do you have the code for it or is that just an image edited as suggestion? If you have the code, then we’re one important step closer to be ready to support this resolution as well. :slight_smile:

One more aesthetic detail: if we’ll have separate code for the button placement, maybe we could have the same for hero placement. Actually the hero used to be placed lower in VCMI before, but it was corrected to be like in OH3. beegee made the fix, so he may know if it can be changed back (or moved even lower) for this resolution only.

Makes sense to me :wink:
Zamolxis already said everything.

Zamolxis, Warmonger

For now I just deleted it, cause I don’t know where to place it…

never in my experience :slight_smile:

I have. I’ll post it here some later

I dont think that patch will be really useful for mainstream code. For now it is heavy and dirty

And one more thing: for now works only battles and adventure map, no towns, no pop-up windows and so

For the console log, we could have simple pop-up window under some hotkey. You can’t see it all the time, but could see longer part of long at once.

@Stil: I admit it doesn’t happen more than once a year when I feel something weird just happened and I go back to the log to double check. However the log is slightly more important during application development (where we are now) as a useful tool for testers to monitor what’s happening (e.g…: double check that the damage formulas are correct). Plus, although I may be biased on this, while I know Heroes 3 may not outlive Chess, I still think it’s one of the best strategy games ever created which - as long as (3D graphics aside) Ubi or any other dev will not be able to come with something at least close as good - will still be discovered by young players in the years, maybe even generations to come. And for some of them it’ll certainly remain useful in the first weeks and months. See my suggestion below for it, in case you think you can code it.

For the rest, I wouldn’t worry much about most of the other windows. I can’t recall pop-ups which would lose more than their borders at worst in 480p hight, except maybe the Hero screen, which is the only notable problem that I see. At least I can’t think of a decent solution, other than perhaps moving the army from the horizontal panel below, to a vertical panel on the left. But that would probably still require a resize or rescale of creature icons. Until someone feels inspired to undergo an effort in that direction, I suggest using Kingdom Overview screen for troop rearrangement. For the rest - if I’m not missing something - we’re left with:

  • Town screen: aesthetically perhaps not the best solution, but I guess we could simply cut about 80p from the top and 40p from the bottom, which should still give access to all functional buildings in all towns.
  • Kingdom Overview: this should be even easier I believe. A simple edit of the default OvCast.pcx and the resolution file to have size 3 i/o 4 should do it.

[size=75]One more thing. This is perhaps just psychological or a matter of intuitive perception (so feel free to ignore if you feel otherwise > it’s your “baby” afterwards), but I feel the order of the side buttons should be the other way around:

  • Autocombat on top, with Surrender at the bottom (psychological, but also intuitive as Surrender is next to Combat Options on the classic interface)
  • Spell Book on top, with Defense at the bottom (for symmetry in transposing the buttons, but somehow also intuitively, especially when it comes to the Defend button)[/size]

@Warmonger: “L” would probably be the best hotkey for the log and it’s not taken. I actually thought once of a feature suggestion, where “L” would toggle an enlarged battle log in all resolutions, as it’s really hard to follow when you have only 2 rows at a time (in x600 would unfold up over the lowest hex row, in higher res would unfold down). But anyway, going back to x480, we could use the Quest Log button graphics from the Hero Screen, and place it in the battle screen symmetric with the Combat Options button (as in attached screenshot). Together with the L hotkey, it could toggle a battle log next to it in the lower right corner of the screen. It’s not the most active corner anyway, as often we like to let the enemy move closer, so after the first round it may often be a place where player could open the log to follow what’s happening. Of course, best is to have a certain degree of transparency to it, just in case the enemy summons a creature there for example, but I can imagine that’s more challenging.

Ok :slight_smile:

patch

Developers, is there a easy way to crop SDL_Surface? When I tried (I dont know how to do it), the best thing i’ve had was the “black” texture
battles-and-advMap.7z (114 KB)

Haven’t tested but this should work.

SDL_Surface *cropSurface(SDL_Surface *source, SDL_Rect *sourceRect)
{
	SDL_Surface *dest = SDL_CreateRGBSurface(source->flags, sourceRect->w, sourceRect->h, source->format->BitsPerPixel, 
			source->format->Rmask, source->format->Gmask, source->format->Bmask, source->format->Amask);

	if (source->format->BitsPerPixel == 8)
		SDL_SetPalette(dest, SDL_LOGPAL, source->format->palette->colors, 0, source->format->palette->ncolors);

	SDL_BlitSurface(source, sourceRect, dest, NULL);
	SDL_FreeSurface(source);

	return dest;
}

The positions of the attacking and defending heroes can be set at line 1430 approximately in the ctor of the class CBattleInterface in the file CBattleInterface.cpp.

//loading hero animations
	if(hero1) // attacking hero
	{
		int type = hero1->type->heroType;
		if ( type % 2 )   type--;
		if ( hero1->sex ) type++;
		attackingHero = new CBattleHero(graphics->battleHeroes[type], 0, 0, false, hero1->tempOwner, hero1->tempOwner == curInt->playerID ? hero1 : NULL, this);
		attackingHero->pos = genRect(attackingHero->dh->ourImages[0].bitmap->h, attackingHero->dh->ourImages[0].bitmap->w, pos.x - 43, pos.y - 19);
	}
	else
	{
		attackingHero = NULL;
	}
	if(hero2) // defending hero
	{
		int type = hero2->type->heroType;
		if ( type % 2 )   type--;
		if ( hero2->sex ) type++;
		defendingHero = new CBattleHero(graphics->battleHeroes[type ], 0, 0, true, hero2->tempOwner, hero2->tempOwner == curInt->playerID ? hero2 : NULL, this);
		defendingHero->pos = genRect(defendingHero->dh->ourImages[0].bitmap->h, defendingHero->dh->ourImages[0].bitmap->w, pos.x + 693, pos.y - 19);
	}
	else
	{
		defendingHero = NULL;
	}

One more question, please.

When I crop original surface instead of just replacing it I’m getting something strange.
Hexes, mouse selections, Morale&Luck animations works fine, but units (and their animation) are located for 62px upper than they it should be.
Where could I find their arrangement?

62px comes from here

if ((conf.cc.resx == 800) && (conf.cc.resy == 480)) {
			SDL_Surface *tmp = BitmapHandler::loadBitmap(backref rand() % backref.size()], false );

			SDL_Rect temp_rect = genRect(480, 800, 0, 62);
			background = cropSurface(tmp, &temp_rect);
		} else {
			background = BitmapHandler::loadBitmap(backref rand() % backref.size()], false );
		}

http://img831.imageshack.us/img831/9881/x28s.png[/code]

Try changing this line:
In CBattleHex::getXYUnitAnim()

ret.y = -139 + 42 * (hexNum/BFIELD_WIDTH); //counting y

In case anyone still monitors this thread…

I DID IT!

TLDR: remove resolution check when running windowed or not-true fullscreen. Done.