GRFCodec feature discussion thread
Moderator: Graphics Moderators
GRFCodec feature discussion thread
I've decided I need my own thread for this, so here it is.
It turns out that I failed to check some of my code in grfcodec and nforenum, resulting in subtly broken NFO file reading, so here's 0.9.10, to fix that.
PNG support is stalled, due to me spending too much time attempting to write Patch code, but rest assured that it is still on the TODO.
NOTE: GRFCodec is now being maintained by members of the OpenTTD project. A thread discussing the latest preview release (as of August 2010) can be found here.
It turns out that I failed to check some of my code in grfcodec and nforenum, resulting in subtly broken NFO file reading, so here's 0.9.10, to fix that.
PNG support is stalled, due to me spending too much time attempting to write Patch code, but rest assured that it is still on the TODO.
NOTE: GRFCodec is now being maintained by members of the OpenTTD project. A thread discussing the latest preview release (as of August 2010) can be found here.
Last edited by DaleStan on 10 Jan 2007 18:44, edited 2 times in total.
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
I've implemented a new option that tells grfcodec to crop extraneous transparent blue out of real sprites. I think this works, but I'd to have some other people to test it too.
To enable, add -c to the command-line when encoding.
There are also several other changes since 0.9.10; see the the changelog for more details.
To enable, add -c to the command-line when encoding.
There are also several other changes since 0.9.10; see the the changelog for more details.
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Yes. It adjusts the offsets as necessary when it crops from the top or left sides. Obviously (I hope), it does not adjust the offsets when cropping from the bottom or right sides.
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
> Yes. It adjusts the offsets as necessary [...]
Very nice. I´ve thrown down ttdpbase.grf for it (which is a good candidate, *lots* of unnecessary blue, <arrgh>, (my own sets don´t have that)) and it reduced it from 310KB to 289KB.
Re-calculated offsets *seem* to be OK, but I´ve to test them more in-game (tram sprites). Do you like to check that file too?
regards
Michael
Very nice. I´ve thrown down ttdpbase.grf for it (which is a good candidate, *lots* of unnecessary blue, <arrgh>, (my own sets don´t have that)) and it reduced it from 310KB to 289KB.

Re-calculated offsets *seem* to be OK, but I´ve to test them more in-game (tram sprites). Do you like to check that file too?
regards
Michael
Actually, no. Bad candidate. I tried that some time ago, and cropping the foundation sprites messed up the landscape drawing something awful.
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Lakie caught me in an off-by-one error that was causing crashes, so here's a new version with that fixed.
- Attachments
-
- grfcodec-i386.tar.gz
- (51.66 KiB) Downloaded 587 times
-
- grfcodec-win32.zip
- (79.51 KiB) Downloaded 819 times
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Will it crop as well fully blue sprites?
At least erails should have two fully blue helper sprites, so actually the ttdpatch base graphic will work, but the sorting may change when you crop certain helper sprites... (In the way how certain things get overdrawn, when in time...)
So I am not sure if it's a really good idea for all grfs without testing all current grfs and see what happens spritesorting wise...
At least erails should have two fully blue helper sprites, so actually the ttdpatch base graphic will work, but the sorting may change when you crop certain helper sprites... (In the way how certain things get overdrawn, when in time...)
So I am not sure if it's a really good idea for all grfs without testing all current grfs and see what happens spritesorting wise...
TTDPatch dev in retirement ... Search a grf, try Grf Crawler 0.9 - now with even faster details view and new features...


-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Yes, indeed. NewStations also uses 2 full blue helper sprites (for icon display). (Although there´s no need to "crop" its sprites.)eis_os wrote:Will it crop as well fully blue sprites?
At least erails should have two fully blue helper sprites, [...]
Anyway. At least for the "official" ttdpbase.grf we should do some cropping of its sprites because the usage of "blue" is somewhat excessive with that file[*]. I always wanted to do that.So I am not sure if it's a really good idea for all grfs without testing all current grfs and see what happens spritesorting wise...

[ttdpatch.grf]
Possibly because of cropping such "all blue" helper sprites? (There´s one full blue sprite to be seen at the lower left corner in the screenshot). Other than that, it must be a bug. Don´t you think? I´ll do some testing today evening.DaleStan wrote:I tried that some time ago, and cropping the foundation sprites messed up the landscape drawing something awful.
regards
Michael
- Attachments
-
- Clipboard01.png (3.92 KiB) Viewed 20227 times
It crops fully blue sprites from the right and bottom -- xrel and yrel are left unchanged.eis_os wrote:Will it crop as well fully blue sprites?
If that is a problem, fixing should be pretty easy.
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
The elrails block has two entirely blue sprites whose size must not be changed or the sprite sorter will have problems.
Maybe some way of marking sprites that should not be cropped would be nice? Somehow that would have to be stored in the .grf too or else decoding&re-encoding would break it again. Maybe bit 6 of the code?
Maybe some way of marking sprites that should not be cropped would be nice? Somehow that would have to be stored in the .grf too or else decoding&re-encoding would break it again. Maybe bit 6 of the code?
hmm, do we still have a bit free then? Maybe someday we want to allow spritestreams, or we create a fully new grf2 format for them, maybe after all better...
TTDPatch dev in retirement ... Search a grf, try Grf Crawler 0.9 - now with even faster details view and new features...


-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
> Maybe some way of marking sprites that should not be cropped would be nice? [...] Maybe bit 6 of the code?
I don´t get what you mean with "code", but possibly you think of the sprite´s "compression byte"?
According to http://wiki.ttdpatch.net/tiki-index.php ... ompression it´s a byte but only bits 0, 1, and 3 are used ATM.
regards
Michael
I don´t get what you mean with "code", but possibly you think of the sprite´s "compression byte"?
According to http://wiki.ttdpatch.net/tiki-index.php ... ompression it´s a byte but only bits 0, 1, and 3 are used ATM.
regards
Michael
JGR just added two new operators to variational action 2, and I'm wondering what escape sequences to use for them.
Personally, I'm inclined to use '\2=' for operator 0E, and '\2,' for operator 0F, on the grounds that 0E, like '=', does assignment; and 0F, like ',', evaluates and discards its left-hand side, prior to returning its right-hand side.
Neither of these are perfect, though. The comma operator is rather obscure, and the store operation assigns left-value to right-location, not right-value to left-location. I also considered '\2->' for operator 0E, since the TI calculators' BASICs (well, at least the TI-83 and TI-92) use a right-arrow for an operation called "sto", which does take the value on the left and store it to the location on the right, but this suffers from the obscurity problem. It also looks a lot like the C's member-from-pointer operator, which is a completely unrelated operation.
Does anyone have any other suggestions?
Personally, I'm inclined to use '\2=' for operator 0E, and '\2,' for operator 0F, on the grounds that 0E, like '=', does assignment; and 0F, like ',', evaluates and discards its left-hand side, prior to returning its right-hand side.
Neither of these are perfect, though. The comma operator is rather obscure, and the store operation assigns left-value to right-location, not right-value to left-location. I also considered '\2->' for operator 0E, since the TI calculators' BASICs (well, at least the TI-83 and TI-92) use a right-arrow for an operation called "sto", which does take the value on the left and store it to the location on the right, but this suffers from the obscurity problem. It also looks a lot like the C's member-from-pointer operator, which is a completely unrelated operation.
Does anyone have any other suggestions?
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Somehow, \2s and \2r seem too short to me, but I can't really explain how they're worse than the \7g, \7G, \7gG, \7gg, \7GG, \7c, and \7C sequences. And I suppose it doesn't really matter what I think, what matters is what the people who will be using these think.
I can easily see allowing both those one-letter forms and the three-letter \2sto and \2ret forms.
I can easily see allowing both those one-letter forms and the three-letter \2sto and \2ret forms.
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Who is online
Users browsing this forum: Google Feedfetcher and 12 guests