Eternal-Lands icon indicating copy to clipboard operation
Eternal-Lands copied to clipboard

Porting to Android (thoughts)

Open raduprv opened this issue 8 years ago • 15 comments

Ok, so I've been thinking about the Android port for the last few days, and I think the following things need to be done:

Things that have to be removed from the client:

  1. Auto updates. We barely use it, and it is more difficult to implement properly on Android. We can also get rid of the zlib stuff.
  2. Logging. There is no point to have a chat log or other logs on Android, except for debugging purposes.
  3. Quite a few options will have to be removed from the Settings window.
  4. As I mentioned in the previous issue, we should get rid of the libxml2 and xml files, and instead have a tool that 'compiles' all the XML stuff into a binary format that the client loads at runtime.
  5. Screensaving ability. There is no need for this, and we get rid of the png library.

Things that have to be added:

  1. SDL2 port. This is really necessary for an Android port, and it is potentially good for non Android based devices that have a touch screen, since we can use touch stuff. Sir_Odie is working at this.
  2. If https://github.com/ptitSeb/glshim doesn't work, then we need to rewrite the OpenGL stuff to GLES 1.5
  3. Support for gestures.
  4. Support for the software keyboard.

Things that have to be changed:

  1. The whole GUI system needs to be redesigned (maybe just enlarged)? Probably all the GUI windows should be full screen, and have the inventory/trade window merged in case there is a trade.
  2. The fonts will probably have to be made much larger.
  3. File system functions might have to be changed a bit, but we'll have to see.
  4. Probably all the textures would have to be reduced in size. Most phones don't have enough video memory for all of them, and the GPUs might be fill rate limited.
  5. The way to identify the object under the mouse/finger will probably have to be changed.

This should be about it. Let me know if you think I missed something, or if you have some other ideas.

raduprv avatar Oct 07 '16 00:10 raduprv

Are you intending to keep one code base for the desktop client and this port to Android?

pjbroad avatar Oct 07 '16 22:10 pjbroad

I think we should use the same code base for both, because some of the things done for Android, such as touch based gestures and OpenGL ES would be useful for non Android devices as well. However, we should probably have some source files especially done for Android, and add them to the Android build.

raduprv avatar Oct 07 '16 22:10 raduprv

OK. I do not know much about C/C++ on Android. Do you intend to the Android NDK and the Android Studio build system?

pjbroad avatar Oct 08 '16 01:10 pjbroad

Yes, I did play with some SDL2 programs 2 years ago. I will try it as soon as we get the SDl2 port ready.

raduprv avatar Oct 08 '16 01:10 raduprv

I posted on the forums a few weeks ago about modifying the client UI components to be scalable for high DPI screens. I was thinking to to make each component individually scalable but with a global setting also applied. The main work will be in making each of the components work in this way. I think this would be useful for the Android / touch changes too. What do you think?

pjbroad avatar Oct 08 '16 11:10 pjbroad

Yes, I think it's a good idea.

raduprv avatar Oct 09 '16 19:10 raduprv

So, Sir Odie worked at the SDL2 port, and he got a working client! There are some problems, but it is functional. pjbroad, can you take a look at the SDL2 branch, and try to fix some of the keyboard handling issues? Sir Odie is not familiar with the GUI/interface system.

raduprv avatar Oct 20 '16 17:10 raduprv

Some compile failures on Linux. http://pastebin.com/raw/NbLsZn7j And the Makefile needs to call sdl2-config.

ht990332 avatar Oct 22 '16 08:10 ht990332

I have no Linux to test atm, so please test if my last patch helps.

Sir-Odie avatar Oct 22 '16 11:10 Sir-Odie

CC events.o events.c: In function ‘HandleEvent’: events.c:105:20: error: ‘SDL_SysWMEvent {aka struct SDL_SysWMEvent}’ has no member named ‘x11’ if (event->syswm.x11->event.xevent.type == SelectionNotify) ^ events.c:106:29: error: ‘SDL_SysWMEvent {aka struct SDL_SysWMEvent}’ has no member named ‘x11’ finishpaste(event->syswm.x11->event.xevent.xselection); ^ events.c:107:25: error: ‘SDL_SysWMEvent {aka struct SDL_SysWMEvent}’ has no member named ‘x11’ else if (event->syswm.x11->event.xevent.type == SelectionRequest) ^ events.c:108:31: error: ‘SDL_SysWMEvent {aka struct SDL_SysWMEvent}’ has no member named ‘x11’ process_copy(&event->syswm.x11->event.xevent.xselectionrequest); ^ make: *** [Makefile.linux:119: events.o] Error 1

ht990332 avatar Oct 22 '16 11:10 ht990332

If this is in relation to the Android port, those things will be #ifdefed out anyway, as they are X11 related.

raduprv avatar Oct 28 '16 16:10 raduprv

@raduprv, If you mean my build error, no it was on Linux. So I'm sorry for posting in the wrong place.

ht990332 avatar Oct 30 '16 06:10 ht990332

I would suggest keeping the logging for dispute resolution and moderator assistance. The ability to purge the logs to an email would help keep bloat down. The ability send the day's logs to a moderator would be helpful. Or the moderators could pull logs. ;)

nathanielstenzel avatar Dec 30 '16 09:12 nathanielstenzel

As I was mentioning, the logs are not accessible outside of the EL app (except on rooted devices).

raduprv avatar Dec 31 '16 00:12 raduprv

Shall we close this one?

pjbroad avatar Apr 03 '22 12:04 pjbroad