Super Smash Bros. for iPhone (WIP) (other help appreciated)

Talk about making games.

Re: Super Smash Bros. for iPhone (WIP) (other help appreciat

Postby Hblade » Tue Jan 24, 2012 5:28 pm

Blender 3D :3

Finishing touches:
FINAL 1.png



Complete:
Final 4.png
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Super Smash Bros. for iPhone (WIP) (other help appreciat

Postby Fojam » Tue Jan 24, 2012 8:15 pm

adding them in right now
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: Super Smash Bros. for iPhone (WIP) (other help appreciat

Postby Hblade » Wed Jan 25, 2012 2:20 am

Thanks xD
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Super Smash Bros. for iPhone (WIP) (other help appreciat

Postby Hblade » Wed Jan 25, 2012 6:15 pm

awesome :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Super Smash Bros. for iPhone (WIP) (other help appreciat

Postby Fojam » Thu Jan 26, 2012 12:06 am

I updated both the executable and the source. the links are in the first post.

@Hblade i added your stage
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: Super Smash Bros. for iPhone (WIP) (other help appreciat

Postby Hblade » Thu Jan 26, 2012 2:45 am

awesome! :D

Wow! I love the flood effect :D The water :) :) that was awesome. You charge it up and err'thang xD
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Super Smash Bros. for iPhone (WIP) (other help appreciat

Postby happyjustbecause » Thu Jan 26, 2012 7:25 am

Just want to say I love the animations for this game, this is shaping up to be a pretty cool game. I don't have an iPhone (or any phone at the moment), but I like how this plays. The stages are also nicely made, and there are several other compliments I can make, but you get the idea. :D
For small creatures such as we the vastness is bearable only through love.
-Carl Sagan

Night Knight Development Thread
User avatar
happyjustbecause
 
Posts: 267
Joined: Tue Jul 26, 2011 3:10 pm
Location: Frazier Park, Ca
Score: 15 Give a positive score

Re: Super Smash Bros. for iPhone (WIP) (other help appreciat

Postby Fojam » Thu Jan 26, 2012 4:19 pm

Thanks :D

Edit: i have just begun programming the AI. i am using a timer system to do this. its incredibly difficult and i would appreciate if some others with a little more experience in this could help.
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: Super Smash Bros. for iPhone (WIP) (other help appreciat

Postby Fojam » Fri Jan 27, 2012 1:25 am

Heres what I have of the AI code so far. its set on a timer

Code: Select all
Actor*enemy1=getclone2(player1Name, 0);
Actor*self=getclone2(player2Name, 0);
int enemy1x;
int enemy1y;


enemy1x=enemy1->x;
enemy1y=enemy1->y;


if(enemy1x>x)
{
    char stand_right[50];
    playerdir=2;
    if((moveLeft==0)&&(moveRight==0)&&(attacksHolder==-1))
    {
        sprintf(stand_right, "%s_stand_right", player2AnimName);
        ChangeAnimation("Event Actor", stand_right, NO_CHANGE);
    }
}


if(enemy1x<x)
{
    char stand_left[50];
    playerdir=2;
    if((moveLeft==0)&&(moveRight==0)&&(attacksHolder==-1))
    {
        sprintf(stand_left, "%s_stand_left", player2AnimName);
        ChangeAnimation("Event Actor", stand_left, NO_CHANGE);
    }
}


if(abs(enemy1x-x)>=40)
{
    if((enemy1y-y)>40)
    {
        cpu_marioUp();
        switch(playerdir)
        {
            case 1:
            moveLeft=1;
            break;
 
            case 2:
            moveRight=1;
            break;
        }
    }
    if((enemy1y-y)<40)
    {
        switch(playerdir)
        {
            case 1:
            moveLeft=1;
            break;
 
            case 2:
            moveRight=1;
            break;
        }
    }
}

if(abs(enemy1x-x)>40)
{
    if((enemy1y-y)>40)
    {
        cpu_marioUp();
        switch(playerdir)
        {
            case 1:
            moveLeft=1;
            break;
 
            case 2:
            moveRight=1;
            break;
        }
    }
    if((enemy1y-y)<40)
    {
        //attack randomizer
    }
}
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: Super Smash Bros. for iPhone (WIP) (other help appreciat

Postby skydereign » Fri Jan 27, 2012 1:50 am

From your code, I'm assuming you are only taking into account the player and a single enemy. Because of this, you only need to use one Actor*, that is linked to the player. I would also advise, though this might be too late, to have all of your actor's have the same name animations. So if you had a mario and kirby actors, they both have a stand_right, they both have a run_right, and so on. Since all characters have pretty much all the same moves (with different movesets), you shouldn't have to worry about prefixing the name of the actor to the name of the animation. And since you are using sprintf like that, that just goes to show that you shouldn't do it, since the animation names will always be in the same format. Never anywhere do you specify "mario_stand_right" because mario is held in a variable, so just name it "stand_right" and skip the string operations.

Now you are using a lock system, which prevents certain actions via an if statement and variables. This can get very hard to manage very quickly, as you can come up with many many locks. You should really stick to one or two variables that will determine what the actor is going to do next. You are using a lot of if statements to determine if the actor is one direction, then another direction, then if the actor is close. You can use the distance function to determine if the player is within attack range.
Code: Select all
Actor* player = getclone2(player1Name, 0);
if(distance(x,y, player->x, player->y)<40)
{
    // attack the player
    // you can set the direction, and then change the animation to your random attack
}


Every condition you end up using to determine what the enemy should do should be very clear. For instance, the player is within range to attack. The player is about to hit the actor, the actor is about to fall off the edge, and so on. If you can clearly identify what an actor should do given the conditions it is placed in, then all you need to do is write the code. The trick is to actually spell out all of the cases you want the actor to act in. There are a lot of conditions that change what the enemy should do, so I suggest that you use the state method. That way you can identify every possible case, with a convenient switch statement. It may be a lot of code, but most people would agree it will make far more sense than trying to do something similar with just if statements. And the use of the state variable would allow you to change how the enemy reacts given what it is doing.

For example: the player is within hitting range of the actor (this means the player can hit the enemy as well). If you were on the ground, you could either go for an attack, or dodge, but if you were in the air, you would be more likely to attack as your quickest option. And since different characters will react differently depending on their specialties, this will allow you to enumerate the differences.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Super Smash Bros. for iPhone (WIP) (other help appreciat

Postby Fojam » Fri Jan 27, 2012 2:36 pm

Hmm i get most of what your saying, but i already have too many places in the code where the mario_ prefix is used, so that would take a whole day to fix. But i see what you are saying about using distance and switch, but how do use switch for > and < conditions?
And whats the best way to keep the computer player from chasing you off the stage when you fall off or to jump over objects in his way?
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: Super Smash Bros. for iPhone (WIP) (other help appreciat

Postby schnellboot » Fri Jan 27, 2012 2:47 pm

Fojam wrote:but i already have too many places in the code where the mario_ prefix is used, so that would take a whole day to fix.

I think it would be worth it
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: Super Smash Bros. for iPhone (WIP) (other help appreciat

Postby skydereign » Fri Jan 27, 2012 6:06 pm

There are two ways to do it, and in this case using if isn't a bad thing... but if you really didn't want to, you can do this.
Code: Select all
int distance(x, y, player.x, player.y); // note I'm not using the Actor* so you'll have to change that
int dir = (player.x>x)-(player.x<x);

switch(dir)
{
    case -1: // player is the the left
    break;

    case 0: // player's x == x
    break;

    case 1:
    break;
}

And so you know, using if for ranges is okay. It's just I would contain them within the if, that way you know exactly what it should be doing when you want it to. Otherwise all if statements, of which there would be a lot, could trigger as the timer event is processed. The switch statement will contain those cases. And do as you wish about the names, removing the mario is cleaner, especially since you were using string operations for it.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Super Smash Bros. for iPhone (WIP) (other help appreciat

Postby Fojam » Fri Jan 27, 2012 9:14 pm

ill probably clean up the names later. I have days where i will try to optimize different parts of the code.

and how do i keep him from following your character off of the edge?
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: Super Smash Bros. for iPhone (WIP) (other help appreciat

Postby Hblade » Fri Jan 27, 2012 9:34 pm

My guess would be use some sort of distance script and have 2 invisible actors around each edge.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

PreviousNext

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest