Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Colour remap feature in object editor.  (Read 4913 times)

0 Members and 1 Guest are viewing this topic.

Brick Nash

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 83
  • Generic Amiga User
Colour remap feature in object editor.
« on: October 01, 2017, 08:35:42 AM »

Just what it says. I know there's probably a list of way more important features waiting to be done, but the ability to colour remap images already in the bank would save the graphics having to be re-imported/re-grabbed by hand should something change. Targeting an image for a colour reference and then remapping within Amos would be great, or even just the ability to import palettes and remap from them.

It would probably be a bitch to implement but it's just an idea.
« Last Edit: October 01, 2017, 09:27:33 AM by Brick Nash »
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Colour remap feature in object editor.
« Reply #1 on: October 01, 2017, 10:24:18 AM »

i agree that the colour changes are one reason why i dont use the object editor at all.

Just out of interest, and i appreciate this might mean a change in the way you work, but why do you use the object editor? What benefits of it do you see?

I always have my program (or a second program, if i just want to keep object banks) rip the graphics direct from an IFF file... this way i can make changes in DPaint and see my edits immediately why i run my AMOS program. Have you considered an approach like this, since it would avoid your palette problems also?
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Brick Nash

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 83
  • Generic Amiga User
Re: Colour remap feature in object editor.
« Reply #2 on: October 01, 2017, 10:36:55 AM »

i agree that the colour changes are one reason why i dont use the object editor at all.

Just out of interest, and i appreciate this might mean a change in the way you work, but why do you use the object editor? What benefits of it do you see?

I always have my program (or a second program, if i just want to keep object banks) rip the graphics direct from an IFF file... this way i can make changes in DPaint and see my edits immediately why i run my AMOS program. Have you considered an approach like this, since it would avoid your palette problems also?

Do you mean like a set sprite sheet which gets auto chopped up into the relevant frames and put in the bank? If so then that would be cool, but I'm not sure how to write such a program. I get the theory of it though and it would save a lot of headaches.

I mostly use the Object Editor simply because that's what the manuals say to do. Everything seems to be centred around the banks and I've not seen any alternatives tbh. I do find it decent to quickly check animation and reposition frames if need be, but I guess that Dpaint (or PPAint in my case) has the same ability.
Logged

Sidewinder

  • Forum Mod
  • A600
  • *****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • http://www.liquido2.com/
Re: Colour remap feature in object editor.
« Reply #3 on: October 01, 2017, 02:54:57 PM »

Do you mean like a set sprite sheet which gets auto chopped up into the relevant frames and put in the bank? If so then that would be cool, but I'm not sure how to write such a program. I get the theory of it though and it would save a lot of headaches.

Look into the Get Sprite instruction.  It allows you to grab a rectangular section of the screen and put it directly into the sprite bank (bank #1).  You could set up a loop to iterate through the image and grab each of your sprites.  Couple the loop with data statements and you can automatically grab sprites that are not all the same size.

Finally, if you're writing a separate tool to do this job, you can use the Save command to save bank 1 to the disk and Load it in your main game program.  This way you only need to grab the sprites from the sprite sheet when a change is made, otherwise, the most current bank is loaded directly from the disk.
Logged
- Sidewinder

Brick Nash

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 83
  • Generic Amiga User
Re: Colour remap feature in object editor.
« Reply #4 on: October 01, 2017, 03:04:20 PM »

Look into the Get Sprite instruction.  It allows you to grab a rectangular section of the screen and put it directly into the sprite bank (bank #1).  You could set up a loop to iterate through the image and grab each of your sprites.  Couple the loop with data statements and you can automatically grab sprites that are not all the same size.

Finally, if you're writing a separate tool to do this job, you can use the Save command to save bank 1 to the disk and Load it in your main game program.  This way you only need to grab the sprites from the sprite sheet when a change is made, otherwise, the most current bank is loaded directly from the disk.

That sound awesome, I'll look into it.

When you say screen do you mean a hidden screen with a sprite sheet on it? Or are you talking about an iff which is loaded.

I can see the advantages of this already and I can set up a grid to position the frames in my paint program before I transfer to the Amiga and just edit from there + remap in PPaint if needed.
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Colour remap feature in object editor.
« Reply #5 on: October 01, 2017, 03:17:11 PM »

this is an example of one i used in one of my games.... it used an IFF file for each character.

Because the grid was not laid out 100% equally, it has to do three different loops, but hoepfully you can follow the idea:


Code: [Select]
Procedure _GRAB[NAME$,OFFSET]
Auto View Off

Load Iff "HB_GAME:Characters/"+NAME$+".sheet",7
Screen Hide 7

E=1+OFFSET

For A=1 To 4 : For B=1 To 2

   C=B+((B-1)*48)
   D=A+((A-1)*20)
   Get Bob 7,E,C,D To C+48,D+20
   Bar C,D To C+47,D+19

   Hot Spot E,$12

   Inc E

' Wait Key
Next B : Next A



B=1

For A=5 To 7

   C=B+((B-1)*48)
   D=A+((A-1)*20)

   Get Bob 7,E,C,D To C+48,D+20

   Hot Spot E,$12

   Inc E
   Bar C,D To C+47,D+19


'Wait Key 
Next A




For A=1 To 7 : For B=3 To 4

   C=B+((B-1)*48)
   D=A+((A-1)*20)

   Get Bob 7,E,C,D To C+48,D+20

   Hot Spot E,$12

   Inc E
   Bar C,D To C+47,D+19

' Wait Key
Next B : Next A





Screen Close 7
Auto View On
End Proc
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Brick Nash

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 83
  • Generic Amiga User
Re: Colour remap feature in object editor.
« Reply #6 on: October 01, 2017, 04:56:05 PM »

this is an example of one i used in one of my games.... it used an IFF file for each character.

Because the grid was not laid out 100% equally, it has to do three different loops, but hoepfully you can follow the idea:


Code: [Select]
Procedure _GRAB[NAME$,OFFSET]
Auto View Off

Load Iff "HB_GAME:Characters/"+NAME$+".sheet",7
Screen Hide 7

E=1+OFFSET

For A=1 To 4 : For B=1 To 2

   C=B+((B-1)*48)
   D=A+((A-1)*20)
   Get Bob 7,E,C,D To C+48,D+20
   Bar C,D To C+47,D+19

   Hot Spot E,$12

   Inc E

' Wait Key
Next B : Next A



B=1

For A=5 To 7

   C=B+((B-1)*48)
   D=A+((A-1)*20)

   Get Bob 7,E,C,D To C+48,D+20

   Hot Spot E,$12

   Inc E
   Bar C,D To C+47,D+19


'Wait Key 
Next A




For A=1 To 7 : For B=3 To 4

   C=B+((B-1)*48)
   D=A+((A-1)*20)

   Get Bob 7,E,C,D To C+48,D+20

   Hot Spot E,$12

   Inc E
   Bar C,D To C+47,D+19

' Wait Key
Next B : Next A





Screen Close 7
Auto View On
End Proc

That's brilliant, thanks so much. Getting a chance to look at code is such a bonus! :)
Logged
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022