Forum index VCMI Project - Heroes 3: WoG recreated
Forum of the project aiming to recreate best turn-based strategy ever!

FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  StatisticsStatistics
RegisterRegister  Log inLog in  AlbumAlbum  DownloadDownload

Previous topic :: Next topic
Closed by: Tow
2014-02-24, 00:40
Android port
Author Message
pelya 

Joined: 06 Jun 2011
Posts: 8
Location: Kiev
Posted: 2011-06-09, 18:22   Android port

Edit by Tow:
The pelya's port of VCMI never worked properly and has been abandoned.
Please check the xyz's port that is active and much more stable: http://forum.vcmi.eu/viewtopic.php?t=850
---



Hi.

I'm in the process of creating Android port of VCMI.
It runs main menu, but the game cannot be started, because it cannot run the server (some obscure problems with shared memory on Android), so I have a request - can you please do some compiler flag to link both client, server and AI libraries into a single binary?
Or at least make the client/server communicate over TCP socket?

There is Android-specific shared memory implementation available, it will require some effort to integrate it into boost::interprocess though.

Installer file
Sources diff
You should copy the Heroes 3 data files to directory app-data/eu.vcmi on your SD card (it will get created after first app launch).
Last edited by Tow on 2014-02-24, 00:41; edited 2 times in total  
 
 
     
Tow dragon 
VCMI Programmer


Joined: 01 Feb 2008
Posts: 1004
Location: Kraków
Posted: 2011-06-09, 20:38   

I'm almost sure linking everything into one executable would be quite hard and undesirable. Client and server communicate over TCP even is single player, there would be some problems with multithreading... good luck if you wish to implement it but don't expect us to do it in predictable future.

BTW, I hope you are aware that VCMI needs 800x600+ display and 256+ MB of RAM in your device. We are not going to work on it soon either.

Sorry if you're disappointed but currently we focus on recreating the game for PC. We will think about mobile platforms when we make VCMI playable.
_________________
:)
 
     
pelya 

Joined: 06 Jun 2011
Posts: 8
Location: Kiev
Posted: 2011-06-09, 20:56   

Tow dragon wrote:
Client and server communicate over TCP even is single player

That's perfectly fine for me, just tell me how to make client use TCP instead of a shared memory.

Quote:
BTW, I hope you are aware that VCMI needs 800x600+ display and 256+ MB of RAM in your device.

All new devices sold today are matching these specs (the screen is however 800x480, but VCMI interface has nice big buttons, so it's not big issue as for me).

Quote:
We will think about mobile platforms when we make VCMI playable.

Can you please give me some overall status, what is playable and what is not?
I mean, can you complete campaign? Or play multi-player games? Or just play single maps? I saw some AI implementation in the code, can it hire heroes, build castles etc?
 
 
     
Tow dragon 
VCMI Programmer


Joined: 01 Feb 2008
Posts: 1004
Location: Kraków
Posted: 2011-06-09, 21:41   

Quote:
That's perfectly fine for me, just tell me how to make client use TCP instead of a shared memory.


I'm sure it's impossible. Tow has written this code long time ago and I'm sure he would bother with shared memory if it weren't necessary.

pelya wrote:
All new devices sold today are matching these specs (the screen is however 800x480, but VCMI interface has nice big buttons, so it's not big issue as for me).


VCMI is *not* playable on 800x480. See here: http://forum.vcmi.eu/viewtopic.php?t=273 for details.

pelya wrote:
Can you please give me some overall status, what is playable and what is not?


Look here: https://spreadsheets.google.com/ccc?key=pRhYM0YkAF9lIpLe4raNAWA#gid=0 and here: http://wiki.vcmi.eu/index.php?title=TODO_list .
Campaigns are partially done (no hero crossover yet), hotseat is done but MP over network not yet (although a lot of progress has been done in this area). The main reason why single player is not playable is lack of adventure map AI (but it's going to change in several months - Tow will create one). You can hire heroes, build buildign in castles etc.
_________________
:)
 
     
pelya 

Joined: 06 Jun 2011
Posts: 8
Location: Kiev
Posted: 2011-06-10, 08:48   

Quote:
VCMI is *not* playable on 800x480

Also not a problem - SDL will provide proper 800x600 display surface, and then shrink it on-the-fly to the 800x480 device screen, using hardware-accelerated OpenGL stuff. So there's no need to redesign the GUI, the pixels won't be square though.

Quote:
I'm sure it's impossible. Tow has written this code long time ago and I'm sure he would bother with shared memory if it weren't necessary.

Well okay, then I'll go and hack boost::interprocess so it will support Android implementation of shared memory - nothing too complicated, it will require another week of coding though.
 
 
     
Tow dragon 
VCMI Programmer


Joined: 01 Feb 2008
Posts: 1004
Location: Kraków
Posted: 2011-06-10, 13:04   

Quote:
Also not a problem - SDL will provide proper 800x600 display surface, and then shrink it on-the-fly to the 800x480 device screen, using hardware-accelerated OpenGL stuff.


Interesting possibility. I didn't know it's possible in SDL. Anyway, Heroes III uses tiny fonts in several places and they won't be readable. But it would be great if it worked.

Quote:
Well okay, then I'll go and hack boost::interprocess so it will support Android implementation of shared memory - nothing too complicated, it will require another week of coding though.


Good luck!
_________________
:)
 
     
pelya 

Joined: 06 Jun 2011
Posts: 8
Location: Kiev
Posted: 2011-06-10, 16:01   

That feature with screen resize is specific for Android SDL port.

After some code inspection I've found that shared memory is used only to signal to client that the server is started, so I've replaced it with a simple flag-file created on disk, so the server starts now, however the game does not start anyway, with several messages to console:
Quote:
Message cannot be applied, cannot find applier!

The same code works on my Linux, so I suspect some memory alignment errors.
BTW I've updated both sources and installer in the first post.
Here's full console output
 
 
     
pelya 

Joined: 06 Jun 2011
Posts: 8
Location: Kiev
Posted: 2011-06-14, 13:57   

I've finished porting, it can be downloaded from Android Market or from here.
Diff and compilation instructions here (I ifdef-ed all Android stuff, so it can be applied on SVN, if you think it's worthy)

Double post BTW :-P
 
 
     
ubuntux
VCMI programmer

Joined: 11 Apr 2009
Posts: 205
Posted: 2011-06-14, 14:33   

Thanks for the patch.

I've committed the erm fix.

I'll check the patch to the console in more detail (since it's linux related) and commit that later in the day.

I think the change to replace the shared memory with a file is not right. That should probably be a handshake between the server and the client instead. But I guess the file will do in the meantime (if it doesn't break on windows).

The changes to CMT.cpp are rather intrusive and may change the behavior of the code on non android platforms.

Also your patch has many blank lines insertion/removal. It would make review easier if they were not there. I'd say the same for the traces you added ("tlog1 << ...").
 
     
Sangemaru
Guest
Posted: 2011-06-15, 14:25   crash

On gingerbread 2.3.3 and Samsung Galaxy Tab the app loads, iti presents the SDL screen with option to change settings and then quits to homescreen.
I tried using aLogCat to view reported logs but i can't make any sense of it, apparently the app makes it all the way to loading unit models, then calls a function for OpaqueWindow that results in error, after which the Homescreen loads.
Can you tell me if you have any clues what I should look for in order to make it load?

Thank you for all your effort and all the nice ports :)
 
     
un-imaginative 

Joined: 15 Jun 2011
Posts: 2
Posted: 2011-06-15, 15:45   

I have the same problem on the Nexus S, I also got the SDL screen, before a black screen, then crashed to home screen.
Is it possible that there's something wrong with my Heroes files? As I followed the instructions on the Android Market (I even tried twice just to make sure).
My Heroes is HoMM3 Complete Edition, from the 'Ultimate Heroes Pack'.

Really looking forward to getting this working, so any ideas that might help would be greatly appreciated.

Keep up the great work, thanks!
 
     
griefman

Joined: 15 Jun 2011
Posts: 1
Posted: 2011-06-15, 15:57   

Well... the same again... SDL starts and then crashes on HTC Desire with Android 2.3.4 ... log is saying libvcmi.so not found

@pelya: i sent you an email earlier with my log file.. if necessary i will attach it here too

and again... nice work for pelya and the vcmi team too ;)
 
     
pelya 

Joined: 06 Jun 2011
Posts: 8
Location: Kiev
Posted: 2011-06-15, 17:17   

I've bumped into some nasty crashes when testing on the device - I've got it back just today, on emulator everything worked so good :-( seems like memory alignment problems. So I've unpublished it for now.
I've also fixed troubles with unpacking libvcmi.so on some devices.
 
 
     
Sangemaru

Joined: 15 Jun 2011
Posts: 3
Posted: 2011-06-15, 21:59   

Ok, if there's something we can do to help just say the word
 
     
Semaphor
Guest
Posted: 2011-06-16, 07:57   

HTC Desire Z, 2.3.4 (Cyanogen)
Getting the "libvcmi.so not found" crash as well.
If it would help you getting a full logcat drop me a line at Christoph(Dot)Wagner(at)gmail[.]com

Appreciate the work you are doing:)
 
     
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies.
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
Add this topic to your bookmarks
Printable version

Jump to:  

Powered by phpBB modified by Przemo © 2003 phpBB Group

Hosting provided by DigitalOcean
Page generated in 0.03 second. SQL queries: 15