raduprv / Eternal-Lands

http://www.eternal-lands.com
Other
158 stars 57 forks source link

Porting to Android (thoughts) #35

Open raduprv opened 7 years ago

raduprv commented 7 years ago

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.

pjbroad commented 7 years ago

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

raduprv commented 7 years ago

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.

pjbroad commented 7 years ago

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

raduprv commented 7 years ago

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

pjbroad commented 7 years ago

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?

raduprv commented 7 years ago

Yes, I think it's a good idea.

raduprv commented 7 years ago

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.

ht990332 commented 7 years ago

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

Sir-Odie commented 7 years ago

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

ht990332 commented 7 years ago

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

raduprv commented 7 years ago

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

ht990332 commented 7 years ago

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

nathanielstenzel commented 7 years ago

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. ;)

raduprv commented 7 years ago

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

pjbroad commented 2 years ago

Shall we close this one?