Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-27 Thread James Paige
On Sat, May 28, 2011 at 09:50:33AM +0930, David Gowers (kampu) wrote:
>On Sat, May 28, 2011 at 1:17 AM, James Paige 
>wrote:
> 
>  This makes a lot of sense to me now. I wrote up a summary of it here:
>  http://rpg.hamsterrepublic.com/ohrrpgce/Types_of_Palettes
> 
>"There are four types of palettes.. (describes three)"
> 
>Are you trying to make a Monty Python reference? ;) 'Type four, there IS
>NO type four..'

Haha! I wish I could say I did that on purpose, but, no, I am just a 
dope :)

---
James
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-27 Thread Mike Caron

On 5/27/2011 20:20, David Gowers (kampu) wrote:

On Sat, May 28, 2011 at 1:17 AM, James Paige mailto:b...@hamsterrepublic.com>> wrote:


This makes a lot of sense to me now. I wrote up a summary of it here:
http://rpg.hamsterrepublic.com/ohrrpgce/Types_of_Palettes


"There are four types of palettes.. (describes three)"

Are you trying to make a Monty Python reference? ;) 'Type four, there IS
NO type four..'


First thou shalt take out the holy colours, then thou shalt count to 
three, no more, no less. Three is the palette thou shalt count, and the 
number of thy palettes shall be three. Four thou shalt not count, 
neither count thou two, excepting that thou then proceed to three. Five 
is right out. Once the palette three, being the third palette, be 
reached, then lobbest thou thy Master palette towards thy game, which, 
being made of sprites and such, shall be coloured.

--
- Mike Caron
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-27 Thread David Gowers (kampu)
On Sat, May 28, 2011 at 1:17 AM, James Paige wrote:

>
> This makes a lot of sense to me now. I wrote up a summary of it here:
> http://rpg.hamsterrepublic.com/ohrrpgce/Types_of_Palettes
>

"There are four types of palettes.. (describes three)"

Are you trying to make a Monty Python reference? ;) 'Type four, there IS NO
type four..'
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-27 Thread James Paige
On Fri, May 27, 2011 at 05:54:20PM +1200, Ralph Versteegen wrote:
> On 27 May 2011 05:04, Mike Caron  wrote:
> > On Thu, May 26, 2011 at 1:01 PM, Jay Tennant
> >  wrote:
> >>> > Don't use indices, but use actual colours instead?
> >>> >
> >>> > set pal color ( 123, make rgb(255, 0, 0))
> >>>
> >>> Yes, but with any changes to the master palette, all the 16-color palettes
> >>> will have to be changed as well. So the distinction between a master 
> >>> (256-color)
> >>> palette and a 16-color is still there.
> >>
> >> Wait a second... are master palettes ever altered during runtime?
> >
> > Anytime there's a fade, for example.
> >
> > However, I wasn't suggesting changing 16-colour palette to use 24-bit
> > colours, I meant having the set pal color command look up the colour
> > in the master palette, and using that.
> 
> Ah! Yes that's pretty handly. But let's name such a command very
> carefully, "set pal color" would certainly trip people up. Something
> more like "set pal color (palno, colno, find master pal col(r, g, b))"

"find master pal col" reminds me that we also need a command that 
can find the special UI colors. Maybe something like:

  find ui color in master pal(ui:menuitem)

Also, I am thinking of going with:

  set sprite pal col(palno, colno, find master pal col(r, g, b))

> > Of course, if you change Red to Blue because the party switched sides
> > or something, this would still break.
> >
> > I guess the other alternative is to let 256-colour sprites use
> > 256-colour palettes, which index into the master palette.
> 
> I don't really see what it's an alternative to? It was the plan
> actually (when I mentioned 256-colour palettes, I was talking about
> palettes indexing into the master palette, sorry for the confusion).
> 
> While we're talking about this, it would be good to talk about
> multiple master palettes as well.
> 
> The idea is that each sprite is associated with a certain master
> palette (with menus and other slices such as text using the
> main/default palette), but they need not all be the same, and you can
> modify them separately. Many, many times I've heard the request "How
> can I fade the screen out, except for the hero/a textbox/the
> NPCs/something on the map/etc". Multiple master palettes seems like a
> sensible way to support that to me, but maybe other people disagree.
> There's going to be some confusion between palettes and master
> palettes. Non master palettes would often be redundant, so most of the
> time you would just use a default with master palette indices 0, 1,
> ..., 255. As a bonus individual sprites could use their own master
> palettes without having to switch to 24-bit.

This makes a lot of sense to me now. I wrote up a summary of it here:
http://rpg.hamsterrepublic.com/ohrrpgce/Types_of_Palettes

Hopefully I got it right :)

This also makes me think more about the "find master pal col" command. 
it should actually be:

find master pal col(r, g, b, master id)

where "master id" defaults to -1 for the current default master palette.

That also means that when sprite palettes gain the ability to point to 
non-default master palettes, there will also need to be commands like 
this

get master pal for sprite pal(sprite pal id)
set master pal for sprite pal(sprite pal id, master pal id)

So to be editing a sprite palette color in a multi-master-palette 
environment you might need to do:

  set sprite pal col(palno, colno, find master pal col(r, g, b, get master pal 
for sprite pal(palno)))

That is quite verbose! But that is not a problem, because it would be 
super-easy to provide a convenience wrapper


script, set sprite pal rgb, palno, colno, r, g, b, begin
  set sprite pal col(palno, colno, find master pal col(r, g, b, get master pal 
for sprite pal(palno)))
end

That isn't so bad, is it?

I am very comfortable with this three-layer indirection of palettes, 
because it provides easy backwards compatability with the way we have 
always done 16 color palettes, and the way we have always done master 
palette fading and manipulation, while at the same time it provides full 
access to the 24 bit global palette.

And the other thing I like about this plan is that most of the 
complexity involved is optional for users who don't care about it.

---
James
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-27 Thread James Paige
On Fri, May 27, 2011 at 05:31:51PM +1200, Ralph Versteegen wrote:
> On 27 May 2011 05:06, Adam Perry  wrote:
> > On Thu, May 26, 2011 at 9:48 AM, James Paige  
> > wrote:
> >>
> >> On Fri, May 27, 2011 at 04:30:59AM +1200, Ralph Versteegen wrote:
> >> > Actually, wait, I'm not sure that a change to a pallete should affect
> >> > all other sprites. I think it makes sense to only allow changing the
> >> > palette for a single sprite (slice): use copy-on-write.
> >>
> >> Hmmm... That sounds like a good thing... but it also sounds like a
> >> completely different feature. What if I wanted to change the palette of
> >> the sprite used in battle, which is not a slice yet? What if I wanted to
> >> change the palette that every Soldier NPC and Soldier Enemy uses to
> >> reflect their country's national colors? What if I want to alter a color
> >> once in my newgame/loadgame script, and not have to keep managing it on
> >> ever different map?
> >
> > With 32767 pal16s available, I really don't see how it would be
> > problematic to just allocate a new pal16 if you wanted a per-instance
> > change.
> 
> Err, you two are quite right, there's no need for it at all. And if
> you really need unique palettes at runtime, it would be much simpler
> for us (and cleaner to use) to add a "create new palette" command
> instead.

I love that!

  palnum := new sprite pal(clone pal)

where the return value is the ID number of the temporary palette, and 
the clone pal argument can be the ID number of an existing palette, or 
can be ommitted for a blank palette with all entries pointing to master 
palette color 0

---
James
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-26 Thread Ralph Versteegen
On 27 May 2011 05:04, Mike Caron  wrote:
> On Thu, May 26, 2011 at 1:01 PM, Jay Tennant
>  wrote:
>>> > >> > We already have to keep supporting 16 color palette changes on 
>>> > >> > sprites,
>>> > >> > even when 256 color sprites are enabled in the future--
>>> > >>
>>> > >> I wouldn't want to treat them separately at all.
>>> > >
>>> > > Neither would I, but one is like a pointer, and the other is a pointer 
>>> > > to a
>>> > > pointer. The 16-color will have to be dereferenced to its 256-color 
>>> > > palette.
>>> > > I haven't heard a complete solution to the 16-to-256 palette problem 
>>> > > yet,
>>> > > nor have I solved it.
>>> >
>>> > Don't use indices, but use actual colours instead?
>>> >
>>> > set pal color ( 123, make rgb(255, 0, 0))
>>>
>>> Yes, but with any changes to the master palette, all the 16-color palettes
>>> will have to be changed as well. So the distinction between a master 
>>> (256-color)
>>> palette and a 16-color is still there.
>>
>> Wait a second... are master palettes ever altered during runtime?
>
> Anytime there's a fade, for example.
>
> However, I wasn't suggesting changing 16-colour palette to use 24-bit
> colours, I meant having the set pal color command look up the colour
> in the master palette, and using that.

Ah! Yes that's pretty handly. But let's name such a command very
carefully, "set pal color" would certainly trip people up. Something
more like "set pal color (palno, colno, find master pal col(r, g, b))"

> Of course, if you change Red to Blue because the party switched sides
> or something, this would still break.
>
> I guess the other alternative is to let 256-colour sprites use
> 256-colour palettes, which index into the master palette.

I don't really see what it's an alternative to? It was the plan
actually (when I mentioned 256-colour palettes, I was talking about
palettes indexing into the master palette, sorry for the confusion).

While we're talking about this, it would be good to talk about
multiple master palettes as well.

The idea is that each sprite is associated with a certain master
palette (with menus and other slices such as text using the
main/default palette), but they need not all be the same, and you can
modify them separately. Many, many times I've heard the request "How
can I fade the screen out, except for the hero/a textbox/the
NPCs/something on the map/etc". Multiple master palettes seems like a
sensible way to support that to me, but maybe other people disagree.
There's going to be some confusion between palettes and master
palettes. Non master palettes would often be redundant, so most of the
time you would just use a default with master palette indices 0, 1,
..., 255. As a bonus individual sprites could use their own master
palettes without having to switch to 24-bit.

I assume Direct3D will let you blit different paletted textures with
different palettes without any nasty overhead sideeffects. Palettes in
SDL, fbgfx, etc. are always per-surface of course.

> (There is no problem that can't be solved by adding another level of
> indirection ;)
>
>
> --
> Mike Caron
> Tale of the Cave
> http://taleotc.com
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-26 Thread Ralph Versteegen
On 27 May 2011 05:06, Adam Perry  wrote:
> On Thu, May 26, 2011 at 9:48 AM, James Paige  wrote:
>>
>> On Fri, May 27, 2011 at 04:30:59AM +1200, Ralph Versteegen wrote:
>> > Actually, wait, I'm not sure that a change to a pallete should affect
>> > all other sprites. I think it makes sense to only allow changing the
>> > palette for a single sprite (slice): use copy-on-write.
>>
>> Hmmm... That sounds like a good thing... but it also sounds like a
>> completely different feature. What if I wanted to change the palette of
>> the sprite used in battle, which is not a slice yet? What if I wanted to
>> change the palette that every Soldier NPC and Soldier Enemy uses to
>> reflect their country's national colors? What if I want to alter a color
>> once in my newgame/loadgame script, and not have to keep managing it on
>> ever different map?
>
> With 32767 pal16s available, I really don't see how it would be
> problematic to just allocate a new pal16 if you wanted a per-instance
> change.

Err, you two are quite right, there's no need for it at all. And if
you really need unique palettes at runtime, it would be much simpler
for us (and cleaner to use) to add a "create new palette" command
instead.
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-26 Thread James Paige
On Thu, May 26, 2011 at 01:04:32PM -0400, Mike Caron wrote:
> On Thu, May 26, 2011 at 1:01 PM, Jay Tennant
>  wrote:
> >> > >> > We already have to keep supporting 16 color palette changes on 
> >> > >> > sprites,
> >> > >> > even when 256 color sprites are enabled in the future--
> >> > >>
> >> > >> I wouldn't want to treat them separately at all.
> >> > >
> >> > > Neither would I, but one is like a pointer, and the other is a pointer 
> >> > > to a
> >> > > pointer. The 16-color will have to be dereferenced to its 256-color 
> >> > > palette.
> >> > > I haven't heard a complete solution to the 16-to-256 palette problem 
> >> > > yet,
> >> > > nor have I solved it.
> >> >
> >> > Don't use indices, but use actual colours instead?
> >> >
> >> > set pal color ( 123, make rgb(255, 0, 0))
> >>
> >> Yes, but with any changes to the master palette, all the 16-color palettes
> >> will have to be changed as well. So the distinction between a master 
> >> (256-color)
> >> palette and a 16-color is still there.
> >
> > Wait a second... are master palettes ever altered during runtime?
> 
> Anytime there's a fade, for example.

There are also plotscripting commands that can read and write master 
palette colors

> However, I wasn't suggesting changing 16-colour palette to use 24-bit
> colours, I meant having the set pal color command look up the colour
> in the master palette, and using that.

I do really like the idea of a command to search for a color in the 
master palette.

> I guess the other alternative is to let 256-colour sprites use
> 256-colour palettes, which index into the master palette.

Yes! Now my memories are returning to me! I am pretty sure this was the 
plan. 256 color sprites would be exactly like 16 color sprites in the 
fact that their palettes would be references into the matser palette.

---
James Paige
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-26 Thread Jay Tennant
> From: Mike Caron 
> Sent: Thursday, May 26, 2011 12:05 PM
> 
> On Thu, May 26, 2011 at 1:01 PM, Jay Tennant
>  wrote:

> > Wait a second... are master palettes ever altered during runtime?
> 
> Anytime there's a fade, for example.

Hmm. Looking through allmodex, that's the only function (besides the *bmp2pal*)
that I found that directly manipulated the master palette. This effect
could easily be moved out of the master palette (since it's applied on
the final frame drawing sequence, it could be an argb modifier) thereby 
guaranteeing the master palette is never changed. Unless I missed something, 
or the intent of the bmp2pal loading functions, I think this might get a whole
lot easier to manage! :D

> However, I wasn't suggesting changing 16-colour palette to use 24-bit
> colours, I meant having the set pal color command look up the colour
> in the master palette, and using that.
> 
> Of course, if you change Red to Blue because the party switched sides
> or something, this would still break.
> 
> I guess the other alternative is to let 256-colour sprites use
> 256-colour palettes, which index into the master palette.
> 
> (There is no problem that can't be solved by adding another level of
> indirection ;)

Haha! Reminds me of this list:
http://www.sjbaker.org/wiki/index.php?title=Cruel_Code_list



___
Unlimited Disk, Data Transfer, PHP/MySQL Domain Hosting
  http://www.doteasy.com 
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-26 Thread Adam Perry
On Thu, May 26, 2011 at 9:48 AM, James Paige  wrote:
>
> On Fri, May 27, 2011 at 04:30:59AM +1200, Ralph Versteegen wrote:
> > Actually, wait, I'm not sure that a change to a pallete should affect
> > all other sprites. I think it makes sense to only allow changing the
> > palette for a single sprite (slice): use copy-on-write.
>
> Hmmm... That sounds like a good thing... but it also sounds like a
> completely different feature. What if I wanted to change the palette of
> the sprite used in battle, which is not a slice yet? What if I wanted to
> change the palette that every Soldier NPC and Soldier Enemy uses to
> reflect their country's national colors? What if I want to alter a color
> once in my newgame/loadgame script, and not have to keep managing it on
> ever different map?

With 32767 pal16s available, I really don't see how it would be
problematic to just allocate a new pal16 if you wanted a per-instance
change.
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-26 Thread Mike Caron
On Thu, May 26, 2011 at 1:01 PM, Jay Tennant
 wrote:
>> > >> > We already have to keep supporting 16 color palette changes on 
>> > >> > sprites,
>> > >> > even when 256 color sprites are enabled in the future--
>> > >>
>> > >> I wouldn't want to treat them separately at all.
>> > >
>> > > Neither would I, but one is like a pointer, and the other is a pointer 
>> > > to a
>> > > pointer. The 16-color will have to be dereferenced to its 256-color 
>> > > palette.
>> > > I haven't heard a complete solution to the 16-to-256 palette problem yet,
>> > > nor have I solved it.
>> >
>> > Don't use indices, but use actual colours instead?
>> >
>> > set pal color ( 123, make rgb(255, 0, 0))
>>
>> Yes, but with any changes to the master palette, all the 16-color palettes
>> will have to be changed as well. So the distinction between a master 
>> (256-color)
>> palette and a 16-color is still there.
>
> Wait a second... are master palettes ever altered during runtime?

Anytime there's a fade, for example.

However, I wasn't suggesting changing 16-colour palette to use 24-bit
colours, I meant having the set pal color command look up the colour
in the master palette, and using that.

Of course, if you change Red to Blue because the party switched sides
or something, this would still break.

I guess the other alternative is to let 256-colour sprites use
256-colour palettes, which index into the master palette.

(There is no problem that can't be solved by adding another level of
indirection ;)


-- 
Mike Caron
Tale of the Cave
http://taleotc.com
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-26 Thread Jay Tennant
> > >> > We already have to keep supporting 16 color palette changes on sprites,
> > >> > even when 256 color sprites are enabled in the future--
> > >>
> > >> I wouldn't want to treat them separately at all.
> > >
> > > Neither would I, but one is like a pointer, and the other is a pointer to 
> > > a
> > > pointer. The 16-color will have to be dereferenced to its 256-color 
> > > palette.
> > > I haven't heard a complete solution to the 16-to-256 palette problem yet,
> > > nor have I solved it.
> > 
> > Don't use indices, but use actual colours instead?
> > 
> > set pal color ( 123, make rgb(255, 0, 0))
> 
> Yes, but with any changes to the master palette, all the 16-color palettes
> will have to be changed as well. So the distinction between a master 
> (256-color)
> palette and a 16-color is still there.

Wait a second... are master palettes ever altered during runtime?



___
Unlimited Disk, Data Transfer, PHP/MySQL Domain Hosting
  http://www.doteasy.com 
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-26 Thread Jay Tennant
> From: Mike Caron 
> Sent: Thursday, May 26, 2011 11:51 AM
> 
> On Thu, May 26, 2011 at 12:47 PM, Jay Tennant
>  wrote:
> >> From: Ralph Versteegen 
> >> Sent: Thursday, May 26, 2011 11:32 AM
> >
> >> > My concern here, is what kind of problems a feature like this could
> >> > cause in the future?
> >>
> >> Actually, wait, I'm not sure that a change to a pallete should affect
> >> all other sprites. I think it makes sense to only allow changing the
> >> palette for a single sprite (slice): use copy-on-write.
> >
> > Wait, what? Create a new 16-color palette just for one sprite? I think a
> > 16-color palette change should affect all objects that use the 16-color
> > palette.
> >
> >> > We already have to keep supporting 16 color palette changes on sprites,
> >> > even when 256 color sprites are enabled in the future--
> >>
> >> I wouldn't want to treat them separately at all.
> >
> > Neither would I, but one is like a pointer, and the other is a pointer to a
> > pointer. The 16-color will have to be dereferenced to its 256-color palette.
> > I haven't heard a complete solution to the 16-to-256 palette problem yet,
> > nor have I solved it.
> 
> Don't use indices, but use actual colours instead?
> 
> set pal color ( 123, make rgb(255, 0, 0))

Yes, but with any changes to the master palette, all the 16-color palettes
will have to be changed as well. So the distinction between a master (256-color)
palette and a 16-color is still there.



___
Unlimited Disk, Data Transfer, PHP/MySQL Domain Hosting
  http://www.doteasy.com 
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-26 Thread Mike Caron
On Thu, May 26, 2011 at 12:47 PM, Jay Tennant
 wrote:
>> From: Ralph Versteegen 
>> Sent: Thursday, May 26, 2011 11:32 AM
>
>> > My concern here, is what kind of problems a feature like this could
>> > cause in the future?
>>
>> Actually, wait, I'm not sure that a change to a pallete should affect
>> all other sprites. I think it makes sense to only allow changing the
>> palette for a single sprite (slice): use copy-on-write.
>
> Wait, what? Create a new 16-color palette just for one sprite? I think a
> 16-color palette change should affect all objects that use the 16-color
> palette.
>
>> > We already have to keep supporting 16 color palette changes on sprites,
>> > even when 256 color sprites are enabled in the future--
>>
>> I wouldn't want to treat them separately at all.
>
> Neither would I, but one is like a pointer, and the other is a pointer to a
> pointer. The 16-color will have to be dereferenced to its 256-color palette.
> I haven't heard a complete solution to the 16-to-256 palette problem yet,
> nor have I solved it.

Don't use indices, but use actual colours instead?

set pal color ( 123, make rgb(255, 0, 0))

-- 
Mike Caron
Tale of the Cave
http://taleotc.com
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-26 Thread James Paige
On Fri, May 27, 2011 at 04:30:59AM +1200, Ralph Versteegen wrote:
> (Currently too busy to respond to anything else, but this is quick enough)
> 
> On 27 May 2011 03:54, James Paige  wrote:
> > I was talking to J_Taylor today about 16-color palette manipulation with
> > scripts. He was hoping to be able to change colors in a 16-color palette
> > for a character customization screen, and I was thinking about whether
> > or not adding a command that can do that would be practical, and whether
> > or not it would cause any problems for future plans.
> >
> > I could imagine a commands like:
> >
> >  set pal16 color(palette id, color index, color value)
> >  get pal16 color(palette id, color index)
> 
> Ditch the "16" from the name, it won't make sense when we switch to
> 256 colour palettes.

Ah, yes, I didn't think of that. I was trying to distinguish the names 
from the master palette related commands... but those are already 
somewhat ambigiously named, so there is probably no hope :)

> > And set pal16 color would change the color for all sprites that use that
> > palette. This seems like it would be relatively easy to implement right
> > now. Just find the desired palette in the palette cache, and alter it
> > (or if it isn't in the cache yet, add it and alter it)
> 
> I've actually already written something very similar to that, except
> for reloading a palette from file.

I will look at that code :)

> > I guess it would
> > also be good to have
> >
> >  default pal16 color(palette id, color index)
> 
> I suggest "restore palette colour" instead.

Or "restore palette color"? ;)

> > In case you wanted to revert changes.
> >
> > My concern here, is what kind of problems a feature like this could
> > cause in the future?
> 
> Actually, wait, I'm not sure that a change to a pallete should affect
> all other sprites. I think it makes sense to only allow changing the
> palette for a single sprite (slice): use copy-on-write.

Hmmm... That sounds like a good thing... but it also sounds like a 
completely different feature. What if I wanted to change the palette of 
the sprite used in battle, which is not a slice yet? What if I wanted to 
change the palette that every Soldier NPC and Soldier Enemy uses to 
reflect their country's national colors? What if I want to alter a color 
once in my newgame/loadgame script, and not have to keep managing it on 
ever different map?

But is there any reason why we could not have both global sprite palette 
changes and per-slice-instance sprite palette changes?

> > We already have to keep supporting 16 color palette changes on sprites,
> > even when 256 color sprites are enabled in the future--
> 
> I wouldn't want to treat them separately at all.

That makes sense. I forgot about the plan to keep the ability to change 
palettes for 256 color sprites (which is great in every way :)

---
James
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-26 Thread Jay Tennant
> From: Ralph Versteegen 
> Sent: Thursday, May 26, 2011 11:32 AM

> > My concern here, is what kind of problems a feature like this could
> > cause in the future?
> 
> Actually, wait, I'm not sure that a change to a pallete should affect
> all other sprites. I think it makes sense to only allow changing the
> palette for a single sprite (slice): use copy-on-write.

Wait, what? Create a new 16-color palette just for one sprite? I think a
16-color palette change should affect all objects that use the 16-color
palette.

> > We already have to keep supporting 16 color palette changes on sprites,
> > even when 256 color sprites are enabled in the future--
> 
> I wouldn't want to treat them separately at all.

Neither would I, but one is like a pointer, and the other is a pointer to a
pointer. The 16-color will have to be dereferenced to its 256-color palette.
I haven't heard a complete solution to the 16-to-256 palette problem yet,
nor have I solved it.



___
Unlimited Disk, Data Transfer, PHP/MySQL Domain Hosting
  http://www.doteasy.com 
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-26 Thread Ralph Versteegen
(Currently too busy to respond to anything else, but this is quick enough)

On 27 May 2011 03:54, James Paige  wrote:
> I was talking to J_Taylor today about 16-color palette manipulation with
> scripts. He was hoping to be able to change colors in a 16-color palette
> for a character customization screen, and I was thinking about whether
> or not adding a command that can do that would be practical, and whether
> or not it would cause any problems for future plans.
>
> I could imagine a commands like:
>
>  set pal16 color(palette id, color index, color value)
>  get pal16 color(palette id, color index)

Ditch the "16" from the name, it won't make sense when we switch to
256 colour palettes.

> And set pal16 color would change the color for all sprites that use that
> palette. This seems like it would be relatively easy to implement right
> now. Just find the desired palette in the palette cache, and alter it
> (or if it isn't in the cache yet, add it and alter it)

I've actually already written something very similar to that, except
for reloading a palette from file.

> I guess it would
> also be good to have
>
>  default pal16 color(palette id, color index)

I suggest "restore palette colour" instead.

> In case you wanted to revert changes.
>
> My concern here, is what kind of problems a feature like this could
> cause in the future?

Actually, wait, I'm not sure that a change to a pallete should affect
all other sprites. I think it makes sense to only allow changing the
palette for a single sprite (slice): use copy-on-write.

> We already have to keep supporting 16 color palette changes on sprites,
> even when 256 color sprites are enabled in the future--

I wouldn't want to treat them separately at all.

> so maybe there
> is no problem here-- I just want to know if anybody else can think of
> any potential pitfalls here before I consider trying an implementation.
>
> ---
> James
> ___
> Ohrrpgce mailing list
> ohrrpgce@lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


Re: [Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-26 Thread Jay Tennant
> From: James Paige 
> Sent: Thursday, May 26, 2011 10:55 AM
> 
> I was talking to J_Taylor today about 16-color palette manipulation with 
> scripts. He was hoping to be able to change colors in a 16-color palette 
> for a character customization screen, and I was thinking about whether 
> or not adding a command that can do that would be practical, and whether 
> or not it would cause any problems for future plans.
> 
> I could imagine a commands like:
> 
>   set pal16 color(palette id, color index, color value)
>   get pal16 color(palette id, color index)
> 
> And set pal16 color would change the color for all sprites that use that 
> palette. This seems like it would be relatively easy to implement right 
> now. Just find the desired palette in the palette cache, and alter it 
> (or if it isn't in the cache yet, add it and alter it) I guess it would 
> also be good to have
> 
>   default pal16 color(palette id, color index)
> 
> In case you wanted to revert changes.
> 
> My concern here, is what kind of problems a feature like this could 
> cause in the future?
> 
> We already have to keep supporting 16 color palette changes on sprites, 
> even when 256 color sprites are enabled in the future-- so maybe there 
> is no problem here-- I just want to know if anybody else can think of 
> any potential pitfalls here before I consider trying an implementation.

Seems fine to me. On a side, can the same thing be done with master palettes?



___
Unlimited Disk, Data Transfer, PHP/MySQL Domain Hosting
  http://www.doteasy.com 
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


[Ohrrpgce] 16-color Palette manipulation with scripts

2011-05-26 Thread James Paige
I was talking to J_Taylor today about 16-color palette manipulation with 
scripts. He was hoping to be able to change colors in a 16-color palette 
for a character customization screen, and I was thinking about whether 
or not adding a command that can do that would be practical, and whether 
or not it would cause any problems for future plans.

I could imagine a commands like:

  set pal16 color(palette id, color index, color value)
  get pal16 color(palette id, color index)

And set pal16 color would change the color for all sprites that use that 
palette. This seems like it would be relatively easy to implement right 
now. Just find the desired palette in the palette cache, and alter it 
(or if it isn't in the cache yet, add it and alter it) I guess it would 
also be good to have

  default pal16 color(palette id, color index)

In case you wanted to revert changes.

My concern here, is what kind of problems a feature like this could 
cause in the future?

We already have to keep supporting 16 color palette changes on sprites, 
even when 256 color sprites are enabled in the future-- so maybe there 
is no problem here-- I just want to know if anybody else can think of 
any potential pitfalls here before I consider trying an implementation.

---
James
___
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org