Jump to content


Photo

NearInfinity


921 replies to this topic

#841 Argent77

Argent77
  • Member
  • 883 posts

Posted 28 August 2017 - 09:27 AM

I've noticed the 'Undo' button when stepping through dialogues has been a little flaky the last few versions. If you click 'undo' and the previous state was a different dialogue file, it will jump to the correct file in the resource panel but the main panel will remain unchanged. Using 'undo' when the previous line was in the same dialogue file works as expected.

Thanks. I'll look into it.



#842 Argent77

Argent77
  • Member
  • 883 posts

Posted 07 September 2017 - 05:08 AM

Update: NearInfinity v2.1-20170907

Changes:

  • Improved autodetection of text encoding in non-Enhanced games. It's currently working for western languages and Polish.
  • Area viewer provides overhead icon labels which can be controlled via global viewer settings.
  • Updated various resource type fields.
  • Updated several opcode parameters.
  • Fixed an OSX-specific bug that prevented saving current application settings when using shortcut command-Q.
  • Applied hotfix to "Undo" button in DLG viewer which didn't work correctly when external DLG references where involved.
  • Several internal fixes.


#843 Roxanne

Roxanne

    Modder

  • Member
  • 3518 posts

Posted 07 October 2017 - 05:29 AM

A very strange event, the only issue is with NI as it works in the game:

 

I added an entry point for an area (OH9360 - the Black Pits). You can go there now from an EET area and play it as part of EET.

Adding the entry is the only modification done to the are file.

Spoiler

The transition works perfectly and there is no issue with playing the extension. Note - the exit from the pits is via script as in the original game (just with a new destination to comply with mod). There is no issue with that at all in the game itself.

 

However, trying to open OH9360.are in NI after the modification is not possible "Error reading oh9360.ARE null".

Uninstall the mod and it is fine again.

There are no problems with the corresponding wed, tis or bcs files, just the are-file.
 


Edited by Roxanne, 07 October 2017 - 05:29 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#844 Argent77

Argent77
  • Member
  • 883 posts

Posted 07 October 2017 - 08:17 AM

It looks like OH9360.ARE doesn't contain a rest encounter structure (rest encounter offset is 0). fj_are_structure seems to set the rest offset to a non-zero value without adding a rest encounter structure. As a result NI attempts to read non-existing data which triggers an error.

I can probably avoid this error by adding more checks, but that's only a hack. Ideally fj_are_structure should be fixed to ensure that offsets pointing to non-existing single structure elements (such as songs or rest encounters) are set to zero.
 



#845 Roxanne

Roxanne

    Modder

  • Member
  • 3518 posts

Posted 07 October 2017 - 08:38 AM

It looks like OH9360.ARE doesn't contain a rest encounter structure (rest encounter offset is 0). fj_are_structure seems to set the rest offset to a non-zero value without adding a rest encounter structure. As a result NI attempts to read non-existing data which triggers an error.

I can probably avoid this error by adding more checks, but that's only a hack. Ideally fj_are_structure should be fixed to ensure that offsets pointing to non-existing single structure elements (such as songs or rest encounters) are set to zero.
 

Maybe not worth it. I assume it is something unique to those Black Pit areas. It sems to have no real impact on the gameplay as such. The only issue I found was in NI when I tried to quickly look up something during mod creation. Unless you think it is a more widespread problem. I have used the same fl_are technique to add exit or entry to numerous original areas and there is never any problem.


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#846 Argent77

Argent77
  • Member
  • 883 posts

Posted 07 October 2017 - 08:49 AM

I found several areas without resting encounter structures outside of Black Pits in BG1EE, and in classic BG1 as well (e.g. AR0608). But all of them had their offsets set to 0. Classic BG1 seems to crash if you set the offset to non-zero. BG1EE handles these structures gracefully.



#847 Miloch

Miloch

    Barbarian

  • Modder
  • 6494 posts

Posted 13 October 2017 - 06:07 PM

Ideally fj_are_structure should be fixed to ensure that offsets pointing to non-existing single structure elements (such as songs or rest encounters) are set to zero.

I am surprised it does not. It has a lot of similar checks anyway.


Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"My definition of an intellectual is someone who can listen to the William Tell Overture without thinking of the Lone Ranger." -Billy Connolly


#848 Mike1072

Mike1072
  • Member
  • 529 posts

Posted 25 October 2017 - 11:38 PM

I'm looking for a way to generate an animated image (such as a GIF) from a BAM cycle. I looked around and didn't see anything that does this already.

The closest I've come so far has been the 'Export all frames as graphics' option in Near Infinity, which outputs all of the frames in a PNG format with transparency. However, the information about the center of the frames is lost, which makes makes it hard to reassemble the animation seen in the game. (I tried creating a GIMP script to offset the images but couldn't get it working.)

I was wondering if something could be done in the export to make this easier.  An option to output cycles directly to animated GIF would be handy, but just outputting the frames on a larger canvas, centered, would be enough.

I have a little diagram and some pseudocode for centering the frames.

eG2dzJq.png
 
Given a list of frames with a known width, height, and center coordinates, we need to determine the dimensions for a canvas that could fit all frames within its borders when they are centered. Then, we need to create a canvas of that size for each frame and center the frame upon the canvas.
 
leftAmount = 0
rightAmount = 0
topAmount = 0
bottomAmount = 0

for each frame in frames
  leftAmount = max(leftAmount, frame.centerX)
  rightAmount = max(rightAmount, frame.width - frame.centerX)
  topAmount = max(topAmount, frame.centerY)
  bottomAmount = max(bottomAmount, frame.height - frame.centerY)
end

canvasWidth = leftAmount + rightAmount
canvasHeight = topAmount + bottomAmount

for each frame in frames
  canvas = createCanvas(canvasWidth, canvasHeight)
  positionX = leftAmount - frame.centerX
  positionY = topAmount - frame.centerY
  canvas.place(frame, positionX, positionY)
  canvas.save()
end

Edited by Mike1072, 26 October 2017 - 03:08 AM.


#849 Argent77

Argent77
  • Member
  • 883 posts

Posted 26 October 2017 - 03:04 AM

Something similar is already implemented for the preview of BAM animations (in both viewer and converter).

Java doesn't provide an animated GIF exporter by its own, so I don't how complicated it would be to implement such a functionality. However, I could add another output filter to the BAM Converter that expands the canvas of each frame relative to the center point. The resulting BAM could be exported with the "Export all frames as graphics" option to produce images that are suitable for creating GIF animations.



#850 Mike1072

Mike1072
  • Member
  • 529 posts

Posted 26 October 2017 - 03:09 AM

That would be perfect for my needs.

#851 Sam.

Sam.
  • Modder
  • 1032 posts

Posted 26 October 2017 - 07:05 AM

The closest I've come so far has been the 'Export all frames as graphics' option in Near Infinity, which outputs all of the frames in a PNG format with transparency. However, the information about the center of the frames is lost, which makes makes it hard to reassemble the animation seen in the game. (I tried creating a GIMP script to offset the images but couldn't get it working.)

I was wondering if something could be done in the export to make this easier.  [...], but just outputting the frames on a larger canvas, centered, would be enough.

Given a list of frames with a known width, height, and center coordinates, we need to determine the dimensions for a canvas that could fit all frames within its borders when they are centered. Then, we need to create a canvas of that size for each frame and center the frame upon the canvas.

In case you're interested in an alternate solution, bamresize can batch process this for BAMs in-mass.  Syntax is something like:

python.exe bamresize.py -p 100 -q 100 -u 1 -t 0 -e png *.bam

It doesn't set the background (Green) color to transparent, but that is easy enough to do when converting the resulting padded frames to animated GIF with an external tool (such as ImageMagick).  This step can also be easily automated.  Note that BAM Workshop and BAM Workshop II can export sequences in a variety of formats including animated GIF also.


Edited by Sam., 26 October 2017 - 07:06 AM.

"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

-- <CHARNAME> to Portalbendarwinden

--------------------

post-10485-0-15080600-1348188745.jpg
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#852 Mike1072

Mike1072
  • Member
  • 529 posts

Posted 26 October 2017 - 03:49 PM

Thanks, Sam.

#853 Argent77

Argent77
  • Member
  • 883 posts

Posted 27 October 2017 - 05:13 AM

Update: NearInfinity v2.1-20171027

Changes:

  • Lots of changes in BAM Converter:
    • Sets a default output name automatically.
    • Adds a list of recently used BAM sessions for quick access.
    • Improved feedback when an export operation failed.
    • Added filter category to filter names.
    • Added new transform filter "Center BAM frames" which expands the dimension of all frames to a fixed size.
    • Added new output filter "GIF output" which exports BAM cycles into animated GIFs.
    • Added new output filter "Image output" which exports all BAM frames into separate images (PNG or BMP).
  • Updated some CRE fields and flag labels.
  • Added SPL primary type (school) 'Wild Mage'.
  • Updated 'Special' field for opcodes 25, 39, 98 and 213.
  • ARE > Song > Reverb uses entries from REVERB.2DA if available.
  • Turned list of script states for opcode 282 (Modify script state) into a static list.
  • Improved color value selection controls used by opcode 7 (Set color) or 342 (Override creature data).
  • Resource types VEF and VVC should not be available for PRO > Area effect > Spread/Ring animation fields.
  • Removed BMP type from ITM description image field (not used anymore by recent game patch versions).
  • Improved ARE resource reader to prevent errors if Song or Rest Encounter structures are missing.
  • Wild Mage kit id won't be displayed as negative value in resource fields anymore.
  • Fixed incorrect order when copying and pasting multiple removable structures at once.
  • Fixed opcode 140 projectile references being off by 1.
  • Fixed auto-comments for several script actions and triggers.
  • Many more internal fixes and improvements.


#854 Argent77

Argent77
  • Member
  • 883 posts

Posted 27 October 2017 - 12:01 PM

Update: NearInfinity v2.1-20171027-rev2

This release fixes a nasty bug from the previous release that resulted in empty IDS lists for resource fields which reference IDS entries. It also fixes a minor import issue with the BAM Converter filter 'Center BAM frames'.



#855 Mike1072

Mike1072
  • Member
  • 529 posts

Posted 27 October 2017 - 04:14 PM

Awesome, this works great.

Quick tutorial:

  • Open BAM file
  • Click Edit BAM
  • Click on the Post-processing tab
  • Under filters, select Transform: Center BAM Frames and click Add
  • Under filters, select Output: GIF output (BAM v1 only) and click Add
  • Click on Save output file... and enter any filename (the output will be a number of .gif files regardless of the extension listed in the filename)

If you want to, you can add additional filters, like changing colours, enlarging the image, or mirroring it. Make sure to add them after the Transform: Center BAM Frames filter.


Edited by Mike1072, 27 October 2017 - 04:17 PM.


#856 Creepin

Creepin
  • Coordinator
  • 1003 posts

Posted 28 October 2017 - 01:36 AM

Thank a lot Mike1072, handy tutorial :) Is there equally simple way to get one single BMP for item description where all 4 parts will be already centered correctly to form whole picture?

The Old Gold - v0.1 WIP (mod for BGT/BWP/BWS)


#857 Argent77

Argent77
  • Member
  • 883 posts

Posted 28 October 2017 - 01:40 AM

Thank a lot Mike1072, handy tutorial :) Is there equally simple way to get one single BMP for item description where all 4 parts will be already centered correctly to form whole picture?

The output filter "Single frame BAM output" does exactly that, merging all frames into a single frame.



#858 Creepin

Creepin
  • Coordinator
  • 1003 posts

Posted 28 October 2017 - 01:50 AM

This generates BAM as a result, which I then had to open in NI again and export as single frame bmp/png. True that this is already simpler than manually adjusting 4 parts in Photoshop, thank you for that improvement, but ideally I hope for a single step export resulting in bmp/png with a whole picture, is that possible?

Edited by Creepin, 28 October 2017 - 01:52 AM.

The Old Gold - v0.1 WIP (mod for BGT/BWP/BWS)


#859 Argent77

Argent77
  • Member
  • 883 posts

Posted 28 October 2017 - 02:04 AM

No, that's not possible. Output filters don't stack since they process the source BAM directly (after applying all selected color and transform filters).



#860 Miksip

Miksip
  • Member
  • 50 posts

Donator

Posted 28 October 2017 - 10:28 PM

I got error compressing saves - they are broken after that. what information do you need to look for problem?


P.S. Don't listen to The Imp - it is voice of the Devil.




Reply to this topic