SGP

Halo Reach => Work-In-Progress (Halo: Reach) => Topic started by: Imppa on January 01, 2011, 20:54:53

Title: Shotcode maker - I need [some of] YOU!
Post by: Imppa on January 01, 2011, 20:54:53
Here's the thing:
I've been working on my thread/article about shotcodes for some time now. I feel like it's coming together soon, but there is a piece I cannot craft alone, myself: an application that you can use to re-create shotcodes. It would be an excellent finishing touch to the text, and would probably draw interest, since it would be easy to re-create and test the shotcodes/find something awesome/possibly achieve glory.

But as said, I am not able to do it. I am very interested in coding, and I have already some experience of Java, but I still don’t know enough about GUIs or such (I only know some methods from it, thanks to my incomplete programming course in school :)).  Thankfully, I have noticed that there are some (talented?) programmers in SGP, who could, perhaps, create it for me. What do you say?

If you are interested, and I hope you are, here’s the plan:


The idea of the program is to create an environment where you can easily re-create shotcodes that are unreadable or damaged (in this case, the shotcodes in Halo: Reach) or try different bit combinations to see where the code will take you (fun?). Selecting the bits would be done by clicking the area where the bit is located, which would change the bit from 0 to 1 (white to black) or vice versa. After this the code could be read.

In the beginning, the program would draw a blank shotcode to the background, where the bits can be set up. Here, the radius of the shotcode is 7r, so that the radius of one ring is r, and that the datarings would be 4r to 5r and 5r to 6r.
To determine which bit should be changed, a method named determineBit would be used. determineBit would have two parameters, x and y, namely the coordinates of the click of the mouse. Since there are 2 rings (5r and 6r) and 24 sectors (each sector is 15 degrees), the bit could be determined by it's distance and degree in relation to the bullseye using trigonometrics and pythagorean theorem (Do I even know what am I talking about? :laugh:).
The method would look like this:

Code: [Select]

public static int determineBit (double x, double y)
{
    int bit = 117;
   
    int shotcodeWidth = 14;
    int shotcodeHeight = 14;
    int degreePerBit = 15;
    int error = 117;
    int r = 1;
   


    x -= shotcodeWidth / 2;
    y -= shotcodeHeight / 2;

/*Since the ring x*x + y*y = 7r*7r, or The boundaries of the shotcode, is drawn
 * around the origo, all the calculations must be made there. Meaning, when the
 *user clicks the center of the shotocde, in the calculations, he is clicking the
 * origo (0, 0). That is why certain values, like half of the size of the
 *shotcode and coordinates must be taken out of the click coordinates.
 */
    if (x*x + y*y >= 4*r*4*r)
    {
        if (x*x + y*y <= 6*r*6*r)
        {
         if (x > 0)
         {
             if (y > 0)
                 bit = (int) Math.floor (Math.abs(Math.toDegrees (Math.atan (x/y)) / degreePerBit));
             else if (y < 0)
             {
                 bit = (int) Math.floor (Math.abs(Math.toDegrees (Math.atan (y/x)) / degreePerBit));
                 //Note the difference to the earlier case
                 bit += 6;

             }
 else if (y == 0)
     bit = error;
         }
         
        else if (x < 0)
         {
        if (y < 0)
         {
             bit = (int) Math.floor (Math.abs(Math.toDegrees (Math.atan (x/y)) / degreePerBit));
             bit += 12;
         }
       
        else if (y > 0)
         {
             bit = (int) Math.floor (Math.abs(Math.toDegrees (Math.atan (y/x)) / degreePerBit));
             bit += 18;
         }
 else if (y == 0)
     bit = error;
     
     
         }
 else
     bit = error;

         if (x*x + y*y >= 5*r*5*r)//If on outer rim
            bit += 24;

        }
       
 else
     bit = error;
       
        }
 else
     bit = error;

    return bit;
}
(Don't worry, if you still don't understand, you don't have to: I've checked it works.)

The value of determineBit is from 0 to 47, giving 48 values, one for each bit. If the click does not hit any bit, it returns error value/117 :).
Each bit would have a value in a chart int bitValues [48]. When the user clicks the bit, the value of that bit goes up by 1. When the value can't be divided with 2, the bit is drawn. When it can, or the value is zero, it is not drawn:
Code: [Select]
if (bitValue [determineBit(x,y)] % 2 != 0 || bitValue [determineBit(x,y)] == 0)
     bitValue [determineBit(x,y)]++;

The image of the bit would be a .png, which would b as big as the shotcode, but only the area of the selected bit would be present in the image; the rest would be transparent. This way we don't have to think about how to calculate the coordinates of the bit, since they can be drawn to the same spot as the Shotcode. Thankfully, we dont have to create 48 different images, since we can do just 12 and then mirror them to create the rest. :)
Also, if we could have a grid you could toggle, placing the bits would be easier.

...And that's it. I'm sorry I can't code more than this, but I still am just an amateur :P. All help is appreciated, since this would take probably months for me to finish it...:D
I can work on the images myself, but if there are any takers, I could use that time to write the thread, you know...;)

Thanks is advance!
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Scatcycle on January 01, 2011, 21:01:34
If I can I will work on this soon...

It would be a great thing to have, but is it really necessary? We have the blank shotcode...

Anyways, I will work on it in a different programming language, as I do not know Java yet, so I will keep you updated on that.
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Pulse Cloud on January 01, 2011, 22:04:49
So you want to create shotcodes yourself? Like.. those circular images?
*sigh*
You don't need to be an expert at programming - you need to know how to use Paint (or Photoshop).

Sure, it would be a good exercise and it would be fun (lolno), but using Photoshop is WAAY easier and WAAY faster.

KISS (http://en.wikipedia.org/wiki/KISS_principle). :)
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Phantasm 08 on January 02, 2011, 04:43:37
Well, it'd be more user-friendly and way faster once it was set up, than using Paint or something, and it would be a useful program to whip up a shotcode in no time flat, and if you mess up in an image editor, you'd have to refresh it or undo the last action, and when you finished you'd still have those unsightly lines between the blank areas. 

Oh, and a simple tip for defining variables is to categorize them by type, and define them all at once, like so:
Code: [Select]
     int Bit = 117,
     shotcodeWidth = 14,
     shotcodeHeight = 14,
     degreePerBit = 15,
     Error = 117;

At least you can in C++, and that's what it looks like you're using.  In later versions, one would think it would be at least that efficient, if not more so.
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Imppa on January 02, 2011, 10:35:27
As Phan said, when the program would be set up, it would be much easier than faster to make one THAN IN PHOTOSHOP. Creating the app is a different story...:P

Oh and Phan, I am using Java there.
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Pulse Cloud on January 02, 2011, 12:36:28
How to Photoshop (or Illustrator for vectorized graphics (ie, perfectly smooth lines)):
1- Create new layer and draw a circumference
2- Create a layer for each "circle segment" (create one, copy-paste and rotate)
3- DONE! Just hide the unnecessary layers and it's game.

You feelin' me, dawg?
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: nightcrafter27 on January 02, 2011, 18:13:29
How to Photoshop (or Illustrator for vectorized graphics (ie, perfectly smooth lines)):
1- Create new layer and draw a circumference
2- Create a layer for each "circle segment" (create one, copy-paste and rotate)
3- DONE! Just hide the unnecessary layers and it's game.

You feelin' me, dawg?

4- Post image on SGP and wait for imppa to decode it.
5- Get results, possibly days later
6- Feel that dawg
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Imppa on January 02, 2011, 19:54:06
How to Photoshop (or Illustrator for vectorized graphics (ie, perfectly smooth lines)):
1- Create new layer and draw a circumference
2- Create a layer for each "circle segment" (create one, copy-paste and rotate)
3- DONE! Just hide the unnecessary layers and it's game.

You feelin' me, dawg?

4- Post image on SGP and wait for imppa to decode it.
5- Get results, possibly days later
6- Feel that dawg
You callin' me slow?  >:(
And while that is true, Night, let me correct you before Pulse does. There are probably more people who could decode it, if you'd just download the app (it supports majority of the models out there, I think). And even if you didn't, you could probably find people from bnet or other groups who would gladly do it in matter of hours (assuming the case catchs interest once more).
No, that is not the thing. The thing is that even though some people could do it easily (if we gave them the models ready), most probably couldn't. Would they even bother doing that much? "Here are the models, now download them on your computer, open your Photoshop and make it work!" Wouldn't it be better if we said "Just scroll down a bit and start placing your bits"?
If an application cannot be made, THEN we will go with the old model. But Pulse, please try to understand that the app would be much better for that huge thing people call Internet.
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Scatcycle on January 02, 2011, 19:57:25
How to Photoshop (or Illustrator for vectorized graphics (ie, perfectly smooth lines)):
1- Create new layer and draw a circumference
2- Create a layer for each "circle segment" (create one, copy-paste and rotate)
3- DONE! Just hide the unnecessary layers and it's game.

You feelin' me, dawg?

4- Post image on SGP and wait for imppa to decode it.
5- Get results, possibly days later
6- Feel that dawg
You callin' me slow?  >:(
And while that is true, Night, let me correct you before Pulse does. There are probably more people who could decode it, if you'd just download the app (it supports majority of the models out there, I think). And even if you didn't, you could probably find people from bnet or other groups who would gladly do it in matter of hours (assuming the case catchs interest once more).
No, that is not the thing. The thing is that even though some people could do it easily (if we gave them the models ready), most probably couldn't. Would they even bother doing that much? "Here are the models, now download them on your computer, open your Photoshop and make it work!" Wouldn't it be better if we said "Just scroll down a bit and start placing your bits"?
If an application cannot be made, THEN we will go with the old model. But Pulse, please try to understand that the app would be much better for that huge thing people call Internet.
*snickers*

But anyway, if people are intelligent enough to make a real, working shotcode, they will know how to use paint.
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Imppa on January 02, 2011, 20:41:43
But, but...:(
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Phantasm 08 on January 03, 2011, 01:54:43
But if people are smart enough to use paint, they would also recognize the importance of having an easy-to-use app, as opposed to individually saving a blank shotcode, and making a new Paint image every time they wanted to make a shotcode.

Face it, people are lazy, and generally, if they have to go out of their way to do something simple on our site, they're not going to like it nearly as much as taking the cursor and going click-click-done. That kind of thing really can make or break the sale. Yes, I'm speaking metaphorically here, but you get the idea.

My dad works mostly with C#, but I sent this page to him in the hopes that he might have some insight. He does web programming for the State Board of Education, so this should be right up his alley.
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Scatcycle on January 03, 2011, 02:05:45
But if people are smart enough to use paint, they would also recognize the importance of having an easy-to-use app, as opposed to individually saving a blank shotcode, and making a new Paint image every time they wanted to make a shotcode.

Face it, people are lazy, and generally, if they have to go out of their way to do something simple on our site, they're not going to like it nearly as much as taking the cursor and going click-click-done. That kind of thing really can make or break the sale. Yes, I'm speaking metaphorically here, but you get the idea.

My dad works mostly with C#, but I sent this page to him in the hopes that he might have some insight. He does web programming for the State Board of Education, so this should be right up his alley.
How many time are people going to make shotcodes? Not even people at the SGP exceed over 5-10.
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: nightcrafter27 on January 03, 2011, 02:10:51
Well, Immpa, I would love to decode shotcodes. But, I have bought three different apps to do that, and none have worked. I'm also learning Java, albeit much farther behind you, and would love an opportunity to get some hands on experience. The app would bring more attention to our site than a blank shot code image would.

And Scat put your name in my earlier post :P
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Scatcycle on January 03, 2011, 02:14:26
Well, Immpa, I would love to decode shotcodes. But, I have bought three different apps to do that, and none have worked. I'm also learning Java, albeit much farther behind you, and would love an opportunity to get some hands on experience. The app would bring more attention to our site than a blank shot code image would.

And Scat put your name in my earlier post :P
I talked about this with Imppa, I told him that our app could get us money, could be used for actual stuff, not just halo stuff, and we could get money for it.

Imppa said: "Nah."
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Phantasm 08 on January 03, 2011, 03:30:57
I talked about this with Imppa, I told him that our app could get us money, could be used for actual stuff, not just halo stuff, and we could get money for it.

Imppa said: "Nah."

Well, I only have this (http://www.snuggieblanketfortwo.com/snuggies/wp-content/uploads/2010/02/the-snuggie.jpg) to say to Imppa.

You would be surprised how much money you can get for saving someone two seconds of trouble.  

How many time are people going to make shotcodes? Not even people at the SGP exceed over 5-10.


The difference between having an application where you click a single data point to fill it all in, and having to shade it in with Paint may not be much.  But being able to do it in the same window, without having to open an extra program, and being able to copy it and save it as it is, will be far easier.  Not to mention, that much easier to bring up if you have a sudden idea, and have a finished product in a matter of seconds rather than minutes.  It's a matter of convenience, and THAT'S what the public wants.  Not everyone will be inclined to save that blank Scatcode and edit it themselves, but being able to fill in the blocks at the push of a button will be received with more open arms.  It will also have cleaner edges, and it'll LOOK better.  It's easier and faster, and anyone can produce an end result that looks good.

Who knows?  Maybe we can make our own shotcode, that corresponds to our site.  And, as much as I like Enigma's Octagon, I bet we could replace the one on 8-Bit Johnson's cover with our own personalized shotcode.
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Scatcycle on January 03, 2011, 03:50:14
I talked about this with Imppa, I told him that our app could get us money, could be used for actual stuff, not just halo stuff, and we could get money for it.

Imppa said: "Nah."

Well, I only have this (http://www.snuggieblanketfortwo.com/snuggies/wp-content/uploads/2010/02/the-snuggie.jpg) to say to Imppa.

You would be surprised how much money you can get for saving someone two seconds of trouble. 

How many time are people going to make shotcodes? Not even people at the SGP exceed over 5-10.


The difference between having an application where you click a single data point to fill it all in, and having to shade it in with Paint may bot be much.  But being able to do it in the same window, without having to open an extra program, and being able to copy it and save it like that, will be far easier.  Not to mention, that much easier to bring up if you have a sudden idea, and have a finished product in a matter of seconds rather than minutes.  It's a matter of convenience, and THAT'S what the public wants.  Not everyone will be inclined to save that blank Scatcode and edit it themselves, but being able to fill in the blocks at the push of a button will be received with more open arms.  It will also have cleaner edges, and it'll LOOK better.  It's easier and faster, and anyone can produce an end result that looks good.

Who knows?  Maybe we can make our own shotcode, that corresponds to our site.  And, as much as I like Enigma's Octagon, I bet we could replace the one on 8-Bit Johnson's cover with our own personalized shotcode.
If someone has made a breaking news discovery about the shotcodes in reach, and need to create one, I don't think they need to have it done under 5 minutes.
They will do whatever they have to do to have it completed.

Although I don't think it will be that helpful, I think it would be a fun project. I'm going to make a binary shotcode (TRAINS!11!!!!one!!1!) for the SGP.
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: nightcrafter27 on January 04, 2011, 00:55:55
Also, a running app would bring more attention to the site than an image. But I feel like I said this already :(
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Phantasm 08 on January 04, 2011, 04:23:01
Also, a running app would bring more attention to the site than an image. But I feel like I said this already :(

Exactly what I was saying, but we all agree that it'd be nice to make the app, whatever our individual reasons.  At least, nobody else has made any complaints.

S'all good, night!  :)
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Phantasm 08 on January 06, 2011, 23:58:26
If someone has made a breaking news discovery about the shotcodes in reach, and need to create one, I don't think they need to have it done under 5 minutes.
They will do whatever they have to do to have it completed.

Although I don't think it will be that helpful, I think it would be a fun project. I'm going to make a binary shotcode (TRAINS!11!!!!one!!1!) for the SGP.

You are very much correct, scat, that someone will do whatever it takes to make a shotcode if it means a big breakthrough, but in the meantime I'm coloring blocks in by hand, and I'd much appreciate an app.  That way, I can have it done in a matter of seconds, instead of spending ten or fifteen minutes filling it in, perfectionist that I am. 
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Imppa on January 10, 2011, 21:50:36
The app is almsot done (by me! :D). If you still want to help, I do need all those 48 bits.
Takers? Seriously, I just need them, and then I'm just a few rows away from completition. Attached a grid for it, if you need it.
Remember: Don't change the coordinates of the bit! The bit should be in the same position where it would be in a 700x700 shotcode (the grid is in a 700x700 image, while the grid itself is 600x600). This way it is easy/possible to place the bit to the right place in the app.
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Phantasm 08 on January 11, 2011, 00:54:32
Nice one, Imppa!  I wish I had been able to help, but I'm still too mediocre of a programmer to do much more than ASCII art hangman  :-\
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Imppa on January 13, 2011, 21:58:18
Nice one, Imppa!  I wish I had been able to help, but I'm still too mediocre of a programmer to do much more than ASCII art hangman  :-\
No prob man, at least you offered some help! ;)

By the way, I just got all the bits drawn - BY MYSELF. At least I can call this app my own..
It ain't ready though. Seems that I have to learn some little more about graphics.
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Imppa on July 17, 2011, 22:04:05
For the record, this case has been but into ice by me. :( Since it does seem that the "Burger Shotcode" is not actually new, I've lost some great "WOW" potential in the article (that has only been started). Also, the app needs serious work/help on the graphics side. ALSO, shotcode.com is down, and I'm not sure will it ever be back...:(

But there will be day for this, too!
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: nightcrafter27 on July 18, 2011, 03:28:22
For the record, this case has been but into ice by me. :( Since it does seem that the "Burger Shotcode" is not actually new, I've lost some great "WOW" potential in the article (that has only been started). Also, the app needs serious work/help on the graphics side. ALSO, shotcode.com is down, and I'm not sure will it ever be back...:(

But there will be day for this, too!

What do you need? The individual sectors?
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Imppa on July 18, 2011, 07:42:57
For the record, this case has been but into ice by me. :( Since it does seem that the "Burger Shotcode" is not actually new, I've lost some great "WOW" potential in the article (that has only been started). Also, the app needs serious work/help on the graphics side. ALSO, shotcode.com is down, and I'm not sure will it ever be back...:(

But there will be day for this, too!

What do you need? The individual sectors?
No, I have .png files of each invidual Bit. What I need is a system that can toggle those images to either show or not to show...The main problem being that I don't get the image drawing stuff.  :-[

But currently, Scat is working on this already, trying to create it in .exe . We should see if he can do it first.
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Pulse Cloud on July 18, 2011, 12:13:03
What language are you using?
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Imppa on July 18, 2011, 12:51:10
What language are you using?
Java, it's all I realy know right now.
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Pulse Cloud on July 18, 2011, 18:49:49
What language are you using?
Java, it's all I realy know right now.
You guys should port it to C, if you're that interested in having an EXE.
I know it's asking a lot, but would you mind posting or PMing me the code of the latest stable build? I've never learned Java (and according to tons of articles I've read I'm not losing anything valuable), and I think I'm going to have to learn it this year, so it would be cool to see something other than "Herro VVorrd" code - something more structured.
Title: Re: Shotcode maker - I need [some of] YOU!
Post by: Imppa on July 18, 2011, 20:46:51
What language are you using?
Java, it's all I realy know right now.
You guys should port it to C, if you're that interested in having an EXE.
I know it's asking a lot, but would you mind posting or PMing me the code of the latest stable build? I've never learned Java (and according to tons of articles I've read I'm not losing anything valuable), and I think I'm going to have to learn it this year, so it would be cool to see something other than "Herro VVorrd" code - something more structured.
I can send you what I have, but as said: it isn't very stable, since the graphics interface is laking (ie. no bits for you).