Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411430 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 20, 2024, 12:19:16 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsGun Runner - iOS Contra Runner
Pages: [1] 2
Print
Author Topic: Gun Runner - iOS Contra Runner  (Read 2944 times)
One Happy Giant
Level 0
**



View Profile WWW
« on: January 04, 2017, 10:37:11 AM »

This is my first devlog here. Been lurking for quite some time and recently left the tech industry to get back to where my heart truly lies. Kiss

This devlog will focus on the journey of porting a game launched in 2011 on iOS called Gun Runner from cocos2d and Objective-C to SpriteKit, GameplayKit, and Swift 3. The port will not only include the existing game as it is in the App Store, but also a massive update I have been sitting on that includes miniboss and boss battles, updated levels, and a host of other improvements.

Gun Runner is an endless runner (never would've guessed! Smiley) with a style inspired by Contra. It has a great 8-bit, chiptune soundtrack by syphus, who also did the soundtrack for Pineapple Smash Crew and Fist of Awesome. Hand Metal Right https://syphus.bandcamp.com/album/gun-runner-soundtrack

It's currently available in the App Store, but it hasn't been updated in quite some time and I was never truly happy with that version. http://itunes.apple.com/app/id503057619



Here's what I have so far:
- Main menu
- Player run, player jump, enemy, and dropship animations
- Jump, double jump, and swipe down controls
- Basic shooting, enemy spawning from dropship, and bullet collision
- Camera follows player
- Levels 1-1, 1-2, and 1-3 ported from Tiled to .sks (although there are some backwards bushes in one of them)
- Infinite tilemap scrolling w/ random level selection

Lots more to do, including:
- Port remaining levels from Tiled to .sks
- Aiming control
- Implement all guns, enemies, dropships
- Coins + coin patterns
- Minibosses
- Boss
- Tutorial
- Shop
- Gamecenter
- Parallax background
- A million other things that will crop up while dev'ing

Will update when I've got some more progress. Coffee
« Last Edit: March 18, 2017, 09:15:14 AM by One Happy Giant » Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #1 on: January 05, 2017, 07:12:50 PM »

Devlog update #2 - 1/5/17


  • Addressed the framerate issues by optimizing bullet and enemy generation. Rather than creating a new bullet or enemy when needed, a set number are created on startup and pulled from as needed. This bumps the framerate up to a consistent 60fps on an iPhone 6.
  • Changed the way bullets and enemies "die." Previously, they would actually be removed from the scene and destroyed. Now, they're hidden, paused, and have their collision test and category masks 0'ed out so as not to continue colliding with things.
  • Added dropship collision by using a separate collision image to create the SKPhysicsBody.
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #2 on: January 07, 2017, 11:11:26 AM »

Devlog update #3 - 1/6/17


  • Health bars for enemies and dropships. This feature wasn't present in v1 and is something I'm playing around with. Not sure I love it just yet and will probably revisit at some point.
  • Extremely basic dropship spawning. Currently just uses the player's current position.
  • Added the flyer enemy.
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #3 on: January 09, 2017, 07:03:55 PM »

Devlog update #4 - 1/9/17


Had to run a lot of errands today so it's a bit light.

  • Enemies explode on death.
  • Started work on dropship death animation. Things went horribly wrong. Just about done but calling it for the night.
Logged

HoffmanIV
Guest
« Reply #4 on: January 09, 2017, 10:21:43 PM »

Visual real estate can be very costly, especially on mobile devices. Maybe instead of having an HP bar for every possible enemy, you could have one singular bar that switches depending on what target you're shooting at. It would lead to less screen clutter, I think.
Logged
One Happy Giant
Level 0
**



View Profile WWW
« Reply #5 on: January 10, 2017, 08:19:56 AM »

Visual real estate can be very costly, especially on mobile devices. Maybe instead of having an HP bar for every possible enemy, you could have one singular bar that switches depending on what target you're shooting at. It would lead to less screen clutter, I think.

Sounds similar to how Streets of Rage and beat 'em ups tend to handle it. Adding that to the list to prototype out. I have yet to address the HUD except for the small $0 in the top right you may have noticed in the gifs. Thank you for the suggestion.  Smiley
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #6 on: January 10, 2017, 06:30:29 PM »

Devlog update #5 - 1/10/17


  • Finished dropship death animation. Took longer than expected because there was a weird flickering issue with the explosions that I had to track down. Turns out if you don't nil out the SKSpriteNode's texture before running an animate action, it will display the last frame from the previous animation for a split second.
  • Began work on parallax background.
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #7 on: January 12, 2017, 10:14:42 AM »

Devlog update #6 - 1/11/17


  • Just about finished the parallax background. Ran into an issue when trying to reposition the parallax sprites once they went offscreen. Note to self: when an SKNode as an SKPhysicsBody attached, manually setting the node's position doesn't work. You need to use an SKAction or remove the physics body, set the node's position, and then re-add the physics body.
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #8 on: January 13, 2017, 08:52:41 AM »

Devlog update #7 - 1/12/17


Dove down a rabbit hole. Noir

While trying to get the positioning correct for the parallax background, I noticed that it was basically impossible to avoid some overlap. Seemed like some subpixel issues. This led me to start looking into the random 1 pixel lines that would sometimes appear while scrolling by the tilemap. It's most noticeable in the trees but once I started looking, it was EVERYWHERE.


I messed around with adding padding to some of the tiles. I created the tree as a single image rather than it being made up of tiles. I made sure everything was being drawn with integers for positions rather than floats. Finally, FINALLY, I tracked it down to the scale mode on the SKScene that contains everything. I had messed around with this before, attempting to make it look decent on iPad so I could have Universal easily. I switched it from AspectFill to ResizeFill and *poof*  Wizard the flickering lines were gone. Of course, this means it doesn't scale well to iPad, but I'm going to push on and focus on iPhone and look at a solution for iPad later. During this debugging process, I did introduce a way to override everything's display position so I'm thinking I can do some scaling there and all will be fine.

tl;dr - Found and fixed root level issue. Back to fun things.
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #9 on: January 14, 2017, 11:26:37 AM »

Devlog update #8 - 1/13/17


  • SO CLOSE to finishing the parallax background. There is one issue left that involves detecting when the image goes offscreen and repositioning it at the end of the parallax layer. You can see them popping out too early on the left side.
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #10 on: January 17, 2017, 08:13:45 AM »

Devlog update #9 - 1/16/17


  • Wrapped up the parallax background.
  • A bit of optimization as I saw the frame-rate dip to the mid-50s. Came across a SpriteKit best practice in Apple's documentation* while trying to track down that 1 pixel flickering line issue. So now, rather than adding all SKNodes to the SKScene and hiding/unhiding them when needed, I'm adding/removing the nodes.
  • Code cleanup for the large parallax background commit and fixed a parallax issue in the process.
  • Started prototyping a new idea:
    In v1, the player can drag their finger on the screen to aim, but the aim was attached to the avatar. For example, if I dragged my finger to the top of the screen while the avatar was close to the bottom, the avatar would aim diagonally up. But if I then jumped, the aim would continue to be diagonally up.

    I'm thinking it would play better to have a reticle that the player can drag around that the avatar always shoots at. It would make it far easier to play and seems like it would be more fun. Got a rough version of this up and running quickly but then the dropship's collision shape disappeared so  Coffee

*https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/SpriteKit_PG/DesigningGameswithSpriteKit/DesigningGameswithSpriteKit.html
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #11 on: January 18, 2017, 11:08:05 AM »

Devlog update #10 - 1/17/17


  • Fixed the dropship collision shape. Found a great tool* so I can use a CGPath rather than take up precious phone space with an image to represent the collision shape.
  • Completely revamped how the controls work. Was using UITapGestureRecognizer for jumping up, UISwipeGestureRecognizer for jumping down, and a UIPanGestureRecognizer for aiming. However, the pan and swipe gestures could not be triggered simultaneously, so I am now overriding touchesBegan, touchesMoved, touchesEnded and handling controls from there.
  • Added a white->red->white animation for the reticle so it stands out more.
  • Noticed the reticle was sometimes flickering so started looking into that but couldn't track it down.

*http://mortenjust.com/path-generator/
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #12 on: January 19, 2017, 09:33:20 AM »

Devlog update #11 - 1/18/17


  • Increased velocity for MAXIMUM SPEED!
  • Refactored how enemies are created.
  • COINSPLOSIONS! Still tweaking these. They will be far more bouncy. Coffee
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #13 on: January 20, 2017, 08:12:56 AM »

Devlog update #12 - 1/19/17


  • Updated coins to use restitution when colliding with ground so they bounce more.
  • Refactored how dropships are created. They are now very similar to how enemies are created.
  • Dropships drop coins.
  • Added juggernaut, soldier, and infected soldier enemies.
  • Updated collision shapes for all enemies so they're no longer just squares.
  • Player has a collision shape and can collide with enemies and coins.
  • Picking up coins increases current run's count, which is now displayed in HUD.
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #14 on: January 23, 2017, 07:58:35 AM »

Devlog update #13 - 1/20/17


  • Player's health is now displayed on HUD and is updated when player collides with enemy.
  • Refactored how guns/bullets work and created the wave gun (as seen in gif) and machine gun.
  • Updated large dropship collision shape as it was apparent with wave gun that bottom of ship was not correct. Can't have bullets disappearing in midair.
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #15 on: January 24, 2017, 08:24:34 AM »

Devlog update #14 - 1/23/17


Light day today due to filling out a bunch of paperwork for health insurance and submitting a 1.1 update for Call Your Reps (free iPhone app for calling your elected representatives). Very inspired from attending the local #WomensMarch this weekend in downtown LA.

  • Started on coin patterns.
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #16 on: January 25, 2017, 11:42:29 AM »

Devlog update #15 - 1/24/17


  • All coin patterns are in!
  • Game loop structure created so that coin patterns, dropships, and eventually minibosses spawn regularly. Used the GameplayKit class GKStateMachine for this and it works surprisingly well.
  • Noticed a slowdown when coins explode from dropships so started looking into that. Might have to redo how I'm doing collision detection for objects and the ground.
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #17 on: January 31, 2017, 10:45:57 AM »

Devlog update #16 - 1/31/17


HUGE ROUND OF OPTIMIZATIONS

  • Tracked down a major issue that was causing the slowdown most noticeable when a dropship explodes into coins.
  • Improved performance of tile collision detection.
  • Improved performance of offscreen detection used for parallax and tilemap.
  • Improved performance of all animations.
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #18 on: February 21, 2017, 10:18:59 AM »

Devlog update #17 - 2/20/17


Had an impromptu trip home to NY because my grandma passed away. Also had a friend visit last week so only now getting back to development. Going to GDC next week and am focusing on a list of items to take care of in hopes of having a polished build to show off.

  • Dropships, enemies, and players flash red when taking damage.
  • Dropships and coin patterns spawn at random tilemap level rather than using player's position.
  • Player's torso now points up and down when aiming at certain angles.
  • Converted a BOATLOAD of levels (1-4, 1-5, 2-1, 2-2, 2-3, 3-1, 3-2, 3-3, 4-1, 4-2, 4-3, 5-1, 5-2, 5-3). Currently displaying them at random but the idea is to use the environment to enhance the story, so as the player continues running, they'll see the slow destruction of the environment and the gradual ascent of toxic waste and industrialization.
  • Added a pause button sans menu and the game now pauses when backgrounding and foregrounding.
  • The parallax background no longer moves vertically.
  • Made the reticle touch area larger so it's easier to move around.
Logged

One Happy Giant
Level 0
**



View Profile WWW
« Reply #19 on: March 07, 2017, 05:22:45 PM »

Devlog update #18 - 3/7/17





GDC is amazing. I've decided to explore an idea that seems like it would make the game more enjoyable and interesting. I was playing Gunman Taco Truck and I thought what if Gun Runner had some roguelike qualities.

At the start of each run, you get to pick a gun. Each of these guns will play differently and influence the entire run. For example, a pistol that does medium damage but is small and fires at a normal rate vs a rocket launcher which does high damage and explodes on impact but fires slowly. Gunstar Heroes comes to mind with the variance in their weapons.

After a certain threshold has been reached (maybe by # of enemies killed or time based) or maybe a trigger by the player using their hard earned coins, your ship swoops in and you can upgrade your gun via a skill tree. The skill tree will contain modifiers such as damage, rate of fire, velocity of bullets, number of bullets, angle(s) of bullets, angle variance, helix-ness, size, etc. I was also considering player-centric upgrades like health, coin magnet, ghost player (that also shoots), etc.

So now I am in the midst of creating an editor so rather than changing a number, building the project, running on device, and testing, I can make the change and see it live. This will be helpful for creating and balancing the guns and gun modifiers. I may even create one for building the skill tree(s). Haven't decided if each weapon should have its own tree but I'm thinking they will need them.

Of course all of these changes need to be prototyped and if successful, tweaked like crazy, but I'm pretty excited about this idea.  Grin

The changes listed below reflect the final changes before going to GDC.

  • MUSIC for the main menu, game, and game over!
  • SFX for a lot of things: explosions, jumping, landing, coin pickup, player taking damage, enemies taking damage, and probably more!
  • Restitution variance for coins bouncing (thanks to Felix-The-Ghost from Youtube for the suggestion)!
  • Added 2 more dropships and tweaked all their params (health, coins, type of enemies, spawn rate of enemies, etc.)!
  • Game loop now spawns between 1-2 dropships (had it at 1-3 but it was CRAZY difficult)!
  • A terrible player death animation complete with slo-mo explosion!
  • A terrible game over screen!
  • Fixed the player jump not being consistent!
  • Restricted the camera's top position so that when you double jump on the topmost platform you can still see the ground and the action!
« Last Edit: March 07, 2017, 05:27:48 PM by One Happy Giant » Logged

Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic