Author Topic: Pixelknight  (Read 2954 times)

knarrenheinz

  • Member
  • **
  • Posts: 19
  • Karma: +0/-0
    • View Profile
    • CodinSoft
Pixelknight
« on: Tue, Jan 26, 2010 »
Greetings flixeladdicts,  ;D

my first flixel/flan-powered game "Pixelknight" was just released: play

I dug into flixel about 2 weeks ago and I can hardly describe how awesome it is. It is even more powerful combined with Flan. It was a pleasure using this stuff :)

Biggest thanks fly out to adam_atomic for flixel (dude!!) , SeiferTim whose tutorial helped me a lot getting started, nitram_cero... flixel's right hand and forum support god :D (everytime I searched the forums for help, nitram_cero came up with a solution.) and to the rest of the flixel community.

I hope you like the game. Any feedback is appreciated.

Cheers
knarrenheinz (proud owner of Flan Map Editor license #13 and banana milk addict)

Haledire

  • Member
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Re: Pixelknight
« Reply #1 on: Tue, Jan 26, 2010 »
I'll keep this one brief, since this is more an issue between computer performance.

Your game is pretty fun for how basic it is, but there's an issue with the post-damage invincibility.  Since I am apparently in possession of 2 fairly good computers to show such a disparity (with the irony that they possess...) I'll explain.

Short Version:

i-hate-flash laptop:  Player takes damage - 1 - 2 - 3 - 4 - ok he can take more damage now.

i-love-flash desktop:  Player takes damage - 1 - 2 - ok he can take more damage now.

Long version:

A computer that runs flash with no problem is limited to a count of 2 on the stage timer to provide the post-damage invincibility effect.  A computer that runs flash somewhat haphazardly is not limited to the same time situation, although the stage timer in both run fairly smoothly.  I'm not to familiar with mochi's leaderboard stuff, but if you can check the guest scoreboards you'll notice the 460,000 some odd score by "Dire".  That was me, and it only stopped there because I was testing to see if it was even possible for me to die on my laptop at stage 33  (which it was, if I actually let myself get hit consistently right away).

It seems that you may want to add an extra check on the timer for invincibility against the stage clock to prevent situations where people with a computer like mine get an excessive advantage over people who have normal computers.

Aside from that issue, the game is challenging after a while for normal play.  It does get repetitive early on as it feels like the optimal gameplay strategy is to simply stand still and turn around to shoot.  The extra flying monsters with extra hit points balance out the issue later on.  It would be nice if there were some extra incentive to actually move around other than to simply get a better temporary turnaround station, like drops from monsters (health recovery, 'loot', etc). 

I was actually somewhat concerned from my i-hate-flash laptop experience that the health recovery after each level was unnecessary, but it seems fine based on my desktop experience.  If anything, to promote movement of the character, a combination of random health drops from monsters and an incomplete health recovery between stages (say, 3 hearts with sparse full recovery stages) might add to the experience a touch.

Judging from the scores, it looks like the general stopping point is around level 12 - 14, which is around the level that extra heart gets added.  Maybe the difficulty of the enemy waves overcompensate for the addition a touch too early?  It doesn't seem like normal players would get much playtime with the last weapon upgrade.

I like the graphics and the shift of palette from day to night and back.  Really sells the ongoing battle theme.

Richard Kain

  • Active Member
  • ***
  • Posts: 231
  • Karma: +0/-0
    • View Profile
Re: Pixelknight
« Reply #2 on: Tue, Jan 26, 2010 »
I noticed that some of the animations don't seem to be affected by the pause function of the engine. That's something to check on. (the green text graphic on the end-game screen moves slowly side to side, even when the game is paused)

knarrenheinz

  • Member
  • **
  • Posts: 19
  • Karma: +0/-0
    • View Profile
    • CodinSoft
Re: Pixelknight
« Reply #3 on: Wed, Jan 27, 2010 »
@Haledire,

thanks for the performance test and the nice feedback. I gotta check this out... I'm just a little curious of how that could happen because the "hurtCounter" is decreased by FlxG.elapsed.

Anyway, I think I won't change the balance curve. It's a skill based game and after testing it a lot I managed to get to round 27. The difficulty increases very slowly once you've reached round 20.

EDIT: Thanks to my brother Eiswuxe (Rocket Ninja Cyborg) who maybe figured out the performance issue. It would be very kind of you, Haledire, if you could test the performance on your laptop again. You may need to delete your browser cache. If it works I will post the solution, because the issue is also in SeiferTim's tutorial.

@ Richard
The green pixelknight logo is a flash MovieClip imported from a .swc and added to the stage (not a FlxLayer). I noticed that the "stage.frameRate" is set to 10 in FlxGame.as after the game is paused... so I gotta check this.

You wrote "some of the animations"... did you find any other animation that didn't pause?

EDIT: I played around with the stage.frameRate. If It's set to "0" the pause screen isn't showing up. Is there a good solution other than just setting the stage.framerate to "1"? Like adding the MC to a FlxLayer... ?

Thanks for the feedback and help so far.
« Last Edit: Wed, Jan 27, 2010 by knarrenheinz »

Richard Kain

  • Active Member
  • ***
  • Posts: 231
  • Karma: +0/-0
    • View Profile
Re: Pixelknight
« Reply #4 on: Wed, Jan 27, 2010 »
Well the most obvious solution is to import the green pixelknight logo as a .png file, assign it to a FlxSprite, and reproduce it's back-and-forth animation using code, tying it into Flixel's "elapsed" value.

I know it is tempting to import Flash elements into Flixel games, but that approach always negatively effects the performance of the game, and causes integration issues. (like the one I pointed out) You might be able to simulate that smooth back-and-forth motion in Flixel by assigning the acceleration of the FlxSprite in Flixel, and then inverting that value at a regular time interval.

Haledire

  • Member
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Re: Pixelknight
« Reply #5 on: Wed, Jan 27, 2010 »
Seems to bounce from 2 when there's not too many enemies on screen and the player attacks to 3 when there's a lot of enemies, lots of particle effects, and the player is attacking.  It's better than the constant 4 I experienced before no matter what was happening.  I can still get pretty far when I'm actually trying though (I started seriously testing the timer after I hit a score of over 1 mil).

joybite

  • Guest
Re: Pixelknight
« Reply #6 on: Wed, Jan 27, 2010 »
Congratulations on your first game, it's pretty fun. One thing I'd consider changing though is the way the player fires. Currently, there seems to be a set delay on how rapidly you can throw knives. I think it'd be more interesting if there were no delay, and instead, there were a limit on how many knives existing on the screen at the same time. I think it's a better system because it obligates the player to fire carefully at range since if he were to miss, he'd have to wait some time for that knife to be freed, thus punishing his carelessness and cultivating a more skill-oriented style of play. The player who risks getting close to enemies (though it becomes unavoidable later on) has greater destructive ability at the cost of greater vulnerability. When surrounded by clusters of enemies, the player's only chance at survival would be to mash the fire key. Since missing is impossible at this range, the knives are freed almost instantly. As the player mashes the fire key frantically, he knows that his survival hinges upon his rapidity, and greater tension arises than that which would exist if he only had to tap the fire key at a set interval. In short, the game would be more fun.

On a side note: if you were interested, you could almost certainly get this sponsored.

xhunterko

  • Contributor
  • ****
  • Posts: 449
  • Karma: +0/-0
    • View Profile
Re: Pixelknight
« Reply #7 on: Wed, Jan 27, 2010 »
A limit on the amount of knives? Have you made it to the higher levels? I think it would be best if you listened to some of the critism here though. I also found that the quicker I hit the fire button, the longer I would survive as well. Except in some cases in which I foud myself surrounded by enemies. Then some trick jumping to get my hide out of the way let me escape a little longer. With my last play, a wrong jump ended my game with only 5 secs left on the ticker. But any case, I liked the overall gameplay though. What I would do though, is a couple things if it were my game.

1. Give the player hiding platforms/caves around the map. With two exits.
2. Give the player a charged "super weapon" to escape sticky situations.
3. Add secondary limited extra sub weapons on another key. (to give the players finger a break)
4. Boss levels + super objective: Every 5/10 levels, have one species swarm the player. The next level is a giant version of the previous level species. With the last level being a "super boss"(the wizard thats attacking the kingdom). The game ends then with either a highscore option or a continue playing option.*
5. If my attack level goes up, I expect my defense level to do the same. Maybe a simple armor color change?

*I'm not really a fan of endless/highscore games. I might never develop one maybe, but just running around for the sake of running around seems pointless for me.

That's just what I would do. you needn't do any of that even. It's still fun as it is. And GOOD JOB on getting flixel, and Siefer Tim's tutorial to work! That is impressive! (check my other couple threads to see what I mean.  ::)). Good luck!
Now on twitter: http://twitter.com/xhunterko I made a game that's in alpha you can buy here: http://xhunterko.itch.io/wave-miner-alpha

joybite

  • Guest
Re: Pixelknight
« Reply #8 on: Wed, Jan 27, 2010 »
I don't mean that the player should have an ammo counter. I mean that there should only be x number of knives allowed on the screen at the same time and that there should also be no limit to how fast you can throw them. If you understand what I'm saying, you'll also understand that the game would be easier this way, not harder. Say that the limit is 2 knives. If you throw 2 knives, you have to wait until one of them leaves the screen before you can throw another. If an enemy is right in front of you and your knife hits it, that knife is freed instantly and it's as if you didn't you didn't "use" any at all. Erm, this is hard to explain. Basically it's like space invaders where you can only have 1 bullet on the screen. If you shoot and miss, you have to wait until that bullet leaves the screen until you're able to fire again. But, if you hit an enemy, you can fire again immediately.

Anyway, I don't mean to push the issue, just trying to clarify and give you something to think about.

knarrenheinz

  • Member
  • **
  • Posts: 19
  • Karma: +0/-0
    • View Profile
    • CodinSoft
Re: Pixelknight
« Reply #9 on: Thu, Jan 28, 2010 »
Thanks for the great ideas so far. I'm sure I'll consider some of them in the sequel  ;D

@Haledire
Thanks a lot for testing it again. Let's take a look at the code that causes the problem (from SeiferTim's Tutorial). That's a snippet from the Player Class:

Code: [Select]
override public function update():void
        {
            if(dead)
            {
                if(finished) exists = false;
                else
                    super.update();
                return;
            }
            if (_hurt_counter > 0)
            {
                _hurt_counter -= FlxG.elapsed*3;
            }
            etc...
            .......
        }

Fine so far, reducing the counter by FlxG.elapsed * whatever.
Let's switch over to the PlayState:

Code: [Select]
private function EnemyHit(E:Enemy, P:Player):void
        {
            FlxG.log(P._hurt_counter.toString());
            if (P._hurt_counter <= 0) // <-------- PROBLEM
            {
                if (E.x > P.x)
                {
                    P.velocity.x = -100;
                    E.velocity.x = 100;
                }
                else
                {
                    P.velocity.x = 100;
                    E.velocity.x = -100;
                }
                P.hurt(1);
            }
        }

Imagine "FlxG.elapsed * 3" gets so big that nearly every frame the hurtCounter is <= 0. The result is that the part after "if (P._hurt_counter <= 0)" is less executed on slower machines.

To fix things up you have to replace "if (P._hurt_counter <= 0)" with "while (P._hurt_counter <= 0)".

After doing that it's also important to change the hurt function of the Player Class:

Code: [Select]
override public function hurt(Damage:Number):void
        {
            _hurt_counter = 1; // (in case of Pixelknight = 80)
            return super.hurt(Damage);
        }  

to

Code: [Select]
override public function hurt(Damage:Number):void
        {
            _hurt_counter += 1; // (in case of Pixelknight += 80)
            return super.hurt(Damage);
        }

so that the counter gets accumulated. You also have to do this for the enemyShotHitsPlayerWhatever function and the enemies. Thanks again to Eiswuxe for pointing this one out to me.
« Last Edit: Thu, Jan 28, 2010 by knarrenheinz »