UFO:Alien Invasion

General => Discussion => Topic started by: noob on April 07, 2007, 10:00:08 pm

Title: Optimization bug connected with language file
Post by: noob on April 07, 2007, 10:00:08 pm
Hi, long time i wasnt here.. decided to try a new ver of ufoai from trunk and it is looking quite good

but there are one f***en bug since first ver of ufoai,
when i tried to use my country language (russian) and looked ufopedia
fps decreased to 10-15, if you are using en translation fps is near 40-60, when you look on russian ufopedia translation fps heavy decreased to 10 or something like it
tried to delete from translation simbols like "--" "!", no effect, somehow its connected with mm font? maybe

win xp sp2
conroe 2 duo 2.1
gf7900gtx
2gb ddr2
73.81

i am not a programmer, but if you can explain me where and how to locate this error (debugging, disasembling, softice...) maybe i can find the reason of this?
Title: Optimization bug connected with language file
Post by: noob on April 08, 2007, 01:49:19 pm
yeah... and its only happaned with russian language...(
when you will use lots of any letter from russian alphabet,
fps will heavy decrease

and i dont think somebody is interesting in fixing this =(
Title: Optimization bug connected with language file
Post by: noob on April 08, 2007, 06:27:45 pm
ok.. its not only russian lang problem ^^
equipment menu(where you choose equipment for soldiers) have the same problem 10-15 fps and its not connected with language in this menu... memory pool?
Title: Optimization bug connected with language file
Post by: Mattn on April 08, 2007, 09:54:59 pm
it's not that we don't want to fix this bug - we want... but there is always much work, many bugs and way to less developers. this seams to be a problem with the utf-8 char rendering in our gl_font.c code (which is a mess at all)
Title: Optimization bug connected with language file
Post by: noob on June 16, 2007, 01:11:01 pm
Quote
equipment menu and etc

fixed by turn off optimisation in nvidia control panel some days ago...
(ye it was this f.. nvidia driver problem)

but utf-8 bug doesnt fixed yet(slow fps with rus translation)
Mattn, maybe you will look this memory leak closer plllllz =(
Title: Optimization bug connected with language file
Post by: Mattn on June 16, 2007, 01:53:27 pm
maybe try to run some profiler and let us know where the bottleneck is - that would really help to track this issue down.
Title: Optimization bug connected with language file
Post by: noob on June 16, 2007, 04:22:40 pm
i am not a programmist, user only =(
so i really dont know how to locate memory leaks in windows
visual project is broken so i cant use this

#define CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>

its some kinda of memory debugger as some peoples said on some forums for visual c++ (if i understand right)
valgrind is only for linux...

mb i should use gdb somehow..., if youll help me to find good tool and say what to do ill try to locate this bug

i have also prog BoundsChecker 6.51 but dont know how to use it...(it's the best for windows as many said)
it doesnt see source of ufoai and it needs some kinda to locate them for this prog

about dev c++ memory debuggers i didnt find anything at all
Title: Optimization bug connected with language file
Post by: Mattn on June 16, 2007, 05:24:02 pm
i don't think that this is a memleak... i suppose this is only about finding the slow part of your font rendering code
Title: Optimization bug connected with language file
Post by: noob on June 17, 2007, 05:16:27 am
maybe... i am not a programmist so dont know, mb there is a way somehow to free memory after rendering text, all constants which was used something like free(all);
mb i said something stupid because dont know c++ =)
Title: Re: Optimization bug connected with language file
Post by: noob on October 07, 2007, 04:40:31 pm
tried last svn.. lol but its not fixed yet
Title: Re: Optimization bug connected with language file
Post by: noob on February 16, 2008, 03:53:18 pm
hope dies last

r.i.p

p.s.
from one russian fan forum(not my post):
"We should be honest - bug is very old. But, because it mention only on utf 8 languages: russian, сzech, сhinese, thai, i has ceased to trust that this will be fixed sometime."
Title: Re: Optimization bug connected with language file
Post by: TroubleMaker on February 16, 2008, 04:26:37 pm
The answer is in Russian. Should moderators object, then I'll translate it to English also.

Нубу.
Самое смешное, что проблема, похоже не совсем в драйвере нвидии. У меня самого ge6200 дома и на работе. Сходные процессоры. Но дома всё пучком, а на работе ТА ЖЕ САМАЯ версия (релиз 2.2) гонит дуру. Есть смысл попробовать более СТАРУЮ версию драйверов.

А вообще, нвидиа творит что-то не то - сразу после установки драйвера на w2k/server перестает нормально стартовать сервер DHCP. Я озадачил технарей из нвидии, они уже третью неделю ломают головы над диагностикой и скриншотами :)

Ты не пробовал запускать игрушку, отключив ВСЁ из автозапусков?
Title: Re: Optimization bug connected with language file
Post by: noob on February 16, 2008, 05:22:26 pm
да много че пробовал =), у мня 1 комп к сожалению, протестить на другой конфе не могу... позырь на аг, тама соответствующая темка про уфо аи,
не только у мня эта трабла, старые дровы скорее всего непокатят, я много какие пробовал серии 4x, 6x и тд и бестолку, только тормоза лишние =) из автозапуска убирал однажды всё, не помогло. как пишут знающие люди проблема чисто в неадэкватности кода к утф8, хотя опять же хз, нужен русский проггер с похожей проблемой, чтобы смотреть код, я пару чуваков хотел сподобить этим заняться, но то некогда, то им влом)...
а какие дрова у тя дома?
вполне возможно что эта трабла только с серией жириков 6xx-7xx, либо она както завязана на винде, ее шрифтами и муи русиком для нее
зыы
все версии гонят дуру, как транк 2.3 так и все ниже до 2.0... баг так и не исправили ни в одной из них =)
Title: Re: Optimization bug connected with language file
Post by: Mattn on February 16, 2008, 08:35:34 pm
only english please
Title: Re: Optimization bug connected with language file
Post by: noob on May 05, 2008, 06:46:49 pm
i am still hoping somebody from programmist dev team will start do this
Quote
[open] Switch over from SDL_ttf to SDL_pango to allow markups and better i18n support
so much time was gone since this topic appeared....  :)
Title: Re: Optimization bug connected with language file
Post by: noob on June 24, 2008, 09:22:41 pm
tried console command
> fontcachelist

when fps begin decreasing got this in console

Code: [Select]
]fontcachelist
Font cache info
========================
...font cache size: 1024 - used 45
...1 collisions for f_smallP8P3Q
...overall collisions 1


when i started a game(heavy decrease of fps in main history dialog first) and after it tried this command:
Code: [Select]
=P> (PP5P;P8QP0P9Q
...13 collisions for f_small2084 P$P5P2 21, 06:00: P!QQ
=P> (PP5P;P8QP0P9Q
...12 collisions for f_small2084 P$P5P2 21, 06:00: P!QQ
=P> (PP5P;P8QP0P9Q
...11 collisions for f_small2084 P$P5P2 21, 06:00: P!QQ
=P> (PP5P;P8QP0P9Q
...10 collisions for f_small2084 P$P5P2 21, 06:00: P!QQ
=P> (PP5P;P8QP0P9Q
...9 collisions for f_small2084 P$P5P2 21, 06:00: P!QQ
P> (PP5P;P8QP0P9Q
...8 collisions for f_small2084 P$P5P2 21, 06:00: P!QQ
P> (PP5P;P8QP0P9Q
...7 collisions for f_small2084 P$P5P2 21, 06:00: P!QQ
P> (PP5P;P8QP0P9Q
...6 collisions for f_small2084 P$P5P2 21, 06:00: P!QQ
P> (PP5P;P8QP0P9Q
...5 collisions for f_small2084 P$P5P2 21, 06:00: P!QQ
P> (PP5P;P8QP0P9Q
...4 collisions for f_small2084 P$P5P2 21, 06:00: P!QQ
P> (PP5P;P8QP0P9Q
...3 collisions for f_small2084 P$P5P2 21, 06:00: P!QQ
P> (PP5P;P8QP0P9Q
...2 collisions for f_small2084 P$P5P2 21, 06:00: P!QQ
P> (PP5P;P8QP0P9Q
...1 collisions for f_small2084 P$P5P2 21, 06:00: P!QQ
P> (PP5P;P8QP0P9Q
...overall collisions 106492

in different menus after starting game its different, for example this
Code: [Select]
5Q
...1 collisions for f_verysmallP P5QP?QP1P;P8P:P0
...1 collisions for f_smallPQP1P5Q
...1 collisions for f_big100000 P:Q
...1 collisions for f_smallCan't transfer (click for more info)
...1 collisions for f_bigP5P4P8P=QQP2P5P=P=P0Q P;P8P=P8Q P>P1P>Q

 QP5P1P5 P?P>QP5
...1 collisions for f_menuP!P=P0Q
...1 collisions for f_bigPP>P2P0Q P1P0P7P0
...1 collisions for f_smallP-P;P5P:QQ
...overall collisions 555

tried mem_stats
Code: [Select]
]mem_stats
Memory stats:
    blocks size                  name
--- ------ ---------- ---------- --------
# 1     10       960B ( 0.001MB) Common: Alias system
# 2   1441    138304B ( 0.132MB) Common: Command system
# 3      0         0B ( 0.000MB) Common: Collision model
# 4    836     73632B ( 0.070MB) Common: Cvar system
# 5     16  16218720B (15.467MB) Common: File system
# 6   5774    382048B ( 0.364MB) Generic
# 7      0         0B ( 0.000MB) Network
# 8      0         0B ( 0.000MB) Server: Game system
# 9     21      1344B ( 0.001MB) Server: Generic
#10   2267    183840B ( 0.175MB) Client: Local (per game)
#11    539     41248B ( 0.039MB) Client: Generic
#12    665    314496B ( 0.300MB) Client: Menu
#13     36      2336B ( 0.002MB) Client: Sound system
#14      0         0B ( 0.000MB) Client: IRC system
#15      0         0B ( 0.000MB) Vid: Generic
#16      7   9961920B ( 9.500MB) Vid: Image system
#17      0         0B ( 0.000MB) Vid: Light system
#18    778  60516960B (57.713MB) Vid: Model system
----------------------------------------
Total: 18 pools, 12390 blocks, 87835808 bytes (83.767MB)

btw strange thing with console fonts in some commands their discription is looking like this, not in english "P5P4P8P=QQP2P5P=P=P0Q P;P8P=P8Q P>P1P>Q"
Title: Re: Optimization bug connected with language file
Post by: noob on June 25, 2008, 03:03:10 pm
found maybe a solution of problem...

http://www.balooga.com/dokuwiki/doku.php?id=lispbuilder-sdl-ttf

interesting moments:
http://osdir.com/ml/games.enigma.devel/2006-10/msg00019.html

quatation:
"It looks like SDL_ttf accesses the font for every displayed cyrillic
character again and again. If you look at the SDL source SDL_ttf.c:
static FT_Error Find_Glyph( TTF_Font* font, Uint16 ch, int want )...."
Title: Re: Optimization bug connected with language file
Post by: noob on September 04, 2008, 12:43:34 pm
found patch for utf 8 buy/sell menu(this bug is still present in current revision)

here it is(bug):
https://sourceforge.net/tracker/index.php?func=detail&aid=1782007&group_id=%20%20157793&atid=805242

patch:
http://sourceforge.net/tracker/index.php?func=detail&aid=1909729&group_id=157793&atid=805244

why nobody from programmist applied it? tested it on revision 15497 (it works)
Title: Re: Optimization bug connected with language file
Post by: Kildor on September 04, 2008, 01:20:46 pm
because «this is not a patch but hack to mask wrong behaviour».
Title: Re: Optimization bug connected with language file
Post by: noob on October 18, 2008, 12:54:46 am
he did it, he did it!

Speed up Cyrillic text by caching result of line wrapping (big change)
Should also fix Chinese line breaking
m_node_text.c: Break MN_DrawTextNode loop early if possible; this stops geoscape from walking through entire message history on every frame.
m_node_text.c: Interface change to R_FontDrawString when using scroll windows: y is now at top of scroll window
r_font.c: Support for truncating lines instead of wrapping (not used yet)
Speed summary Cyrillic: intro sequence went from 4 fps to 50; ufopedia went from 12 fps to 50; geoscape went from 4 fps to 12
Speed summary English: geoscape went from 7 fps to 12; others were already at 50 fps.

congratulation to all russian fans  ;D problem is fixed now
Title: Re: Optimization bug connected with language file
Post by: TroubleMaker on October 20, 2008, 04:42:40 am
he did it, he did it!
As kildor mentioned that in Russian forum, we will check it and, hope, will enjoy it.
Thank you, devs!
Title: Re: Optimization bug connected with language file
Post by: Kildor on October 20, 2008, 05:53:11 am
I`ve already enjoyed this ;-)

Game start to be totally russian-usable on this weekend