Author Topic: We're rewriting SMW  (Read 34732 times)

Offline JM Dragon

  • Stomp Arena Staff
  • this title came sooner than the last
  • **
  • Posts: 3629
Re: I'm rewriting SMW
« Reply #30 on: October 12, 2011, 04:18:30 PM »
Alright, time to get some serious stuff done. I'll see what I can do with getting  some of the stuff I've worked on in the past put into the game.

Also, are we using Java 6 or Java 7?
 

Offline EON8ight

  • Stomp Arena Staff
  • Regular
  • *****
  • Posts: 129
  • Dropped the screw in the tuna
    • EON8ight's Repository
Re: I'm rewriting SMW
« Reply #31 on: October 12, 2011, 05:11:40 PM »
I'm using Java 6 now.

Thanks, Big JM! Your help is appreciated.

Offline EON8ight

  • Stomp Arena Staff
  • Regular
  • *****
  • Posts: 129
  • Dropped the screw in the tuna
    • EON8ight's Repository
Re: I'm rewriting SMW
« Reply #32 on: October 12, 2011, 08:28:45 PM »
Also, as a general rule, if you're creating new classes, remember to include your name in an annotation at the top (@name is the tag, I think) and an overview of what the class contains. If you're modifying existing classes, be sure to include sufficient comments so others know what's going on.

Offline JM Dragon

  • Stomp Arena Staff
  • this title came sooner than the last
  • **
  • Posts: 3629
Re: I'm rewriting SMW
« Reply #33 on: October 12, 2011, 08:57:47 PM »
Quote from: "Blaspergerstoise"
Also, as a general rule, if you're creating new classes, remember to include your name in an annotation at the top (@name is the tag, I think) and an overview of what the class contains. If you're modifying existing classes, be sure to include sufficient comments so others know what's going on.
I believe that it is the @author tag. I'll be sure to add comments as I [s:2wfja1ox]totally break the game[/s:2wfja1ox] code new features.

I've been working on these things to kind of warm up and get used to how the code works:
Skin loading - Done. I used the 0smw skin, and got it fully transparent. I have yet to implement team colors (mainly because I complicated it in my own code).
Physics - Working on it. I had also toyed around with SMW physics before, so I'm trying to implement that (currently failing).

I'm hoping to get the physics done tonight. I feel like I'm close, but some things are wonky (player floats up when game is started).

EDIT:
It's working now, but the physics are floaty. I'll need to take a look at why that is soon.
 

Offline EON8ight

  • Stomp Arena Staff
  • Regular
  • *****
  • Posts: 129
  • Dropped the screw in the tuna
    • EON8ight's Repository
Re: I'm rewriting SMW
« Reply #34 on: October 12, 2011, 09:19:23 PM »
Quote from: "Big JM"
Quote from: "Blaspergerstoise"
Also, as a general rule, if you're creating new classes, remember to include your name in an annotation at the top (@name is the tag, I think) and an overview of what the class contains. If you're modifying existing classes, be sure to include sufficient comments so others know what's going on.
I believe that it is the @author tag. I'll be sure to add comments as I [s:162q2d5c]totally break the game[/s:162q2d5c] code new features.

I've been working on these things to kind of warm up and get used to how the code works:
Skin loading - Done. I used the 0smw skin, and got it fully transparent. I have yet to implement team colors (mainly because I complicated it in my own code).
Physics - Working on it. I had also toyed around with SMW physics before, so I'm trying to implement that (currently failing).

I'm hoping to get the physics done tonight. I feel like I'm close, but some things are wonky (player floats up when game is started).
Skin loading is finished. I wouldn't suggest doing a single thing with that. The original's palette thing was weird, and in my opinion, completely unnecessary. Skin loading is done through the constructor - the player and AI have BufferedImages as parameters.

I'm going to work on commenting things so you guys know exactly what everything is doing.
« Last Edit: October 12, 2011, 09:26:58 PM by EON8ight »

Offline JM Dragon

  • Stomp Arena Staff
  • this title came sooner than the last
  • **
  • Posts: 3629
Re: I'm rewriting SMW
« Reply #35 on: October 12, 2011, 09:26:11 PM »
Ah, ok. I set it back to the way it was before. I'll keep working on the physics.
 

Offline EON8ight

  • Stomp Arena Staff
  • Regular
  • *****
  • Posts: 129
  • Dropped the screw in the tuna
    • EON8ight's Repository
Re: I'm rewriting SMW
« Reply #36 on: October 12, 2011, 10:02:12 PM »
I finished adding comments. I also changed MapTestScene.java to DevMapScene.java.

Offline MSX

  • Posts Somewhat Often
  • *
  • Posts: 307
Re: I'm rewriting SMW
« Reply #37 on: October 12, 2011, 10:02:47 PM »
Pretty good stuff guys, keep it going!
Crouching Tiger Hidden Spaghetti.

Offline Felix-The-Ghost

  • Too Much Free Time
  • *****
  • Posts: 1305
  • 1v1 Rust
    • http://members.allegro.cc/felix-the-ghost/index.html
Re: I'm rewriting SMW
« Reply #38 on: October 12, 2011, 10:22:30 PM »
Quote from: "Big JM"
I have yet to implement team colors (mainly because I complicated it in my own code).

Super Skin Editor has code for that, I can try to implement or just show logic from it at least (as it is C++)

It loads the colors from the palette and knows which row of colors to draw based on conditions.
Once it's in, it's easy for a user to modify.

What are your thoughts on mod support? (some very popular mods edit things like the palette)
Mods and fully changeable graphics were something that was very attractive to our community.

I apologize for not having time today to do anything. I worked from 6:00am to 4:30am. Hard labor :(

Offline JM Dragon

  • Stomp Arena Staff
  • this title came sooner than the last
  • **
  • Posts: 3629
Re: I'm rewriting SMW
« Reply #39 on: October 12, 2011, 10:39:58 PM »
Quote from: "Felix-The-Ghost"
Quote from: "Big JM"
I have yet to implement team colors (mainly because I complicated it in my own code).

Super Skin Editor has code for that, I can try to implement or just show logic from it at least (as it is C++)

It loads the colors from the palette and knows which row of colors to draw based on conditions.
Once it's in, it's easy for a user to modify.

What are your thoughts on mod support? (some very popular mods edit things like the palette)
Mods and fully changeable graphics were something that was very attractive to our community.

I apologize for not having time today to do anything. I worked from 6:00am to 4:30am. Hard labor :(
I believe that Blaspergerstoise is planning on overhauling the team colors system, so let's not worry about that too much just yet.

I think that mod support is a must, but that is something to think about down the road. The code to do mod support is going to be difficult to do, though, so it might not come around until much later.

The graphics are currently external to the program, so changing graphics is not going to be an issue.
 

Offline EON8ight

  • Stomp Arena Staff
  • Regular
  • *****
  • Posts: 129
  • Dropped the screw in the tuna
    • EON8ight's Repository
Re: I'm rewriting SMW
« Reply #40 on: October 12, 2011, 10:43:58 PM »
Quote from: "Felix-The-Ghost"
Quote from: "Big JM"
I have yet to implement team colors (mainly because I complicated it in my own code).

Super Skin Editor has code for that, I can try to implement or just show logic from it at least (as it is C++)

It loads the colors from the palette and knows which row of colors to draw based on conditions.
Once it's in, it's easy for a user to modify.

What are your thoughts on mod support? (some very popular mods edit things like the palette)
Mods and fully changeable graphics were something that was very attractive to our community.

I apologize for not having time today to do anything. I worked from 6:00am to 4:30am. Hard labor :(
I believe team colors can be implemented through BufferedImage's setRGB method. The only problem I can think of is actually getting the pixels, but I think that can be handled by getRGB().

Here's my idea: instead of having the color-to-be-replaced be red, it should be an RGB color like [255, 0, 0] (or whatever that neon pink color was in the original). Then the game goes through each pixel, checks if it's that pink color, and then changes it to be red, blue, green, or yellow depending on the character's team.

Also, I like the idea of a skin editor. Perhaps we could include your Super Skin Editor in the release?

I also like the idea of mod support. We just have to figure out a way to load user-created classes instead of the default classes. And, as always, graphics will always be changeable, as will sounds.

Also, just a thought - the level editor doesn't necessarily have to be written in Java. All that matters is the file - as long as something can be implemented that can read a file, what language the level editor is written in shouldn't matter. However, I don't want to encourage using the original SMW's level editor - I'm thinking of a new, fully-redesigned editor with multiple layers (handled using arrays or ArrayLists, perhaps) and a new, streamlined user interface.

Offline EON8ight

  • Stomp Arena Staff
  • Regular
  • *****
  • Posts: 129
  • Dropped the screw in the tuna
    • EON8ight's Repository
Re: I'm rewriting SMW
« Reply #41 on: October 12, 2011, 11:00:58 PM »
EDIT 2: Don't touch the repository for a while. I'll let you guys know when it's safe to use it again.
« Last Edit: October 12, 2011, 11:10:11 PM by EON8ight »

Offline JM Dragon

  • Stomp Arena Staff
  • this title came sooner than the last
  • **
  • Posts: 3629
Re: I'm rewriting SMW
« Reply #42 on: October 12, 2011, 11:08:09 PM »
I have basic physics implemented into the player class. Here's a summary of what I did:
  • I added a few new fields to Player: float hspeed,vspeed; and boolean canJump.
  • I changed some variables in update() to use hspeed and vspeed instead of x and y.
    (for example, x += Physics.VELOCITY_X * timePassed; is changed to hspeed += Physics.VELOCITY_X * timePassed;)
  • added WALK_MAX_VELOCITY_X and MAX_VELOCITY_Y to Physics. The latter is the maximum jumping speed.
  • Implemented gravity with if(!onGround) vspeed += Physics.GRAVITY; (multiplying by timePassed proved to be too glitchy)
  • Added checks for maximum hspeed and vspeed
  • Added changes in collision to set hspeed and vspeed to 0 upon collision.

Once you get the SVN issues fixed, should I commit these changes?
 

Offline Felix-The-Ghost

  • Too Much Free Time
  • *****
  • Posts: 1305
  • 1v1 Rust
    • http://members.allegro.cc/felix-the-ghost/index.html
Re: I'm rewriting SMW
« Reply #43 on: October 12, 2011, 11:08:50 PM »
When I said mod support, I kinda meant like the kind of mods SMW currently has. I mean external graphics (cause it sounded like you were planning on an internal palette so I wanted to make sure you knew how much graphics/sound "mods" contributed to the community.

getRGB

Quote
Here's my idea: instead of having the color-to-be-replaced be red, it should be an RGB color like [255, 0, 0] (or whatever that neon pink color was in the original). Then the game goes through each pixel, checks if it's that pink color, and then changes it to be red, blue, green, or yellow depending on the character's team.
Yeah that's... exactly what my existing system does that I am proposing (as far as logic, anyway. I use a graphics library myself)

The idea is simple. A 2D array of the existing palette.bmp. You would need to read up on what Java classes/functions are available to you to adapt the logic for your use. What I don't know is what kind of struct you would need to store pixel information if we cannot store the separate RGB values in one integer (the separate bits) like the graphics library I use.

ColorPalette is an array of integers where the seperate bits represent RGB information.
Code: [Select]
    for (int k = 0; k < 37; k++) //reading colors from palette.bmp
{
    for (int l = 0; l < 25; ++l) //reading colors from palette.bmp
{
// Assigns the colorPalette array
ColorPalette[l][k] = getpixel(Palette, l, k);
}
}

The following the code for accessing that array to compare the skins colors to the palette. Adaption will be a little different as my implementation is used for creating a fully recolored frame (for editing/displaying) The logic is still there though. My editor uses 16x16 skins instead of 32x32 ones, mind you.

newcol is simply an integer denoting which row of the the palette to display (since they are already ordered by condition)

Code: [Select]
void make_recolor(int newcol, BITMAP* frame, int x) //recolor individual frames
{
    int color;

    for (int k = 0; k < 16; k++) //y loop (of the skin frame)
{
        for (int l = 0; l < 16; l++) //x loop (of the skin frame)
{
for (int i = 0; i < 25; i++) //for each pallete color length of one row in the palette)
{
   color = getpixel(frame, l, k);
if (color == ColorPalette[i][0]) //if there is a match in the top, "input" row of colors in the palette
{
                    putpixel(Recolor, x+l, k, ColorPalette[i][newcol]); //recolor preview with the saw column, new row of the palette (as SMW and my editor do)
                    break;
}
                else
                putpixel(Recolor, x+l, k, color); //no match -- draw existing color
}
}
}


}

edit:eww. our code tag is... gross :P

Big JM, would you kindly?

Quote from: Big JM
I think that mod support is a must, but that is something to think about down the road. The code to do mod support is going to be difficult to do, though, so it might not come around until much later.

Well, depending on our ability to perceive things down the road now, and making our code flexible, we won't need a huge overhaul, then :)
« Last Edit: October 12, 2011, 11:18:15 PM by Felix-The-Ghost »

Offline EON8ight

  • Stomp Arena Staff
  • Regular
  • *****
  • Posts: 129
  • Dropped the screw in the tuna
    • EON8ight's Repository
Re: I'm rewriting SMW
« Reply #44 on: October 12, 2011, 11:10:33 PM »
DON'T TOUCH SVN YET IT'S MESSED UP SEVERELY

I need to rework everything. Nothing was lost; it's just that nothing can be imported or committed.

EDIT: I have no idea what I'm doing. I'm importing files into the SVN, and afterwards, I should have the option of committing when right-clicking, but it acts like nothing happened. How the hell do I use Subversion and Tortoise SVN?