# Simulation [Somewhat] Complete

This topic is 4976 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

As some of you may know, I am doing a car physics simulation in DirectX. It is done for the most part. I thank everyone here on gamedev for all your help, you all helped me out a lot. The physics are fairly basic, and the geometry just ends (so you can drive out in world space:), but that is OK. The conrols are just the arrows to accelerate, decelerate, and turn; the number keys 1-6 to shift gears; and Home and End keys to fly up and down:) If you want to edit the physics constants, do so in CarData.txt, the game parses it when you boot the game up. The only thing that doesn't seem to work is the damn ID3DXFont. It works on some computers, and doesn't work on others. I set it so that on the computers where the font doesn't work, it just doesn't render the text, it does not crash:) This is what is failing on the computers where the font does not work (I had posted this before actually, but never got an answer or figured it out):
if (FAILED(D3DXCreateFont(g_pD3DDevice, 22, 0, FW_NORMAL, 1, false, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
ANTIALIASED_QUALITY, DEFAULT_PITCH|FF_DONTCARE, "Arial", &g_pFont)))
{
if (FAILED(D3DXCreateFont(g_pD3DDevice, 22, 0, FW_NORMAL, 1, false, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE, "Arial", &g_pFont)))
{
g_bText = false;
}
}


I have the game hosted on my OLD geocities site (here), it seems to work well. Enjoy, and if you could possibly figure out why the font only works on some computers, that would be a great help. Again, thank you very much for all the help on this simulation. -Dev578

##### Share on other sites
what is the return code on D3DXCreateFont?

##### Share on other sites
Well, this doesn't help much, but it is returning D3DXERR_INVALIDDATA.

Any help is appreciated,

-Dev578

##### Share on other sites
The font works okay on my coumputer,

This is just a total stab in the dark, but maybe the computers where the call to D3DXCreatefont fails doesn't have the Arial font.

Have you tried changing the font from Arial to Times New Roman ?

Here is my call to D3DXCreatefont from one of my old projects, try it and see if it solves your problem

D3DXCreateFont(pd3dDevice,16,8,FW_NORMAL,0,FALSE,ANSI_CHARSET,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH | FF_ROMAN,"Times New Roman",&m_pText);

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 13
• 9
• 15
• 14
• 46
• ### Forum Statistics

• Total Topics
634065
• Total Posts
3015311
×