Red!Viewer 1.7 coming some time - TIL Editing bug found!

Mapping & modding Fallout Tactics and reviewing maps thereof.
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Red!Viewer 1.7 coming some time - TIL Editing bug found!

Post by Red »

Code: Select all

1.7.0.0
- Reworked entire layout; now all useless controls for a format are disabled
- CAM In preview mode it now renders the selected square in the upper left
- CAM Optimized rendering so it only renders squares that fit in the display
- FRM Added [ and ] key support
- TIL Fixed [ and ] keys no longer working
- TIL Made reticles actually move properly when using the mouse 
- Various small scale optimizations
- Pressing cancel while exporting to TGA now actually cancels the process
- Pressing cancel on the background color reverts the colour to grey
- Changed layout in view of future enhancements
- FRM (DX8) Changed "upper left corner reticle" to a full rectangle
- SPR Changed "Loop Point" to "Loop Point (+1)", also "Step Right" and
  "Step Left" to "Right Step" and "Left Step" respectivly
- SPR Added mechanism to check wether the file was modified and made it reload
  it automatically (great if you edit a sprite with Spray)
- SPR Removed thourough file locking
- SPR (Sequence Preview) Fixed reverse animations so they don't trigger on Loop 
  and Loop Point
- SPR (Sequence Preview) Fixed animation so that when Loop and LoopPoints jumped
  onto an "invalid" frame it would be skipped
- SPR Changed "Fire (+2)" sequence to "Fire (+3)" since it uses 3 frames of data
- SPR (Software) Fixed bounding box rendering
d Fixed more typos and stuff
I'm calling it a day... or a night? anyhoo.

In the process of "disabling" all useless controls, I'm cleaning up a lot of the code. There's a lot of stuff which was implimented rather quickly just to add support for a new format, and as such wasn't necessarely implimented in a good way. This is why I'm getting a new minor version number since I'm touching pretty much all the interface code.

Also from now on the extra ".0" will be ignored in versions since useless.
Last edited by Red on Thu Dec 23, 2004 2:31 am, edited 2 times in total.
...
User avatar
xbow
Vault Elite
Vault Elite
Posts: 337
Joined: Fri Jul 30, 2004 12:23 am
Location: Mojave Desert

Post by xbow »

Damn Red your an animal!!!!

long ago I took two semesters of C and Two semesters of C++ ( finished with an overall A- for the 4 classes) but I neved did anything with it just not my thing.

I could never go back and fix much because both my internal and external documentation was generally non existant. I would be willing to bet a copy of Morrowind with guns (Fallout 3) that your exdocs and rems are detailed and copius through out your programs. Thanks for being the professional that you are.

It would be great if Interplay did the ID thing and released the FOT source code..ill bet you would be unable to resist tweaking the game from that level. I would bet a monkies balls that there are alot of artifacts of unimplemented or shut off features lurking in that code.
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Post by Red »

I have sparse comments here and there :)

Even in my last professionnal contract I had to cut corners and guess what flew out the door once the deadline was emminent?

I'm adding a lot of comments in the code while doing the current cleanup. If I don't understand a peice of code now, I surely won't 2 years from now :P

I still haven't found the proper relationship between the length of a variable name and it's descriptive form IE: if I have a local variable used to store a string name of say... a generic object, should bother naming it "nameOfObject" or just call it "name" (for the most part I've stopped calling it "n" :p).
Though inline completion is handy in helping out with lond names, when you have a lot of variables within a scope, the inline completion becomes practically moot.

For the most part I've been toying with this code for 5 years, looking at it at least once every trimester, so obviosuly a lot of it is known to me. If I actually would stop looking at it for a whole year, then I'd be lost - though hopefully not with 1.7 version anymore.
...
User avatar
xbow
Vault Elite
Vault Elite
Posts: 337
Joined: Fri Jul 30, 2004 12:23 am
Location: Mojave Desert

Post by xbow »

I wrote (wrote= (begged + borrowed + stole + modified)) a little visual basic6 game engine (tile based) that was up and functioning a few years ago, I was just about ready to start actually implementing a game itself when I laid it down for awhile. That awhile ended up being over a year and when I felt like messing with it again, I didn't have a clue what I had done or how I did it. :confused2:

My code was very dense and cryptic. Not enough comments and had horribly shorthand variable names. I was just too busy to take the time to do the internal documentation or even make up the meaningfull variable names that would have made the code readable. It was almost a blessing when a hard drive crash in conjunction with a spilled cup of coffe destroyed what was on my HD and what I had on a zip disk. I guess there was over a thousand lines of code there, I was so pissed that I havent written anything since. I didn't even bother to install Visual C++ or VB on any of the machines I have now. I'll just leave the coding to my betters.
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Post by Red »

I'll have to agree that your maps are awesome :)

Redviewer code is probably only about 7k codes of line though, not that big a deal.
...
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Work Update

Post by Red »

I've found a very big bug with TIL editing.Sadly it was found so late in the 1.7 change that I can't really apply it to the 1.6 version as a fix, so we'll have to wait for th 1.7 release. The bug found might explain why so many people have been having "palette" problems and the like. Though maybe not. Either way it didn't work correctly.

Here's my new history:

Code: Select all

TODO 2
- SPR Save
- FRM Save

TODO 1.x.x
- FRM offset editing
- SPR offset editing
- SPR Display and edit "steps"

TODO 1.7.0
- Software rendering changes
- SPR Add layer coloring
- SPR Allow changes in animation and sequence names
- Mouse support for bounding box editing
- SPR Show shadow marker in palette preview

u ART Finish GUI update
u DX8 Finish GUI update
u FRM Finish GUI update
u SPR Finish GUI update

1.7.0
- When clicking and leaving the mouse pressed, the image is now rendered all
  the time instead of when you unpress the mouse (applies to TIL offsets too)
- TIL Fixed bug using up/down with an empty frame would remove both frames
- TIL Fixed bug preventing from adding new frames
- Clipboard now selects an item if you add one and none is selected
- TIL Optimized Rendering so it renders the palette preview only when required
- TIL Added "shadow" marker support
- ZAR4 Added marker to indicate the "shadow" color if palette preview is on
- TIL You can now view and edit the offsets values directly
c Added comments pretty much everywhere
- Various optimizations, added a lot of bounds checking and try to handle
  application errors as seemlessly as possible
- Reworked entire layout; now all controls not use in a format are disabled,
  changed some labels to be clearer and takes less space
- CAM In preview mode it now renders the selected square in the upper left
- CAM Optimized rendering so it only renders squares that fit in the display
- FRM Added [ and ] key support
- TIL Fixed [ and ] keys no longer working
- TIL Made reticles actually move properly when using the mouse 
- Pressing cancel while exporting to TGA now actually cancels the process
- Pressing cancel on the background color reverts the colour to grey
- FRM (DX8) Changed "upper left corner reticle" to a full rectangle
- SPR Changed "Loop Point" to "Loop Point (+1)", also "Step Right" and
  "Step Left" to "Right Step" and "Left Step" respectivly
- SPR Added mechanism to check wether the file was modified and made it reload
  it automatically (great if you edit a sprite with Spray)
- SPR Removed thourough file locking
- SPR (Sequence Preview) Fixed reverse animations so they don't trigger on Loop 
  and Loop Point
- SPR (Sequence Preview) Fixed animation so that when Loop and LoopPoints jumped
  onto an "invalid" frame it now skips it
- SPR Changed "Fire (+2)" sequence to "Fire (+3)" since it uses 3 frames of data
- SPR (Software) Fixed bounding box rendering
d Fixed more typos and stuff
This is the new layout:
Image
The screen almost fits in 640x480 again. You can use it all in that resolution even though the window is slightly larger. As you can see it looks much cleaner too.
Last edited by Red on Wed Sep 29, 2004 1:51 pm, edited 5 times in total.
...
User avatar
requiem_for_a_starfury
Hero of the Wastes
Hero of the Wastes
Posts: 1820
Joined: Tue Oct 29, 2002 11:13 am

Post by requiem_for_a_starfury »

The zar clipboard, in earlier versions you could export from the clipboard into a brand new tile, but now in 1.6.0.23 you can only export into a new zar or an existing tile.

Edited Tiles or New tiles made with redviewer, if for some reason you need to export a tga from an edited/new tile redviewer just crashes (I'll post the error message when I get home).

Quick and dirty open, I know it says it's quick and dirty but it's dead usefull if your making a lot of tiles and need to open them up to import into the zar clipboard. If it's not too much to ask is it possible to add a file type filter to this, so that when you've got bmps, pngs, tgas and zars in the same directory you can filter to just see what you want to work with?

[edit|Red! -- I accidently edited your message instead of reply, sorry for the inconvinience, I hope I restored the message in it's full original glory (actually there was another nice paragraph preceeding the 3 left which made the text sound more like a request rather than it's now "demandish" looking state). Again, I apologize.]
If you can bear to hear the truth you've spoken
Twisted by knaves to make a trap for fools,
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Post by Red »

The zar clipboard, in earlier versions you could export from the clipboard into a brand new tile, but now in 1.6.0.23 you can only export into a new zar or an existing tile.
That's the bug which I found... (see previous posts)
Edited Tiles or New tiles made with redviewer, if for some reason you need to export a tga from an edited/new tile redviewer just crashes (I'll post the error message when I get home).
Actually I know why: Red!Viewer optimizes the frames removing the palette since TILs include a global palette. I tested this in FOT and that's how it works - however I haven't checked to support that in the TGA export. You can still post the error if you wish to make sure that this is indeed the same problem.
Quick and dirty open, I know it says it's quick and dirty but it's dead usefull if your making a lot of tiles and need to open them up to import into the zar clipboard. If it's not too much to ask is it possible to add a file type filter to this, so that when you've got bmps, pngs, tgas and zars in the same directory you can filter to just see what you want to work with?
I'll add that to my suggestion list. Right now I have no "simple" solution to that (other than allowing you te select a single type at a time like most other programs allow you to do - if this suffices, do tell me as I'll Impliment it since this will allow me to clean up quite a bit of code). The other "dirty" solution is to allow the user to specify his own filters manually following the VB Fialog filter format (*.PNG;*.jpg etc etc).
...
User avatar
requiem_for_a_starfury
Hero of the Wastes
Hero of the Wastes
Posts: 1820
Joined: Tue Oct 29, 2002 11:13 am

Post by requiem_for_a_starfury »

Red wrote:That's the bug which I found... (see previous posts)
Sorry must of missed that.
Red wrote:Actually I know why: Red!Viewer optimizes the frames removing the palette since TILs include a global palette. I tested this in FOT and that's how it works - however I haven't checked to support that in the TGA export. You can still post the error if you wish to make sure that this is indeed the same problem..
The error reads

Run-time error '91':
Object variable or With block variable not set
Red wrote:I'll add that to my suggestion list. Right now I have no "simple" solution to that (other than allowing you te select a single type at a time like most other programs allow you to do - if this suffices, do tell me as I'll Impliment it since this will allow me to clean up quite a bit of code).
Yeah that sounds okay for me at least, I don't know about everyone else? I only really use the Q&D open for zars or tiles anyway but it is so useful with bulk sessions.
If you can bear to hear the truth you've spoken
Twisted by knaves to make a trap for fools,
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Post by Red »

requiem_for_a_starfury wrote:Run-time error '91':
Object variable or With block variable not set
Aiiii. I hate that. Basically that means "VB did something it shouldn't have", which means pretty much nothing... Anyway I'm fairly confident it's the problem I've described above.
Yeah that sounds okay for me at least, I don't know about everyone else? I only really use the Q&D open for zars or tiles anyway but it is so useful with bulk sessions.
I get few feedback from my "users" so anyone giving feedback to me is pretty much "the user" while it's hapenning. Given I had more requests your advice might have other considerations but meanwhile, well, yours has priority :D
...
Flamescreen
Vault Hero
Vault Hero
Posts: 1017
Joined: Thu Apr 18, 2002 5:30 pm
Location: Stone of Light Land
Contact:

Post by Flamescreen »

Looks very good Red
User avatar
requiem_for_a_starfury
Hero of the Wastes
Hero of the Wastes
Posts: 1820
Joined: Tue Oct 29, 2002 11:13 am

Post by requiem_for_a_starfury »

Red wrote:Red!Viewer optimizes the frames removing the palette since TILs include a global palette.
Damn is that why I get a no palette found error when trying to convert using til2gif? Bugger I guess I'm just not going to be able to convert this custom tile. :(

Could it also be why the palette goes to hell as soon as I save a custom animated tile?
If you can bear to hear the truth you've spoken
Twisted by knaves to make a trap for fools,
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Post by Red »

Yes abd yes.

For the animated palette, it is imperative that all animation images share the same palette.

To accomplish this, I suggest putting all images of the animation into a single image and hainv the software generate a new palette. You would then applly the computed palette onto all the individual frames before saving them as paletted PNGs and then convert them to ZARs. There is still a chance that the PNG->ZAR conversion messes up the palette too!

I've tried leaving the ZAR palettes and removing the main one but the engine insists on using the main one rather than the ones included in the ZAR.

Sorry, but recent events in my life have pulled my programming hobby time pretty much to the 0h/week mark for the last 3-4 weeks.
...
User avatar
requiem_for_a_starfury
Hero of the Wastes
Hero of the Wastes
Posts: 1820
Joined: Tue Oct 29, 2002 11:13 am

Post by requiem_for_a_starfury »

Red wrote:To accomplish this, I suggest putting all images of the animation into a single image and hainv the software generate a new palette. You would then applly the computed palette onto all the individual frames before saving them as paletted PNGs and then convert them to ZARs. There is still a chance that the PNG->ZAR conversion messes up the palette too!
Yeah I've tried all that, but as soon as I do 'save as' the palette goes, interestingly though if I do 'save' instead of save as the palette doesn't go haywire straight away and I'm able to see how it would look if it worked, at least until I close Redviewer.
Red wrote:Sorry, but recent events in my life have pulled my programming hobby time pretty much to the 0h/week mark for the last 3-4 weeks.
Nothing horrible I hope.
If you can bear to hear the truth you've spoken
Twisted by knaves to make a trap for fools,
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Post by Red »

requiem_for_a_starfury wrote:Nothing horrible I hope.
No, quite the opposite, don't worry about me.
...
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Post by Red »

I Suddenly had a spur of enthusiasm and wanted to work on Red!Viewer to try to get closer to the 1.7 release... Only to realise that VB doesn't work anymore...

Through some fiddling, I've discovered that a big part of my registry is corrupt. Bleah.

All that effort thwarted by Windows.

For those not aware of what a corrupt registry means/is; well, it means I haven't lost any code but I need to reinstall my computer and I really wasn't planning on doing that... So in addition to gathering strengh on working on the viewer, I need to gather it to fix my computer first!

Also, before it crashed I added mouse support for bounding box editing... you can click on the width/height/length the on the picture and move the mouse left/right to make it grow/shorten. It's not perfect but it's neat. I might be changing how it works as right now it seems a bit complicated still.
...
User avatar
Jimmyjay86
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2102
Joined: Thu Apr 18, 2002 4:02 am
Location: Wisconsin
Contact:

Post by Jimmyjay86 »

Damn, it doesn't sound like the greatest of news but we've been waiting this long so a little longer shouldn't be too bad. Do you have any thoughts of adding sprite editing support?
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Post by Red »

Red! wrote:- SPR Allow changes in animation and sequence names
This assumes that you will be able to save sprites (as changing the names without saving is rather useless).

I can adapt the ZAR clipboard to work with sprites (ie: paste ZARs in a sprite) easyly, though with a few limitations at first:
  1. Like tiles, sprites share the same palettes for each animation (though sprites have 4 for each layer while animations 1, so you could actually have a 4 frame animation with each a different palette). (Mental note: I'll make it so the first frame "pasted" into a sprite animation will define the palette, while the others won't)
  2. No compression support, at least at first (ie: you won't be able to modify character sprites).
The main goal of the "first sprite editing release" would be to have a better tool than spray to edit your item sprites (not that spray is bad per say, but it'd be nice to have a single tool to do it).
...
User avatar
requiem_for_a_starfury
Hero of the Wastes
Hero of the Wastes
Posts: 1820
Joined: Tue Oct 29, 2002 11:13 am

Post by requiem_for_a_starfury »

If you're going to add the filter to the quick and dirty open, would it be possible then to be able to add pngs to the zar clipboard or a seperate png clipboard?

So that if you adapt the clipboard to export to sprites then we could skip the conversion to zar stage and make non-animated inventory sprites from pngs?

But being able to create inventory sprites from zars would be so handy that I could kiss you if you do it. :hug:
If you can bear to hear the truth you've spoken
Twisted by knaves to make a trap for fools,
User avatar
Jimmyjay86
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2102
Joined: Thu Apr 18, 2002 4:02 am
Location: Wisconsin
Contact:

Post by Jimmyjay86 »

I went to go back and check over the Hot Wheels tiles and sprites and noticed some tiles crashed the old Rediewer (1.6.17). I can send you the offending tiles if you want to experiment. Also I wondered if you could possibly offer the same conversion for the HW sprites as the tiles. There are quite a few interesting sprites that might be good to convert. Again if you want to experiment I can send some of those as well.

Currently I have a new download of converted HW tiles at my site.
Post Reply