Showing posts with label 2d. Show all posts
Showing posts with label 2d. Show all posts

Tuesday, February 10, 2015

It's Been A While

Hello Everyone!

It sure has been a while, hasn't it? I ended up getting the job I mentioned in one of my last posts, and that has kept me really busy. I even got sent across the country for a couple weeks! Things are finally settling down to where I have been able to start working on game development again.  Here's what I've been up to!

Winds of Commerce                                                                         

I took a look at what I had previously made for Winds of Commerce, and taking what I have learned since I put it on hold, I think if I want to continue on with that I will end up remaking it from scratch. There is a lot of code that I am not happy with, and going forward I think it would be more work trying to build the new code from the existing code base than it would be start over and have a better design of the whole thing. This is especially true for when I would need to add enemy AI. The existing code is not very modular, and it would just be adding to the disorganization to continue on with this code base. In the end I'm going to shelve the game until a later date. I may create it in a different engine, since UDK is not really suited for running what essentially is a 2D game. There is a lot of overhead that isn't being utilized.

New Project                                                                                       

I was playing Sonny a couple weeks ago and thought that something like that might be an interesting game type to try and make. I spent about a week designing the base combat system (since that game style is almost solely combat) and I got a system I was happy with. I haven't been able to test it in a real life situation, so it might have to be overhauled once I get a chance to test it. Basically you have four base stats that six other stats are derived from. The six derived stats are what are used in combat to determine your effectiveness. There are also boons and skills that can affect different aspects of combat.

Given what I decided to do with Winds of Commerce, I sat down and looked at some of my options for game engines. I wanted to stay with a language I was already familiar with so that left m with either Flash (AS3), UDK (Unrealscript), Construct2 (Visual Scripting), or C#. I immediately ruled out UDK, for the same reason I don't think it was a good choice for Winds of Commerce. I also ruled out Construct2 because I think setting something up with the all the features I want, while doable, would be overly complicated using Construct2. That left me either using Flash, or finding a game engine that uses C#. I was leaning more towards C# since I use it at work and have gotten used to some of the features it has, and working in Visual Studio. I found that the Unity game engine supports Java, C#, and Boo script. Unity has a lot of built in support for doing 2D games, including sprite sheet handling, layers, and a pretty cool animation state editor. I could also do all of my code development directly from Visual Studio and utilize the power that it offers with Intellisense and refactoring, among others. To me, this made the decision easy since Unity offers almost everything that Flash offers, with most of them being better than Flash.

I plan on going through documenting the process I'm going through. I'll save that for another post since this one is getting a bit long.

Complimentary Code Bit                                                                 

To wrap things up here is some code I am using. For drawing the GUI elements you have to provide a rectangle to tell it where and how big to draw the GUI element. It didn't make much sense to me to have all of that be calculated every frame since mine won't be moving at all. To make this easier I created a small class to create the rectangle for me, as well as store other data as I need to. It is essentially a glorified Rectangle class, but it allows me a bit more flexibility, plus I can add any other fields I want associated with a particular GUI control, such as an image or particular GUI Skin.

Here is the class:

public class Control { private int x = 0; private int y = 0; private int width = 0; private int height = 0; private int bottom, top, left, right; private Rect rectangle; public int X { get {return x;} } public int Y { get { return y; } } public int Width { get { return width; } } public int Height { get { return height; } } public int Bottom { get { return bottom; } } public int Top { get { return top; } } public int Left { get { return left; } } public int Right { get { return right; } } public Rect Rectangle { get { return rectangle; } } public Control(int newW, int newH) { width = newW; height = newH; UpdateBounds(); } public Control(int newX, int newY, int newW, int newH) { x = newX; y = newY; width = newW; height = newH; UpdateBounds(); } private void UpdateBounds() { left = x; top = y; bottom = top + height; right = left + width; rectangle = new Rect(x, y, width, height); } public void SetWidth(int newW) { width = newW; UpdateBounds(); } public void SetHeight(int newH) { height = newH; UpdateBounds(); } public void SetX(int newX) { x = newX; UpdateBounds(); } public void SetY(int newY) { y = newY; UpdateBounds(); } }

Here is how you would initialize a Control:

private void InitializeBackground() { panBackground = new Control(800, 800); panBackground.SetX((Screen.width / 2) - (panBackground.Width / 2)); panBackground.SetY((Screen.height / 2) - (panBackground.Height / 2)); }

And here is how you would use it in the OnGUI method to create a button:

public void OnGUI() { GUI.Box(panBackground.Rectangle, GUIContent.none); }

Thanks for reading!

Friday, February 21, 2014

A Little Detour To Revisit a Old Side Project

Hello everyone!

My buddy Andrew contacted me the other day and asked if I wanted to help him redo a lot of the stuff that we made for SpaceWings now that we have a bit more experience. So, we dredged up as many of the old files that we could and got to work figuring out what we needed to redo. He wanted to tackle most of the base code himself, while I took on getting the menus put together.

Unfortunately, the only assets we had from the original menus were screenshots. A bit of Photoshop magic and I had almost all the elements I needed. A major thing I was still missing was the font. None of the other guys that worked on it before that I talked to had the name of the font we used in the original. So, I had to find some new fonts. I then had to try and replicate the effects that Justin Bucher made for the originals. He's much more proficient at Photshop than I am though, but I did my best.

Here are some of the HUD assets:


Once I got the main aspects of the menus done I decided to start working on getting the pickup system working. This has four main parts to it: Picking up and classifying an item, adding to the inventory if applicable, updating the HUD if something was added to the inventory, and checking to see if the player has a particular item. 

Picking Up and Classifying

Getting the item to be picked up proved to be surprisingly difficult for me. I haven't really worked with skeletal meshes/skinning/animation before in UDK. I got almost all of it set up thanks to some help from Andrew, mostly setting up the anim tree. The part that kept throwing me off was the collision. To get collision on a static mesh is really easy, but I was having a trouble with a skeletal mesh. Turns out I was looking at too much code and over looked adding BlockNonZeroExtent = true default properties of the skeletal mesh component...

As for classifying it, there is a variable in the actual pickup that holds what type of pickup it is. When the pickup is touched it calls a function in the player controller class that takes that variable and decides what to do with it. Here is my base pickup class:

class SW_Pickup extends Actor abstract placeable ClassGroup(SW_Pickups); var string PickupType; var SpaceWingsPlayerController PC; var SpaceWingsPawn P; event Touch(Actor Other, PrimitiveComponent OtherComp, vector HitLocation, vector HitNormal) { PC = SpaceWingsPlayerController(GetALocalPlayerController()); P = SpaceWingsPawn(PC.Pawn); PC.MyLog("A" @ PickupType @ "Pickup was touched", 'PickupTouch'); //If the instigator is the player, then process the pickup if(Other == P) { PC.ProcessPickup(PickupType); Destroy(); } } defaultproperties { PickupType = "None" Begin Object Class=SkeletalMeshComponent Name=PickupMesh Scale3D=(X=1.0, Y=1.0, Z=1.0) CollideActors=true BlockNonZeroExtent=true End Object Components.Add(PickupMesh) CollisionComponent=PickupMesh bCollideActors = true bBlockActors = false CollisionType = COLLIDE_TouchAll }
And then all you have to do is extend off of that and add the relevant skeletal mesh properties in the defaultproperties of the child class and assign the item type to that variable I mentioned earlier. For example, here is the the red key card pickup class.
class SW_RedKeyCardPickup extends SW_Pickup; defaultproperties { PickupType = "RedKeyCard" Begin Object Name=PickupMesh SkeletalMesh=SkeletalMesh'SW_Meshes.KeyCard.KeyCard' Materials(0)=Material'SW_Meshes.KeyCard.RedKeyCard_Mat' AnimSets(0)=AnimSet'SW_Meshes.KeyCard.KeyCard_Anim' AnimTreeTemplate=AnimTree'SW_Meshes.KeyCard.KeyCard_AnimTree' PhysicsAsset=PhysicsAsset'SW_Meshes.KeyCard.KeyCard_Physics' End Object }

Adding To My Inventory

Adding it to the inventory was really simple. Since the inventory can hold a maximum of 3 items I didn't need to implement a grand inventory manager. For simplicity I assigned each pickup that could be added to the inventory a number instead of trying to save a class into the array, or something overly complex like that. I could have done a string, but I end up using the id number when updating the HUD. Here are the functions that manage my small inventory:
exec function AddItem(int ItemID) { local int i; if(ItemList.length < 3) { i = ItemList.length; ItemList.length = ItemList.length + 1; ItemList[i] = ItemID; HUDGFx.UpdateItems(); } else { MyLog("ItemList is full", 'AddItem'); } } function bool CheckForItem(int ItemID, out int FoundItemID) { local int i; local bool bHaveItem; bHaveItem = false; for(i = 0; i < ItemList.length; i++) { if(ItemList[i] == ItemID) { bHaveitem = true; FoundItemID = i; } } return bHaveItem; } //This would be used like this in whatever function needs the check //If not being called from this class, get PC reference like normal /* local int FoundID; if(CheckForItem(1, FoundID)) //If we have a keycard (ID 1) { RemoveItem(FoundID); //Insert the rest of the code that happens if they have the keycard } */ exec function RemoveItem(int ItemID) { ItemList.Remove(ItemID, 1); HUDGFx.UpdateItems(); }

Updating the HUD

Now that I have all of that in order I have to update the HUD to show which items I have in my inventory. As I do more and more Scaleform projects I try and migrate as much code as I can from AS3 to Unrealscript, since Unrealscript runs faster than AS3. Since I will be spawning movieclips directly from Unrealscript I have to keep a reference to them in order to adjust them or delete them. To help manage my references I decided to make my AttachMovie function a bit more dynamic on what parameters are passed. The first step was to create an array that holds the linkage names(to match the ones in Flash) and the desired instance names for all of the different item types that can be added to the inventory. The element number then corresponds to the ID I gave the items when I added them to the inventory. Here is how I have the AttachMovie and the reference array set up:
var struct ItemInfo { var string LinkageName; //Name used in Flash var string InstanceName; //Desired Instance Name } ItemReference; //ItemSlot[0] holds the id number of the item assigned to that spot. ItemOneSlot.AttachMovie(ItemReference[ItemList[0]].LinkageName, ItemReference[ItemList[0]].InstanceName); ItemOneMC = GetVariableObject("_root.itemOneSlot_mc." $ ItemReference[ItemList[0]].InstanceName); //In the defualt properties ItemReference[1] = (LinkageName = "redKeyCard_item", InstanceName = "redKeyCard") ItemReference[2] = (LinkageName = "blueKeyCard_item", InstanceName = "blueKeyCard")

CheckForItem Kismet Node

Since I like using Kismet for setting up triggers and other level specific things I needed a way to check if I had the correct item before the actual action could be executed. For instance, if they have the red keycard when trying to lower the force field. If they don't have it they shouldn't be able to lower it. So I made a custom Kistmet node that calls my check inventory function in my PlayerController class(see above), then outputs the correct result. I wanted to be able to set which item was being checked and also if I wanted it to be removed when the check was made. If I had like a master key card or something that could be used over and over again I wouldn't want it to be removed from my inventory. Anyway, here is my Kismet node:
class SeqCond_CheckForItem extends SequenceCondition; var bool bResult; var int ItemID; /**Remove the item if found? */ var(Items) bool bRemove; /**Expected Item Type*/ var(Items) enum ItemTypes { ITEM_RedKeyCard, ITEM_BlueKeyCard } ExpectedItem; event Activated() { local SpaceWingsPlayerController PC; PC = SpaceWingsPlayerController(class'WorldInfo'.static.GetWorldInfo().Game.GetALocalPlayerController()); bResult = PC.CheckForItem(ExpectedItem + 1, ItemID); if(bResult && bRemove) { PC.RemoveItem(ItemID); } //If the check result is true, activate the first output link, else the second OutputLinks[(bResult == true) ? 0 : 1].bHasImpulse = true; } defaultproperties { ObjName="CheckForItem" ObjCategory="SpaceWings" bRemove = true InputLinks(0)=(LinkDesc="In") OutputLinks(0)=(LinkDesc="True") OutputLinks(1)=(LinkDesc="False") VariableLinks(0)=(ExpectedType=class'SeqVar_Bool',LinkDesc="Result",bWriteable=true,PropertyName=bResult) }

Wow, this post ended up being a lot longer than I had anticipated. I was going to throw up a video of the pickups and HUD in action, but that will have to wait until later. Time to work!

Monday, January 6, 2014

And Now We're Back From Our Intermission!

Hey guys!

Sorry it's been so long, life has been hectic! Thankfully, my life has mellowed out a lot now, so I can get back on a regular updating schedule.

In the spare time I have had I've been dividing my time between working on that commerce game I mentioned in my last post, and helping a buddy with a game he's working on.

The premise of the trading game is you are the captain of a merchant ship. You can find more information here. You start off with a set amount of gold and you buy your first cargo with it. You then have a set amount of  'days' to go to different ports to try and make the greatest profit in that time. Each port, except the starting one will have randomized prices and quantities so each playthrough will be different. I've made some pretty good progress so far. I have the core system down for determining the value and quantity of the various goods, and I've almost finished up the information system in the game. This will allow you to get information on the different ports ahead of time, to help you plan. I still need to implement the actual buying and selling of goods though.

I've made a very simplistic mock up to give a representation of the game. To exit the trade and information windows just click them.


That's all I have for now. Once I get things a bit more organized I'll put up some interesting code bits, images, or something.

Saturday, November 2, 2013

AssetManager Is Complete!

Hey guys,

Been a while, but I am happy to say that AssetManager is as done as it is going to get. It is fully functional, and mostly pretty. It can be downloaded from here, if you want to give it a shot. The ReadMe that comes with it gives some instructions on how to use it, but almost all of it is self-explanatory.

For those of you who don't know, AssetManager is a project management tool that allows you to add projects and assets to keep track of all the things you are working on. It uses UDK for two reasons; one is because I'm too lazy to learn C++ or another language, and the second reason, ironically, is to learn how to use AS3 and Unrealscript for more complex tasks. Due to using UDK it is probably a much bigger file size than it needs to be. As I went through this project I did learn a lot about using config files, spawning items in AS3, and just managing a dynamic system in general. It was a  lot of fun to make, but I'm glad it's done. After working on that immediately after PrepHelp I was getting pretty burnt out on looking at mostly the same code.

Unlike PrepHelp I tried to make graphics for this. Overall I am unhappy with them, but it looks better than my placeholder graphics. If there is enough interest in the program I'll probably redo the graphics and fix the one (potential) bug I know of. The one thing I do like is the logo. It is kind of plain, but when it is smaller it looks better without realistic textures, which was what I was originally intending to do.



The only bug I can foresee is that you can add an item to a project even if there is no projects. Should have thought of that before, but I didn't. I know it sounds lazy to not go back and fix it, especially since it would be around 3 lines of code...and you're right! I want to be done with it for now, since it is starting to no longer be fun to work on. Since I'm not getting paid I figured that means it's a good time to wrap it up. Also, when your internet is so slow it takes 30-60 minutes to upload a file less than 200mb ...

I don't think I have anything else to add that isn't in the ReadMe. Now that this is out of the way I plan on working on a isometric, commerce strategy game. Just something small to see if I can do it and to get more practice with another type of game.

Friday, October 11, 2013

One Project Completed - PrepHelp

Hello everyone!

I should have posted this a little earlier, but time got away from me. I finished up the code stuff for PrepHelp. It now is a fully functional little program. Yippie! You can download it from here, but be warned: I have not improved the visuals past the mock ups I made for testing. I was planning on it but another idea came up that I will explain a little later. I did, however, provide a little instruction image pointing out what some of the more obscure, unlabeled buttons do.

I believe on my last post all I had left to do was set up the search feature, as well as implement the medical item category as well. The latter was very simple, just copy, paste, change a few names, and done. The search function...at first I thought it'd be easy, just do a check against the types and it will find them and sort them. Well, I was partially right. Actually finding the elements was the easy part, the hard part was figuring out how to display just the search results without overwriting my existing inventory.

Since I wanted to find all of the elements in the array that matched the given item type I found that the Array.Find() function wouldn't suit my purposes without a bunch of work. Instead I created a for loop, where on each element it would check if the item type matched the searched type. Here is an example below.

function SubmitSearch(string TempType) { local GFxObject DataProvider; local GFxObject TempObj; local int j; //Clearing the temp array PP.TempFoodInv.length = 0; for(i = 0; i < PP.FInv.length; i++) { if(PP.FInv[i].T == TempType) { j = PP.TempFoodInv.length; PP.TempFoodInv.length = PP.TempFoodInv.Length + 1; PP.TempFoodInv[j].N = PP.FInv[i].N; PP.TempFoodInv[j].T = PP.FInv[i].T; PP.TempFoodInv[j].Q = PP.FInv[i].Q; PP.TempFoodInv[j].E = i; //Setting the temp element number to i so it will show where it is in the food inventory PP.TempFoodInv[j].D.Y = PP.FInv[i].D.Y; PP.TempFoodInv[j].D.D = PP.FInv[i].D.D; PP.TempFoodInv[j].D.M = PP.FInv[i].D.M; } } //If any matches were found, draw the new inventory if(PP.TempFoodInv.length > 0) { bFood = true; DataProvider = CreateArray(); for(i = 0; i < PP.TempFoodInv.length; i++) { TempObj = CreateObject("Object"); TempObj.SetString("FoodItem", PP.TempFoodInv[i].N); TempObj.SetString("Type", PP.TempFoodInv[i].T); TempObj.SetInt("Quantity", PP.TempFoodInv[i].Q); TempObj.SetInt("Element", PP.TempFoodInv[i].E); TempObj.SetInt("ExpY", PP.TempFoodInv[i].D.Y); TempObj.SetInt("ExpD", PP.TempFoodInv[i].D.D); TempObj.SetInt("ExpM", PP.TempFoodInv[i].D.M); DataProvider.SetElementObject(i, TempObj); } RootMC.SetObject("foodInvo", DataProvider); ActionScriptVoid("_root.clearInvo"); ActionScriptVoid("_root.drawFoodInvo"); } //If no matches were found, show an error else { ActionScriptVoid("_root.spawnSearchError"); } }

If the for loop found an element it would copy it to a new array. After it finished searching the entire array the temp array would be sent over to the SWF to be displayed. This way, my original item array would remain intact and I would only be displaying the contents of the found items.

Now, to talk about the idea that got in the way of redoing the graphics for PrepHelp. I have been calling it AssetManager, but the name will probably change. Basically it is just a remake of PrepHelp, but focused on helping keep track of the different assets needed for the projects I'm working on. I hope this can help me, and possibly others, keep track of how many things they need to work on, when they're due, and at what stage of development they are at. I could just take PrepHelp and rename few things and call it good, but that just isn't good enough.

While I was figuring out how to do the search feature I thought of a better way of doing things to make the whole system more dynamic. I figured if it was going to help you keep track of all the assets for every project you are working on it will have to be more flexible than having only two set categories(like food and medical in PrepHelp). So I am in the process of reworking it to allow user added categories with their own asset lists. This way a person can add as many projects as they would like, and the system would still work perfectly. I do plan on making graphics for AssetManager though, since I will probably be using it more than PrepHelp.

One feature I wanted to add, but couldn't figure out until a couple days ago was having a auto adjusting thumb on a scroll bar. Meaning, if you only had a couple items the thumb on the slider would be really big, while it would be a lot smaller if you had a bunch of items. That way you wouldn't have to drag as far to move a few items up, just like on a webpage. I have a working version, though it could use some tweaking if I can figure out to... Anyway here is the first version of it, using the inventory test I made a couple months ago and put up on my blog.


That's all I have for now. When I get the rest of the code wrapped up for AssetManager I'll fill in more detail on how I went about doing some of that stuff.

Sunday, September 29, 2013

My Good Friends, Sort() and e.target.parent! - PrepHelp

Hello everyone!

Just a quick little update on PrepHelp. Since my last post I've worked out quite a few bugs. Here's a few things I got working:

  • Expiration date checking
  • Edit an existing item
  • Sort items by name, type, quantity, or expiration date
To check to see if the item is close to expiring gave me quite a bit of trouble. My initial thought process was to convert the dates into a separate number. For instance let's use 12/24/14 as our example date. The day would be the base number, so 24. Then you would add 100 for every month, which would bring us to 1,224. Then you could add 10,000 for every year, then compare the two numbers to see if the current day is still before the expiration date. As I'm sitting there I'm thinking to myself that this is not the way to try and check something like this. It's just nuts to complicate it like that. What I ended up doing was something more logical, and I hope a good way to do it. Basically, when I check the date I work backwards, starting with checking if the current year is the same, before, or after the expiration year. If it is the same year I then do the same check for the month, then the day. If it is within one month of expiring it will change a movie clip as a warning, then if the expiration date has passed it changes that movie clip again stating it is expired.

Here's the code that I came up with:
/* Since the add item date only has the last two numbers of the year we have to add 2000 since the date chek in unrealscript has a 4 digit year */ //If it is the same year, check if it is the same month if(foodInvo[i].ExpY + 2000 == currentYear) { //If so, check if it is the same day if(foodInvo[i].ExpM == currentMonth) { //If so, say it is expired if(foodInvo[i].ExpD <= currentDay) { item.expMarker_mc.gotoAndStop(3); } //If not, flag it as about to expired else if(foodInvo[i].ExpD >= currentDay) { item.expMarker_mc.gotoAndStop(2); } } //If the expiration date is a month away, flag it as about to expired else if(foodInvo[i].ExpM == currentMonth + 1) { item.expMarker_mc.gotoAndStop(2); } //If it is past the expiration year, flag as expired else if(foodInvo[i].ExpM < currentMonth) { item.expMarker_mc.gotoAndStop(3); } } else if(foodInvo[i].ExpY + 2000 < currentYear) { item.expMarker_mc.gotoAndStop(3); }

This helped me get the sort by date feature figured out as well, since it is basically doing the same thing. With the sort feature I used a delegate for the first time. Very interesting stuff, though kind of confusing. Basically a delegate allows you to use a function as a variable, sort of. In the case of the Array.Sort(delegate) function the sort function calls the delegate and the delegate takes parameter A and parameter B, compares them, and returns either -1(If your statement is true) or 0(If your statement is false). If -1(If I read the inline if statement correctly) is returned then the two elements in the array that are being compared will be switched. 

For sorting by date I ended up doing a little bit of my crazy number adding, though just by 1 or 2 instead of thousands. Since it is comparing two values and returning the larger I ended up adding or subtracting from one or the other depending on if the year/month/day were before or after the other.

Here is what the final code looked like:
//Calling the correct delegate switch(SortType) { case "Qty": //If SortType is quantity //use the SFBQ delegate FInv.Sort(SFBQ); break; case "Date": //If it is date, //use SFDB instead FInv.Sort(SFBD); break; default: FInv.Sort(SFBQ); break; } //The delegates //Sort Food By Quantity delegate int SFBQ(Food A, Food B) { //If sort quantity ascending is true if(bQUp) { //If FoodA.Quantity is greater //than FoodB.Quantity return A.Q > B.Q ? -1 : 0; } else { return A.Q < B.Q ? -1 : 0; } } //Sort Food By Date delegate int SFBD(Food A, Food B) { local int TempA, TempB; //If Year A is greater than B add 1 to A; if(A.D.Y > B.D.Y) { TempA += 1; } //Else, add 1 to B else if(A.D.Y < B.D.Y) { TempB += 1; } //If both have the same year, repeat down //through month and day. else if(A.D.Y == B.D.Y) { if(A.D.M > B.D.M) { TempA += 1; } else if(A.D.M < B.D.M) { TempB += 1; } else if(A.D.M == B.D.M) { if(A.D.D > B.D.D) { TempA += 1; } else if(A.D.D < B.D.D) { TempB += 1; } } } //If sorting Date ascending is true if(bDUp) { return TempA > TempB ? -1 : 0; } else { return TempA < TempB ? -1 : 0; } }

The other sorts were pretty straight forward since it would automatically check if the strings/ints were equal or not.

When I got around to adding the edit item I took almost all of the code for it from my add item popup. One thing I did change, though, was when the edit item popup comes up it will already have the information of the item being edited in the textfields. This would allow the user to change only what was necessary instead of having to re-input all of the information again. To do this I made use of the e.target.parent variable in Flash. Since the items are being added dynamically through code I found using the e.target or e.currentTarget keywords to be really helpful since it stores what movieclip/button that was the target of the event(Like the editItem_btn on a MouseEvent.CLICK event). One thing I had an issue with was that my target was my editItem_btn and all the information I wanted to access, so I could fill the edit item textfields, was in the parent movieclip item_mc. I tried several variations of parent.e.target and MovieClip(parent).e.target until I got e.target.parent. Then I could access my other textfields and all was well.

Anyway, hope that helps someone. Back to working on the search functionality!

Monday, September 16, 2013

Another Roadblock Avoided - PrepHelp

Hey guys!

In my last post I talked about the code project I was working on called PrepHelp. Over the past week and a half I have figured out most of the functionality for it. I have adding items, removing items, and am working on saving/loading inventory items to/from a config file.

To add an item I created a popup where you can enter any name, quantity, and expiration date. I also had to create a custom dropdown menu since I ran into issues when I tried the default component menu, as well as the Scaleform CLIK menu. With the default menu that comes with Flash it turns out it is not compatible, so while it works great in a strictly Flash project it throws errors when used with Scaleform. The CLIK one on the other hand has some issues where the dropdown part of the menu gets drawn over all other things in the swf, including the cursor(If you have the cursor in the same file). There are several workarounds, but I wanted the challenge plus this allows me to have more control over the graphics when I get to that part.

Also, if you forget to fill in all of the textfields on the Add Item popup then it will display an error and won't let you add the item till you fill the empty field.

When it came time to work on getting the saving and loading I ran into a pretty big problem...You can't save arrays to a config file. This should have been the first thing I checked before I started on this project, not after I have almost all of the framework done. Since the main reason I chose UDK over a strictly Flash based project was to utilize the config files.

Luckily, I found a post on the forums alluding to using a function to append/split a string and use that variable since you can save a string to a config file. Intrigued, I scoured the internet to find this magic function. After trying the wrong function I found the correct one. It is called SplitString. It is pretty handy. The first parameter is the string you wish to split. The second parameter is the delimiter, or what it looks for to know where to split it. The third is optional and it just asks if you want to cull empty elements. All of these broken up chunks are then stored in an array that is returned by the SplitString function. Here is an example of how I am using it to load my test inventory:

var config string FoodName; function LoadFoodInventory() { local array<string> FoodNameArray; FoodName = "How,now,brown,cow,this,goes,around,the,world"; FoodNameArray = SplitString(FoodName, ",", false); for(i = 0; i < FoodNameArray.length; i++) { FInv.Length = FInv.Length + 1; FInv[i].N = FoodNameArray[i]; } }

And as promised here are some screen shots of PrepHelp:

The test inventory using the SplitString function,
loaded from a config file.

The Add Item popup with custom dropdown menu.

Inventory after new item has been added.
From here I think it will mostly be copying existing code and fitting it for the medical inventory. and getting the search function all set up. I also have to get the expiration date thing implemented as well. I have a plan to tackle that, but it will just be a matter of plugging it in and seeing how it goes.

Well, that is all I have for now. Hopefully by next week I'll have the code wrapped up and started working on the visuals for it.

Wednesday, September 4, 2013

A Small Side Project - PrepHelp

Hey there!

Since we are waiting on models for N'Ferno, the firefighting game, and some more of the code base I decided to do a couple personal projects. I decided to start a small modeling project, and a larger code/design project. For the modeling I started modeling components of a camper van I own. I figured it was something I have ready access to and should be a nice little project. I wanted to do somewhat low poly, though have enough to make the objects look nice without going into a lot of detail. I finished up the dinette(the table and seats) and am working on the cabinet where the stove, fridge, sink, and electrical stuff is.

Here is the dinette:


When I get done with all of the models I want to go through and texture everything. Since I think texturing is my weakest point, this should be a good little exercise.

For my other project I had an idea to make a program to help people keep track of their long term food stores and medical supplies. This could be useful if you are prepping for the apocalypse or if you have food stored away in case of flood/hurricane/tornado or other natural disaster. The program would offer basic functionality. You would have the ability to add items into either medical or food items. Each item will have an expiration date, quantity, subcategory, and name. When viewing the list it will let you know if a particular item is getting close to its expiration date. There will also be a search function where you can search by subcategory(i.e. under food would be: grains, beans, meat, etc...) to help keep track of what items you have.

Due to the fact I haven't learned any other language besides UnrealScript and AS3 I decided to make it using UDK. I realize it isn't the best platform to make something like that in, but it is what I know. Eventually I will sit down and learn C++ or another language, but for now I'm working on expanding my knowledge of how to do things using UDK.

When I have the main body built I will post some pictures and possibly some code that I used to achieve it.

Friday, July 12, 2013

A Whole Lot of Menus - Nordic Sol, N'Ferno

Hey there guys!

Over the past week I've been working pretty hard on getting some menus put together and working the bugs out of them. For Nordic Sol, which has gone through a huge overhaul since my last post about it, I have almost all the menus working how they should.

I made a:
Title Menu
Pause Menu
Death Screen
Inventory Screen

I have a little cleanup to do on the Inventory screen, for some reason one of the features stopped working...

I also have to do a credits/end game screen.

For N'Ferno I have most of the same menus, except the Inventory. Instead, I have a store where you can upgrade your gear. It is based off the generic store/upgrade screen I made a while back.

I did find an interesting thing out about the ExternalInterface.call() function in AS3 though. When you pass parameters with it you can have the Unrealscript function catch them. Now, I know that is pretty standard functionality in a function. You know, in the function being called in GetItem("Plasma Gun"); it would be function GetItem(string ItemName) and ItemName would then be a local variable. However! In all of the examples I had seen of ExternalInterface.call() in Unrealscript they would always use GetInt() in the function itself instead of catching the passed the parameters. Seems pretty lame of a find, but it always confused me why you would get the variable in the function when you were passing it in ActionScript. Now I know I can treat it like a regular function, which is really handy and a lot cleaner.

Monday, June 3, 2013

A Proof Of Concept And An Old Datapad

Hey guys,

Over the past week I've been doing a small proof of concept for a game I'm thinking about starting development on. The working title for the game is Crazy Steve. I have the core game design document done for it, I just have to create an asset list, animation list, and put in some initial concepts for the menus/HUD.

Here's the synopsis of the game: Crazy Steve is a top-down, horde survival game. You play as Crazy Steve, an aging man protecting his dying wife from the Grim Reaper and its minions. In between each level there will be stills of their lives together before this point. You must defend yourself and your trailer. If either one falls, you lose. You win by defeating all the minions in each round, and eventually defeating the Grim Reaper.

Here is the proof of concept so far, though I apologize the graphics are nowhere near pretty. This proof of concept served two purposes; the first was to get a rough idea of what it would take to make this game in Construct2, and the other was to flesh out the enemy classes to get a better understanding of what I am envisioning. Overall I like the enemies as they are, although the Warlock(The ones who shoot things at you) may need to be toned down just a little. Just click on the window to play. If the game is too small you can click here and it will open it in a new tab/window in a larger size.

The controls are: WASD or the arrow keys to move, the left mouse button to fire, and R to reload.
P will pause the game.

That has been taking up most of my time, along with getting ready to move. As I was looking through my old documents I found a datapad I modeled a while ago. It was modeled off one from the Star Wars universe. Here is the model and reference photo. The reference photo is courtesy of Wookiepedia.



It doesn't quite have the same proportions and the textures are way off. It's interesting to go back and look at projects you worked on a long time ago and see how far you've progressed. 

That's all I have for you guys for now!

Saturday, May 4, 2013

Post Mortem - SMDP

I figured I might as well do a post mortem, or a development review/critique , of the process of making Super Monster Dance Party. I'll go over several different aspects of the development cycle, namely Team Forming/Brainstorming, Development, and finally Quality Assurance/Publishing. I'll give an overview of what happened in each stage, then give some suggestions on how to possibly improve the step for the next time.


**Warning- This is will be a long post. You have been warned!**

Here is a two sentence summary if you don't want to read it all: We set out to make a pseudo-rhythm game featuring various monsters destroying towns around the world. The development phase went smoothly, but we needed to allow more time for concepting and testing.


Team Forming/BrainStorming:

Overview:  This stage went pretty smoothly. Dave Troyer came up to David Fuson and me and said he had a concept for a game involving a monster destroying city to music. It started out as a very simple, one button game where notes, or rings, would come in from the sides and you tap the button when the notes go through it. Over the course of around 30-70 minutes we had a more fleshed out version that had the possibility of multiple buttons, several monsters, and several different modes. After we had a stronger concept we recruited Corey Farmer to work on the songs for the game. The rest of the team were kind of picked up along the way, I'll go over that more in the development stage.

Suggestions: I don't really have any suggestions for this stage, it went really smoothly. If I really had to pick one thing it would be to establish an art style before work starts on the art assets. I think spending more time doing concepts to lock down a style will help reduce the amount of assets that need to be redone when the art style changes.This would also include concepting out menus, page backgrounds, buttons, and other aspects of a game that often get overlooked.

Development:

Overview: We started off pretty strong on this game. After Dave proposed the idea and we elaborated it a bit, I started prototyping the engine that would spawn the notes and had a working version within a couple hours. By that time, David Fuson had concepted out 5-6 different monsters and presented the art style he had in mind for the game. We spent the next couple weeks refining the art and engine. Due to certain limitations we ended up cutting the infinite mode, due to how Construct2 handles loops. We also decided to reduce the amount of monsters from the 10 we originally had down to five, as well as the amount of songs.

This was where we changed up the team quite a bit. Corey decided he had enough on his plate working on our school project, and withdrew from the group. To fill the sound void, Dan Langford stepped forward and took on the task of making sound effects and music for the game. Since he was still learning some of the digital music software, he only had time to complete one song, as well as some voice acting. Since we were approaching our target release date and were lacking the amount of songs we needed, we resorted to bringing in a third party composer, DJ SynthR, to supplement the missing songs. We also added Ben Mjelde as a backup artist to work on the buildings for the city.

Onto the art style and art assets. As mentioned before, partway through the development cycle we cut back on the amount of monsters the game would feature. We had to go through and pick the monsters we liked the best, and that had the most diversity stylistically, so they wouldn't all look the same. Once we got those decided on David started putting together the sprite sheets for the animations for Dave to set up in Construct2. Dave ended up redoing the monsters since the previous ones had some issues once they were actually put into Construct2. The only problem with that is that Dave and David's art styles are substantially different, where David was leaning towards the pixel art style with rough edges and shading and Dave had made crisp and shiny new ones. To alleviate some of the differences Dave worked some magic in Photoshop and got his pixelated. They still looked different, but not nearly as much.

Since a lot of effort was being put into the monsters to get them squared away, other aspects of the game were being ignored. We were still lacking a cohesive menu/button scheme, and till right up at the end we were running with the placeholder images I had made so I could set the pages up. These took till the day of release to get finalized, which is not the time to be deciding on layout styles for a game. As we got towards the deadline it seemed like trying to get art assets became increasingly difficult. What I mean by this is when an art asset needed to be updated with new information, or just a tweak to make it look better, there was some resistance to actually update them. I realize that they had already been made, but it should be expected that art assets need to be tweaked/updated. It is frustrating as a developer to be met with an exasperated sigh when we need an art asset before a major deadline, and then receive something that is vaguely what you had asked for.We did manage to get everything updated though, so that was good.

Suggestions: The major thing I think of is to diversify what a group is focusing on. For instance, instead of focusing the entire art team on getting monsters animated, have someone start working on the menus, page backgrounds, text, and stuff of that nature. That way we have more time to refine/redo those assets if we're not satisfied with them on the first go around. When it comes to redoing assets/code/sounds we need to remember that things will need to be adjusted, and just do them. This is especially true if the change would take minutes at most. Sure, you already did the work once, but the assets aren't finalized until the game has been released(And sometimes not even then!)

Another thing that would help the team is to don't take on more than you are willing/able to work on. This was a major issue when it came to our songs, we had the game very close to being done, yet we had no music(which is a major part of the game). It wasn't until several weeks into it that we found out Corey wouldn't be able to do the songs. If the team is relying on another team member to get them something, the team member should let the rest of the team know as soon as they can that a different person will have to work on it. This would avoid a lot of frustration for the remaining team. By all means, if it turns out you have less time than you thought you would have or something comes up and you can no longer work on it, then let the team know. We understand that things come up, but  it should be brought up as soon as you know you can no longer work on it.

Quality Assurance and Publishing:

Overview: This portion of the cycle was entirely too short. Since it took so long to get the songs and remaining art assets we had very little time to test the game with all of that stuff in it. During this process we learned that each browser handles HTML5 different, especially when it comes to audio. Audio support for HTML5 is sporadic at best it seems. Part of the time sound would work great on Chrome, then others it would only work on Firefox. We ended up doing a lot of last minute testing right before we started the publishing process. We also should have tested the game on more types of phones, since apparently every Android device handles HTML5 differently just like a browser. We had the best results on the latest version of Android, and very mixed success on older phones. We also found out that there really isn't anything we could/can do to fix a lot of those issues, since the browsers haven't decided on web standards for HTML5 yet. If we knew Javascript we might be able to smooth some things over, but that is beyond our team's capability at the moment.

Publishing was quite a new experience for Dave Troyer and myself. We ended up spending around 4 hours going from exporting the game to actually publishing it to Google Play. We had crash courses on how to sign an .apk which is needed to upload to the marketplace. Now that we have the process down it should be really easy for future games, but it took a little bit to find a tutorial/explanation that was detailed enough for us newbies to figure it out. Thank you to whomever made this tutorial over on Scirra.com, it was easy to follow!

Suggestions: Main thing would be to allow way more time for testing and to have a wider testing base for mobile. I think that would solve many of the problems that arose during this stage.

Project Overview:

Overall I think this project went pretty smoothly. There were a few hiccups here and there, but we did finish it. Main suggestions would be to: Know your limitations, be prepared to redo stuff, and allow a bunch more time for testing. I would also recommend a longer concepting phase, or at least not just focusing on the main aspects of the game. I feel that would help the game as a whole be more cohesive, and provide a clearer goal for the different teams to work towards.

P.S.: On a side note, after the release of the game we have had reports of features(mostly sound) that are not working correctly. These issues appear to be with how Android processes HTML5 and varies between different versions of Android. I apologize for the inconvenience. We recommend trying to get the latest version of Android. If we receive enough sales we might port it to Apple devices, which are supposed to handle HTML5 better, but that is farther down the road. Thank you for all of your support!