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
Search found 25 matches
VCMI Project - Heroes 3: WoG recreated Forum Index
Author Message
  Topic: VCMI for Android
Fay

Replies: 210
Views: 164446

PostForum: Development   Posted: 2017-03-18, 14:41   Subject: VCMI for Android
Quote:
Relative cursor mode doesn't seem to work very well, literally disappears after trying to press right click and you can move it off screen as much as you want, to the point where you completely lose it, thanks for adding it so fast though, if you're gonna fix it and don't mind working a bit more on it add sensitivity too, would be useful.
Okay, you're right. That's because I wanted to do it without adding more java<=>c communication so I didn't have any reliable info about an actual cursor position and had to guess sometimes. I changed it to get the cursor directly from SDL an it works substantially better. Still can go offscreen though; not sure if I can limit it to actual game bounds.

Quote:
While intro seems much nicer now it seems to take longer time to load (might be just a psychological thing) and the sound of it disappeared (Actually now that I think about it, it may have not ever been there, if so dismiss this one), not something essential to the game but I think it worked previously.
The only things I changed there is clearing screen + displaying progressbar. Definitely nothing that could affect the loading speed.
I'm not sure about the sound because I always have it turned off. If it was there previously, it should still be there.

Quote:
are there any performance differences between 16 and 21 API versions? And if not, what's the point of making two different ones?
Okay, so the short answer is "it's complicated". ;) I could probably get away with building only one package. I'm not sure about some details but generally:
* android device can have one of 5 architectures (arm, arm-v7a, arm64-v8a, x86, x86_64); 64-bit ones require api21 (android 5.0+) and I think x86 needs api18 (android 4.3+),
* all arm-based archs should work "normally" with applications built for normal arm, but x86-based devices will probably not,
* I assume when the arch doesn't match, the performance is works becuse there needs to be some translations,
* running arm application on 64-bit device is probably the similar case as running 32bit applications on 64bit pc (slower, more limited, but usually not really noticable).

Currently the api16 package contains only arm arch and api21 contains all 5.

Quote:
why does this update take up three times as much space compared to the last one?
Because, for some reason, the apk file has no compression. I assume this is some kind of bug in android build system, because I can't see any settings to change it and previously it was compressed normally. You can test this by unpacking the apk file (it's just a zip) -- both packages have ~313MB after unpacking.

Quote:
I just updated from the previous version of vcmi that I had and everything went smooth. On my device, Lenovo P2 with Android 6.0.1, the game works absolutely amazing. The right click is working very well and the hero movement is so smooth now. I've played for a few minutes with no crashes and bugs at all. Thanks for the excellent release, Fay!
:)

I wrote:
Maybe it would be possible to change these forced full redraws into partial draws (redrawing only hero tiles + neighbors(?)) because nothing except hero animation changes there. I might try looking into it (at some point).
Actually... never mind. That's definitely not possible, because the screen follows the hero during movement.
  Topic: VCMI for Android
Fay

Replies: 210
Views: 164446

PostForum: Development   Posted: 2017-03-13, 23:26   Subject: VCMI for Android
Quote:
What i must download? api16 or api21?
api21 is for android 5.0+. If you have 4.1-4.4.x, you can only use api16. "Installation" instructions should be displayed in the launcher, but rough description is in the post with the first version http://forum.vcmi.eu/viewtopic.php?p=15731#15731

Quote:
Yes. In fact I tried to remove map redraw altogether, but it lead to some crashes - couldn't figure out why. Probably only original author knows why it's implemented this way
Maybe it would be possible to change these forced full redraws into partial draws (redrawing only hero tiles + neighbors(?)) because nothing except hero animation changes there. I might try looking into it (at some point).

--

Sooo I built new packages, but they're quite weird this time and I'm not sure if they work correctly (honestly, compiling them feels very random). It works correctly on my 7.1 device, but I was unable to start the app on any emulator (tested on three different ones and each one is broken in a different way...). I don't know, I might need to downgrade sdk/ide or something if it doesn't work for others.

If you feel lucky, you can try it.
https://github.com/Fayth/vcmi-android/releases/download/4/vcmi-api16-20170313-debug.7z
https://github.com/Fayth/vcmi-android/releases/download/4/vcmi-api21-20170313-debug.7z

Changes:
* right-clicking support (two modes, switchable in launcher; personally, after some testing I find relative cursor very weird but I'll leave it there),
* intro doesn't appear frozen anymore (after interrupting intro, screen is cleaned + progressbar is displayed); this might also possibly fix HarryPhoon's problem with artifacts on the sides, buuut I don't know,
* hack that might make hero movement animations slightly smoother.
  Topic: VCMI for Android
Fay

Replies: 210
Views: 164446

PostForum: Development   Posted: 2017-03-12, 23:17   Subject: VCMI for Android
I'll try to build apks tomorrow. I tried to do it, but currently the app seems to crash on older devices (and it looks like some android build system bug).

I've done some testing on the movement animations/logic. I think that the issue here is that
1. movement logic uses some custom/manual rendering loop (with manual frame delays etc); I'm not sure if that's a problem but certainly the rendering hero movement works differently that all other rendering
2. there are lots of full map redraws during the movement and android can't really keep up.

I made a small change/hack (basically added a frameskip during movement rendering so that it doesn't do full redraws every frame) which helped (at least on my phone). I wouldn't call it smooth, but definitely looks better than previously.
  Topic: VCMI for Android
Fay

Replies: 210
Views: 164446

PostForum: Development   Posted: 2017-03-11, 22:00   Subject: VCMI for Android
@SomeGuy147 Most of the differences probably come from the fact that xyz used unofficial sdl 1.2 port (https://github.com/pelya/commandergenius) and I used official sdl 2.0.

I installed xyz version to check how it works because I haven't seen it for a very long time. I don't have any old devices on me to check in-game, but menus worked correctly. So...

Quote:
While intro plays perfectly well, there is some significant lag after skipping it, like solid 4-8 seconds. Didn't happen at all with xyz's version but hey, that one instantly crashes when trying to load a game from the menu so what do I know.
I think that in xyz's version, actual loading is done before the intro starts (splashscreen + some black screen afterwards). Ideally I just need a change that doesn't freeze the main thread after skipping intro. Optionally displaying a progress bar in that case. It would look "correct" then. This shouldn't be too hard, but again, I'm slightly hesitant to change vcmi code too much because it makes merging the changes harder.

Quote:
The way controls are implemented seem awful to me, I much more preferred xyz's way of doing things, he made so your finger upon touching the screen would act as a mouse and controlled the cursor in that way which was really accurate and felt pretty good. If you're still wondering the way he made right click work was that if you had one finger on the screen dragging the mouse around and put a second one anywhere it would instantly stop and hold right click. It's really intuitive and is easy to figure out even if you don't know it beforehand.
This input handling is done in SDL port. Feels quite good and I thiiink I could port it. (few weeks ago I added a bandaid method to send right-clicks through extra button in gui, but this would probably work better).

Quote:
Resolutions higher than 1280x768 might as well not exist for phones since stuff gets ridiculously small and hard to see, but I am guessing you can't fix this without redrawing everything.
Well, tablets have bigger screens so I assume it could be used there.

Quote:
Whole menu, loading, displaying maps and that stuff in general is significantly laggier and slower than xyz's version.
Probably nothing I can do. Either SDL2.0 is more CPU-heavy than SDL1.x, or VCMI 0.99 needs more resources than 0.97 (or both).

@Kiiro
Quote:
Oh~! Sneaky 3DO, pretending it's just an intro
I meant desktop vcmi version, not OH3. No idea how resources are loaded in the original. ;)

@HarryPhoon
Yeah, basically "random" stuff from memory is displayed outside of the 4:3 game screen area. This is definitely a problem in SDL, because the app itself doesn't even know if the bars are present. It might be fixable.

Edit next day ~ okay, so I added right-click support + changed intro so it looks better. I might build/upload apks later today.
  Topic: VCMI for Android
Fay

Replies: 210
Views: 164446

PostForum: Development   Posted: 2017-01-12, 11:34   Subject: VCMI for Android
Sooo I'm still alive and do plan to continue working on this, but not sure when (probably not very soon).

Quote:
The intro is still laggy when trying to skip but meh with it, it's just intro.
This is the same behaviour as desktop version, but it's less noticeable because it loads much quicker. Basically app tries to load all data during intro on a separate thread, but when you skip intro, the main thread waits for the loading so it gets blocked until everything is loaded. This should be changed but it's more on vcmi-side than android fix.

Quote:
The walking on the map is choppy as hell but it works at least so I'm not complaining.
I didn't check this, but I can confirm that movement animations don't really work for me neither. From what I remember, heroes movement looks very complex and I don't really want to mess with it. ;)

Quote:
The one thing I want to ask is how to do "right-click" here? I want to check sometimes stuff like "what does that magical spoon do?" and I can't find any way for it.
Do you know if this was somehow solved in xyz's version? Probably the most "intuitive" solution would be to use long-press as right click. This would require to add "proper" touch controls support. It would probably require a lot of changes in vcmi, because application assumes mouse input everywhere.
The only easy way to implement it that I can see atm is to add an ui element outside of the game that would cause next press to be treated as right-click. It definitely would be very inconvenient to use.

Quote:
- Clicking certain point is sometimes tricky
Pinch-to-zoom adventure map would be cool, but again, needs proper touch controls support. And possibly also changes to map drawing (as far as I remember, scaled drawing was much slower in SDL).

Quote:
But when using bad resolution (screen ratio) there are artifacts between the game screen itself and the edges of the screen
Didn't notice it on my side... I'm not sure if I can do anything there, because the whole surface is managed by SDL. Might be worth to check it.

Quote:
Is there any way to use the mods for vcmi?
After the app initializes the first time, you can put the mods in <app-root-folder>/Mods (the same folder where you put game data), the start the launcher and you should be able to turn them on/off in the mods section.
  Topic: VCMI for Android
Fay

Replies: 210
Views: 164446

PostForum: Development   Posted: 2016-12-02, 17:19   Subject: VCMI for Android
I didn't really have time recently, so only a quick update this time...

@ Broken api21 package: okaaay, it's broken and this was a problem on my side (actually, that's due to some broken/undocumented feature of the build system). Hopefully this package is better.

@ Hang during map start/load: I managed to track this one down. It was occurring due to some weird interaction between jni->java communication and SDL events (I think that SDL hook to java was getting broken when client called jni method to start the server; after that, SDL_PollEvents froze the main SDL loop).

(additionally some better logging in launcher)

https://github.com/Fayth/vcmi-android/releases/download/3/vcmi-api16-20161202-debug.apk
https://github.com/Fayth/vcmi-android/releases/download/3/vcmi-api21-20161202-debug.apk

I haven't checked other problems yet... I probably won't be able to do anything for the next few+ days.
  Topic: VCMI for Android
Fay

Replies: 210
Views: 164446

PostForum: Development   Posted: 2016-11-27, 13:10   Subject: VCMI for Android
Added updated version.
https://github.com/Fayth/vcmi-android/releases/download/2/vcmi-api16-20161127-debug.apk
https://github.com/Fayth/vcmi-android/releases/download/2/vcmi-api21-20161127-debug.apk

* black screen on game start should be fixed,
* slightly better error handling in launcher (saving launcher logs + crashes in /cache/VCMI_launcher.log; also hopefully less crashes),
* added ability to enable/disable the mods and submods

Quote:
Here logcats for resolution selection crash and black screen
I'm not entirely sure why this crash happened (looks like a problem in android support libs), but I think I might've fixed it in today's version.

@Kiiro
S2 log -- I'm not sure how exactly resource loading works in vcmi, but it looks like it couldn't find some files during init (multiple entries with "File <unknown> is not a valid JSON file! At line 1, position 0 error: File is empty").
P9 log -- hard to say what happens, because there are no errors in the logs... the last line in the client log is "Entering virtual void VCAI::loadGame" so I suspect there was some deserialization crash in AI. Was this save created in android version or copied from pc?

Quote:
The screenshot may be a bit blurry because of 800x600 or something...I guess?
Probably. If you have full hd phone then everything is upscaled almost 2x.

Quote:
The game loaded, I just can't do a thing
Actually, I managed to do this few times (during normal game start, not loading). I have no idea why this happens, but I'd say this is SDL problem. The game gets "stuck" on loading screen -- it looks like the whole game initialization succeeded, but the screen doesn't refresh anymore (nothing in logs). Minimizing the game "helps", because it forces SDL to recreate the screen, but it still doesn't refresh.
  Topic: VCMI for Android
Fay

Replies: 210
Views: 164446

PostForum: Development   Posted: 2016-11-26, 14:38   Subject: VCMI for Android
Quote:
Unfortunatelly the game crashes in two moments:
1) Loading saved game.
2) After battle results.
Both of these work correctly for me, so it may help if you can get the logs.

Quote:
we don't risk that polish-exclusive-letters will do some OMGWTFBBQ situation
Special characters should work correctly in the current version. ;)

Quote:
BTW is it somehow possible to force VCMI to read from External microSD card instead of Internal Memory? Just asking~ :3
I don't hardcode the path to anything, but ask system to give me an "external storage directory". I think I could force it to use a secondary external storage, but this would probably complicate things... honestly, if I was about to do something more complicated, I would just allow user choose the folder that he wants to use... but that might be something for later.

I managed to reproduce the problem with black screen on game start (on 5.0 emulator). There was a deadlock in CLogger and the game basically froze on the second log line.
I'll try to build and upload updated packages... possibly later today. With fixed blackscreen, possible launcher crash and saving logs to file in the launcher (so I can actually know what goes wrong in the launcher ;)).

Edit~
Quote:
If I understand correctly - in android version there's possibility to enable/disable mods in launcher?
Not yet (you can see the detected mods, but this doesn't really work anyway, because currently it only shows mods from config/settings.json, so it's displayed correctly only after you already run the game).
  Topic: VCMI for Android
Fay

Replies: 210
Views: 164446

PostForum: Development   Posted: 2016-11-25, 23:01   Subject: VCMI for Android
Quote:
It's working now except screen is all red
Sounds like SDL incorrectly chooses pixel format. I didn't see any calls to methods described in that bug report in vcmi. Possibly sdl receives some unhandled pixel format from the system here https://github.com/Fayth/vcmi-android/blob/master/project/vcmi-app/src/main/java/org/libsdl/app/SDLActivity.java#L1426 (and then it defaults to rgb565). There should be an entry in logcat logs with "pixel format xxx" if you want to check it.
(edit ~ actually, there's one direct pixelformat manipulation in video handler, but I think if that was a problem, it would affect only the videos, not the whole game)

Quote:
The game loads, starts, all is fine
Yay, so it's not only working for me. ;)

Quote:
The game goes in english language
Hm, the language should be based on your data files... It's not in english for me (unless I add WoG).

Quote:
Any other selection differ than "Start VCMI" in launcher lead to crash of vcmi (Unfortunately VCMI, has stopped).
I probably should have added saving launcher logs to a file, because currently launcher logs can only be retrieved through adb (or shell).

Black screen issue sounds more like some vcmi/SDL initialization problem, but it's hard to say anything without any details. There might be some useful info in client log (in vcmi-data/cache, as SXX noted).

I might try to setup some emulators tomorrow to try to reproduce some problems (I wonder if there's a way to use cyanogen emulator ;) ).
  Topic: VCMI for Android
Fay

Replies: 210
Views: 164446

PostForum: Development   Posted: 2016-11-24, 08:49   Subject: VCMI for Android
Quote:
any chance you have any device with Cyanogenmod
I dooon't think so. Personally I've never used any custom ROMs. I can ask around but I don't think I can find something.

Quote:
It's says data must be put into "/storage/emulated/0/vcmi-data/Data" (...)
UPD: Find out that vcmi-data directory in root of internal memory wasn't visible for file management over MTP for some reason
This is normal. It'll usually be storage/emulated for devices without sdcard and something like /mnt/sdcard for the rest. This should be a root folder that is accessible though mtp. As far as I remember, Android does have some problem with syncing the data automatically, maybe that's why it wasn't visible... I can try to check later if there's something to force syncing.

Quote:
Now stuck at "Error: Heroes III data was not found!"
Hm, that's a message from the actual game, right? So launcher detected that the files were added correctly. Are you able to access logs from logcat (through something like "adb logcat -f output.txt")? There should be a line "Accessing data root: /storage/emulated/0/vcmi-data" -- that's the path that gets passed to VCMIDirs. Is it correct?
  Topic: VCMI for Android
Fay

Replies: 210
Views: 164446

PostForum: Development   Posted: 2016-11-24, 00:43   Subject: VCMI for Android
Sooo... first of all, disclaimer -- I have no clue if this works for anyone. :P I tried to make building process straightforward, but it's still a horrible mess.

Compiled apks are here:
https://github.com/Fayth/vcmi-android/releases/download/1/vcmi-api16-20161123-debug.7z (for android 4.1+, only armeabi)
https://github.com/Fayth/vcmi-android/releases/download/1/vcmi-api21-20161123-debug.7z (for android 5.0+, all abis (arm, arm v7a, arm64, x86, x86_64))
Project code: https://github.com/Fayth/vcmi-android
Modified vcmi: https://github.com/Fayth/vcmi/tree/android-support

The app should tell you how to setup the data, but roughly it goes like this: start app -> app detects this is a first run and creates <storage>/vcmi-data folder -> you're supposed to put h3 data there (+optionally mods as well) -> restart the app -> app unpacks internal configs (including extra resolutions submod) to internal location -> start game (it'll probably hang for few seconds before getting to main menu, because data-loading thread in CMT is joined to the ui thread -- this should be changed at some point to load data without blocking main thread).

If you want to try to build it yourself, the rough outline is here: https://github.com/Fayth/vcmi-android/blob/master/building.txt (I'm on win10, it probably should kind of work on linux (except maybe some permission magic in the scripts?), probably won't work on older windows (needs win10 bash for ffmpeg build) and I have no clue abous macs)

I'll try to answer tomorrow if you have any questions etc...

Some thoughts/details about the current state of the project in totally random order:
* currently special characters seem to work correctly for me no matter if I choose CP1250 or CP1252; I'm not sure if this setting is correctly applied...
* building ffmpeg is hell; fortunately someone did it before and I mostly reused his confs ( https://github.com/yesimroy/build-scripts-of-ffmpeg-x264-for-android-ndk ),
* I managed to run the game on my android 7.1, an 4.4.2 and a very old 4.1 (needed some extra hacks to get it running and the game is very slow ;) )
* I'll probably take a break from coding this for a few days,
* vcmi's repository.json is broken and can't be parsed without some non-strict mode (missing commas),
* I tried adding WoG and I think it worked correctly (didn't try to play a lot, but generated the map and didn't crash),
* RMG takes a very long time,
* Higher resolutions should work, but the game is noticeably slower,
* Few times I encountered the problem where the game wouldn't start (both client and server were ready, last thing in the logs are successful autosave, then the game just idled on the loading screen and didn't move to the game),
* I'm probably not the best guy to handle contributions/requests etc and don't really plan to make extensive use of github, so if you want I can add you as owners of the repo or whatever (not sure how, but I assume it's possible).
* I tried to gather are configurable paths into one place (vcmiconf.in), but of course there's a possibility that I forgot about some of them... so if you find some hardcoded absolute paths then let me know ;)
* I think that vcmi like to randomly (?) remove my settings from settings.json reverting selected screen res/codepage (possible during a crash?)
* this is the first time I've ever used python, so not sure about scripts quality ;)
  Topic: VCMI for Android
Fay

Replies: 210
Views: 164446

PostForum: Development   Posted: 2016-11-20, 11:29   Subject: VCMI for Android
Quote:
we use networking for local game anyway
Do you mean it should work correctly without boost IPC in the current version? Hmm, maybe I should check if it works on android. That replacement for IPC was a first thing that worked correctly so I went with it... (currently messaging works like this: client-cpp sends msg to client-java (and enters waiting loop) -> client-java -> server-java -> server-cpp -> (server-inits and messages back) -> server-java -> client-java -> client-cpp -> (atomic_bool gets switched and we exit waiting loop)).

I'll leave stupidAI/battleAI like this for now. It needs to be checked but it doesn't seem that important... For now I'd like to make building process easier and allow for basic config editiing like in standalone launcher.

Quote:
They have some bug on PL letters which suddenly cuts the texts making funny situations like "Troglodyci widz"
As you can see, currently special characters are broken on my version as well. ;) That's probably because vcmi default to CP1252 codepage and I currently don't change it to anything else.

Quote:
If you will need testing reports I can test as hard as possible the game on Android 5.5 , 6.0 and probably some 4.x if I will search a bit.
I have access to various versions of androids at work, but for the last week I've been quite busy and haven't been able to check yet. I'll upload the project soon(ish) and of course you're welcome to test. :)
  Topic: VCMI for Android
Fay

Replies: 210
Views: 164446

PostForum: Development   Posted: 2016-11-19, 16:17   Subject: VCMI for Android
Just want to let you know. I've been working on android version for a couple of days and currently have a quite stable application (vcmi master (0.99), boost 1.61, ffmpeg master, SDL 2.0.5). If there aren't any big issues, I'll try to upload it to github in a few days.

Main changes in vcmi to make it working:
* similarly to xyzz's version, I compiled AI libraries together with main lib; android's support for dlopen/dlsym is broken (it compiles and kind of works, but RTTI between libraries is broken),
* I disabled StupidAI for now (currently always using BattleAI); is StupidAI important? the game seems to work correctly with BattleAI; I didn't search a lot why it doesn't work, but it seems that memory gets corrupted somewhere in there,
* starting server / notifying client that server is ready can't use boost IPC, so these messages go through java (using android's Messenger for a simple IPC)

Currently testing only on my android 7.1, but in theory it should work on 4.1+.

I didn't try to play any game longer than a week, but I think it is quite stable. Playing feels very weird, because map can't be swiped and only viable way to scroll the map is through minimap.
  Topic: View world option implementation
Fay

Replies: 20
Views: 10645

PostForum: Development   Posted: 2015-01-31, 18:58   Subject: View world option implementation
Okaaay, I see now.
Apparently this happens because of weird drawing offsets passed to map handler. Originally initial position of advmap drawing was drawing bounds x/y (in my case: 7/7 -- this is the frame around the map) + parent offset (which for me is... -7/-9). This worked for normal map, because camera could leave the map area anyway, but for world view it basically cuts off half of a first tile (first 7/9px).
This also explains why I had to add +1 to tile count for world view. :)

Anyway, not adding parent offset to initial drawing position seems to fix the display. I'm not sure if this is THE correct solution though.
  Topic: View world option implementation
Fay

Replies: 20
Views: 10645

PostForum: Development   Posted: 2015-01-31, 11:15   Subject: View world option implementation
I fixed gems redrawing. Additionally added hotkey V to enter world view from advmap.

@4 I can't really reproduce this one. I tried WoG/SoD (with and without heroes 3 hd) and it's all the same: (screenshot from SoD)

Map is top-left as far as possible on 2x zoom; there are 3px wide line on the top and 1px on the left and it looks like a bug and not a feature, because this area is not redrawn (the more you scroll or change zoom, the more broken images are displayed there).
 
Page 1 of 2
Jump to:  

Powered by phpBB modified by Przemo © 2003 phpBB Group
Template Chronicles modified by Nasedo modified by Tow.
© VCMI Team
Page generated in 0.12 second. SQL queries: 16