I'm unable to play. (NewGRFs and language packs involved)

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
ragzter
Engineer
Engineer
Posts: 8
Joined: 31 May 2005 21:40

I'm unable to play. (NewGRFs and language packs involved)

Post by ragzter »

I recently downloaded OpenTTD 0.4.0.1, compiled and installed it. I had no problems during the compilation process (and I installed the data files to the data directory) so I tried to start the game directly from the source directory. The game succesfully started and I didn't even configure it, thinking that I might start a New Game right away just to see if things works. Then the game exited abruptly (after clicking on 'New Game'), echoing a couple of lines to my terminal:

Code: Select all

ragzter@sprindl:~/software/openttd-0.4.0.1$ ./openttd
Error: Tried to load non-existing sprite #5423.
Probable cause: Wrong/missing NewGRFs
If I have understood things right these NewGRFs are new kind of sprites or something? I have not configured anything so I don't see why the game is looking for them. I have the original data files, aren't they enough?

Well, however, then I thought my problem would be solved if I did a 'make install' so that's what I did; resulting in a new problem:

Code: Select all

ragzter@sprindl:/usr/local/games$ ./openttd
Error: No available language packs
Your sample.cat file is corrupted or missing!
I checked the data files and they were properly located at "/usr/local/share/games/openttd/data". So now I'm stuck. What shall I do?

Thank you for any help.
User avatar
Invisble
Transport Coordinator
Transport Coordinator
Posts: 341
Joined: 17 May 2005 15:06
Location: England
Contact:

Post by Invisble »

what I have found to work is to just copy the data dir from another install of OTTD (I use one just to throw in diffs ect then to compile) and place that in the folder with the compiled openttd.exe

Works fine for me after that.
ragzter
Engineer
Engineer
Posts: 8
Joined: 31 May 2005 21:40

Post by ragzter »

Thank you for your reply.

I tried that and it still doesn't work. I guess the biggest problem is this with the NewGRFs since I can start the game from the source directory and all. I mean, there is a lot of sprites in the background in the main menu. So they must be loaded? But when I press "New Game" the game exits complaining about sprites.
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

make install is made rather quickly by request. If it works for you, it's fine, if it don't... well we will improve it some day. All the developers just compile with the default paths and put the data dir and lang dir in the same folder as openttd(.exe)
That will work

Make install can also be made to work if you look closely on the paths, but it's not needed or well testet.
ragzter
Engineer
Engineer
Posts: 8
Joined: 31 May 2005 21:40

Post by ragzter »

So I put the data and lang directories in /usr/local/games (where the openttd binary is located) and now it works to start the game from there as well. But the NewGRF problem still exists. Any ideas what this is about?
ragzter
Engineer
Engineer
Posts: 8
Joined: 31 May 2005 21:40

Post by ragzter »

I made a table of my sprites if that could be of any help:
http://teepee.deepwood.net/~ragzter/sprites

By value I mean _sprite_file_pos[id].

Here is a snippet of the table:

Code: Select all

Sprite #5422 has value: 50354600
Sprite #5423 has value: 0
Sprite #5424 has value: 0
Sprite #5425 has value: 0
Sprite #5426 has value: 50354666
Sprite #5427 has value: 50355768
My problem was that sprite #5423 couldn't be loaded (because it has value 0), and it's really annoying since the previous sprite has a value and a couple of sprites later on has values. (see the whole file for further investigation)

Is this a sign of file corruption or are there "reserved slots" or something in these files? If any of my files are corrupted it seems strange since I could play OpenTTD before with my data files. Is this a bug? The "NewGRF" system seems to be something new for OpenTTD 0.4? I don't remember where I saw this but wasn't NewGRF said to be "fully supported/used for OpenTTD 0.4"?

Thank you for any help. I really, really want to play this great game, especially now with this new pathfinding system and all.
ragzter
Engineer
Engineer
Posts: 8
Joined: 31 May 2005 21:40

Post by ragzter »

I fixed the bug! I told the program not to read the sprite if it wasn't defined. I did this by switching the following snippet in function LoadSpriteToMem (in file spritecache.c):

Code: Select all

ReadSprite(sprite, s->data);
with

Code: Select all

if (_sprite_file_pos[sprite] != 0)
  {
    ReadSprite(sprite, s->data);
  }
I don't know if you consider this kludgy but what the hell, now it works!
ragzter
Engineer
Engineer
Posts: 8
Joined: 31 May 2005 21:40

Post by ragzter »

Uh, now when I click on a train depot I get segmentation fault. Is this because I ignore some undefined sprites? Otherwise, the game seems to work perfectly.
Asterix
Engineer
Engineer
Posts: 121
Joined: 04 Apr 2005 18:17
Location: Germany

Post by Asterix »

Could you please list all files that you have in your data-dir?

My guess would be a missing file, and as you already discovered its not such a good idea, to just make the error-message not show up ;)
ragzter
Engineer
Engineer
Posts: 8
Joined: 31 May 2005 21:40

Post by ragzter »

Asterix wrote:Could you please list all files that you have in your data-dir?
Sure thing!

Code: Select all

autorail.grf
canalsw.grf
dosdummy.grf
openttd.grf
opntitle.dat
sample.cat
signalsw.grf
trg1r.grf
trgcr.grf
trghr.grf
trgir.grf
trgtr.grf
trkfoundw.grf
Asterix wrote:My guess would be a missing file, and as you already discovered its not such a good idea, to just make the error-message not show up ;)
Yeah, you're totally right! But I'll do anything to make this game work since my summer vacations starts just about now. :)
Asterix
Engineer
Engineer
Posts: 121
Joined: 04 Apr 2005 18:17
Location: Germany

Post by Asterix »

Ok, at least theres no file missing, but I suspect something...

Please look if your "openttd.grf" has 22.917 Bytes, cause reading this again, it might be you have overwritten one of the current OpenTTD-.grf files with an older one.
(I suspect openttd.grf, but to be sure, here are the filesizes of the other files: autorail.grf, 9.747 Bytes, canalsw.grf, 41.639 Bytes, dosdummy.grf, 90 Bytes, signalsw.grf, 22.939 Bytes, trkfoundw.grf, 91.558 Bytes)
ragzter
Engineer
Engineer
Posts: 8
Joined: 31 May 2005 21:40

Post by ragzter »

Asterix wrote:Please look if your "openttd.grf" has 22.917 Bytes, cause reading this again, it might be you have overwritten one of the current OpenTTD-.grf files with an older one.
Hey, you're right! I overwrote the new one with an old one by mistake! So I switched the old one with the new and now it works! Thank you, Asterix! I hope this was the last problem. ;)
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 15 guests