NEED HELP! NAO!!! (Rotation code wise)

You must understand the Game Editor concepts, before post here.

NEED HELP! NAO!!! (Rotation code wise)

Postby Game A Gogo » Wed Jun 11, 2008 9:22 pm

after many great help from all of the forum members *COUGH*

anyways...

I MADE IT WORK! but it needs clean up. it rotates yes :D but it would be nice at least that there would be no black dots randomly...

here is the file. click the rotate button to rotate :D

soo... PLEASE HELP ME! it's very rare I need help anyway <,,<

I will give points to the one that cleans it up :O

and to sgt.sparky... I know you were working on something like this, well... D: nothing else to say lol
Attachments
data.zip
CW sprite designer
(400.41 KiB) Downloaded 138 times
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: NEED HELP! NAO!!! (Rotation code wise)

Postby feral » Wed Jun 11, 2008 10:48 pm

need more info ?

I cant seem to replicate the problem ?? sorry, what should i be looking for ?

feral
User avatar
feral
 
Posts: 308
Joined: Sun Mar 16, 2008 6:27 am
Score: 47 Give a positive score

Re: NEED HELP! NAO!!! (Rotation code wise)

Postby Game A Gogo » Wed Jun 11, 2008 11:39 pm

ok, just enter like the number 1, then click rotate. you will see that it will take some data out of bound. which is all 0. I would like to be able to at least make it completly transparent or something
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: NEED HELP! NAO!!! (Rotation code wise)

Postby pyrometal » Wed Jun 11, 2008 11:51 pm

It seems your rotating single pixels at once... By doing it that way, you generate those black pixels because pixels cannot be garanteed to align in a proper manner, generating data loss... I may know a method that could fix your problem, consists of taking average colors instead and using a similar rotation method. I'll try something for you ok?
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: NEED HELP! NAO!!! (Rotation code wise)

Postby pyrometal » Thu Jun 12, 2008 5:35 am

Here! This is better and doesn't generate black pixels at all! Note that there is still loss in detail and data after after rotation, but the result is cleaner. I tried using an averaging method like I mentioned, but the results became very blured, and were very shitty... So instead, I opted for a system that creates a rotated version by selecting only the values of the closest matching pixel, this way, you avoid "voids" and also, without color averaging, only the original colors used will reappear. Don't rotate the same image continually because it will become very bad. Instead, draw the initial, save it, and everytime you need a new angle for it, reopen the original instead in order to minimize image loss. Hope this was helpful and that my comments in the code aren't too horrible to read! (I also made a test image! Nice program indead! I beleive its practically complete!)

Rotation Fixed.zip
Yay!
(162.12 KiB) Downloaded 159 times


--pyro
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: NEED HELP! NAO!!! (Rotation code wise)

Postby DST » Thu Jun 12, 2008 1:35 pm

Well done!
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: NEED HELP! NAO!!! (Rotation code wise)

Postby pyrometal » Thu Jun 12, 2008 1:38 pm

Thanks!
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: NEED HELP! NAO!!! (Rotation code wise)

Postby Game A Gogo » Thu Jun 12, 2008 1:52 pm

Thanks a lot!!! With this, I will be able to make my next game :D

and this will be a great revolution without the need to have intense need of images.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: NEED HELP! NAO!!! (Rotation code wise)

Postby pyrometal » Thu Jun 12, 2008 2:29 pm

No problem! It was fun to figure out!
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: NEED HELP! NAO!!! (Rotation code wise)

Postby Game A Gogo » Thu Jun 12, 2008 8:06 pm

and here is your two points :D now you are eligible to receive a free GE gold/silver (Forgot) version

and also, that program is old, and I just used it cuz it had what I needed for starting. I will implant the rotation engine in another game, where you have space ship and all. will be very interesting.

And what I like with your code is it's in degree, unlike my previous code, it was weird screwed up radians O,,o
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: NEED HELP! NAO!!! (Rotation code wise)

Postby pyrometal » Thu Jun 12, 2008 8:50 pm

thanks a lot for the points Gogo! I have to warn you about one thing though, Using this in real time sucks up CPU power, especially if used extensively... It tried something like that with my bmp24 code series, and I got my CPU usage higher than 50% doing rather simple things. It will work fine for a single actor, but many actors could be risky.
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: NEED HELP! NAO!!! (Rotation code wise)

Postby Game A Gogo » Thu Jun 12, 2008 9:05 pm

only 50%? not a lot. games usually take it all :P even on my parents computer
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: NEED HELP! NAO!!! (Rotation code wise)

Postby pyrometal » Thu Jun 12, 2008 9:28 pm

Alright, just keep that in mind though!
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest