Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user IcePic ! (Registered 2024-12-03) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Taking NUFLI one step further
2024-11-10 22:46
cobbpg

Registered: Jan 2022
Posts: 24
Taking NUFLI one step further

I'm working on a new converter for creating images the C64 can display with as much freedom as possible: NUFLI Studio preview video.

The images are NUFLI with the sprite colour limitations lifted: all sprite colours outside the FLI bug area can potentially change in every row. While this is impossible in general due to CPU time limitations, the solution is to generate the speedcode that updates the registers ahead of time. The code generator can make informed decisions about dropping the least impactful register changes to fit everything into the available budget. In practice, most pictures don't require all the 10 possible colour updates on every scanline, far from it.

Another big innovation compared to Mufflon is the improvement in conversion speed. Lifting the sprite colour change limitations makes it easy to fully parallelise the brute force colour search step for each 48x2 pixel area (or 24x2 pixels over the FLI bug), and this allowed me to implement it as a compute shader. The whole process takes about 0.25 seconds on my three-year-old gaming laptop. Besides, when using the internal editor, only the affected areas are recomputed, and they can be previewed in VICE right away (note that the video shows some lag that's probably introduced by OBS somehow; it doesn't happen outside recording).

My hope is that making the feedback practically instantaneous (even when using an external image editor) opens the door for pixel artists to develop a much better intuition about this image format. Also, removing the limitation of only changing sprite colours every second row should make it a lot less frustrating to work with.

I'm not sure what to call this image format. This is 95% NUFLI, the only real difference is that the speedcode is also generated ahead of time (when run on NTSC, there's a patching step done by the displayer routine to make it work), so the files are 4096 bytes bigger (they load from $1000 instead of $2000, the rest of the structure is almost identical). I'm leaning towards "NUFLI2" to make it somewhat search engine friendly, but I'm open to ideas.

At the moment I'm in the process of writing a manual for the tool and a deep-dive article about the technical details. Hopefully neither of those will take too long!
 
... 50 posts hidden. Click here to view all posts....
 
2024-11-29 22:09
cobbpg

Registered: Jan 2022
Posts: 24
It's out now, grab it while it's hot!

Source and release: https://github.com/cobbpg/nuflix-studio
Write-up: https://cobbpg.github.io/articles/nuflix.html
2024-11-30 01:02
Digger

Registered: Mar 2005
Posts: 432
Wonderful! How to compile it? On a Mac.
2024-11-30 08:49
cobbpg

Registered: Jan 2022
Posts: 24
This project was made with Unity 6. The easiest way to get started:

1. Clone the project from GitHub.
2. Download and run Unity Hub.
3. Use the Add button and select the NuflixStudio directory.
4. Let the Hub download the correct Unity version (6000.0.3f1). Make sure to include build support for the platforms you need.
5. Open the project.
6. Select File → Build and Run. In case that doesn't work out of the box, check File → Build Profiles.

If somebody makes Linux and Mac builds and confirms that they work, I can add them to the release. Make sure to uncheck the Development Build toggle.

I also added a 32-bit Windows build in the meantime.
2024-11-30 09:33
Jetboy

Registered: Jul 2006
Posts: 329
Awesome! My ctr+f5 keys are thanking you :)
Will post some feedback after i manage to get me stop playing.
2024-11-30 17:58
Jetboy

Registered: Jul 2006
Posts: 329
Excellent write up. Pretty clear and well explained (i might be biased as mosty i know what i'm reading about, but i learned some things and got some new ideas too). It was very good read to me, like some top novel.

As for the software itself it is absolutely awesome for a first release. Working with it is so silky smooth performance wise.

However there is a lot of improvements to be made, as some things are making working with it hard or hardly possible.

What would be the way to report bugs/add suggestion that would be most convenient for you? While we are at it here are things that seem important to me:

- Ability to zoom with ctrl mouse scroll wheel, centered on mouse. I have not found a way to move contents of the zoomed windows horizontally, hence no possibility to paint on the right parts of the image while zoomed.
- Ability to force zoom to integer factors - so we do not get unpleasant moire effects, that twist the view of images we are working on.
- Palette mapping could be improved by adding more palette options. Currently if i try to load images exported with PALette Middle Gray is being interpreted as Dark Gray and Light Gray as Middle gray. While it is easy to fix that by either editing the mapping, exporting with the palete you use, or edit vpl in the program data to use palette of choice. It would be great if the program had support for multiple palettes built in.
- I guess colors in the palette while color mapping are sorted by the value, which was confusing to me at first as i'm used to have them ordered by color number. An option to change that ordering would be lovely.

Bugs/strange behaviours:
- when i load indexed color images it works fine, but when i load truecolor images, behaviour is inconsistent. Sometimes it does not update, sometimes it does , i did not find any regularity with it yet.
2024-12-01 00:00
Digger

Registered: Mar 2005
Posts: 432
Managed to compile it for Mac, the UI seems to be out of scale in places. Will see if I can fix that somewhere in the settings.
2024-12-01 09:51
cobbpg

Registered: Jan 2022
Posts: 24
Quoting Jetboy
Excellent write up. Pretty clear and well explained (i might be biased as mosty i know what i'm reading about, but i learned some things and got some new ideas too). It was very good read to me, like some top novel.

Thanks, writing that little article was pretty much all I did over the last two weeks. ;)

Quoting Jetboy
What would be the way to report bugs/add suggestion that would be most convenient for you?

GitHub issues would be the best, but I'll also be monitoring this topic.

Quoting Jetboy
- Ability to zoom with ctrl mouse scroll wheel, centered on mouse. I have not found a way to move contents of the zoomed windows horizontally, hence no possibility to paint on the right parts of the image while zoomed.

Yeah, ctrl+wheel sounds like a good alternative to support for zooming, I'll see what I can do about that. As for scrolling horizontally, you already have two options: laptop trackpads (which Unity treats as a two-dimensional wheel input), or dragging with the middle mouse button pressed. Does neither of those work for you?

Quoting Jetboy
- Ability to force zoom to integer factors - so we do not get unpleasant moire effects, that twist the view of images we are working on.

Zoom is actually forced to integer factors in the editor, but I wonder if there's some screen scaling magic going on depending on the setup. I haven't tested with a non-100% desktop scaling factor, so I'll have to look into that. In the meantime, you could try setting the DPI factor for the executable to see if you can get rid of the issue.

Quoting Jetboy
- Palette mapping could be improved by adding more palette options. Currently if i try to load images exported with PALette Middle Gray is being interpreted as Dark Gray and Light Gray as Middle gray. While it is easy to fix that by either editing the mapping, exporting with the palete you use, or edit vpl in the program data to use palette of choice. It would be great if the program had support for multiple palettes built in.

Yeah, the palette management story is very minimalistic for the time being. :P I generally wouldn't mess with the VPL, since it's tuned to be close to VICE, and those colours are used by the search algorithm. The current recommended way of doing things is to create a conversion profile for a certain palette, then you can just reuse that for many pictures. At the moment the conversion profile is reset when you load a new picture, but I could e.g. add a checkbox to keep it between loads if the colours match.

By the way, I found that pretty much all sensible C64 palettes can be matched by just cranking up the brightness slider to varying extents.

Quoting Jetboy
- I guess colors in the palette while color mapping are sorted by the value, which was confusing to me at first as i'm used to have them ordered by color number. An option to change that ordering would be lovely.

Unfortunately the problem is that with Unity's image loader you lose the information about indexed colours, and you just get an array of RGBA pixels. Because of that, I implemented a sorting method that sorts values into a handful of buckets, and sorts by hue within those buckets, just to prevent completely random ordering.

Quoting Jetboy
- when i load indexed color images it works fine, but when i load truecolor images, behaviour is inconsistent. Sometimes it does not update, sometimes it does , i did not find any regularity with it yet.

That sounds strange, since it should make no difference at all to the program. If there's a real issue, it would be great to reproduce it reliably.

Quoting Digger
Managed to compile it for Mac, the UI seems to be out of scale in places. Will see if I can fix that somewhere in the settings.

This could be easily related to Jetboy's problem with scaling. I really hope we can get to the bottom of this and make it work nicely out of the box.
2024-12-01 11:29
Jetboy

Registered: Jul 2006
Posts: 329
Quoting cobbpg

Quoting Jetboy
- Ability to zoom with ctrl mouse scroll wheel, centered on mouse. I have not found a way to move contents of the zoomed windows horizontally, hence no possibility to paint on the right parts of the image while zoomed.


Yeah, ctrl+wheel sounds like a good alternative to support for zooming, I'll see what I can do about that. As for scrolling horizontally, you already have two options: laptop trackpads (which Unity treats as a two-dimensional wheel input), or dragging with the middle mouse button pressed. Does neither of those work?


It was not intuitive for me to try. Strange as some application i use daily use middle mouse button to drag.


The scaling was working fine when i first run the editor, but then i put it into fullscreen mode and it is off eversince. That seems like the dpi problem indeed. Game engines are notorious to have problems with UI scalling. I havent worked with unity for like 10 years or so, i thought they come up with solutions for that problem in meantime, but i see they didnt.

I'm installing unity right now so i can build the project myself and investigate the problems deeper.

I will use github for issue reporting, and this thread for discussion.
2024-12-01 11:56
cobbpg

Registered: Jan 2022
Posts: 24
Quoting Jetboy
It was not intuitive for me to try. Strange as some application i use daily use middle mouse button to drag.

This is all written in the manual for what it's worth. ;)

Quoting Jetboy
The scaling was working fine when i first run the editor, but then i put it into fullscreen mode and it is off eversince.

Another thing that never even crossed my head to try!

Quoting Jetboy
I havent worked with unity for like 10 years or so, i thought they come up with solutions for that problem in meantime, but i see they didnt.

It could be that there's a magic setting somewhere, but no matter what, Unity is not exactly aimed at making desktop UI applications...
2024-12-01 14:27
Jetboy

Registered: Jul 2006
Posts: 329
Quoting cobbpg
Quoting Jetboy
It was not intuitive for me to try. Strange as some application i use daily use middle mouse button to drag.

This is all written in the manual for what it's worth. ;)

This is one of those rare cases I actually read manual. Somehow i missed that, yet it is in the very last paragraph. I would suggest moving it up, or at least bolding it. Compiling FAQ section wouldn't be bad idea neither.

btw. After building it locally, i have no problem with the scale. I can resize the window and it works fine.
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Acidchild/Padua
REBEL 1/HF
Fresh
Guests online: 73
Top Demos
1 Next Level  (9.7)
2 What Is The Matrix 2  (9.7)
3 13:37  (9.7)
4 Edge of Disgrace  (9.7)
5 Coma Light 13  (9.7)
6 Mojo  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Wonderland XIV  (9.6)
10 Comaland 100%  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Libertongo  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Morph  (9.5)
9 Dawnfall V1.1  (9.5)
10 It's More Fun to Com..  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Nostalgia  (9.3)
5 Triad  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.7)
4 Acidchild  (9.7)
5 Cash  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.043 sec.