IMPORTANT: TIME TO DECIDE

Programming, graphics, sound, etc

Moderators: jean.vivien.maurice, Nicosmos, woody, ced117, erin

Forum rules
Due to uncontrollable amounts of spam we will be moving to
https://sourceforge.net/apps/phpbb/extremetuxracer/


New user registration has been disabled for this reason.

Re: IMPORTANT: TIME TO DECIDE

Postby erin » Thu Jun 04, 2009 12:40 pm

That's an initiative! But I'm not alone, first I need some more assessments.

@cpicon92:
The ETR font code is implemented, overall not a problem since the libraries are almost compatible. But the ETR code is slow, extremely slow. It's so slow that it is quite unusable even on the menu screens. The worst function is BBox to get the textlength. It is used to fit text in the textbox and it's intended for the edit widget. Not possible.

I will try to optimize. If not successful I will have to look for another font solution.
erin
 
Posts: 276
Joined: Mon Oct 08, 2007 8:10 am

Re: IMPORTANT: TIME TO DECIDE

Postby cpicon92 » Thu Jun 04, 2009 12:42 pm

That's odd, because it never seemed particularly slow in ETR before. Would you like me to set up a branch in the repository for you?
cpicon92: utilisateur de Windows; défenseur du logiciel emprisonné
a.k.a. kpicon92
User avatar
cpicon92
 
Posts: 865
Joined: Sun Apr 08, 2007 5:06 pm
Location: New York, USA

Re: IMPORTANT: TIME TO DECIDE

Postby erin » Thu Jun 04, 2009 2:55 pm

Would you like me to set up a branch in the repository for you?


Please wait a bit, first I've to fix the font problem.

That's odd, because it never seemed particularly slow in ETR before.


The menus in ETR are not as demanding as in Bunny Hill. I can imagine that the edit widget for new players works a bit slowly, too, doesn't it? Nevertheless, I've detected the reason. The ETR solution works with FTTextureFont wheras I've used the FTPixmapFont. Changing from FTPixmap to FTTexture slows down the original functions in the same way (factor > 50). And the BBox function generates a texture for each size request.
erin
 
Posts: 276
Joined: Mon Oct 08, 2007 8:10 am

Re: IMPORTANT: TIME TO DECIDE

Postby slythfox » Thu Jun 04, 2009 3:51 pm

I got it running on my 32bit Ubuntu box. I took a quick glance at some of the code.

Is there a need for an SDL_Delay at all at line 270 of main.cpp (version 0.08). I know very little c++ programming and c++ game dev, but it looks like you're already regulating FPS using variable delay, so there's no need for another; it just throws off the game. (Regarding the variable delay: it looks like an empty while loop is being used to create a delay... Am I the only one that finds that amusing.) Maybe I'm just reading it all wrong.

I removed it and it doubled my FPS and the game appears to be working fine. I got between 600 and 900 FPS at 1680x1050, compared to 300/500 without the change. (nvidia 9600GSO video card)

Regarding configuration: It would be nice to be able to change [some of the more fundamental] settings without recompiling the game. Without messing with a GUI interface for now, I imagine we could read a config file upon loading of the game,which basically replaces what config.cpp currently does.
slythfox
 
Posts: 177
Joined: Mon Apr 23, 2007 2:41 am

Re: IMPORTANT: TIME TO DECIDE

Postby erin » Thu Jun 04, 2009 7:44 pm

Nice to meet one of the "old" developers ...

Is there a need for an SDL_Delay at all at line 270 of main.cpp (version 0.08). I know very little c++ programming and c++ game dev, but it looks like you're already regulating FPS using variable delay, so there's no need for another; it just throws off the game. (Regarding the variable delay: it looks like an empty while loop is being used to create a delay...


You need only 40 fps. :wink: Seriously: I use the delay to simulate computers with different performance. Sometimes I set it to 0, sometimes to 1, sometimes to 10, sometimes to 30 - and forget to reset it.

Regarding configuration: It would be nice to be able to change [some of the more fundamental] settings without recompiling the game. Without messing with a GUI interface for now, I imagine we could read a config file upon loading of the game,which basically replaces what config.cpp currently does.


Sure, it's on the todo list. I've already said that the program isn't ready yet and writing a config is a boring job but nevertheless much work. I'm alone.
erin
 
Posts: 276
Joined: Mon Oct 08, 2007 8:10 am

Re: IMPORTANT: TIME TO DECIDE

Postby erin » Fri Jun 05, 2009 7:48 am

I've exactly compared the different kinds of generating fonts by displaying the fps on a menu screen (average):

1. Original FTGL with TextureFont: 3 fps
2. Original FTGL with PixpmapFont: 80 fps
3. ETR version with TextureFont: 3 fps

The time is mainly used for drawing about 10 - 20 short strings on a menu screen. Without drawing the strings the program runs with 150 fps in the menu loop. The hack in ETR doesn't enable other fonts than TextureFont. Maybe you don't notice the low performance on a screen with slight requirements. In my opinion, it's not a real solution, and those fonts shouldn't be used on the racing screen.
erin
 
Posts: 276
Joined: Mon Oct 08, 2007 8:10 am

Re: IMPORTANT: TIME TO DECIDE

Postby cpicon92 » Fri Jun 05, 2009 11:17 am

Could the hack be adapted to use Pixmap fonts?
cpicon92: utilisateur de Windows; défenseur du logiciel emprisonné
a.k.a. kpicon92
User avatar
cpicon92
 
Posts: 865
Joined: Sun Apr 08, 2007 5:06 pm
Location: New York, USA

Re: IMPORTANT: TIME TO DECIDE

Postby erin » Fri Jun 05, 2009 12:22 pm

perhaps, probably, I don't know. Currently I've only the compiled version of FTGL installed on my computer. I'm going to download the source code to compare it with the hack.

I ask why the hacker , whoever it was, has used only TextureFont. Is it generally so much slower or does it depend on the system or on the OpenGL version? On the OpenGL website I found this article:

http://www.opengl.org/resources/faq/technical/fonts.htm
erin
 
Posts: 276
Joined: Mon Oct 08, 2007 8:10 am

Re: IMPORTANT: TIME TO DECIDE

Postby erin » Fri Jun 05, 2009 2:28 pm

I don't know, am I erin or am I a stupid penguin?

The code I've called a hack is almost (or entirely ?) the original FTGL code. Is it possible that it works after having it simply integreted in the ETR sources? Hoewer, I've added the pixmap modules and it works as desired. Possibly we can use all kinds of fonts provided by FTGL.

So the font library is statically linked, that seems to avoid a lot of problems. In this context another question. On my Linux system I've all needed libs properly installed in /usr/... That's not a problem since most distributions contain the libs. But what about Windows? Must the user install SDL or freetype separately to get Tuxracer running? Or are these libs statically linked by mingw?
erin
 
Posts: 276
Joined: Mon Oct 08, 2007 8:10 am

Re: IMPORTANT: TIME TO DECIDE

Postby cpicon92 » Fri Jun 05, 2009 6:13 pm

Mingw mostly requires the dependencies to be compiled from source, it's a real pain in the neck. I seem to have working build system together for ETR/bunnyhill (-ftgl), though. If you send me your modifications I could give it a try.
cpicon92: utilisateur de Windows; défenseur du logiciel emprisonné
a.k.a. kpicon92
User avatar
cpicon92
 
Posts: 865
Joined: Sun Apr 08, 2007 5:06 pm
Location: New York, USA

Re: IMPORTANT: TIME TO DECIDE

Postby FreeGamer » Fri Jun 05, 2009 9:55 pm

erin wrote:writing a config is a boring job but nevertheless much work. I'm alone.


Not if you use the right library/format. With JSON, it's a 2 minute task.

http://jsoncpp.sourceforge.net/
Want Free Games?
Free Gamer - open source games resource
FreeGamer
 
Posts: 28
Joined: Wed Apr 11, 2007 9:41 am

Re: IMPORTANT: TIME TO DECIDE

Postby erin » Sat Jun 06, 2009 8:34 am

it's a 2 minute task.


2 minutes? I think we should synchronize our clocks. :wink:

Maybe that an external library has some advantages but it involves other problems. The font library is an example.

@CPicon92

This evening (european time) you can download the code to test if it compiles on Windows. Remember that the font code is part of the source now, so the linker flag -lftgl is no longer required.
erin
 
Posts: 276
Joined: Mon Oct 08, 2007 8:10 am

Re: IMPORTANT: TIME TO DECIDE

Postby FreeGamer » Sat Jun 06, 2009 1:18 pm

It's a lot simpler than the font library. I only suggested it because it is incredibly simple to both use and depend upon.
Want Free Games?
Free Gamer - open source games resource
FreeGamer
 
Posts: 28
Joined: Wed Apr 11, 2007 9:41 am

Re: IMPORTANT: TIME TO DECIDE

Postby cpicon92 » Sat Jun 06, 2009 1:37 pm

erin wrote:This evening (european time) you can download the code to test if it compiles on Windows. Remember that the font code is part of the source now, so the linker flag -lftgl is no longer required.

I may or may not be here to download it in the evening (european time) but I'll do it asap.
cpicon92: utilisateur de Windows; défenseur du logiciel emprisonné
a.k.a. kpicon92
User avatar
cpicon92
 
Posts: 865
Joined: Sun Apr 08, 2007 5:06 pm
Location: New York, USA

Re: IMPORTANT: TIME TO DECIDE

Postby cpicon92 » Sun Jun 07, 2009 5:45 am

everything works fine now except i can't get freetype to work, i think i may have to start over with a fresh install of mingw and try to be a little cleaner. heres what i get when trying to compile in case you have any advice:
Code: Select all
Christian@CPLAPTOP /e/bunnyhill_win
$ make
g++ -c main.cpp -Wall -O2 -I/usr/include/freetype2
In file included from ft_font.h:16,
                 from font.h:13,
                 from main.cpp:25:
e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/ft2build.h:56:38: freetype/config/ftheader.h: No such file or directory
In file included from font.h:13,
                 from main.cpp:25:
ft_font.h:19:10: #include expects "FILENAME" or <FILENAME>
ft_font.h:20:10: #include expects "FILENAME" or <FILENAME>
ft_font.h:21:10: #include expects "FILENAME" or <FILENAME>
ft_font.h:22:10: #include expects "FILENAME" or <FILENAME>
In file included from font.h:13,
                 from main.cpp:25:
ft_font.h:302: error: ISO C++ forbids declaration of `FT_Library' with no type
ft_font.h:302: error: expected `;' before '*' token
ft_font.h:303: error: expected `;' before "FT_Error"
ft_font.h:303: error: `FT_Error' does not name a type
ft_font.h:307: error: expected `,' or `...' before '&' token
ft_font.h:307: error: ISO C++ forbids declaration of `FT_Library' with no type
ft_font.h:308: error: expected `,' or `...' before '&' token
ft_font.h:308: error: ISO C++ forbids declaration of `FT_Library' with no type
ft_font.h:310: error: ISO C++ forbids declaration of `FT_Library' with no type
ft_font.h:310: error: expected `;' before '*' token
ft_font.h:311: error: `FT_Error' does not name a type
ft_font.h:332: error: expected `,' or `...' before '&' token
ft_font.h:332: error: ISO C++ forbids declaration of `FT_Vector' with no type
ft_font.h: In constructor `FTPoint::FTPoint(int)':
ft_font.h:333: error: `ft_vector' was not declared in this scope
ft_font.h: At global scope:
ft_font.h:389: error: `FT_Face' has not been declared
ft_font.h:390: error: ISO C++ forbids declaration of `face' with no type
ft_font.h:398: error: `FT_Error' does not name a type
ft_font.h:400: error: ISO C++ forbids declaration of `FT_Face' with no type
ft_font.h:400: error: expected `;' before '*' token
ft_font.h:401: error: `FT_Size' does not name a type
ft_font.h:405: error: `FT_Error' does not name a type
ft_font.h:419: error: ISO C++ forbids declaration of `FT_Face' with no type
ft_font.h:419: error: expected `;' before '*' token
ft_font.h:420: error: expected `;' before "const"
ft_font.h:422: error: ISO C++ forbids declaration of `FT_Encoding' with no type
ft_font.h:422: error: expected `;' before '*' token
ft_font.h:424: error: `FT_GlyphSlot' does not name a type
ft_font.h:426: error: `FT_Error' does not name a type
ft_font.h:429: error: ISO C++ forbids declaration of `FT_Face' with no type
ft_font.h:429: error: expected `;' before '*' token
ft_font.h:432: error: ISO C++ forbids declaration of `FT_Encoding' with no type
ft_font.h:432: error: expected `;' before '*' token
ft_font.h:434: error: `FT_Error' does not name a type
ft_font.h:461: error: expected `)' before "glyph"
ft_font.h:516: error: expected `)' before "glyph"
ft_font.h:521: error: `FT_Error' does not name a type
ft_font.h:526: error: `FT_Error' does not name a type
ft_font.h:538: error: `FT_Encoding' does not name a type
ft_font.h:539: error: `FT_Encoding' has not been declared
ft_font.h:539: error: ISO C++ forbids declaration of `encoding' with no type
ft_font.h:543: error: `FT_Error' does not name a type
ft_font.h:545: error: `FT_Encoding' does not name a type
ft_font.h:546: error: `FT_Face' does not name a type
ft_font.h:549: error: `FT_Error' does not name a type
ft_font.h:561: error: `FT_Encoding' has not been declared
ft_font.h:561: error: ISO C++ forbids declaration of `encoding' with no type
ft_font.h:569: error: `FT_Error' does not name a type
ft_font.h:575: error: `FT_Error' does not name a type
ft_font.h:584: error: expected `)' before "glyph"
ft_font.h:610: error: `FT_Encoding' has not been declared
ft_font.h:610: error: ISO C++ forbids declaration of `encoding' with no type
ft_font.h:612: error: ISO C++ forbids declaration of `FT_Encoding' with no type
ft_font.h:612: error: expected `;' before '*' token
ft_font.h:628: error: `FT_Error' does not name a type
ft_font.h:635: error: `FT_Error' does not name a type
ft_font.h:688: error: expected `)' before "glyph"
make: *** [main.o] Error 1
cpicon92: utilisateur de Windows; défenseur du logiciel emprisonné
a.k.a. kpicon92
User avatar
cpicon92
 
Posts: 865
Joined: Sun Apr 08, 2007 5:06 pm
Location: New York, USA

PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron