Jump to content
Eternal Lands Official Forums
bluap

[Closed] New development version of the Android client

Recommended Posts

9 hours ago, Grum said:

Just leaving this out here in case someone else wants to look further, because I have to stop now:

 

The crash seems to be related to Font::draw_ortho_ingame_string(), responsible for drawing the actor names and other banner text. It looks as if trying to draw even a single quad in there will cause a crash at some point, though I have no clue why that would be, or why the crash only seems to occur during or after a fight.

Interesting. I've tried turning off character names from the banner without modifying the client and have not had a crash so far. It might be worth others giving that a try. I note the banner names uses a pointer to the actor in the call the the draw function. Perhaps that's becoming invalid when the creature dies.

 

Edit: well I fought many more creatures but it did eventually crash. Seems like we're close.  Trying no banners at all....

 

Edit 2: No crashes with no banners enabled. This with nearly a hundred despatched creatures. I'd be really interested to here how others fair.

 

You can turn off banners by long pressing the banner and selecting the context menu options.  To restore the name banners if everything is off you can use "#keypress #K_VIEWNAMES". This needs improving ...

Edited by bluap

Share this post


Link to post
Share on other sites
6 hours ago, bluap said:

Interesting. I've tried turning off character names from the banner without modifying the client and have not had a crash so far. It might be worth others giving that a try. I note the banner names uses a pointer to the actor in the call the the draw function. Perhaps that's becoming invalid when the creature dies.

 

Edit: well I fought many more creatures but it did eventually crash. Seems like we're close.  Trying no banners at all....

 

Edit 2: No crashes with no banners enabled. This with nearly a hundred despatched creatures. I'd be really interested to here how others fair.

 

You can turn off banners by long pressing the banner and selecting the context menu options.  To restore the name banners if everything is off you can use "#keypress #K_VIEWNAMES". This needs improving ...

 

Using instance mode banners I don't get the crash if only my banner is visible. When I turn on the mob's banners, I start seeing the crash again.

Share this post


Link to post
Share on other sites

This is one aggravating bug. As far as I can tell:

  • The crash only occurs when we draw banner text
  • Replacing quads with triangles in draw_ortho_ingame_string() does not help
  • Turning off texturing and just drawing filled rectangles does not help
  • The crash is triggered most easily when the name is drawn. But the health/mana texts will cause a crash as well, though less frequent.
  • bluap quite reasonably suggested that the pointer to the string might be invalidated if the character dies. But the actor is not removed (immediately) when it dies. Just to be sure I merged my actors_list_lock branch which should prevent unlocked access to the actors, and I still get crashes.

I'm starting to run out of ideas. Perhaps the matrix stack overflows? But then I don't understand why drawing the health bars does not seem to result in errors.

 

EDIT: BTW, the GL_INVALID_ENUM error is caused by the GL_TEXTURE_MAX_ANISOTROPY_EXT parameter in textures.c. Removing the corresponding call to glTexParameterf() does not prevent the crash, however.

EDIT 2: replacing the string to draw with a constant string "blob" in draw_ortho_ingame_string() still causes the crash, so I think we can rule out that the crash is due to an invalid string pointer.

Edited by Grum

Share this post


Link to post
Share on other sites
35 minutes ago, Entropy said:

Ok, this is very strange. I mean, why the hell does it only happen when fighting?

 

Beats me. The only thing I can think of is that an actor animation command somehow subtly messes up the OpenGL state, which is exposed when drawing the banner. No idea which one, randomly commenting out stuff does not help :/ Either that or a bug in gl4es.

 

Speaking of which, the fact that there's exactly one version of gl4es that works is somewhat troubling in itself. 

 

I've been trying to bisect, but as Nogrod noticed, that's near impossible since the bisection points refer to the main branch which is missing all the Android stuff. Perhaps we should at some point merge the Android branch back into main, so this can be prevented for future bugs. Does not help us now though :(

 

Edit: we should resolve this soon. My wife wants her phone back :)

 

 

Edited by Grum

Share this post


Link to post
Share on other sites

I gave the new android client another try and the only "weird" thing I noticed is that the UI was really big for my screen when starting, almost unusable.

I had to go into the settings and change the User interface scaling factor.

Finding the option to reduce the size of the UI was not easy...

Maybe a future version could have a first time only config window appear to help the user define/confirm the scaling factor, and any other important settings. (I'll add this to the suggestion forum later).

 

Regarding chat, I did miss the local chat separate from the rest.

I was trading with bots and it was a bit weird to have scroll back to see the local chat messages history.

I did not find the option to bring back the separate local chat, I assume it was removed to simplify the options and have less stuff there. (I'll add this to the suggestion forum later).

 

The new Keyboard button is quite nice, and really useful.

I did notice that the button is not scaling with the rest of the UI, but that could be a feature.

The button not scaling with the rest of the UI is not causing any usability issues for me.

 

I did some harvesting, traveling, bot trading, NPC dialogs, and everything worked.

It does get a bit of time to get used to the android client controls, but if you spend a bit of time on it, the overall experience is quite nice.

 

Great work!

 

P.S.: I'll continue to use the client in the coming days and report any issues here.

 

Share this post


Link to post
Share on other sites
6 hours ago, ladrilho said:

I gave the new android client another try and the only "weird" thing I noticed is that the UI was really big for my screen when starting, almost unusable.

I had to go into the settings and change the User interface scaling factor.

Finding the option to reduce the size of the UI was not easy...

Maybe a future version could have a first time only config window appear to help the user define/confirm the scaling factor, and any other important settings. (I'll add this to the suggestion forum later).

 

That is strange, do you know the native resolution of your screen?  Do you know that the scale was set too?  The first time the client runs, it sets the initial scaling factor based on the screen resolution.  It should probably be DPI based but I've found that unreliable previously.  The simple config window would be a nice addition.

 

6 hours ago, ladrilho said:

Regarding chat, I did miss the local chat separate from the rest.

I was trading with bots and it was a bit weird to have scroll back to see the local chat messages history.

I did not find the option to bring back the separate local chat, I assume it was removed to simplify the options and have less stuff there. (I'll add this to the suggestion forum later).

 

That's something I included from the original version, I'm not sure why those setting are disabled but I suspect it would OK to enable them.  I'll check.

 

6 hours ago, ladrilho said:

The new Keyboard button is quite nice, and really useful.

I did notice that the button is not scaling with the rest of the UI, but that could be a feature.

The button not scaling with the rest of the UI is not causing any usability issues for me.

 

The "Keyboard" button font is scaled using the chat font size; the button to be the same hight as the input field.

 

6 hours ago, ladrilho said:

I did some harvesting, traveling, bot trading, NPC dialogs, and everything worked.

It does get a bit of time to get used to the android client controls, but if you spend a bit of time on it, the overall experience is quite nice.

 

Great work!

 

P.S.: I'll continue to use the client in the coming days and report any issues here.

 

Good to hear!

Share this post


Link to post
Share on other sites
On 25/11/2021 at 7:50 PM, Grum said:

Beats me. The only thing I can think of is that an actor animation command somehow subtly messes up the OpenGL state, which is exposed when drawing the banner. No idea which one, randomly commenting out stuff does not help :/ Either that or a bug in gl4es.

 

Speaking of which, the fact that there's exactly one version of gl4es that works is somewhat troubling in itself. 

 

I've used a lot of time trying to get more recent versions working.  I know Radu suggests getting in touch with the developer but I've not done so so far.

 

On 25/11/2021 at 7:50 PM, Grum said:

I've been trying to bisect, but as Nogrod noticed, that's near impossible since the bisection points refer to the main branch which is missing all the Android stuff. Perhaps we should at some point merge the Android branch back into main, so this can be prevented for future bugs. Does not help us now though :(

 

Yep, I was going to propose merging after this release.

 

On 25/11/2021 at 7:50 PM, Grum said:

Edit: we should resolve this soon. My wife wants her phone back :)

 

Same here.

Share this post


Link to post
Share on other sites

If we can't figure the problem out in a week or so, I guess the only fix is to disable the name of the mobs. Normally it shouldn't be a huge issue, as the name is usually superfluous.

 

Share this post


Link to post
Share on other sites
13 hours ago, Entropy said:

If we can't figure the problem out in a week or so, I guess the only fix is to disable the name of the mobs. Normally it shouldn't be a huge issue, as the name is usually superfluous.

 

This is already available as an option - perhaps add as an extra button on the troubleshooting section?

 

Talking of the name being superfluous - any chance of getting a fix to make identical mobs differentiated - even if just by colour - ie breaker vs yeti

Share this post


Link to post
Share on other sites

Not making any progress on the crash. Some more data points:

  • you don't need to be the one fighting, the crash can happen with another player fighting in your view.
  • draw_actor_banner() is called from draw_actor_banner_new(), both of which push the modelview matrix. I had hoped that by removing one push the situation would improve, but no such luck.
  • drawing with a constant z value of 0.0 does not help
  • printing the arguments to draw_ortho_ingame_string() shows nothing our of the ordinary
  • Copying the actor name to a temporary before drawing does not help (why would it? I dunno, at this point I would be tearing my hair out if that were feasible).

 

EDIT: interestingly, drawactor_floatingmessages() which does something very similar to the banner name/stats drawing code, seems to cause no issues.

Edited by Grum

Share this post


Link to post
Share on other sites
3 hours ago, Grum said:

EDIT: interestingly, drawactor_floatingmessages() which does something very similar to the banner name/stats drawing code, seems to cause no issues.

 

I found that disabling floating messages prevents the crash even when I have mobs' banner with Names and HP enabled.

Share this post


Link to post
Share on other sites
6 hours ago, Raz said:

This is already available as an option - perhaps add as an extra button on the troubleshooting section?

 

Talking of the name being superfluous - any chance of getting a fix to make identical mobs differentiated - even if just by colour - ie breaker vs yeti

 

Yes, but I think this disables the player names too, no? And we don't want that.

As for making them different, that would require some extra time and skillsets we don't currently have.

Share this post


Link to post
Share on other sites
6 hours ago, Entropy said:

 

Yes, but I think this disables the player names too, no? And we don't want that.

 

 

You can separate that in the options.

PL1vyaI.png

Share this post


Link to post
Share on other sites
20 hours ago, Nogrod said:

 

I found that disabling floating messages prevents the crash even when I have mobs' banner with Names and HP enabled.

Thanks, you are right. That observation allowed me to zoom in a little further on the problem, unfortunately still without a full solution.

 

New observations:

  • The crash only seems to occur when we draw multiple strings in a banner, e.g. health or exp updates as well as the character name.  Strangely, though, it seems that player name and stats next to the bars can coexist?
  • There does not need to be fighting for the crash to occur, it can also happen when e.g. you simply heal a point with a positive food level.
  • When I disable alpha testing in draw_ortho_ingame_string(), the game no longer crashes. But then the text has a solid black background.
  • I have tried saving and restoring the current alpha test function in draw_ortho_ingame_string(), but that does not help.
  • I hate state machines in general, and the OpenGL one in particular ;)

 

 

Share this post


Link to post
Share on other sites
48 minutes ago, Grum said:

Strangely, though, it seems that player name and stats next to the bars can coexist?

 

That actually gave me an idea. For the bouncing damage numbers, the depth test function is set to GL_ALWAYS, so that they are always visible. For names and health bar texts, the test function is GL_LESS, so that they can be obscured by objects in the world. Allowing the damage updates to be obscured as well:

diff --git a/actors.c b/actors.c
index 26f6e574..32842fb5 100755
--- a/actors.c
+++ b/actors.c
@@ -533,7 +533,8 @@ void draw_actor_banner(actor * actor_id, float offset_z)
 
        glColor3f (1.0f, 0.0f, 0.0f);
 
-       glDepthFunc(GL_ALWAYS);
+//     glDepthFunc(GL_ALWAYS);
+       glDepthFunc(GL_LESS);
        if(actor_id->damage_ms){
                if(floatingmessages_enabled){
                        float a=(float)(cur_time-actor_id->last_health_loss)/2000.0f;
@@ -594,7 +595,7 @@ void draw_actor_banner(actor * actor_id, float offset_z)
                }
        }
 
-       glDepthFunc(GL_LESS);
+//     glDepthFunc(GL_LESS);
 
        //figure out which lines should we display
        display_health_line = (actor_id->kind_of_actor != NPC && (display_hp || display_health_bar) && actor_id->cur_health > 0 && actor_id->max_health > 0);

seems to resolve the crashes for me. Why? No idea, but it seems to work. The disadvantage is of course that damage updates can now be obscured by world objects or other text in front of them.

Share this post


Link to post
Share on other sites
1 hour ago, Grum said:

 

That actually gave me an idea. For the bouncing damage numbers, the depth test function is set to GL_ALWAYS, so that they are always visible. For names and health bar texts, the test function is GL_LESS, so that they can be obscured by objects in the world. Allowing the damage updates to be obscured as well:

...

seems to resolve the crashes for me. Why? No idea, but it seems to work. The disadvantage is of course that damage updates can now be obscured by world objects or other text in front of them.

 

This seems to resolve the crashes for me too. Strangely, I can still see floating messages through objects such as houses so maybe there is no disadvantage to this fix.

Share this post


Link to post
Share on other sites
16 hours ago, Nogrod said:

 

This seems to resolve the crashes for me too. Strangely, I can still see floating messages through objects such as houses so maybe there is no disadvantage to this fix.

Good to hear!

 

the exp updates are unaffected, this is only for the damage numbers. 

EDIT: You are correct The damage numbers are drawn at z=0, so on top of everything else. So while checking the depth buffer should be superfluous, it should not change the behaviour of the game.

 

Edited by Grum

Share this post


Link to post
Share on other sites
On 11/29/2021 at 4:28 AM, Aislinn said:

 

You can separate that in the options.

PL1vyaI.png

 

Where can you disable the animal names? I don't see it in that picture.

Share this post


Link to post
Share on other sites
2 minutes ago, Entropy said:

 

Where can you disable the animal names? I don't see it in that picture.

 

"Creatures instance banners - names"

You just uncheck the box.

 

To do this, you have to check the box "Use instance mode banners", which allows you to customize what you see and how you see it for both players and creatures/mobs.

Share this post


Link to post
Share on other sites
9 hours ago, Entropy said:

Ok, that's great to hear! Bluap, can you do another apk with those changes?

Good news indeed, looks to be a fixed for my wife's phone too.  Nicely done!

I've built a RC4 android package with the fix, replacing RC3.  As before, this is the new data version signed with the release key.

https://github.com/raduprv/Eternal-Lands/releases/download/1.9.6.0-rc2/EternalLands-Android_1.9.6.0-rc4.apk

 

I've also done a build with the old data, signed with my debug key for those using the package from this thread:

The latest build  el-1.9.5-20211130.2302.apk: (also in RC4)

  • Fixed not closing the keyboard at login if using SSL.
  • Enable full screen toggle (video tab).
  • Fix issue for remembered windows positions if resolution changed before client restart (including portrait / landscape changes).
  • And of course Grum's fix for crashing when fighting on some GPUs.

 

Edited by bluap

Share this post


Link to post
Share on other sites

@bluap hi bluap, first of all I want to mention that u did. and do a great job again! Thanks for that.

I just tried the new Version and I can say that My game doesnt crash anymore while being in combat, thats awesome.

 

I did find some „holes in the ground“- dunno if it is a thing here but the two ones were in :

 

- You are in Morcraven Marsh Caves [101,140]
-You are in Morcraven Marsh [76,112]
 

Just wanted to mention those, if already known forget about those lines :)

 

I will test more and will Report if I am going to find more issues/bugs!

 

Sam

Share this post


Link to post
Share on other sites

I had the same "issue" with the UI scaling when I installed the latest version (UI too big).

My phone is a Galaxy s10+ with resolution FDH+ 2280x1080.

The scaling factor is set to 2.90 by default.

Is there something I can do to add more useful information for you?

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×