Jump to content
IGNORED

7800basic and png images


mksmith

Recommended Posts

Hi everyone,

 

Just updated to the latest version of Paint.Net (v4.2.4) and upon reading the release notes (v4.2.2) noticed that you can now save .png images to 4-bit. Just tested and these are compatible with 7800basic!  There is no transparancy for the background when saved but you can just set that to 0 in your incgraphic call.  

 

Nice!

  • Like 3
Link to comment
Share on other sites

For some reason, I have really struggled producing indexed PNGs that would work with the Gimp, although modifying sample ones worked okay  if it just needs to be 4-bit PNGs, then maybe that would expand the options of what can work. Without the indexing, how does it match colors to palette entries, though? 4-bit images would be 16 colors, right? 

Link to comment
Share on other sites

11 hours ago, Karl G said:

For some reason, I have really struggled producing indexed PNGs that would work with the Gimp, although modifying sample ones worked okay  if it just needs to be 4-bit PNGs, then maybe that would expand the options of what can work. Without the indexing, how does it match colors to palette entries, though? 4-bit images would be 16 colors, right? 

@Karl G They appear to export whatever number of colors are used - for these up-to 16 (remember 3+1 transparent for each palette still).  Probably what is lacking in Paint.Net is the ability to set a palette so you can match approximately to the 7800 - which is what I've added to Atari Dev Studio.

 

So what I've done in Arkanoid is set the palette and then match the indexes for each image - a bit more work but as we use every color a mix of single palettes, palettes 0-3 and 4-7 it was the best way to maximise.

 

 This is the base palette (which I then adjust in various ways for things like the title, intros, doh level):

 rem Palette 0 - font/sprites/playfield/brick
 P0C1 = $0f ;White
 P0C2 = $08 ;Grey
 P0C3 = $06 ;DkGrey 
 rem Palette 1 - font/sprites/brick
 P1C1 = $34 ;Red
 P1C2 = $37 ;Orange
 P1C3 = $00 ;Black
 rem Palette 2 - sprites/brick
 P2C1 = $a8 ;Cyan
 P2C2 = $c8 ;Green
 P2C3 = $00 ;Black
 rem Palette 3 - sprites
 P3C1 = $54 ;Pink
 P3C2 = $1b ;Yellow
 P3C3 = $92 ;Blue
 rem Palette 4 - brick
 P4C1 = $0f ;White
 P4C2 = $09 ;Grey
 P4C3 = $00 ;Black
 rem Palette 5 - brick
 P5C1 = $1b ;Yellow
 P5C2 = $f6 ;LtBrown
 P5C3 = $00 ;Black
 rem Palette 6 - background (adjusted per level)
 P6C1 = $00 ;Black
 P6C2 = $00 ;Black
 P6C3 = $00 ;Black
 rem Palette 7 - brick
 P7C1 = $93 ;Blue
 P7C2 = $54 ;Pink
 P7C3 = $00 ;Black

Then for images I match up:

 rem vaus
 incgraphic gfx/vaus.png 160B 0 3 2 6 7 1 5 9 
 rem vaus (trans to laser)
 incgraphic gfx/vaus_trans_laser1.png 160B 0 2 3 7 6 1 9 5
 incgraphic gfx/vaus_trans_laser2.png 160B 0 2 3 1 7 9 6 
 incgraphic gfx/vaus_trans_laser3.png 160B 0 2 3 7 1
 incgraphic gfx/vaus_trans_laser4.png 160B 0 3 2 7 1
 incgraphic gfx/vaus_trans_laser5.png 160B 0 3 2 7 1 5
 incgraphic gfx/vaus_trans_laser6.png 160B 0 3 2 7 1 6
 incgraphic gfx/vaus_trans_laser7.png 160B 0 3 2 7 1 9 6
 incgraphic gfx/vaus_trans_laser8.png 160B 0 2 3 7 1 6 5
 rem background
 incgraphic gfx/background5_1.png 160A 0 1 3
 incgraphic gfx/background5_2.png 160A 0 1 3
 incgraphic gfx/background5_3.png 160A 0 2 1 3
 incgraphic gfx/background5_4.png 160A 0 1 3

I have a separate program I compile which just loads and displays the images and I work through the indexes to then match them. So for example above I set the index to 0 (transparent in palette) for each color then work my way through.  It's a process definitely and if you change the image the indexes may also change but it offers a lot of flexibility.  

 

When you plot the image you then set the palette - for 160A (0-7) or for 160B (0 or 4).

 

Hope that helps??

 

 

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

37 minutes ago, Karl G said:

Thanks for the more detailed explanation.  I'll have to look at this again when my head is more in a 7800 programming space.  ?

No probs ? It was a little confusing initially but is straight forward once you use it ?

Link to comment
Share on other sites

  • 4 months later...

For me too, this is the one thing I've been struggling to conceptualise and also the same as Karl, trying to work with GiMP has killed me lol.

 

I'll give Paint.Net a try. 

 

I'm keen to get into 7800 as I have some game ideas I want to test out which need text and that's beyond what I can personally do on the 2600.

  • Like 1
Link to comment
Share on other sites

It's an acknowledged weakness. I didn't want 7800basic to get tied to any one platform's tools, and indexed PNGs seemed the best fit. Unfortunately some of the graphics editors aren't very good at creating standard indexed png images.

 

Thankfully @mksmith came along and put together the very excellent Atari Dev Studio, with it's 7800 graphic editor. Give it a shot if you're struggling. [edit - noticed that mksmith mentioned it earlier in this thread, but it can't be said enough. :D ]

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

2 minutes ago, RevEng said:

It's an acknowledged weakness. I didn't want 7800basic to get tied to any one platform's tools, and indexed PNGs seemed the best fit. Unfortunately some of the graphics editors aren't very good at creating standard indexed png images.

 

Thankfully @mksmith came along and put together the very excellent Atari Dev Studio, with it's 7800 graphic editor. Give it a shot if you're struggling.

Thanks @RevEng

 

I just found the sprite editor and it looks like I can build a tileset and export that :) .

 

I think I have a lot of experimenting to do!

  • Like 3
Link to comment
Share on other sites

@Muddyfunster @Karl G Hey guys!

 

As said images are the fun bit especially aligning the palettes! FYI - I have found the images exported out of my editor appears to either align them in some sort of randomish order (perhaps either by pixel count or something else). Paint.Net appears to correctly align them to the expected order (saving as 4-bit I think from memory).

 

Probably the biggest weakness of my editor is there no import of an image currently - I transposed most of the Arkanoid images into it manually (it saves the data as binary until you export it to file).

 

I also found the initial Gimp process confusing as I hadn't used it before that's why I did the initial editor but I do have a bit more work to do on it.

 

I'll can write up a basic process if you would like on how I got stuff into Arkanoid. Will try and get that done sometime over the next few days ?

 

  • Like 1
Link to comment
Share on other sites

@mksmith hey :) that would be really helpful.

 

I spent a couple of hours tinkering last night and I could get a basic tileset from the sprite editor and into tiled but then I couldn't get anything from tiled into 7800 basic to experiment with plotmapfile, i just kept getting errors like "plotmapfile didn't find a palette for palette0".

 

I expect i'm missing something and I  need to go back to basics and start working through the process, first with just simple PNG files. (double wide or not, zone height 8 or not.. lots to figure out).

 

After stepping through some of the sample files on with 7800 basic, I'm quite excited by the potential of what I might be able to do with it!

  • Like 1
Link to comment
Share on other sites

I imagine seeing your process could be handy, but I wouldn't want to take time away from your other projects. :) In my case, I just need to dedicate enough time to working with it to figure out my own process. If you want to spend the time, though, I'm sure your notes could be handy for many people. 

  • Like 1
Link to comment
Share on other sites

Hey guys,

 

I thought creating a video might make explaining the sprites and colors in 7800basic (from the Sprite Editor) a little easier! (wow don't you hate hearing yourself!)

 

 

I've also attached the source code if that makes the examples a bit clearer.  It's also very possible I may have got something not quite right so if you have any questions please don't hesitate to ask ?

7800basic.SpritesAndPalettes.zip

  • Like 4
  • Thanks 4
Link to comment
Share on other sites

Thanks for the video. I did have luck using your editor before I lost data when my laptop had to be rebuilt. 

 

Just in case it will be useful to anyone, my current method on the Mac is to use the editor of my choice (Paintbrush), and then convert the images to 4bpp with the ImageMagick convert utility, e.g.:

 

convert gfx/skyscraperstiles.png -depth 4 gfx/skyscraperstiles.png

 

  • Like 2
Link to comment
Share on other sites

27 minutes ago, SlidellMan said:

@mksmith

I would like to thank you for the video, and am looking forward to more. By the way, nice Arkanoid wallpaper!

No probs - hope it can help in some way! @Atariboy2600 did a great job on the wallpapers which you can find in the Arkanoid post ?

Link to comment
Share on other sites

@mksmith thanks for the video, i'm going to watch that later when I get some time. I hope that I can get some insights on palette management from it :)

 

 

 

The one thing that's really killing my enthusiasm right now is indexed colours. I feel like I'm spending a lot of time fighting the system to get my sprites and banners in to experiment on. I've tried 3 or 4 applications and none of them work well and I find myself going to the Atari Dev Studio sprite editor, even to do banners.

 

I wanted to use 160B as some of my ideas would work really well with the 12+1 palette but I've found using 160B to be incredibly hard work due to how the palette dances around, even from banner to banner (that's before I get to sprites and thinking about tiled).

 

I stripped the idea back and made my banners in the sprite editor by using two 40x65 sprites 12+1 palette (left and right halves) with the same palette and loaded them with palette 0 in my program, they both had scrambled palettes (expected) but the scrambling was different on each side even though the original colours were the same.

 

Some of my banner detail vanishes as 7800Basic seems to push one of the transparent colours on to my "detail" section. I know I can change how the colours are indexed and which refers to which entry but trying to line that up for 12+1 is really tedious.

 

I know some of this is down to me to learn a new workflow and how to work efficiently but right now 160B is not co-operating and 160A has a lot of restrictions in terms of what I want to do.

 

I'll post an example after I've watched the video as that might help folks to understand my rambling :)

 

There's probably an easy fix to all of this, I just need to learn the right way :)

 

 

 

  • Like 1
Link to comment
Share on other sites

Y

4 hours ago, Muddyfunster said:

@mksmith thanks for the video, i'm going to watch that later when I get some time. I hope that I can get some insights on palette management from it :)

 

 

 

The one thing that's really killing my enthusiasm right now is indexed colours. I feel like I'm spending a lot of time fighting the system to get my sprites and banners in to experiment on. I've tried 3 or 4 applications and none of them work well and I find myself going to the Atari Dev Studio sprite editor, even to do banners.

 

I wanted to use 160B as some of my ideas would work really well with the 12+1 palette but I've found using 160B to be incredibly hard work due to how the palette dances around, even from banner to banner (that's before I get to sprites and thinking about tiled).

 

I stripped the idea back and made my banners in the sprite editor by using two 40x65 sprites 12+1 palette (left and right halves) with the same palette and loaded them with palette 0 in my program, they both had scrambled palettes (expected) but the scrambling was different on each side even though the original colours were the same.

 

Some of my banner detail vanishes as 7800Basic seems to push one of the transparent colours on to my "detail" section. I know I can change how the colours are indexed and which refers to which entry but trying to line that up for 12+1 is really tedious.

 

I know some of this is down to me to learn a new workflow and how to work efficiently but right now 160B is not co-operating and 160A has a lot of restrictions in terms of what I want to do.

 

I'll post an example after I've watched the video as that might help folks to understand my rambling :)

 

There's probably an easy fix to all of this, I just need to learn the right way :)

 

 

 

It's the trickiest part of the process for sure and as you noted it can change when you edit the image.

 

As mentioned in the video the easiest way I found is to create a separate app which just the basics, set the indexes all to 0 and work your way through each index. Do stick with it though!!

 

Also have you tried paint.net? I'm positive it saves the index in the current order.  I'll take another look at the library (or another one) I'm using in Dev Studio to see if I can find a way to set it in the correct order

 

Link to comment
Share on other sites

  • 7 months later...
On 2/8/2020 at 11:43 AM, mksmith said:

Hey guys,

 

I thought creating a video might make explaining the sprites and colors in 7800basic (from the Sprite Editor) a little easier! (wow don't you hate hearing yourself!)

 

 

I've also attached the source code if that makes the examples a bit clearer.  It's also very possible I may have got something not quite right so if you have any questions please don't hesitate to ask ?

7800basic.SpritesAndPalettes.zip 4.39 kB · 15 downloads

When you are using 12+1 colors, it still says displaymode 160A, is that just a typo?

And I can't see where in the incgraphic command you are telling it to start with palette 0, the first 0?

I just added a fourth color and when I try the same thing and everything else I can think of I just get an error

 

plotmapfile didn't find a palette for testsprite

Link to comment
Share on other sites

Hi @Lillapojkenpåön!

 

Sorry for the delay in responding.

17 hours ago, Lillapojkenpåön said:

When you are using 12+1 colors, it still says displaymode 160A, is that just a typo?

And I can't see where in the incgraphic command you are telling it to start with palette 0, the first 0?

I just added a fourth color and when I try the same thing and everything else I can think of I just get an error

 

plotmapfile didn't find a palette for testsprite

So with 12+1 colors (160B) you can overlay those on a 160A display no problem.  Both Arkanoid and Millie and Molly do this for extra colors on certain objects.

 

With incgraphic you only include the indexes (0-3 for 160A or 0-15 for 160B - with these you generally skip 4,8,12 as they are the other transparent colors) with the actual palette set with plotsprite.  What you do have with indexes is the allocation of the expected palette colors. If we look at the sprite2 example:

 rem images
 incgraphic gfx/pod1.png 160A 0 3 2 1
 incgraphic gfx/hexa1.png 160A 0 1 2 3
 incgraphic gfx/hexa2.png 160A 0 1 2 3

 rem palette 0
 P0C1 = $04
 P0C2 = $09
 P0C3 = $0F

 rem palette 1
 P1C1 = $92
 P1C2 = $75
 P1C3 = $0F

 rem palette 0
 plotsprite pod1 0 50 50

 rem palette 1
 plotsprite hexa1 1 50 100
 plotsprite hexa2 1 75 100

pod1 is assigned palette 0 and hexa1/hexa2 are assigned palette 1.  You can then ties that back to the incgraphic where the order of palette indexes is determined.  The other difference with the sprite3 example is setting a 12+1 palette where we combine either palettes 0-3 OR 4-7 to create a 12 color image:

rem images
 incgraphic gfx/vaus.png 160B 0 3 2 6 7 1 5 9 

 rem palette

 rem P0-P3 (12 colors)
 P0C1 = $0f
 P0C2 = $08
 P0C3 = $06

 P1C1 = $34
 P1C2 = $37
 P1C3 = $00

 P2C1 = $a8
 P2C2 = $c8
 P2C3 = $00

 P3C1 = $54
 P3C2 = $1b
 P3C3 = $92
 
 rem pod
 plotsprite vaus 0 50 50

Let me know if that helps answer your questions ?

  • Thanks 1
Link to comment
Share on other sites

Thanks for the info!

3 hours ago, mksmith said:

 

With incgraphic you only include the indexes (0-3 for 160A or 0-15 for 160B

 

If you use plotmapfile you also have to include palette_# after 0-3

that was the problem, guess you have to use plotmap instead if you want more colors, that worked.

 

Do you have to create your tiled maps differently when using 160B instead of 160A?

My tiles are now half overlapping eachother so the map only covers half the screen.

Edited by Lillapojkenpåön
Link to comment
Share on other sites

1 hour ago, Lillapojkenpåön said:

Thanks for the info!

If you use plotmapfile you also have to include palette_# after 0-3

that was the problem, guess you have to use plotmap instead if you want more colors, that worked.

 

Do you have to create your tiled maps differently when using 160B instead of 160A?

My tiles are now half overlapping eachother so the map only covers half the screen.

 
 
 

No I don't believe there to be any difference but I haven't used plotmap much before.  You may need to be wary of drawing a whole map in 160B in regards to DL render time.

 

Try set doublewide on and see if that works.

 

Link to comment
Share on other sites

So how do you load your background if you don't use plotmap and plotmapfile doesn't work with more than 3 colors?

I have doublewide on allready, how would I draw the map otherwise to reduce render time?

 

 

I drew a new map and to clarify

this works but my fourth color missing ofcourse

incgraphic testsprite.png 160A 0 2 3 1 

 

switching to this now only gives me a black screen

incgraphic testsprite.png 160B 0 2 3 1 5

 

 

both with this

     plotmap tiledMap4colors 0 0 0 20 12

Edited by Lillapojkenpåön
Link to comment
Share on other sites

16 hours ago, Lillapojkenpåön said:

Do you have to create your tiled maps differently when using 160B instead of 160A?

My tiles are now half overlapping eachother so the map only covers half the screen.

 

The process to create the tiled maps are the same however you have to remember the width of a 160B sprite is half the width of a 160A sprite. If your tiled map is still assuming 8 pixel wide tiles from the 160A sample, then it's going to cause 7800Basic to do exactly what you saw happen.  You'll have to adjust the tile sizes on your map in Tiled to width of 4 from 8 before exporting it.

 

 

 

 

  • Thanks 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...