Help a noob

edited February 2012 in Help request
Hi! :)
I'm trying to understand how to use the Orx engine. I use Grey's tutorials. There's no trouble with №1 and №2, but my project I made using tutorial №3 doesn't work properly. :blush:

Please help! Tell me, what I'm doing wrong. You can download the whole project from the link below.

My project

Comments

  • edited February 2012
    I would like to help you, but when I downloaded the project, my Microsoft Security Essentials detected a trojan in orxp.exe.

    So I'm hesitant to work with the project.
  • edited February 2012
    That said, it did build properly on my system, so it may be a problem with the config files. Check the console output when you run it and look for any errors from the config system.
  • edited February 2012
    aksys, if you build from source you shouldn't have a problem.

    The executables in the pre built binaries are packed, and most anti-viruses don't like that.

    Mystic, can't help you yet... I'm at #2 ;)
  • edited February 2012
    The executable runs, but there isn't any walk animation for the soldier's picture it should have according the tutorial. I spend two days trying find out where is the problem, without a result.
  • edited February 2012
    Mystic, tutorial #4 included with Orx demonstrates the animation in a similar way.

    Why don't you use its source code as a starting point for experimentation?
  • edited February 2012
    acksys, because I want to know what's wrong with the current project to avoid mistakes in the future. Thanks for a hint, I'll use it :)
  • edited February 2012
    Hi Mystic,

    I just got your project (took me for ever to find the right link on the page, btw ^^) and will have a quick look to see if I can spot an error without building it.

    As for the compressed exe issue with antivirus, I think I'll just sync the 1.3 release and replace the dev package with an un-compressed one, that'll be much easier for everybody. :)
  • edited February 2012
    Hello!

    So the only thing I could see was an early return in your StandAlone.cpp, line 37, which would prevent from executing all the code that's placed after (creating a clock, targeting the walk right anim, etc...).

    I don't have vs2010 so I created a quick project with vs2008, used your project folders for include/lib and compiled the debug & release.

    When removing the early return everything looks nice to me, at least the soldier is animated. :)
    I couldn't find any other issues.

    Hope this helps! :)

    Cheers!
  • edited February 2012
    iarwain, thank you very much! It works now :) Now I can proceed to a next tutorial B)
  • edited February 2012
    Hi, it's me again. I've got a new problem I hope you will help me to solve. :blush:

    I'm trying to use a custom font in my Orx project. It's a .ttf file that contains English and Russian characters.
    I placed it in the /myproject/data/fonts folder and specified ../data/fonts/font.ttf in the main .ini file as it shown in the attached screenshot.
    Orx.jpg
    It doesn't work, any text in the game window uses the default Orx font. Can anyone explain to me what's wrong and what should I do to use my font in the game? :side:
    Orx 217.9K
  • edited February 2012
    That does not work because what you need to put for Font is actually an Orx config Font template.. not the .ttf file.

    The config font template specifies info about the characters in the font, its spacing and an image file with all the characters. There is also a tool that comes with Orx called orxfontgen that can be used to create these things from a .ttf file.

    Here's some more info on the font template and orxfontgen: http://orx-project.org/wiki/en/orx/config/settings_structure/orxtext

    Here is a sample directly from my project of how to specify a font template:
    [F-Sam-20]
    CharacterList = " !+-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
    CharacterWidthList = 7#3#7#10#10#6#10#10#10#10#10#10#10#10#10#10#10#10#10#10#10#10#7#7#10#10#13#10#10#10#10#10#10#13#10#10#13#10#13#10#10#10#10#10#10#10#10#10#7#7#10#10#13#10#10#10#10#10#10#13#10#10#13#10#13#10
    CharacterHeight = 20
    CharacterSpacing = (2, 2, 0)
    Texture = Sam.tga
    

    So then you would have a line Font = F-Sam-20 in the [Display] section.
  • edited February 2012
    Hmm, actually Mystic, sorry, I just tried this myself in the Display section and it didn't work for me either. Maybe iarwain can tell us why.

    I do know what I described above does work when you are specifying a font when creating individual Text objects rather than specifying a default in the Display section.
  • edited February 2012
    Thank you for an answer! Could you tell me how to use the orxFontGen tool?
  • edited February 2012
    Of course. The details of its use are described well in the link I sent earlier.

    But basically you need to create a text file containing all the characters you want generated from the font (see the CharacterList I specified above, add to it if necessary, and call it input_chars.txt). Don't forget the space character if you need it!

    Then go to your command prompt and navigate to the directory containing the .exe (on my Windows machine, it's C:sdkandroid-ndk-r7sourcesorx oolsorxFontGeninwindows for example). Then run the command like this:

    orxfontgen -t input_chars.txt -f myfont.ttf -s 20

    Specify -s other than 20 for a different size.

    When the tool runs, it will create a .tga image file which can be used in the Font template. It also generates the Font template itself into an .ini file. You can just cut and paste the contents of that .ini into a config file you are already using if you want.
  • edited February 2012
    Thank you very much! :) I did everything as you told me, then put necessary info into the .ini file with my text strings:
    Orx-06fcfb6e404c1af2566e996a41bc4809.jpg
    and now the test string uses my font :cheer:
    But there is nothing happens when I try to make an application use my font declaring the font in the [Display] section of the main .ini file, just as you said.
    Thanks for your help! :)
  • edited February 2012
    You're very welcome. iarwain can probably comment on the use of the Font key in the Display section.

    One tip: it would probably be better to start a new forum thread for a completely new question, because it makes the answers easier to find for new people.

    Let us know if you need any help. I hope you are enjoying learning Orx as much as I have been.
  • edited February 2012
    Thank you! Yes, I enjoy it so much I can't even think about any other engine :)
    And one more problem with fonts - I can't use Russian characters and I've got no idea why. When I execute orxFontGen it doesn't find any.
  • edited February 2012
    I have no experience to share on that. English is my native language and I have not worked with any other character sets.

    Maybe try a different font to rule out the TTF as a problem?

    P.S. Have you looked at this tutorial yet: http://orx-project.org/wiki/en/orx/tutorials/standalone. It shows examples of localization for different languages, so it might be of interest to you.
  • edited February 2012
    Hi there!

    Thanks acksys for the support and sorry for the late answers! :)

    So as you found out, the Display section doesn't care much for fonts. Fonts are declared in their own separate section and are linked to texts.
    So there isn't any way to override the default function. However one can do something like that:
    [Text]
    Font = MyFont
    
    [MyText@Text]
    
    [MyOtherText@Text]
    

    As for the character list, the idea was to use on the command line all the files that contains the text you're going to display, the tool would then collect all the characters for you and extract them from the .ttf. This was mostly for Chinese-like alphabets that containt tens of thousands of glyphs. :)
    Using a self made character list file works too and is probably more handy for smaller alphabets such as latin and cyrillic.

    Lastly, if you have the cyrillic characters in your .tff and in the text file you provie to orxfontgen, you shouldn't have any trouble.
    Just verify that all the character files you give are encoded in UTF-8, that's the only unicode encoding supported by orx. :)
  • edited February 2012
    Thank you for answers!
    But I still can't extract cyrillic characters from any .ttf file I have.

    Here is a text from .log file:
    [2012-02-12 16:34:16] <LOG> (ProcessSizeParams() - srcorxFontGen.c:368) [SIZE] Character size set to '20'.
    [2012-02-12 16:34:16] <LOG> (ProcessFontParams() - srcorxFontGen.c:462) [FONT] Using font 'font1.ttf'.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
    [2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:271) [LOAD] 'input_chars.txt': added 23 characters.
    [2012-02-12 16:34:16] <LOG> (ProcessInputParams() - srcorxFontGen.c:301) [LOAD] 'input_chars.txt': SUCCESS.
    [2012-02-12 16:34:16] <LOG> (Init() - srcorxFontGen.c:622) [MODE] Output mode set to non-monospace.
    [2012-02-12 16:34:16] <LOG> (Init() - srcorxFontGen.c:639) [PACKING] Characters will be packed.
    [2012-02-12 16:34:16] <LOG> (Run() - srcorxFontGen.c:726) [OUTPUT] No output name specified, defaulting to 'orxFont'.
    [2012-02-12 16:34:16] <LOG> (Run() - srcorxFontGen.c:829) [PROCESS] Calculated character size: 9 x 20.
    [2012-02-12 16:34:16] <LOG> (Run() - srcorxFontGen.c:830) [PROCESS] Calculated character spacing: 2 x 2.
    [2012-02-12 16:34:16] <LOG> (Run() - srcorxFontGen.c:831) [PROCESS] Calculated texture size: 42 x 110.
    [2012-02-12 16:34:16] <LOG> (Run() - srcorxFontGen.c:1006) [PROCESS] 23 glyphs generated in 'orxFont.tga'.
    [2012-02-12 16:34:16] <LOG> (Run() - srcorxFontGen.c:1015) [SAVE] 'orxFont.ini': SUCCESS.
  • edited February 2012
    This really looks to me like your input_chars.txt file isn't encoded with the UTF-8 format.

    Would you mind sending us the file? (input_chars.txt)

    EDIT: And the .ttf file as well, this way we can try the full export process. :)
  • edited February 2012
    Finally, it works! I saved input_chars.txt in UTF-8 and now I've got characters I need :) Thank you very much!
  • edited February 2012
    No worries. I'm glad it worked. :)
Sign In or Register to comment.