Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Special characters in font aren't implemented #769

Open
tehKaiN opened this issue Jul 20, 2019 · 20 comments
Open

Special characters in font aren't implemented #769

tehKaiN opened this issue Jul 20, 2019 · 20 comments

Comments

@tehKaiN
Copy link
Contributor

tehKaiN commented Jul 20, 2019

When special characters are about to be drawn, the game enters exception which stops further drawing of game view. It's easily reproducible in non-english locales (e.g. Polish)

obraz

@tehKaiN
Copy link
Contributor Author

tehKaiN commented Jul 23, 2019

The funny thing is that special chars are working just fine in UI. My guess is that it's not rendered the same way, right?

EDIT: After a bit of digging I see that in-game font uses predefined set of characters bound into pre-baked font atlas texture (my guess is that it comes from S3 data files?). How about generating it dynamically using TTF font?

@paulwedeck
Copy link
Contributor

no you are looking at the legacy font drawer
see LWJGLTextDrawer or AndroidTextDrawer

@tehKaiN
Copy link
Contributor Author

tehKaiN commented Jul 24, 2019

yes, I've discovered it this morning. :)

I've hacked together a bit of code to display '?' characters when trying to display a special char that is not in pregenerated font - It fixed some cases where text printing stopped display of rest of UI, but not all. Perhaps I've not patched all needed code. Nonetheless it confirms that it's special-chars related.

I'll dig into it a bit deeper and then try to scan locale for needed chars and generate font atlas from such charset as we discussed at some point on Discord.

@paulwedeck
Copy link
Contributor

I did it in 419b2e2

@paulwedeck
Copy link
Contributor

It is based on the character I found in the locale_* files and therefore not complete

@tehKaiN
Copy link
Contributor Author

tehKaiN commented Jul 24, 2019

But it's good enough, I guess, since it allows displaying all needed strings. That fixes this issue then. Do you want me to commit '?' replacement afterwards or do you think it's not needed after the fix?

@paulwedeck
Copy link
Contributor

its not necessary because AbstractTextDrawer:222 basically does what your commit would do.

@tehKaiN
Copy link
Contributor Author

tehKaiN commented Jul 24, 2019

okay, so we'll have to wait for a merge then ;)

@PaweX
Copy link

PaweX commented Apr 19, 2020

I also add this:
obraz

"Harbour" is not displayed in the local language. Words are cut at special characters.

Version: 88ba0d9

@paulwedeck
Copy link
Contributor

@PaweX Harbor is not yet localized into Polish so JSettlers will just fallback to English instead of crashing or just showing nothing.

Polish localization can be found here:
https://github.com/jsettlers/settlers-remake/blob/master/jsettlers.graphics/src/main/resources/jsettlers/graphics/localization/labels_pl.properties

The English one as a reference how to call and where to place which entry:
https://github.com/jsettlers/settlers-remake/blob/master/jsettlers.graphics/src/main/resources/jsettlers/graphics/localization/labels_en.properties

@PaweX
Copy link

PaweX commented Apr 19, 2020

Ok, I will do the translation.

P.S. how to change the language of the game? options.prp is ignored. By changing the language of SIII Gold Edition? If yes, how?

@tehKaiN
Copy link
Contributor Author

tehKaiN commented Apr 19, 2020

Also, what are the guidelines for translations? I think they should be as close to original retail as possible, but isn't that the problem for the project in terms of copyright? Perhaps they should be done from scratch instead of almost copy-pasting?

@PaweX
Copy link

PaweX commented Apr 19, 2020

Words can't be copyrighted. If we copied all translation file and it's mechanism maybe that would be potentially a problem. But here is something new.

Yes, as close as possible to original. However with some corrections. Anyway JSettlers is a bit different. I only translate this what haven't been translated yet. I will finish it probably today. But there are some things that, very probably, will need to be updated in the future.

BTW. forester message can be sometimes very annoying. Can't it be switched off by default? Why to inform the player that forester doesn't have enough space for new trees? That's not important, especially when our settlement is already large.

@PaweX
Copy link

PaweX commented Apr 19, 2020

Done. #787

@paulwedeck
Copy link
Contributor

@PaweX options can be set directly via the command line or via %APPDATA%.jsettlers.jsettlers or ~/.jsettlers/.jsettlers

@PaweX
Copy link

PaweX commented Apr 21, 2020

Ok thanks, found it. Is there any command prompt in the game? (If not it would be nice to have it.)

@paulwedeck
Copy link
Contributor

There is nothing similar to a command prompt. What kind of commands are you thinking of?

@PaweX
Copy link

PaweX commented Apr 22, 2020

For the in-game command prompt? Many, basically debugging commands (for single player), e.g:

  • reveal the map
  • control all AI players (boolean variable)
  • player x can't lose (boolean variable)
  • see all players (reveals what other AI players can see)
  • show minerals (boolean variable)
  • show grid (boolean variable)
  • show paths (when settlers move)
  • create material (material id or name)
  • create settler (settler name or id, player id)
  • create vehicle/ship (name or id, player id)
  • create building (name or id, player id)
  • create object e.g. rock (object id or name)
  • change tower owner (player name or id)
  • some graphics commands for debugging
  • show AI army commands (like attack, go here etc. - e.g. drawn as lines on the map)
  • cast spell (spell id or name)
  • create minerals in area (mineral name or id, radius)
  • remove player (removes all buildings)
  • remove all soldiers (player id)
  • remove all settlers (player id)
  • remove all buildings but towers (player id or all)
  • remove all buildings of type (name or id, player id or all)
  • remove all settlers of type (name or id, player id or all) (including soldiers)
  • remove all vehicles/ships of type (name or id, player id or all)
  • player defeated (boolean variable)
  • become a different player (player id) (swaps between these two players)
  • peace time (how long - counting down)
  • commands for AI e.g. attack player x, don't fill towers, don't use priests and magic etc.

Here are just examples. They act as cheats, so there should be a command that makes them available like "sv_cheats 1". Personally I would like to dynamically (during the game play) reveal the map, control all AI or friendly AI and become a different player.

Command prompt would be also for notifying about warnings and errors. I am thinking about command prompt like in all games based on Source Engine (or older engines, even like Quake's engine): Half_Life2, Portal, Counter Strike etc. - it was my favourite command prompt. Or command prompt like in some other games e.g. Minecraft.
I didn't like the one from Settlers IV because it was mixing messages from a game mission, game messages (e.g. you've been attacked) and command prompt and chat.

It would be nice to place "change language" option in the main menu->settings.

@paulwedeck
Copy link
Contributor

--control-all lets you control all players and remove the fog of war via 'w'.
Spells are not yet merged https://github.com/paulwedeck/settlers-remake/tree/priests
Killing all soldiers/ships is already possible via control-all (just select all and click "kill")
You could simply add a change language option to SettingsMenuPanel.java

@PaweX
Copy link

PaweX commented Apr 23, 2020

Thanks for the commands, I was looking for them.
I may try to add it, but I am not Java programmer, (I come from C++ background. I made just one Java program at school :) ). But if you say it's simple, I can have a look at it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants