Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Thu May 23, 2013 5:37 pm

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 437 posts ]  Go to page Previous  1 ... 18, 19, 20, 21, 22
Author Message
PostPosted: Thu Feb 18, 2010 6:05 pm 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
0A is encoded in 0.dat as a variable-sized property. (It could be encoded as a single word, but that would lose the \b... \b... formatting.) As such, it appears one value per line instead of in columns. In this case, it would be OK to put it in columns, but NFORenum cannot tell the difference between properties like this and ones like station property 09 or industry property 0A. I may yet change this, but it didn't happen this time.

With the default LEADINGSPACE setting, you get something more like
Code:
 1517 * 82    00 07 15 02 E8
                 08 6D           6D
                 09 24           00
                 0A \b1930 \b2175
                    \b1930 \b2175
                 0B 0A           00
//...


The one-value-per-line condition becomes more obvious when there are more values:
Code:
 1517 * 0     00 07 01 04 E8
                 0A \b1930 \b2175
                    \b1930 \b2175
                    \b1930 \b2175
                    \b1930 \b2175

_________________
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser


Top
 Profile  
 
PostPosted: Fri Feb 19, 2010 4:18 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Apr 16, 2003 4:09 pm
Posts: 4177
Location: SPb, Russia.
DaleStan wrote:
0A is encoded in 0.dat as a variable-sized property. (It could be encoded as a single word, but that would lose the \b... \b... formatting.) As such, it appears one value per line instead of in columns. In this case, it would be OK to put it in columns, but NFORenum cannot tell the difference between properties like this and ones like station property 09 or industry property 0A. I may yet change this, but it didn't happen this time.
With the default LEADINGSPACE setting, you get something more like
The one-value-per-line condition becomes more obvious when there are more values:
As I expected, it is a feature, not a bug. Because it can cause issues with other actions 0, let us leave it as is.

_________________
ImageImage Image Image Image Image


Top
 Profile  
 
PostPosted: Fri Feb 19, 2010 5:13 am 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
DJ Nekkid wrote:
renum r2300 do not seem to support new rails, and it also crashes when trying to do its job.
This is on my list, but since it hasn't happened today, I'm not optimistic about its chances of happening until at least Sunday. (Real life is great, but it's also great at getting in the way.)

Any volunteers to update data.cpp and post a patch and new datafiles?
_datfeat and all following _dat* definitions will need to be updated; between the comments (mostly thanks to minime) and the existing examples, there should be enough information there.

DJ Nekkid wrote:
The action1 crashes renum.
I'm not going to touch the datafiles myself until I find and fix the crash, lest it sit there and ferment until next time. As it is now, I uncommented the Action 1 and found a really strange messaging bug, but no crash. You'll have to try again, DJ. I'm not sure how, but apparently my uncommenting does not reverse your commenting.

_________________
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser


Last edited by DaleStan on Fri Feb 19, 2010 5:08 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri Feb 19, 2010 1:58 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Nov 30, 2006 8:33 pm
Posts: 2141
no rush dale ... :)

I'll _try_ to crash it again, and see if it _still_ happens :)

_________________
Member of the
ImageImage


Top
 Profile  
 
PostPosted: Sun Feb 21, 2010 9:54 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
nfo used to trigger the crash: (I've broken the "Escapes" line at 2 random places to avoid breaking the layout).
Code:
// Automatically generated by GRFCODEC. Do not modify!
// (Info version 7)
// Escapes: 2+ = 71 = D= = DR 2- = 70 = D+ = DF 2< = 7= = D- = DC 2> = 7! = Du* = DM 2u< = 7< =
D* = DnF 2u> = 7> = Du<< = DnC 2/ = 7G = D<< = DO 2% = 7g = D& 2u/ = 7gG = D| 2u% = 7GG =
Du/ 2* = 7gg = D/ 2& = 7c = Du% 2| = 7C = D% 2^ 2sto = 2s 2rst = 2r 2+ 2ror = 2rot
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel

 0 * 4    00 00 00 00
 0 * -1    08 07 "TEST" " # Test newgrf" 00
 "test" 00

 0 * -1    03 12 01 01 00
   08 00


I've attached a fix for this case. There might be similar cases in the other check() functions as there are more calls "IssueMessage(ERROR,INVALID_FEATURE);" without a return.

I'm working on an update for data.cpp
Edit: added the diff, I'm not sure I did the changes to _dat4 correctly.


Attachments:
crash_on_invalid_feature.diff [1.08 KiB]
Downloaded 46 times
feature_10.diff [3.67 KiB]
Downloaded 44 times
Top
 Profile  
 
PostPosted: Wed Mar 03, 2010 9:46 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
Warning 109 (Property %2x is previously defined at offset %d.) is incorrectly given for houses prop 15 and industrytiles prop 09, which are both valid to be specified multiple times.


Top
 Profile  
 
PostPosted: Sun Mar 07, 2010 2:38 am 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
DJ Nekkid wrote:
The action1 crashes renum.

I still can't reproduce this, but I think everything else is in. (Finally.)

_________________
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser


Top
 Profile  
 
PostPosted: Sun Mar 07, 2010 9:03 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 6979
Location: Sol d
Kudos & thanks for fixing the crash with invalid features and supporting those new ones :-)

Property 12 of the general variables (rail type translation table) is not yet supported:
Code:
// Railtable
//!!Fatal Error (47): Offset 5: Invalid property 12.
   10 * 54    00 08 01 \b12 00 12 "RAIL" "ELRL" "_160" "E160" "_230" "E230" "HSTR" "3RDC" "3RDR" "MONO" "MGLV" "PLAN"


Also property 13 of rail types (construction cost multiplier) was (re-)defined to a word-sized value, it looks like renum looks for a byte value, though:
Code:
//!!Warning (209): Offset 93: Found byte 2 of a 2-byte escape while reading byte 1 of a 1-byte field.
//!!Fatal Error (47): Offset 93: Invalid property 02.
   73 * 99    00 10 \b14 01 02 // action0, for rails, numprops, numrails, ID
08 "_160" //      4*B   Rail type label
09 29 D0 //      W   StringID: Name of rail type
0A 2A D0 //      W   StringID: Menu text
0B 2B D0 //      W   StringID: Build window caption
0C 2C D0 //      W   StringID: Autoreplace text
0D 2D D0 //      W   StringID: New engine text
0E 07 "HSTR" "E230" "_230" "E160" "ELRL" "RAIL" "3RDC" //      B n*D   Compatible rail type list
0F 07 "HSTR" "E230" "_230" "E160" "ELRL" "RAIL" "3RDC" //      B n*D   Powered railtype list
10 00 //      B   Rail type flags
11 00 //      B   Curve speed advantage
12 00 //      B   Station graphics
13 \w600 //      W   Construction costs <--- translates ot 58 02
14 \w160 //  W   Speed limit
15 00 //      B   Acceleration model


And while we're at it, airport tiles may also be defined since OpenTTD r19200 (see also the page in the newgrf wiki); get a source repo with this feature from here:

Code:
//!!Fatal Error (44): Invalid feature byte.
    9 * 9    00 11 \b2 01 01
 08 \b35 //subsitute type
 09 \b35 //override type


Attachments:
File comment: nfo of nutracks
nutracks.nfo [17.37 KiB]
Downloaded 38 times
File comment: the whole repo ready for building
nutracks-nightly-r31-source.tar.gz [53.44 KiB]
Downloaded 40 times

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Top
 Profile  
 
PostPosted: Sat Mar 13, 2010 7:13 am 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
planetmaker: I started on this, but I can't find the var/rand action 2 information.

Yexo: Why did you report that a railtype's related object is an airport?

_________________
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser


Top
 Profile  
 
PostPosted: Sat Mar 13, 2010 8:36 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
DaleStan wrote:
planetmaker: I started on this, but I can't find the var/rand action 2 information.
If "this" is airporttiles, then the varaction2 is the same as for industry tiles (http://wiki.ttdpatch.net/tiki-index.php ... ustryTiles) minus var 40.
Currently airporttiles have 16+4 random bits (like stations, 0..15 are the random bits from the station and 16..19 are tile-specific), but I think this should be changed to work the same as industrytiles. In that case it'd be 4 random bits per tile + 16 random bits for airports.

Quote:
Yexo: Why did you report that a railtype's related object is an airport?
Before railtypes was merged to trunk both railtypes and airporttiles used feature 10 in their respective development branches. Railtypes got merged first to got feature 10, airporttiles got feature 11. I must've made a mistake while updating my renum files.


Top
 Profile  
 
PostPosted: Tue Apr 06, 2010 10:18 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
Support for extended string codes (9A + byte) 0B and 0C, print 8-byte value as hex / print station name.


Attachments:
extended_string_codes.diff [402 Bytes]
Downloaded 42 times
Top
 Profile  
 
PostPosted: Sun Apr 11, 2010 10:01 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
NFORenum hangs when it encounters an action0 with num-info = 0. Minimal nfo to reproduce the hang:

Code:
// Automatically generated by GRFCODEC. Do not modify!
// (Info version 7)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
-1 * 4 00 00 00 00

-1 * 0 00 0A \b1 00 00
08 FF


Top
 Profile  
 
PostPosted: Thu Apr 15, 2010 1:23 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Sun Jan 18, 2004 10:02 am
Posts: 339
Location: Prague, Czech Republic
This check on act0.cpp:314 seems to be brain damaged, and since it doesn't stop processing, we then go on iterating over some 4 billion IDs (hence the hang):
Code:
if(IDs==0&&(propsRemain!=1||feature||str.ExtractByte(i)!=0x1A))IssueMessage(WARNING1,NO_IDS);


What's the logic behind this? It seems to be an attempt to handle the special case of vehicle sorting property (albeit for trains only).

First of all - what about other vehicle types? Is resetting the sorting not supported for those? Documentation for those features links to description of the property of trains and makes no mention of any differences -- hence I would assume that it does (if not, wiki needs some fixing).

Second, are there any other cases, where it may be valid to have 0 IDs? I'm not aware of any at the moment, please correct me if I'm wrong.

Next, what is the proper behaviour for this error? Can we make it a FATAL, or do we want the autocorrection to do something with it?

_________________
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image


Top
 Profile  
 
PostPosted: Sun Jun 20, 2010 2:29 am 
Offline
Tycoon
Tycoon

Joined: Fri Oct 23, 2009 7:35 pm
Posts: 1165
Location: Thoftkinwise Theedishland
I am having a few problems with NFORenum... Or possibly I am missing something...
I wrote an Action8, which looks like this:
Code:
-1 * 00 08 07 76 67 51 45 "<name>" "<description>"

But NFORenum will always delete the complete line and replace it with "0 * 4 01 00 00 00".
Writing it like this:
Code:
-1 * 00 08 07 76 67 51 45 "<name>" 00 "<description>" 00

will produce the same result, on a file with otherwise only a (valid) road vehicle Action0 after the Action8, and nothing before it.
Who's making the error here?

PROBLEM SOLVED by adding "0 * 4 00 00 00 00" as the first line.

In addition, it won't accept extended vehicle IDs(as used in OpenTTD).

_________________
--- My code and sprites may be used under the terms of the GPL v2 or newer, if I have not stated otherwise - no need to contact me beforehand --- Call them "track types", that's what they are ---
--- Developer for: NuTracks - Central European Train Set - Britrains --- Running/compiling for: Linux (32/64 bit x86, ARM) - Windows (32/64 bit) - OS X (32/64 bit x86) - Haiku ---

--- Need a file packer? 7-Zip --- Bypass web blockers? Tor --- BOINC - use your computing power to benefit science --- Unix in dispersible pellets, the formula for the future. ---
Image


Top
 Profile  
 
PostPosted: Mon Jul 05, 2010 7:26 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 21, 2007 11:47 am
Posts: 6117
Location: The Netherlands
Small bug: unuseful error message.

nforenum wrote:
A portion of sprite 3250 could not be processed.


The problem actually lies within sprite 3251 and the offending line was correctly escaped by renum (property 19)

Code:
//Tile action 3
 3250 * 7    03 09 01 CC 00 \wxA0 //-1 * 0 03 09 <n-ids> <id> 00 <def-cid>


//Industry defenition

//Action 0
 3251 * 589    00 0A \b26 01 20 //-1 * 0 00 0A <num-props> 01 <id>
 08 05 //substitute industry type; reuse original industry with this here ID
 0A 03 //number of industry layouts
  \d498 //size of layout definition +2 for termination
  //layout 1:
   00 00 FF // special clearance tile - nothing built
   //(part removed due to size)
   06 06 FF // special clearance tile - nothing built
  00 80 //terminate layout definition
 0B 01 //production flags 1h=extractive, 2h=organic, 4h=processing
 0C 33 48 //industry closure message
 0D 35 48 //production increase message
 0E 39 48 //production decrease message
 1B 2D 48 //new industry message
 1F 94 DC //industry name
 24 EB DC //default text for nearby station
 10 1D FF //production cargo types (word; fill unused with FFh)
 11 FF FF FF FF //acceptance cargo types (dword; fill unused with FFh)
 12 \b16 //production multiplier cargo 1
 13 00 //production multiplier cargo 2
 1C \w0 \w0 //input cargo 1 multiplier (dword M1 M2; output_typen = X*Mn/256)
 1D \w0 \w0 //input cargo 2 multiplier
 1E \w0 \w0 //input cargo 3 multiplier
 14 \b2 //minimal cargo distribution amount
 16 FF FF FF //conflicting industry types (3*byte; ID+80h; FF to disable)
 17 \b20 //probability in random game
 18 \b20 //probability during gameplay
 20 FF FF FF BF //prospecting success chance (dword; FFFFFFFFh=100%)
 0F \b255 //fund cost multiplier (byte)
// 19 CLR_FISHINGGROUNDS //map colour (byte; using indexes from dos palette)
 23 \d0 //destruction cost multiplier (dword; default: 0)
 1A \dx404 //special industry flag
 21 31 //callback flags
 22 04 //callback flags

_________________
FooBar's Tram Tracks | TransRapid Track Set | Metro Track Set | OpenGFX base graphics set | FIRS Industry Replacement Set
Dutch Tram Set | Dutch Trainset 2 | Dutch Road Furniture


Top
 Profile  
 
PostPosted: Tue Jul 06, 2010 4:27 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 21, 2007 11:47 am
Posts: 6117
Location: The Netherlands
Renum doesn't support the multiple ground sprite syntax for house/industry tiles, which is available in TTDPatch since 2.6 r2313 and in OpenTTD since r18959. See http://wiki.ttdpatch.net/tiki-index.php ... ustryTiles, below the explanation of the extended syntax.

_________________
FooBar's Tram Tracks | TransRapid Track Set | Metro Track Set | OpenGFX base graphics set | FIRS Industry Replacement Set
Dutch Tram Set | Dutch Trainset 2 | Dutch Road Furniture


Top
 Profile  
 
PostPosted: Mon Aug 09, 2010 12:32 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Feb 09, 2006 7:15 pm
Posts: 3704
There's a new (preview) release at viewtopic.php?f=26&t=49612


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 437 posts ]  Go to page Previous  1 ... 18, 19, 20, 21, 22

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000-2013 phpBB Group

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2013.
Hosted by Zernebok Hosting.