Doing My Part

August 22, 2012

I really haven’t done any development for Resistor in over a month, so I decided to go ahead and put it into the Peer Review process on the Microsoft Creator’s Club site.  I see it as my way of doing my part in adding to the fine collection of interactive video entertainment titles in the XBox Indie Games marketplace.

With over 400 entries into the Dream Build Play competition, I don’t think I have a chance at being one of the finalists.  If the competition was based purely on uniqueness I think my game would fare better.  However as in real life, looks do matter and my game is about as plain as it gets.

Overall, I would be thrilled if my game could make $100 on the marketplace, which would equal the original investment that I made for the Creator’s Club membership.  Unfortunately, I’ve heard that most XBLIGs don’t make anything, so my goal is probably a bit of a stretch.

Below are the changes I made to the game after putting it through playtest a few weeks ago.

Tutorial System

Tutorial tips were added to teach new players the rules of the games.  These tips should not display as long as the player is doing well in the game.  The tutorial tip system keeps track of which tutorial tips the player has seen, and it doesn’t display a tip that the player has already seen.  However, once the player quits the game the tip flags are reset.  A tip is displayed if the player falls to the B rank in any of the three categories.  Also, if the player doesn’t use the appropriate resistor and gets a Game Over, then a tip will display when the level is started again stating that resistors should be used to reduce the flow value.

More Graphical Improvements

Made the spinning light sprite display while the LEDs are filling, using the scale parameter.

The rank letters at the end of the stage now zoom into position.

Changed the A, B, and C rank colors to use lighter shades of blue, green, and red.  The status icons in the lower right portion of the screen now change with their respective rank values.  I also modified the real time rank value of the luminosity category, so that it calculates the rank based upon the maximum possible luminosity of activated LEDs (instead of all LEDs).  This way, the player starts out with an S rank in luminosity and the rank is only lowered if they connect a wire with a lower flow needed by the LED.

Audio Changes

Used Audacity to make the ding sound when an LED is activated lower based on the difference between the maximum flow value and the current flow value.  The rank grades at the end of the stages use these modified sounds as well.


Anomalies

June 27, 2012

Category Icons

Another problem that I noticed during the playtest session was that there was not a clear correlation to the player between what they were doing in the level and the rank grades after the level was completed.  Therefore, I added three icons to the lower right portion of the screen, and numbers signifying the values for those categories which update in real time.  I thought that adding this would make the screen have “too much going on”, but I will leave it in for now.  I also put those icons next to the textual descriptions on the level complete screen, so that there is a direction connection between the icons on the game level screen and the categories on the level complete screen.

I also tried coloring the icons in real time based on the current rank value for each category.  However, this was confusing because pieces and time would start out yellow (S-rank) and luminosity would start out red (C-rank).  This is because the player raises their luminosity rank over time, and the player can only lower their  piece and time rank over time.  Plus, the colors would sometimes change and flicker too quickly between grade colors at times.  Therefore, I left all of the icons and numeric values white.

“The Level 2-6 Problem”

There is a visual connection problem that only occurs when placing a resistor next to two objects, where one of the objects in another resistor.  This is apparent on level 2-6, where you have to put a 1 resistor next to both a wire and a level 2 resistor to get the maximum luminosity of 2, as shown in the screenshot below.  Notice the connection between the 2 and 1 resistors, which really doesn’t exist when looking at the flow values, but it is incorrectly drawn.

 

Displaying the flow values shows that the resistor’s value is automatically deducted from the flow value.

 

I rewrote most of the code in the  method which returns the wire image used for a specified cell.  This code is used for both the wire and the resistors, since the resistor is overlayed on top of a wire image.  First I load four variables containing references to each of the four adjacent pieces (or null if one doesn’t exist).  Then I start assigning null to those variables if a connection to that adjacent cell should not be made.  Finally, I have an if/then statement which looks at those values and then returns an integer ID representing the wire image to use to make the appropriate connections.

I started seeing the one frame flicker problem again, when a new piece was placed  next to more than one adjacent pieces.  I found that the line of code that placed a new piece on the board was located after the code which updated all of the pieces.  Therefore, the first frame of a new piece was always incorrect.  I moved the line of code which adds the new piece above the piece array update check, and now the flicker problem is no more.

For each piece, if it is not filled or filling, then it should make all possible connections because there is no way to tell which direction the flow will be coming from.  If there is an adjacent cell, it should make a connection to that cell if the flow direction (stored as an instance variable of the GamePiece) is coming from that direction.  Conversely, a connection should be made to any adjacent cells which have flow coming from the current cell.  Otherwise, a connection should not be made to the adjacent cell, because it could possibly have a different flow value.  One continuous wire should not have two different flow values, which I explained in an earlier post.

Below is what the corrected display looks like now.  A lot of work to fix a small graphical anomaly which nobody would have probably ever noticed anyway.

 

Additionally, I updated the code so that the luminosity icon value only increments after the LED fills (not as it starts filling).


Playtesting at KGD Meeting

June 25, 2012

Attended the Knoxville Game Design meeting at The Technology Cooperative and received a lot of good feedback from fellow developers.  The guys at Chaosoft were particularly helpful with their suggestions to improve controls and gameplay.  It was my first time seeing other people play the game, and served as a good informal cognitive walkthrough.

A couple of gamers tried out my game, and it was quickly obvious that the game wasn’t clear about which buttons perform which actions.  In the old days we had instruction manuals that told us the controls, but it was usually faster to figure out the controls than looking it up in the manual.  With digital distribution, we no longer have the luxury of providing the player with a hard copy manual, so all of the control explanations have to be built into the game.  Also, back in the NES days we only had 4 buttons and a D-pad, so figuring out the controls was a lot simpler back then.

One helpful suggestion was to put the wire on its own button.  This was an obvious control improvement, and I couldn’t believe I hadn’t implemented that earlier.  The wire is used much more often than the resistors, so it clearly warrants having its own button.  Separating this functionality took a little bit of time, but it was worth it.

A graphical “A” button has been added below the wire selector, and a graphical “X” button has been added below the currently selected resistor.  The animated arrow which previously pointed to the selected component has been removed.  This makes it clear which buttons perform which actions.  I also added “LB” and “RB” labels next to the “X” graphic.  “LB” only displays if the selected resistor is greater than one, and “RB” only displays if the selected resistor is less than the maximum (however you can still press those buttons to make the selection loop around).

There was still some confusion about hooking up a resistor with a lower flow value than the LED, so I may have to add some more explanation about the rankings, especially the “luminosity” ranking.

Another suggestion was to display a timer on the game level screen, so there was an indication of how well you are doing  in respect to the time rank.  I’ll see if I can work that in, but I think it may make it appear as “too much stuff going on” in the game screen.

The screenshots below show the new button displays, as well as the new blue color if the LED wasn’t connected with it’s maximum flow value.  I chose blue because it is a cold color, and it was different than the default “off” gray color of the LED.

 


Feedback

June 21, 2012

The game got a lot of good feeback on the AppHub playtest forum.  I’ve resolved most of the issues that other developers found.

Device Selection Issue

There was one report that the game wouldn’t play on any controller index, even though I tested that case multiple times.  After doing some more testing with all four controllers, I found that if one of the controllers was not signed into an account, then it would stay on the storage device selection screen if a storage device is not already selected.  Therefore, on the load screen the “Select Device” button didn’t appear to do anything, because there was no profile to select the storage device.  The screen was misleading, because what the user really needs to do is sign-in (however it did say “must be signed in to use storage device”), but it didn’t automatically take the player to the XBox profile login screen.  After doing some research, I found that the PlayerIndex is not a mandatory parameter for the DeviceSelection control.  Therefore, I just removed that parameter, so now all players (signed-in or not signed-in) can select a storage device.  The only downside is that now all players on the system share the same save data, but I doubt there will be any complaints about that.

Component Selection

Another developer reported that it was difficult to tell which component is currently selected.  This is simple to see in later levels with many selectable components, but I can understand that it is difficult on the early levels with only two selectable components.  I went ahead and added a simple animated arrow which points to the currently selected component, which should remove any doubt on which component is selected.  I also created a frame sprite to display around the selected item, but it didn’t look good so I just stuck with the arrow.

Tutorial Tips

Since this is an unconventional game, some players didn’t fully understand the game mechanics.  I’ve always thought that part of the fun was learning the game, but I don’t want anyone to get frustrated at the start of the game.  Therefore, I’ve added tips that display to the left of the game board for the starting levels.  I wanted to have these tips scroll across the bottom like a television news feed, but I didn’t have enough vertical screen real estate in the title safe area.

I ended up putting the tips off to the left side, since there was a lot of unused space there.  At first, I only had the tips display if the amount of time for the S-rank had elapsed, so that expert players wouldn’t see the tips.  However, this resulted in the tip flashing at the last second if the level is completed slightly after the time required for the S-rank.  Therefore, I decided just to have the tip fade in and let all players see them.  Trying to figure out how to get text to fade-in was a lengthly process.  At first I thought all I had to do was pass a color object with the fourth parameter set to the alpha, but this does not work when specifying the first three RGB parameters as well. (good grief!)  Fortunately, I found an article which explained that you have to multiply the color by the alpha value for it to work right, such as Color.White * 0.5f.  It’s mind boggling why just new Color(255, 255, 255, 128) won’t work.

Activating LEDs with  Lower Flow Value

Another suggestion was to remove the ability to activate LEDs with flow lower than the LED value.  I think that would make the game too difficult for a casual audience.  The game appropriately penalizes the player in the “luminosity” rank if the LEDs are not using the maximum values.  However, I did modify the colors of the activated LEDs if those are not using the maximum value.  Now those are colored light blue.  I will probably also add a different sound effect as well.


Stick a Fork in It

May 28, 2012

Title Safe

Noticed that the title safe area on the PC is the entire window, so things looked slightly off when it is running in  a window.   Went back and removed the device specific Title Safe Area rectangle, with my own that I calculate based on the size of the screen that I define, using 10% around the edges as the unsafe area.

Device Storage

The fast transition of the device selection screen on the XBox Slim was very noticeable, due to the bright yellow background color.  This screen is only displayed for a split second, since there is only one storage device which is automatically selected.  I’m not sure why it won’t let me select between the hard drive and cloud storage.  I removed the yellow screen and replaced it with the standard background color, but the “select storage device” message still flickered for a brief second, so I put in a counter to delay the display of the message for 60 frames.  Now, the message should only display if there is a problem.

I also need to go back and modify the “reset all data” functionality, so that it takes advantage of the new load storage screen.   I don’t have the time to fix this, so I went ahead and removed the “Delete All records” functionality from the level select screen.  I never liked the fact that there was no selector for it on the screen, and adding the functionality back using the new saving method will just be too much of a hassle at this point.  I can use that time to do better things.  Plus, I did learn previously that the player’s data can be deleted from the XBox system menu.

Four Controller Ports

Added code to hold the controller state for all four controller ports.  Apparently, I don’t need to check to see if a controller is actually active to get its state.  Added a parameter to Screen methods which handle button presses, so that now those take an int parameter which signifies which controller port pressed that button.

Updated the code so that it now allows the device selector to be opened and controlled by the controller port which started the game.  Added exceptions to handle a save after the user has signed out of their profile during the game.

Tried using the Guide message display API call to display a message to the user if the game was no longer being saved due to the user signing out, but it also has the problem of crashing if the guide is active, so I didn’t bother with it.

Marketplace

After reading threads about others who have failed peer review, I added a check to ensure that the logged in player can purchase content before the Marketplace screen is shown on the trial screen.  I’m thinking that 21 levels for the trial may be a bit too much.  I’m doubting that anyone can complete that many levels within 8 minutes, and my purchase screen is only displayed after those 21 levels are complted.  However, people can still buy the game through the main marketplace window.  The user can play the 8 minute trail multiple times, selecting the other levels (up to 21, 3-1) that they have not completed, so therefore it is possible to the player to complete all 21 trial levels to see the purchase screen.

I’m trying not to be like most other games which have “buy buy buy” plastered all of the game’s interface.  After all, if the player likes the game, then I’m sure they will know how to buy it from the marketplace menu.

Graphics Updates

Updated the cell selector to use the a symbol representing a resistor.  Went back and made it a hand drawn anti-aliased line using the Gimp brush tool, with the middle cut out.  Added a slight green glowing effect to this selector sprite.

Also added another overlay to the filled light, which is a sprite of two white filled arcs.  This rotates for each filled light.  It looks much better than what the screenshot shows.

  

Minor Changes

On the title screen, I also changed “New Game” to “Start Game”.  I thought people may think that “New Game” will overwrite their existing record data, which isn’t the case.

After checking the Not So Evil Checklist again, the game won’t be failed for a Code 7 crash, which results from the account with the App Hub subscription signing out.  So I just needed to ensure that it is playable from any controller port.

Learned that I don’t have to recreate the XBox entry XNA Studio Device Center and re-enter the key after restarting the XBox.  I’ve just got to ensure that the XBox device for the active system is set as default.

Wrapping Up

At this point, I’m considering this game to be done.  I tested it using all of the checks on the Evil Checklist, and I believe it passes all of them now.  I will sleep on it overnight, and may play test some  more of the levels again tomorrow, since I have tomorrow off of work for Memorial Day.  Unless there is some major issue that must be fixed, I plan on submitting it to the contest tomorrow.  Thanks to everyone who has read my status updates.



Play it Again Sam

May 20, 2012

Wrapping Up Level Design

Created 20 new levels, which use the 7 and 8 resistors.  Now I have a total of 80 levels.  If each level takes 30 seconds to play, then it would make the total time to play through all the levels 40 minutes.  This is not counting the replay time, which I’m sure some people will want to do to get the best ranks in all the levels.

While playtesting, I noticed a few issues with some of the levels that I have noted:

Level 7-5:  The 6 LEDs block the 8 LEDs, so the maximum luminosity can never be achieved.  Either remove the 6 LEDs, lower the 8  LEDs to 6 or below, or add tiles to make the 8 LEDs accessible without connecting to the 6 LEDs.

Level 7-8:  There is no way to activate the 1 LEDs without first lowering the 6 LEDs and 4 LEDs to one.  Again, this makes it impossible to get the maximum luminosity.

Level 7-9:  There is no way to activate the 5 LED without lowering it to four.

Level 8-2:  Accidentally added 8 and 1 batteries, when I intended for those to be LEDs.

  

 

Scales of Difficulty

I still feel like there needs to be something extra in the game.  I did have the idea to add capacitors, encoders, and logic gates, but it is too late now to make major changes in the game engine.  Those will have to wait for Resistor 2.  If I make any changes to the engine (even just moving the starting location of the cursor), then I will have to recalculate the time ranks for all of the stages, which is something I don’t want to do.  I think this is the right level of difficulty to reach the largest player base.  Most players probably make up their mind in about 10 seconds of first starting a game on whether or not the game is too difficult to play.  If the game isn’t easy to pick up, people will put the game in the “too hard” pile in their minds and give up on it.  On the other hand, I don’t want a game that is so easy that players will get bored with it.  This is definitely a delicate scale to balance, and that scale is different for each person.  I would rather error on the side of being too easy, because players may go ahead and play through the boring parts to see if there is something better coming.  If the game is too hard, then people will drop it and never play again.  However, there is a niche out there for very difficult games (Super Meat Boy, I Want to be the Guy), but that is only a very limited number of players compared to the overall pool of game players in the world.

Replay Option Added

One of the things that frustrated me while I was playtesting the game, was that if I did not get the best ranks on a stage then it would automatically send me to the next stage.  I really wanted to play the same stage again, so I could get the best ranks.  This made me have to quit, go back to the level select screen, and then scroll all the way back down to the level I was playing.  This was very aggravating, so on the GameWinScreen I added two options, “Replay” and “Next”.  Next is default, so the player still only has to press the confirm button to move to the next stage.  Pressing left will select “Replay”, which will just load the current stage again, so that the player can try to get better ranks.  These options don’t appear until the game win pause has expired (after all of the ranks have displayed).

This also sheds light on another problem, that on the Level Select screen it can take quite a while to scroll down to the later levels.  In a way, this is a good thing that there are so many levels to display, it takes some time to get to the bottom.  This reminds me of the game “You Don’t Know Jack” for the XBox 360, which had over 70 total episodes, so it took forever to select one of the later levels.  What I really need to do is have the trigger or bumper buttons jump up or down 10 levels on the level select screen.  The benefit of this is minimal, so I probably won’t take the time to implement that feature now.

Menu Backgrounds

Spent some time touching up the menu selector graphics.  This can really be a time drain, because I can spend hours on the graphics and it still not look perfect to me.   One reason I really don’t like doing graphics is because there is no right or wrong answer.  There’s just people’s preferences, which will be different for each person.  Added the bevel effect for all selectors.  I changed the main menu selector to a box, but I wasn’t happy with the color of the selector.  If it’s too light, then you can’t read the menu text.  If it’s too dark, then it contrasts too much with the rest of the screen, drawing attention away from the title graphics.  Fortunately, I can change the color programmatically, so I don’t have to change the graphic each time in Gimp.  Just as I was about to give up, I used a less saturated shade of green (selected from the scrolling background image), which looks fairly good as the selector color.

  

I went ahead and changed the font color for the 5 resistor to black, because white was a little hard to see.  Currently, only the 4, 5, and 9 resistors have black text.

Trailer Video

In order to submit this game to the contest, I have to submit a trailer video.  Therefore, I took a shot at making my first trailer video with its own cheesy indie game song.

 

Blog Cleanup

Went through all the posts in this blog and added categories, so that all of the posts related to Graphics, Engine, Game Saves, Level Design, and Audio can be quickly displayed and accessed.  A Video Update category was also added, to easily display all posts with video content.  Casual and Technical categories were added, so that the casual audience can view  posts targeted towards them.


Home Stretch

May 18, 2012

Small Glitch

Fixed an issue that actually only occurs on one frame of the fill animation.  This happens when a wire goes to the “filled” state, but the neighbor wires have not yet begun filling.  Since the wire is filled, it doesn’t make any connections to neighbors that don’t have the same flow value.  Since the neighbor doesn’t have a flow value initialized yet (assuming it is defaulted to zero), it’s flow value doesn’t not match the flow value of the wire that just completed filling, therefore it will not be connected.  However, on the next frame the empty wire will begin filling, using  the flow value of the filled wire which will make it connected again.  This flicker was quick, but it was noticeable.  Therefore, I added special checks for this case, and made the wires connected in this one frame case.

The Night the Music Died

Used the Pause method on the MediaPlayer to pause the music when the pause screen is active.  Unfortunately, there is no MediaPlayer property to determine if the music is paused, so I had to create a new variable to track if the music was paused.  I simply want to resume if the GameLevelScreen is coming from the pause state, but I want it to start playing anew if it is coming from the title screen or level select.  Also had to set this pause variable to false if the user quit from the pause menu to the main menu, otherwise it would still think that the music just needs to be resumed.  When that happened, it would try to Resume the title screen music when the level started.  The title screen music would just continue to play during the level, and the level music would never start.

Centering Text

Overloaded the drawRaisedString method, so that it now takes six arguments with the last being a boolean signifying if the text should be horizontally centered at the point passed as a parameter.  The drawing code is now in the six parameter method, and the five parameter method of the same name just calls the six parameter method with the boolean set to false.  This will keep me from having to change every line of code in the game that uses the drawRaisedString method.  Plus, I just add “true” as an extra parameter for the text that does need to be centered.

Background Colors

Fixed the background colors for level 4 (yellow) and 5 (green) so those aren’t so bright.  Also created a standard method in the LevelDefinition class that returns the background color, since that color was previously being determined in two different locations.  Updated those locations to use this new standard method.

Added columns of stars in the background which scroll if the player achieves the star rank (S Rank in all three categories at once).  Stars in the even number columns scroll in the opposite direction of the stars in the odd number columns.  I used Inkscape to make the stars since there was no easy way to make a star shape in Gimp.  Then, I just took a screenshot (PrintScreen button) and pasted into Gimp, because copy-and-paste from InkScape to Gimp doesn’t work.  I then used the fuzzy select tool to select the star, set the selected star region to white, inverted the select and set the remaining to transparent (after adding transparency to the layer).

 

One thing that I do like about C Sharp is that after some research, I found that structures (such as Vector2) can be passed by either value or reference.  At first I found it passed by value, when I tried to pass my star position to the getStarPosition method, but it left the position at the original value after the method completed.  Then I found that just using the ref keyword in the method parameter list and in the method call will make it pass the Vector2 by reference, which allows the method to modify the original Vector2 passed to the method.  This was necessary for me to make a trailing star effect, for the blinking stars that circle the results.  After trying a few different things, I thought the best look was two groups of three stars that circled the result screen.  Also, the yellow alternates between the three stars in each group.

More Effects

I also added a glow effect, so that the wire transitioned from yellow to white (four different shades) every 15 frames.  I didn’t like how it looked, so I just set it back to solid yellow.

Using the sprite scale parameter, I was able to make a light layover expand inside of the LED circle.  This gives the appearance that the LED is filling up.  The default color for an LED was set to light gray (previously white) to give a better contrast between the expanding yellow inner circle sprite and the rest of the LED sprite.