Friday, December 27, 2013

The universe - a quick overview

The galaxy in Junkcraft Armada is quite vast, just to have a quick look how it will look like for the player here is a zoom out/in to the current player location, traveling through different star systems will consume fuel and food so the player will have to be aware of the limited resources to decide the next steps.

There is a mission to accomplish but time is limited, normal engines will take you to local star systems but will take many months if using normal the standard engines but there are wormholes that can speed up the travel and lower the usage of food and fuel used. Crew experience will have an effect on what the player can see on the galaxy map, a more experience pilot can provide more visibility to more wormholes, and in some cases allow for shortcuts.

There will be a network of wormholes that connect different sectors through the galaxy otherwise it will be impossible for the player to reach other systems between a lifetime. In this example just to go from the current moon to the red marker at the start of the image takes about 15762 years with the current propulsion system, so a proper use of wormholes and resources is critical.

Friday, December 20, 2013

Space food, fuel and time game mechanics

Food is very important part of our lives, without it we can't survive, and fuel too, fuel allows us to travel or get energy from it for our daily lives, so why I can't see much of that in space games? usually energy or fuel is a little bit limited but not so much, mostly in terms of travel time or regeneration speed or how far you can move, and for most of the games food is completely ignored, one of the reasons is that players shouldn't be bothered with many menial tasks and instead add more guns and things like that. Another one is if you don't have a crew to care about, why will you care about food then and how will that affect your crew?, I think this can be a very interesting game mechanic.

So food will be important as well as fuel, in Junkcraft Armada there isn't a Faster Than Light engine, so traveling can take days, weeks or months from one point to another, but the player won't have to wait for all that time to happen when playing. There are short cuts where wormholes will be available, but wormholes will allow the player to travel to specific points in space and after that, normal engines will be in effect, so fuel will limit how far you can travel without having to refuel and also food. The longer the trip the more food you will need, so why do we need two things to limit our travel? well, for example the player can recruit people in some missions, that increase the salary cost and also food consumption, so if you assumed you have food for 4 months, and suddenly in the middle of your trip you double your crew , there will be a shortage of food and this will cause stress in your crew and may even kill them over time, they may even go crazy and fight each other to survive, so food bring another dimension to think about, to recruit or to not recruit, do you want to bring more man power with the extra cost associated? will you have enough resources for that? will you feed your prisoners or not?, what if one of your crew members usually eats in excess? Food can bring happiness to crew members , a well feed crew will perform better than a malnourished one.

Fuel brings another dimension to think about. Fuel consumption and the cost associated will skyrocked if you explore every system, fighting and evading enemies also cost fuel, so do you want a faster ship or slower one, if you add more engines your ship will be able to change direction faster and react faster but will consume a lot more fuel, adding more energy generators will allow the player to expand and add many different facilities to the ship but more fuels is consumed to support the infrastructure, so what should be the perfect balance? it will depend on the kind of ship the player want, there is no free ride.

Finally "time", most games allow you to do the side/main missions as you fit, you can accomplish most missions whenever you like, most games give the player all the time in the universe to do whatever he/she wants until activating the trigger. Well that won't be the case in Junkcraft Armada for many of the missions, the player will be able to do the mission between a given time or face different consequences that will affect the end of the storyline, if you can't make it on time, the story changes, so be prepared to take action as fast as you can because events won't wait for the player, things will happen as they happen even if the player is there or not.

Thursday, December 5, 2013

Space the final frontier of unlimited space that needs some work...

I've been playing around the alpha version of the game and found that sectors do look too similar besides planets , stars , asteroids and some other things, so to add a more interesting things I just added new backgrounds that really add more deep into the game, thanks to NASA, some of the most beautiful images were used to make new backgrounds in Junkcraft Armada plus a lot of image editing to make sure images fit well together in-game and do not fight over the foreground space ships. Here are some examples:

Tuesday, December 3, 2013

Crew traits

Previously mentioned crew traits will play a major role in your ship and the decisions that you will have to make to get through. To explain how traits affect the gameplay check the details below with the descriptions of some of the reactions to in-game actions:

Behaves like a normal crew member, but runs from boarding raids when life is below 75%, leaving other team members behind. If the player accepts to help a ship in distress but instead decides to destroys it, the coward crew member gains loyalty to the captains since he/she is afraid of any risks that may put his/her life in danger, other crew members may lose loyalty instead. When life is low a coward crew member will surrender and stop fighting. Do you want a coward as part of your crew?

Looking for any opportunity to enter in a fight with anyone and becomes loyal to the captain when giving those opportunities, have a bonus in energy weapons and security and enjoys every battle available but will lose loyalty points when running from battle, any missed opportunity will have an impact. Fight over negotiations.

Terminally Ill
Crew member may die soon during any mission, you never know when the clock will stop but for sure it will stop, perhaps before the player dies or maybe last enough to accomplish the mission. As a bonus this crew member will have a very high skill level in 3 areas compared to normal crew members that start with just a minor skill level in only one area. Will you try to use the services of this crew member or not? death is permanent so once this crew member dies no one will be able to save him/her.

Being a social person is very important, but more important is being persuasive enough to convert enemies to your ranks, a very important source of crew members for a fee or by conving enemies while in imprisoned, at the end it is your choice, isn't it?

Looks for peace and non-fighting solutions, lose loyalty when killing enemies in non-combat situations like killing enemies that surrender or when not allowing the enemies to run away in some situations. By using the will of a pacifist, you may get a shield bonus regeneration when put in the shield management section and usually pacifist also do get a bonus on healing. Will your crew be pacifist enough to get through the game without killing anyone?

What is worse than having to deal with thiefs, smugglers, pirates and many more enemies? a dishonest crew member may steal from your loot, so be careful and watch your pockets!

A very dangerous crew member, a suicidal crew member will fight until death, won't care about life that much and if you face one be careful, in some cases a suicidal enemy may lock your ship with the enemy ship and setup the auto-destruct if low on health, life is short and it doesn't matter if the enemy gets killed by killing everyone. Even when boarding a suicidal enemy can detonate bombs around him/her just to kill your crew.

Mind Reader
Afraid of facing a trap when boarding another ship? a mind reader crew member put in sensors can detect some specific situations by trying to read the other ship crew's minds and gain tactical advantage. Trying to extract some important information from the enemy?, you got it.

Looking to know more? there are around 40 traits now and growing, more to come later, each crew member receive a few traits on creation, so very interesting combinations will happen, so hardware is not the only thing that matters.

Sunday, November 10, 2013

Crew personal traits

Each crew member is different and you, the captain, will face many different challenges while managing the ship and crew in battles or events. Let me try to explain it in a quick FAQ.

What makes each crew member different?
Each crew member will have skill stats as previously mentioned and each skill will affect your ship performance, additionally to the standard skill knowledge each member may have a few traits.

What is a trait? and how will that affect my ship?
A trait is a personal characteristic to each crew member, maybe one or more will be assigned to each member. For example, a crew member may be fearless and greedy, and this will translate while playing into many different actions, being fearless means never runs and may lose loyalty points if the captain decides to run from battle, so when boarding ships this crew member will fight until death and won't be scared and run in panic when health is low. Also the greedy trait means that there will be a request to raise the salary paid every few missions or he/she may lose loyalty points overtime, also may lose loyalty points when certain options are chosen like not risking the ship for an incredible loot in an dangerous asteroid field. So traits will have real impact on each crew member and how the ship operates.

How many traits are you planning to have?
At the moment there are more than 20 traits, like Benevolent , Greedy , Diligent , Lazy , Fearless , Coward  ,  Educated , Inexperienced , Efficient , Incompetent , Flexible , Stubborn and many more. Each with bonuses and penalties.

Friday, November 8, 2013

Boarding ships and airlocks

The airlock is the latest addition to the boarding process, when linking two ships close enough crew members will be able to travel between the two ships and board other ships to help for repairs, help ships in distress invaded by unknown bugs for example or other events. Since each crew have individual traits some may not be suited for some of the missions, lets say a crew member doesn't like weapons so sending that crew member to a mission to board a pirate ship may be very hard for that crew member to survive a fight inside with any weapon, most probably he or she may become a hostage so it will be up to the player to decide what to do with the hostage situation.

What no transporters? from technology point of view, transporters are just an easy solution but in this universe there isn't any, so people use airlocks and space suits to travel between ships or use space transporter tubes that can help people travel between ships.

Here is a concept screen showing two ships linked with a transport tunnel so crew members will float in the middle and travel slowly in 0g. You are the captain of the ship and you can give orders to crew members but they may not obey you blindly all the time, especially when scared or in distress.

Tuesday, November 5, 2013

The face, your crew

Just a few days ago I started working on crew personalities and traits, decided that crew members can't go without a face since it will be difficult to get attached with a faceless crew member, so this is the result of the past 4 days of work.

Take a look at some crew examples, randomly generated faces for each crew member will make sure you don't have the same crew the next time you play, many different variations await besides the face...but will you be lucky enough so you can find the same crew member with the same name and attributes? one in a billion probably... beside crew preferences change between games too, so be prepared for a more personalized adventure!

Sunday, November 3, 2013

Game mechanics , crew skills, loyalty and more...

This is a sample profile screen still work in progress.

Crew was added last week, and each crew member will feel different and special, so it is logical to be able to see each crew member face and their skills, loyalty is very important since many crew members may even revolt and take the ship if not happy, or may even do a better job than expected if they are very loyal to you, the captain of this ship.

Junkcraft armada will generate a face to each character and the combinations are vast, there are mainly 60 parts for each character but may even grow more if time allows and combining all of those parts can allow the game to display a many millions combinations with color, positions, size and other variations. I still need to do draw the female characters, and there won't be alien races to communicate at the moment, in this universe only humans have been able to colonize a small part of the galaxy, and since resources are not infinite I can't draw infinite number of alien races, so for now humans are the main ones that will be able to interact.

How to gain or lose loyalty? well some crew members may be attracted to right decisions, like for example a distress call from a transport ship is heard, if the player saves the ship, those crew members will be more loyal to the captain, but if instead the captain decides to plunder the transport ship and take as much as possible from that ship then those crew members will be less loyal to the captain, but those who like money will be better off with this captain, so trying to find a proper balance with your crew will be a challenge , and it won't be so easy to recruit new people, traveling through space into unknown areas is dangerous and the hiring places are not so common and in some events you may even get few crew members join your ship too.

Crew members do have a single life, so permament death is an important component of the game, so take care of your crew as needed, and if you lose a crew member in combat, don't forget about the funeral, some may respect you more by doing it or otherwise you may suffer the consequences too, and since each crew member is unique and special, you will have a place to remember those who fall in combat. Life in space is hard so chose wisely...

Friday, November 1, 2013

Communications up!

As mentioned before the crew of the ship will take a center piece of the game, many missions will depend on your crew performance and skill levels. Communications adds another layer of complexity, the player may get called by other ships asking for help, or asking to surrender or many other options, each selected answer may have consequences that the player will have to bear with till the end, some answers may even affect your crew loyalty, and by doing so, some crew members may become angry at your leadership skills, some may even revolt against you and if you are not fully aware and have enough crew to defend your ship you may even lose it get killed or ejected of the ship in a escape pod, too many possibilities!

This is a very simple communication between a group of pirates threatening the player, looking at your status and the number of enemies the player will decide what is better, fighting will not be always the best option.

Friday, October 25, 2013

Junkcraft Armada, the Crew!

Most space ship games allow you to control your ship or a bunch of ships, recruit units without names that are used just to die in battle to accomplish your main objective and if lucky survive. To make a personalized story you need different characters and each of them with some back story that will make some impact on the gameplay, but I think giving the player the opportunity to get attached to specific characters through the game may bring a more memorable and personalized story. Initially I was thinking to just keep the space ship game moving around the ship only, and in a later version add the crew, but after a few hours of playing I couldn't find more ways to expand the universe without having characters attached, so decided to move the crew part into this phase of development.

So Junkcraft Armada will allow the player to have different crew members onboard the ship that will make it better or worse depending on the skills of each of the crew members, the captain rank can only be assigned to the player, and if the captain dies the game ends, simply said you are one of the characters and death is permanent, so be careful what you order crew members to do. Crew members can help fix other's ships by boarding and repairing the ship, can attack and board enemy ships, and in some cases they may become hostages if enemies are too smart or too strong for them, you decide their specialisations and how will they develop over time, and if lucky you may hear and do some missions based on their needs and development, more to come soon.

Tuesday, October 15, 2013

Jump points in Junkcraft Armada

Traveling through space can take long time and can be very boring traveling for hours without nothing to do inside the game, I have decided that having FTL engines doesn't make sense in the context of Junkcraft Armada, so a way to overcome the time to travel between sectors players will have to use jump points, worm holes or other space anomalies or other advanced technologies. In this screenshot you can see a working jump point concept image.

Sunday, October 13, 2013

Junkcraft Armada status

Development is going well, in the last few weeks I've been able to do some major fixing and making the pre alpha version very stable but still many modules need to be updated and balanced as well as the missions, with only 2 missions built I still have about 10+ more to make and add all the randomization between them so the end result will be more than just 12 to 15 types of missions, it will end up with many different variations since there will be environment effects combined that will make the adventure more interesting.

Some screenshots of the last enhancements.

Close combar explosions.

Non balanced ship test, with controls and more weight on one side to test ship response.

Guarded derelict entrance with light effects

Parts color tinting to add color variation to each ship, this is just a test that helped me test the module manager and added several parts from different enemy ships I killed white testing, that's why the ship has so many different colors on hull parts.

Close view of the 179 module test ship of today, just very few parts were tested in this scenario since I haven't been able to add more enemy parts yet, all the modules were captured while playing.

If you are interested on this game, please follow me on , don't forget twitter account. Soon I will publish some gameplay videos.

Wednesday, September 25, 2013

Shadows and light

As mentioned before light will play a major role in tight spaces inside derelicts, asteroid mines or space stations, so to expand the exploring experience light has to be good enough so it can help players to discover areas as they move. So below you can see an example how light will play a major role while exploring some areas in the game.

Monday, September 23, 2013

There is no light in closed environments in space...

In closed environment like old abandon derelicts, asteroid mines or tunnels light should be pretty much non existant, it should be dark, the darkest of all, so I just decided that is time to add some of this into the game, while exploring those places you will have to rely on lights or sensors and this is just my first try to see how light will work inside a derelict.

Still there is a lot of work to do to make sure that all the illumination goes as planned, at this moment is very basic since I just wrote the code in 2 hours including the basic pixel shader. Now a more complicated ray casting method may be implemented since I don't want the player to see other corridors that are behind the next wall, and also I need to still enable the collision detection inside tunnels, but looks interesting enough to continue this approach. I am still thinking if sensors should show more on screen, in this case all walls around you depending on your sensors upgrade level and power distribution, I will show up the idea in another screenshot later during the week.

Saturday, September 21, 2013

Size and exploration

I've been doing a little bit of testing today just to feel how big or small a level inside a derelict feels. Just to give an idea how big can it feel at this moment, this is a random maze made by the derelict creator.

Every character in the screen above is a block in the map for now, the red square above is what you will be able too see if you put a ship inside the map.

Still graphics are just dummy textures for the test, but it feels quite big just by looking at my lonely ship there. And this is a small map, maps may be up to 20 times bigger easily but that can become quite complicated for the player to not get lost.

Friday, September 20, 2013

Procedural content creation in space

Yesterday I had a new idea, well is not new, but it is something I wanted to add to the space ship game, to be able to explore more than just empty space or asteroid fields, something like derelicts, space stations or asteroid mines and many other locations. So, after thinking for a few minutes I started my research and after 1 hour I was able to make somethink like a maze, which looked like something like this:

But, just adding a maze won't be fun, you need to have rooms, caves and something more interesting, so I scrapped the idea of having just a maze, and started again from scratch, I read some articles about room generations in rogue games, so based on some of those ideas found on the web I started to write my own generator and randomly create rooms and connect them. After a long night of coding I reached my bed but before that I had something like this:

It automatically generates an entrance as seen on top, and some interesting things inside the labyrinth like portals or exits to other levels, it still needs some more work but it has a very viable design for the game, one of the main challenges I had was that rooms can't be too small and the tunnels also can't be just one unit wide, since I don't know how big or small the space ship will be it would be better to give enough room to maneuver and also encounter enemies and other things. Since I have each room as objects I can easily decide what to add to each one without having to worry about tunnels and how everything is glued together. The image above is just a representation of what is filled or not on the map, but internally everything is divided as rooms and tunnels connecting to each other, so there will be always a connection to the start or end and everything will be accessible otherwise there may be rooms which can't be accessed like the exit and that will not be good at all. Also some obstacles are added in some tunnels so the player will have to discover secret tunnels for a little bit of variability in game.

So what's next? adding enemies and other things inside the maze as well as loot and rewards for doing it. There will be more complicated layouts but for a night of coding this was very good, hopefully I will be able to show up the final result in game with graphis in a couple of days.

Saturday, September 14, 2013

In space nothing stops you unless you hit something...

I was having some thinking about space today, I was looking at the smoke trail that missiles left in game, and somehow I felt that there was drag and smoke started to move behind, that would look fine if you are on earth when air resistance and gravity will drag your weapons bullets and even smoke trail, but in space it shouldn't. Actually I've spent a few hours thinking what is off on screen, bullets and energy weapons seem fine but missiles and torpedos did not, after so much thinking it was the smoke trail! sounds simple and didn't look so important but I like to take care even of the small details, when a missile was fired to the right side of your ship the smoke trail started to move down as my ship accelerated up, but missile keep moving at the same rate as my ship, up!, but smoke moved down!, if fired on earth it will be fine, but not in space, so I have to redo the smoke trail algorithm to take into account the missile accelearation, and keep attention when the missile change direction.

Red arrows show the direction of things moving below. On earth it may make sense but not in space.

More thinking to come later and most of the bugs I was planning to fix today are done, except the UI flow which is my next step, a little bit complicated to use even for me, after simplifying it I hope to post some new screens and gameplay videos.

Wednesday, September 11, 2013

2.5D or 2D? normal maps quest for a better game

As usual, for any new game I do, I try to make something new on the tech side and learn new skills and usually increase the development time and make things ugly in the long term and delay the end result. But is a challenge I like to take just to make something different, something refreshing and something that I haven't done before, I did it with the Mystic River animation framework which works very well but it does not fit this project... yet , I have several plans for it but that will be for the next version. So what is the 2.5D challenge then? Well I've spent the last couple of days thinking how to improve the look of the game, and one of the key features is graphics, eye candy. So instead of trying to make super nice sprites with fixed shading I think I can make them even better by adding shading effects to add depth, that will make it look better without having a major impact on the development "time"...   well I was wrong but not by much.

2.5D brings some new challenges, but finally I was able to resolve them today, the simple use of normal maps to address the shading in 2D have been explored before in other games, like Legend of dungeon and also many others, but all of the implementations I found are for platformer type, or platformer camera style, with all sprites standing vertically aligned without rotations. Why do I mention without rotations? well if you use normal maps with lights, and use sprites in a batch the normal map information is baked in the normal map texture, and the light calculation is performed per batch usually, so the problem with this approach is that once you start rotating the sprites, the light information will also rotate to the same direction giving you wrong illumination. To illustrate the problem, the image below shows a bunch of asteroids and all are supposed to recieve the same light from a star located top right, but after rendering with rotations all the shades were off.

The green arrows show the actual shade of an asteroid which is pointing the to the wrong angle given the light source in red.

After trying for 2 days to align the shades, I found a not so nice solution. The thing I was trying to do in the pixel shader is not possible between the scope of spritebatch in XNA, the reason for this is because how everything gets batched, I had to think how the spritebatch batch works to understand why the light rotation is not working at the pixel shader to compensate for the rotation of the sprite.

The actual code that is not visible to the normal XNA user behind spritebatch is quite interesting, as per documentation there is a limitation 2048 sprites that spritebatch can batch at a single time, if more sprites are drawn more batches do happen, why? because it has a dynamic vertex shader with a fixed number of quads which is 2048, with a total of 2048x4 vertices. So how does the batch works then? it actually creates 1 quad per sprite and put each sprite into the dynamic vertex buffer, the transformations are performed in the spritebatch batch process in the CPU and then the end result is passed to the shader (yes up to 2048 sprites in one batch goes to vertex+pixel shader), which is what I was receiving in my shader, so I am getting a total of 2048 sprites in one go all of them already transformed, so I can't transform back the light source for each sprite because simply a maximum of 2048 sprites is already clumped together in one big mesh! so there is no way to move the light back for each sprite at this stage, it is too late for that, and as per my testing I didn't get each sprite vertex information while doing deferred spritebatch, that's why I wasn't able to resolve the issue at the vertex or pixel shader and the normals are not real normals, just baked normals, they all moved with the sprite, so the light source as seen on the asteroid image. While the vertex shader is getting all the vertex information also a tranformation matrix is sent with the vertex data, that means the whole screen transformation that happens for the camera view, which can't be used to compensate the light source for each sprite.

Then why does it works with 3d and not with spritebatch? with 3d you simply go and draw one mesh and do all the transformations for each piece and calculate the light source position for "each" piece, with a deferred spritebatch you can't do that because as I mentioned before is only one mesh of 2048 sprites with different transformations, but there is only one case in which this works, and this is when all the sprites are aligned exactly the same, meaning for example all are rotated 0 degrees, just a plain tileset or like what you see on Legend of Dungeon.

So what now? I can't adjust the light source for the whole list of sprites because simply it is only just one big mesh, but there is a solution for this but it is not nice, I just tested it today and it works. The solution is to actually rotate the light source for each sprite before it is drawn, even if you use spritebatch.begin .... spritebatch.end  you can still change the light source position passed to the shader, but the only way to make this to work is to make the batch sort to immediate, so every sprite is drawn after spritebatch.draw( .... ) so you can adjust the light position for each sprite just before drawing and voila! you have normal maps with rotation rendered at the proper location but I am not sure how slow the end solution will run yet, I just tested with a couple of sprites only, so the next step is to actually try with several hundreds and implement it in Junkcraft Armada.

To improve performance, only the sprites which require normal maps will be drawn using this technique, for any other sprite like bullets I will use the simple spritebatch to run as fast as possible.

I haven't seen any answer to this anywhere else, everyone mentioned how to do it in theory but I couldn't see why it didn't work, or how to implement it without having to code a lot of things at the vertex shader, I wish I could find a better solution with vertex shader implementation , but I really doubt it will work when having deferred sort with up to 2048 sprites in one spritebatch batch, in the meantime this seems to be the only workable solution.

I will post more screenshots during the weekend after I finish the normal maps drawings, I just only have at this moment very rough samples and won't really showcase the new render style of the game., but I am very excited with the preliminary results.

Just a quick sample I made a few minutes ago to test in a single module...

Sunday, September 8, 2013

Painful changes in architecture but great rewards - skin system

Spent nearly 6 hours yesterday on a simple idea. I need a more robust and simple way to implement different looks to the same building blocks in Junkcraft Armada. After a painful search and replace of hardcoded numbers and creating a more robust and flexible system which actually doesn't add much to the gameplay except for the look I am very happy with the results.

A quick screenshot showcasing  the difference can be seen below.

The blue parts are actually the same builing blocks as the white ones where you can attach different modules, but do have a different sprite representation allowing me to design custom looks to each part with different shapes without having to hardcode any part inside the game code. The change allows a very large number of skins and will make the game more enjoyable to play since graphics will jump in quality and will add a lot of variety. Players will start with the basic ones and as your ship progress you will be able to change the way your ship looks and also how it plays, allowing the player to design very interesting ships including ships from other games if they want, all the ships provided in game will be original ships but custom parts will allow players to shape the ship as they like.

Modding in the future may be possible for the Windows version, but for the first release I will only allow the standard pieces delivered with the game, otherwise the release date will be too far in the future and I want to release this game before the year ends.

Saturday, September 7, 2013

Junkcraft Armada update

Things are moving fast and in good shape, take a look at the first sample screen capture of Junkcraft Armada, which started as my summer challenge game that was supposed to end after 2 weeks but already working on it for about 1 month.

This is about a modular spaceship game, build/design your ship while you play, explore, escort or help transport ships, exterminate pirates and use the remaining modules as part of your ship or recycle them for parts for upgrades or repairs with more than 20 different module types, more than 10 different missions and many different environments that affect how you maneuver and survive, black holes, white holes and many other space anomalies , choose the power distribution of your ship between weapons, shields, thrusters, tractor beams, and many other modules.

The game is physics driven so expect things to behave like in space, you just drift in space even if your thrusters are off after initial acceleration, get your thrusters damaged and you will have some challenges flying/turning your ship, module's mass and many other factors affect how your ship fly and how fast it can accelerate with many different weapons like energy weapons, kinetic weapons with limited ammo/missiles/torpedos and you can upgrade any module up to 5 levels, with only one life expect to have a though time trying to get to the end, get your command center killed and you are done.

Most of the texture modules are just placeholders at this moment and this is a pre-alpha screen captudre just to test how it works.

Sunday, September 1, 2013

Summer Challenge end...but not so...

For this summer, I set a challenge to make a game in 2 weeks, at the end of those 2 week I had a running game, "Junkcraft Armada" with around 19 modules enabled, and a single level  with was just kill all the enemies that came to you, I had only 3 kinds of enemies at that time and very simple layout with a very minimalistic UI and no sound at all and no menu, just go to action and kill some time. It was a great experience since I do want to use this to build new games in the future.

So what's next for me? well I had so much fun doing this game, and looking at the state of it at the end of the 2 weeks challenge I don't think I should leave it as it is now, it won't make justice to those 2 weeks of effort. So I decided to extend the time a little bit more, to make it a complete game, it is very fun for me to play it, but it can get boring with just 3 enemies, and no missions and progress, so in the last 2 weeks I enabled different scenarios and a few more enemies, I am thinking to add about 30 enemies to the game and bosses since it is extremelly easy for me to crate one, it takes about 5 minutes for small ships. I wanted to create random enemies by using an AI builder, but even if that tool provides interesting results it will take quite a lot of effort to make just to have some reasonable ship design, so for this version, I will create the enemies and that should bemore than enough, and maybe add the AI builder for a next version for infinite fun and challenge.

What else will I add? different missions, I have 14 types in mind now with different variations and one is finished, add more random events and more environment hazards, plus more upgrades and maybe a few more weapons, I don't want to make a big game with it but more like a rogue like game, adding variety will make it easier and enjoyable to play. So I hope to finish it in the next 2 to 3 weeks so I can return to Elem3ntz! and finish that big game.

Tuesday, August 13, 2013

Little bit late, but here is the first screenshot - Junkcraft Armada - Summer Challenge

It took me more time than I was expecting to finish the basic collision detection system and get the proper modules damaged, instead of spending one day on it spent twice, so I have one day less for other things, but still looks promising.

Here is the first screenshot of  "Junkcraft Armada" game, my 2 weeks summer challenge project in which you design and equip your ship, get junk parts from the enemies you destroy on the way and upgrade/equip your ship with those parts, upgrade your parts with scrap materials or buy/sell parts at the space station. This screenshot has all the major modules for testing but when you start the game you will only have a very small module and limited weapons.

Physics play a great role in this game, so any part you add to your ship will affect how it fly in space, gravity of stars will make it difficult to maneuver around those areas and nebulas and other things may speed down your movement due to space dust and other things. There are still many ideas I want to implement, but first is to make the framework work together.

The graphics of the game at this moment are just simple placeholders, if I find more time I will improve them after the challenge is finished. Last night I implemented a very simple skin system, so I could have more than one skin for the same module, this will allow a nice looking spaceship, players will be able to select different skins to make it look better but functionality will be the same.

Sunday, August 11, 2013

Another day , another challenge resolved

One more day has passed, and another challenge resolved, I spent a day programming the virtual cameras and weapons systems, the rudimentary UI and weapon selection is also working, ammo, missiles and torpedo additional storage modules are working now and firing is working finally. Still need time to implement the use of the energy distribution system which I may not be able to implement due to lack of time, but I will try my best.

Since only one week is left, I am wondering if I will have enough time to develop the ship editor, since at this moment I am creating ships in notepad the editor will be crucial to the final game to add different modules and create different shapes, most probably I will need about 2 days from the next week to implement it. Today's task is to write and finish the collision detection algoritm so finally weapons can do some serious damage!, not sure if I can make a very robust collision detection algorithm between ship to ship.

One idea that I am looking to implement is the ability to just crash your ship against the enemy, let's say is your last enemy and you run out of ammo and your laser guns are destroyed, what else can you do? just crash your ship and self destruct it to kill your last enemy, pretty neat idea, but for that I need to have the ship to ship collision detection working and one more module, the escape pod module, so you and your crew can escape your final destiny and save the day. And of course, you only have one life, you die and is over, I want the player to be very serious while playing this game, have fun and feel the pressure that while playing the game it is like real life, you only have one life so don't do stupid things, at least at the beginning, I may decide to implement a legacy option, so you can store some of the stuff you have in the bank or depot  or something like that for your next play, but I may not too, it all depends on the time left!, but if the game ends up being very fun, I may do a second version later. And I also have the name of the game now, I will post some screens and the name of the game in my next post.

Friday, August 9, 2013

5 days so far and great progress

I've been working on my summer challenge for just around 5 days and made great progress and is so refreshing to switch to a new project for a short period of time. So far the game is going to be a space ship design and management with random battles in space, not sure how much I will be able to put inside the game given that I only have a little bit more than a week to finish the playable version, have the idea to add space stations to explore, gravity areas, nebulas with storms that will affect your systems, all in a random universe. The basic idea to work on your ship is to destroy enemies and capture parts to upgrade/expand your ship, or go to the shop and sell some of useless modules.

So far, I have added 19 different modules including weapons, energy reactor, tractor beams, shields and many others, the graphics are pretty basic at the moment just to be able to test my ideas and if the game works nicely I may spend more time later for a graphic revamp. The most difficult part in the first few days was to actually made the physics engine to work properly, it is made as accurate as possible so when building or upgrading your ship you will have to think about the mass you are adding to it and how it will affect your navigation, trusters are very important to maneuver your ship properly and getting some damage in battle will really affect your propulsion system. Getting enough ammo in your ship's storage will be challenging, so you can't just fire everything you have all the time, energy weapons are the cheapest to use since those will depend on your energy generator. Not quite sure if I will have the time to add the fuel module yet plus many others that I have in mind, at least this version will have the basic 19 or 20 modules at the beginning.

I will post some prototype pictures by the end of the week, hopefully I will be able to make the weapons systems to work by then.

Wednesday, August 7, 2013

The 2 weeks challenge...

I haven't updated the blog and the game that much lately, I've been very busy with other things and I took a small break after many years, now I feel refreshed, so I decided to take a small refreshing challenge to warm up and started a new game, but there is a catch, I will only spend 2 weeks on it and see how it goes.

I will publish by the end of the week the game progress, so far I had many ideas for my next game after finished Elem3ntz! , and I have already decided the game mechanics, but since it may take very long to finish the whole thing I decided a new strategy. The next 2 weeks will be used to build the foundation of the game and release a playable game with it, it will be very simple but it will allow me to test the basic ideas and physics. So far in the last 2 days I've been able to finish the basic physics engine and have it moving! I am pretty excited since I couldn't imagine how to do it until I started coding it and works pretty nice. Stay tuned for some small micro updates by the end of the week.

In the next two weeks I will have to finish a small spaceship game based on physics.

Sunday, July 7, 2013

More characters

In the last few weeks I've been trying to finish as many animations as I could, I ended up with 13 animations per character so far, and each is around 60 FPS as a minimum so I have a lot of work to do, even if I use parts like flash animations, I do a lot more to animate the parts than just rotate a piece or scale, there are a lot of small things going on on the cloths for example that adds an extra touch, also on the faces, sometimes you can feel that is like 3D, but actually everything is just 2D.

Still 2 more characters to finish and 1 needs complete design, after that level design follows and the game will be almost ready, since most of the framework is already done, music is another topic since I am learning now how to write music for the game, if I can't make anything exciting I may end up hiring someone, but I would like to be able to make eveything in this game by myself and see how it goes.

Here are some new sample animations.

This last one took quite a lot of time to get it done since it is all frame by frame drawn and painted, it may looks like a simple painting job, but there are quite many tricks inside for the cloth color change that brings. Like this:

You can see some of the palettes here with the same texture I can get very different looks by using a more planned palette placement.

Thursday, June 13, 2013

More eyecandy - page flip test

I wanted to have a page flipping animation but the effort and time spent on it in my mind was not worth it,  but I really wanted to give more eye candy. So my target was to make it in a day max, doing the texturing and animating in 3d will make sense but would have taken more than a day since I haven't written any code at this moment to import 3d animated skeletons. At the end, I did the page flip animation in 2d with the framework I developed for this game without having to use very complicated stuff, just a few hours matching the textures and animation and then importing everything through the animation pipeline, everything went smoothly in less than a day finished it but there was a small bug I didn't like. So most of the time spent the next day was to to make sure no flicker happen, I couldn't really find the issue for many hours but it happened from time to time, at the end I found that it was a synchronization issue, the game is running freely and with over 300 FPS, but when doing the updates and getting the control input it was not in sync with the animation, so it was switching the textures at different times, sometimes before the page animation started, sometimes after, so the solution was to synchronize the update and the controller input, finally no move quirks on screen.

I am happy with the results. Check the video in my youtube channel.

Saturday, June 8, 2013

Character line up... animation samples

I've been working a lot lately fixing the animation loop, below you will be able to see some of the work done in the past few weeks, more to come soon.

The samples are running at half the animation framerate due to file size, but in game the animation runs at 60 FPS.

It took a little bit of time to get the cape to look as it is now, fluid enough for being just single 2d patch.

Each character is getting better and better with every week of work, as I learn how to better use my own tools. I will show more in-game animations with some play test soon.

Monday, May 27, 2013

Character redesign

Last year, I finished sketching up all the characters and special attacks for the dream build play competition but due to time restrictions I really didn't have the time to think in deep about each of the characters, now that I had more time and the animation framework working I decided that is time to redesign the rest of the characters, as of today there are 4 characters in good shape, and today I will show up the 5th one and the evolution from concept to somehow a finished version.

The first image on the left side is just the very first quick draft of this character, the next one is the clean up version of the line art and that was used for the DBP2012, not quite exciting but didn't have much to draw, animate and program everything given the time I had. This weekend made a new character to replace the old one, I had an idea to use sheeps as part of the special attack, as seen in the middle as a hat, but made me feel sleepy, so changed the hood drawing to a fish type, a little bit more agressive.

The color placeholder can be seen above on the left, and I just designed a few color palettes in the animation editor as seen on the right side, I like the second one a lot. So after finishing coloring this version, all the animations will be drafted by hand and hopefully I will have this character running in game by end of this week. So 3 more characters to go until all the main characters are ready for the final game, plus some more monsters.

Sunday, May 12, 2013

Time flies, past, present and future...looking back what I've done...

It is almost 2 years and 7 months since I started playing with XNA framework, and even if it is no longer supported by Microsoft I am still using it since I can easily migrate it to MonoXNA or do something else with it. The first year I wrote my first game, which is still unfinished but I was able to submit a demo of it to the DBP2011 with little less than a year and a half of experience, and proud of finishing a demo I came to know some of my limitations. So I decided to move ahead and keep the old game for a future release and move forward, so I started a more compact game and this will be released for sure. Today, I wanted to see how it all evolved during the year and a half since I started this new game, I spent most of the last 11 months making an animation framework that could do the things I wanted to do, so far it is working well, and just for fun tonight I will post some metrics.

Animation framework : 5483 lines of code
Elem3ntz game :  19853 lines of code
Shaders : 741 lines of code
Total lines for game + animation framework : 26077

Quite a lot, I didn't expect to have this much, but there is more...

Animation tool  : 29188 lines of code, used to do the nice animations previously shown in other posts.

Wow!, I wrote a total of 55265 lines of code for this game + animation tool, but 35412 lines were written only in the last 11 months!, so most of the work was made in the last year. I didn't expect it to be this big and still there is a lot to write, but I believe now that 90% of the code is already there, that makes me feel happy and I just started to see the light at the end of the tunnel.

All of this doesn't take into account all the art I've made and the new characters, long ago I posted a few pictures of the characters in-game but I really didn't like the art so much, but that was the only thing I could do given the limited time I had, now that I made a new framework things speed up a lot, and I made new art+animations, it really moved faster and faster, I still want to make some drawing tools to increase the speed of sketching but I don't have enough time to do that at this moment. I want to release my game in the next few months.

And one last metric for fun, I have +1700 png image files in this game, and counting, I will add a few hundreds more by the time I finish.

I haven't heard of this kind of metrics in any other game, but I would like to know how big some indie games can be.

In my next post I will show up some of the last changes in the framework, one of the things that I didn't like is to manage the audio manually in game for some animations, trying to sync up frame animations with audio was a little bit time consuming, so finally this weekend wrote an audio module that is linked to the animation framework so I can animate and add sound effects at the same time, this is really a time saver! The interesting thing is that I can use it also to make music, though the intention is not to make music with it!, but I noticed it can be used as a tracker, which is a plus. I may expand those capabilities in the next version after I finish the game, since I don't see a need to write music attached to animations at this stage.

Sunday, May 5, 2013

Bug of the week , funny moments...

I haven't seen any indie blog nor any other kind of blog that publish some of the most interesting bugs while developing , probably is it not so nice to show the mistakes but sometimes I think showing some of them bring some joy and fun while developing.

This time I just want to show some of those funny moments from last night, also as a plus the first bug gave me some new ideas, learning from previous mistakes one can make do better everyday. Like the following image, the garbage on the right is a wrong texture applied to another character, and when I saw that thing moving gave me an idea of a new character , I will keep it as a secret until the final draw is ready but was fun to see.

After replacing and fixing the correct texture I got this...
Well, now it looks better, a group of trolls coming, but hmm... colors and patterns are not good, I was so sleepy that it took me over half an hour to fix the issue, it was only a DXT compression setting and a key color that shouldn't be using, I usually do not compress textures since my animation framework can replace colors and it needs to have precise numbers to change them to do a palette replacement, well spent too much last night fixing trivial bugs, but finally today I got this image.
Finally! it is working as expected! and I got crushed over and over tonight while trying to win the level , those trolls are overpowered now, I am trying to balance the gameplay and have fun mixing the building blocks of the game and it takes time to balance it well, but I am pretty happy to lose over and over now, it is fun! better than the previous puzzle mode.

Saturday, May 4, 2013

Puzzle mode from scratch!

It has been almost a month since my last update, but I've been quite busy thinking and reworking this game. One of the features that I wanted to implement was the puzzle mode, in which the player will have to solve different kind of puzzles using the game tools available, at first I found very interesting idea and quickly implemented about 7 levels of it and that was part of the DBP2012 entry about 6 months ago. Then I tried to implement more levels but I did a trial test again of the old levels to see how much fun I could find on them, and I didn't find it very rewarding at all, after so many months of denial, I finally decided that this can't go live the way it is since there is no fun playing it. It is very hard to implement a challenging mode that is rewarding and fun at the same time, so I decided to redo it again and from scratch.

Now that I had more time to think about it, one thing that is rewarding is to learn how to use the tools, take advantage of those tools, and eventually the player will build more confidence and feel more and more powerful and solving a different kind of puzzles seems to be a better idea. The old system was a quick use of what you have on screen and I felt over powered all the time, I had to try to save/cover/extinguish or any othe action into the opposite board, that was a great idea until I tried it more and more, and I found it very difficult to offer a challenging puzzle since most of the tools I provided were more like "make the other player take damage and cover myself", so basically, not a good way to match and mix game components into one framework, and I found myself not looking at the opposite board at all, so I had hard time trying to play it. So having this framework in my mind, the logical solution is something similar to a tower defence game, in which you are the only barrier to defend all the innocent people behind you, and that way of thinking just made me redo all the puzzle mode. This mode is working a lot better than the previous one, so I can introduce different enemies and abilities that can challenge the player even more than the previous one, is more dynamic and entertaining, and also allows me to introduce boss levels after small quick and run small levels to unlock even more powers! , so giving all the powers at the start was not a good idea, but that allowed me to test all the functionality, and that was also a problem with the last build. I will post a video of the alpha version of the puzzle/challenge mode once I finish a couple of monsters and some other effects, but so far I just made a big leap forward this month.

Saturday, April 6, 2013

Game mechanics and juicy things...

I've spent the last 4 days play testing Elementz game trying to find out the best balance and while having fun, but after a few hours I felt that it was too slow and too tedious in some places, with matches lasting for about 6 minutes or more, i felt it dragged me too much. Also I got confused in many cases with the icons and the response of the game, I wouldn't say it is not fun to play but after playing myself alone it became clear that lot of small changes are needed to make it faster and have a better pace.

So, I had a about a year ago the great idea that a puzzle game of matching 3 is not enough, and that an evolution of the old match 3 puzzle is the next step, so why there isn't any game that allows you to upgrade each of the matching elements? that was the first idea, so Elementz is based on match or upgrade and match, so the gameplay can be more rewarding, but found that just upgrading is not enough, so I forced also the player to only be able to match 3 of the same level, but since the elements non upgraded and upgraded are very similar and the properties are the same it became confusing for me while playing, what to upgrade, how to group, and how to take advantage, this only small change in the match 3 puzzle make it very hard to play. Anyway today I just tweeked it and I am able to use any upgraded and non upgraded together and that helped save a lot of time and avoided confusion so I think a design issue is fixed, the pace got faster too and I felt I was doing more in less time. To illustrate the issue, the picture below shows two groups one inside the red area and another in blue, both are the same elements but how the player can use them vary a lot after this change, either use 3 or use 5, it doesn't looks like a big difference but when playing it makes a lot of difference when you have many different groups at the same time.

Now coming back to match 3 puzzle style, another simple idea is that usually you put 3 elements together and the game rule is that it should vanish or attack or something else, always 3 together or more and that should be the trigger, well the next idea is also simple but changed greatly the pace and gameplay, I just forced the player to choose what should be triggered, so now i can put together like 10 or 20 elements together and trigger all at the same time for greater effect. Sounds like a good idea but this also slowed the gameplay and since you can only trigger what you want to trigger it means that there is one key thing missing, "combos" that are cascaded when other elements get in groups of 3 or more, that is one of the most rewarding things to see but since I am triggering those groups manually there are no more combos to trigger. So for now, the only thing I could do from design perspective is to create a fever mode, which is triggered by the number of elements used by the player, the more elements used the more points awarded to the player and once you reach a certain limit you enter a fever mode and you get some extra benefits for about 30 seconds. But now the question I have is how to make the gameplay more strategic since I could just spam as many elements as possible without having to upgrade, and I noticed that I was playing after this change without upgrading the elements too much or not doing that at all, just spamming attacks one after another. The interesting thing that came from this experience is that even though I was spamming my AI opponent non stop, I lost to it twice, only because the AI decided that upgrade is better than spamming like I did, this was a very rewarding experience, so I think somehow there is some more strategy involved but I was not able to see it since I played this game for so many days without looking at any other thing, but losing to the AI was the most interesting thing that I had today. Just to show up the idea behind this and some animation made with the animation framework, I just posted a video in my channel.

Monday, April 1, 2013

Animation loops the hard way or is there a better way?

One thing that sometimes seems to be tedious is to make an animation to loop seamlessly without jumps, and all animation packages I saw till today do not provide a way to to do this, the reason can be obvious if you are just making straight animations, but when making games an essential component is to loop for example an idle animation and have each channel behave as expected regardless of the starting frame without having to worry about the start or end of the animation loop, anyway it can start at any frame if you are in a loop and it should look as expected.

Since I couldn't find any reasonable tool for that, I ended up doing it to simplify simple looping tasks, like moving legs, arms, etc... in loops , Check a quick test here. Nothing really revolutionary to see here, but it just broke down a tedious task to the minimum, by only having a keyframe at the beginning and one in the middle the framework takes care of compensating and returning back to the loop properly without having to do it myself manually, and one of the key issues I had for many months when trying to animate simple loops was that all loops had to start at frame 0, and put my keys after, with this solution I just end up putting keyframes at any time and the framework will close the loop without me having to adjust it to look proper. This simple logic actually made me save quite a lot of time at the end, each animation has multiple parts moving and I am not showing up at this stage what the vertex animation holds, so trying to loop seamlessly all the keys and look proper was a tedious task, for example, for one of the characters it took me about 10 hours to make it look right, only because the looping started always at frame 0, ended at the end of the animation length and have so many moving parts that it was really hard to make it look convincing. Now it can easily take me half of that just by using a free mode where loops are calculated by the framework and not by my eyes. I am still wondering why there aren't any tools like that in animation packages, probably because the target audience is not games and just movies, or perhaps I haven't search enough.

Wednesday, March 13, 2013

A bug that is so deadly that can kill you...

A short story that I wouldn't want anyone else to live. Yesterday I was creating new animations with the Mystic Framework and found a small bug that I wanted to fix, nothing  important but was related to a UI glitch of the animation editor, so I decided to put some breakpoints and find the culprid class that created that annoying glitch and suddenly Visual Studio showed an error telling me that the source code is not matching the current build, ok I said , I will stop and rebuild so I can continue debugging, soon after it stopped around 2000+ errors popped up on the screen. This doesn't looks good, anyway, I am tired now so the best way is to quit and reload, and probably no errors will show up since I haven't closed VS for the last 3 days, well after loading the application to my surprise surprise! errors were still there, and after trying to figure out what was going on, I noticed that magically nearly 1.5 megabytes of code was gone from many classes, I don't really know how is that possible but many files were affected and the code was gone, nowhere to be found, only being able to see some code that maybe I wrote about a year ago and few pieces of code here and there was there!, I went from very angry to very sad in a second of my life.

Not all is lost, luckily, I made some periodic backups, I used to have a backup utility but it stopped working long ago, but didn't care to find a new one because I wanted to keep coding, so I only did the minimum and keep doing manual backups and zip the files, saddly the most recent back was made about 15 days ago, but not all is lost, keeping a log file in another place with the tasks I made since I started allowed me to find what I did, and restoring the old files plus using some code that I was able to salvage restored maybe 98% of the missing code or even a little bit more, and I only had to spend 2 hours more verifying that the code worked with minimum patching since the code was quite fresh in my mind I could easily fix it.

Now, I am a little bit worried that this may happen again, about 4 to 5 months ago something similar happened but was not serious just a few lines of code was lost, but this time it was almost everything I worked on the in the past 6 months or maybe more, so my weekend task is going to be "find a good backup utility", I haven't been able to find yet an "incremental" backup tool with zip capabilities so I don't get my hd full of backups, I saw a few ones here and there but most of those tools just synchronize files without compression, and without scheduler, I don't need a 5 minute backup tool, just once a day is more than enough so I can backup different folders and compress the new output, if none are available , something I doubt, I may have to write one but I don't want to spend time on it since I prefer to keep doing testing and fixing some other bugs in game as well as adding more gameplay features.

The bug in VS happened on all the form files I was using, I have one main form but its code is divided into several files for readability, so at some point of time VS may have gotten confused and broke in pieces and taking my code with it. Hope this thing doesn't happen to anyone else in the future.

Wednesday, February 13, 2013

Killing bugs!

I've been having small pixel errors in the shader while converting colors, and this piece of code fixed it finally, took me a few weeks to find this bug, still not quite sure why my values went over the limits but the commented code didn't do it before.

h += 360 * (-floor(h / 360.0));    // convert to absolute 0 to 360 degrees
//if( h < 0 ) {
//    h += 360;
//if (h > 360) {
//    h -= 360;   

pretty happy that I was able to find the issue and fix it in 10 minutes while testing the shader editor, I didn't see that bug until I used the real time capabilities to get instant feedback, trying to do the same in Visual Studio and XNA directly in HLSL is very complicated since I am not an expert in shaders yet and takes forever to see something on-screen.

Updated development video - shader and palettes editor

Finally I was able to make some time and published a brief short video showing up the shader editor I made during the last weekend to help me fix more shader coding bugs that I had for a few months and was taking a lot of time to debug. Also the color palette manipulation in the framework, color palettes is something that is not available with modern hardware but necessary for 2d games, so this is just an example of a color palette manipulation and how to take advantage of it to reduce the memory footprint by reusing textures and by changing a few paremeters you can change how your character looks in-game. The shading layer can also be manipulated while in game to adjust the shade strenght and I am thinking if I should enable shading coloring at this stage.

Now with the shading layer working and most of the framework working, it is time to redo all the animations of the game using this new platform!

Monday, February 11, 2013

Shaders! let's break the cycle

Shaders do make things come to life in the 3d and 2d, but it is quite challenging to have a Jack of all trades do it all platform that can help write good shaders since shaders are usually tied to game engines. I tried Nvidea and AMD solutions plus a few others without much luck.
So the cycle continues, I've been trying to improve and fix my shader for the past month, and still I haven't been able to properly finish it, it works but the quality I am looking for is still not there, it takes quite a lot of time to write a good pixel shader, especially when it takes some time to think and write code without knowing fully the syntax, try to compile it and get some syntax/coding errors, fix them and then again compile the shader, then compile the game editor or game viewer to test the result, if it doesn't works I have to go back and modify the shader, every single test takes from 3 to 5 minutes with a few more minutes of waiting for the compiler to finish plus review the outputs so it takes around 10 minutes for each test. I think I wasted too much time waiting, so what do you do when you can't find something that you need? well... I usually do something for myselft when something like that happens, and I wrote one for myself, and spent this weekend doing it, just a day and a half and I just made a realtime shader editor/compiler so no more wait! no more trying to find a tool that can handle my needs of mixing textures and many other things that I was looking for, now the sky is the limit! and here I go!.

I will post some videos of the real time shader editor with the new code for palette color handling soon! I am quite excited by the results of this week and looking forward to fix the last ones at the shader level.

Saturday, February 2, 2013

Speed! Speed! I need to be faster...

This was a very difficult week, I was able to finally integrate and run the Mystic framework in XBOX360, finally!, and I was expecting to spend most of this week trying to improve performance of the framework, but after so many tries, it seems that XBOX doesn't have enough horse power to deliver all real time calculations I have in the framework as fast as I was expecting, sometimes I had constant framerates and sometimes from no where dropped quite a lot even in Windows.

I got stuck for about 2 days just optimizing the code as fast as I could and still enjoying the real-time calculations, but finally found a road block and couldn't find a way to improve it more, so now step 2 is to start caching values and make sure that the animations run perfectly. Luckily, I came up with many last minute optimizations and a few more are still in my mind, but I am getting now solid 60 FPS in-game even in XBOX, and this is without using multi-threading in the animation modules, when I added the multi-threading support I started getting even lower framerates from time to time, due to the local variables created per thread, so sometimes caching and re-using the same variables can really help improve the speed of the calculations but makes it impossible for some threaded blocks of code, specially for vertex calculations since I am not using the GPU at this moment for that due to the physics calculations per vertex. I will publish a video of the framework running in-game pretty soon, and it is working very nicely.

Just a quick screnshot, the character in the middle is being rendered using the Mystic Framework, the others using the old skeleton model, I will post a video of the small details achieved with the Mystic Framework animation tool.

Still need to investigate why in XBOX the color replacement technique is not working in the same way as in Windows, but in this case the color of the character in the middle was dynamically changed to green/blue for testing.

Thursday, January 31, 2013

Sometimes code is so secure that I can't even access my own code...

Being trapped with security issues in the .Net framework got me stuck with no simple solution for quite many days, while trying to test the animation framework on XBOX 360 I got quite many warnings and many show stoppers, one that I couldn't figure out for almost 3 days was the confusing security implemented for classes in .Net, I know for some tools security is a must, but for a game I don't think a high level of security is needed, anyway, the content deserializer was able to properly decode all the animation and play it flawlessly in Windows but it didn't run on XBOX since I couldn't setup the same security level directly in the assembly code, so it was just telling me that the security methods that I was trying to setup didn't exists in XBOX so I couldn't set it at all, after many days of frustration found that by simple adding into each dll the following:

using System.Security;              // <-- this adds security
[assembly: SecurityTransparent]  

will clear up the dll requirements needed to be able to use reflection and call List<List<T>>
This is not rocket science nor something close to anything revolutionary, but I needed this to keep the framework simple and run it fast, finally, I was able to compile with the directives and the framework finally started to work in XBOX which really excited me. Saddly I am stuck now in another issue with the shader code which I hope to solve soon and be able to test the whole solution together. If this fits as expected I will post a video with the very smooth animations achieved with the Mystic Framework, it is not a revolutionary 3d framework since there are many, maybe hundreds or more made by tens or hundreds of people, so there is no way for a single person to compete against that, probably most people think that 3d is the future and that's where everyone is going, but I feel that there is a lot to gain also in the 2d arena using 3d technology, so I hope to make a niche new market with this solution. Rayman Origins by Ubisoft did a great step towards this direction, so I hope to achieve the same level at the Indie level, if not, well at least I tried.

Monday, January 21, 2013

The color palette of the 21st century...

Not so many years ago, previous hardware used color paletter to display colors and it was relatively easy to swap colors and create animations like rainbows, well with technology evolution it came as a thing of the past and today it is quite cumbersome and complicated to replicate the same effect, even color replacements can be quite difficult to achieve as in old generation hardware. I spent a week thinking how to achieve the same and searched everywhere for a good implementation that will have the less impact as possible, well as a matter of fact I couldn't find any code but just a bunch of ideas. Even something as simple as creating blending effects became a nightmare in a matter of days, like linear burn A+B-1 blending, can be quite complicated to achieve in modern hardware and I am still unable to perform this in a way that memory, bandwidth and speed are not compromised, since the framework has to be very fast I came up with some solutions in my mind and will post some videos soon. Sometimes I think I just only need one command to do whatever I want, but that command doesn't exists in the pipeline, or is available in the next generation hardware.

So far color replacement is working, but I haven't tested it yet in XBOX in game, for only one color, adding more colors shouldn't be that difficult but there are quite many restrictions with the technology available in XNA and pixel shaders v2 with XBOX, like the number of parameters that can be passed through the shader, so using an image to remap color palette seems to be better solutions but doing it in RGB color space seems to be pretty bad if you are using different shades of the same color, so HSV comes to the rescue, but the number of operations performed to convert each pixel to HSV can be quite taxing to the GPU of the XBOX, so hopefully I can squeeze as much juice as possible from the GPU and implement a color palette, stay tunned.

Monday, January 7, 2013

Sometimes going back to traditional animation gives better and juicy results

Finally, last weekend I found myself with lot of things to animate, now that the framework is almost ready and mostly working except for the audio module that is only half implemented. I decided to re-take again the juicy part, which is to make the eye candy and character movement so I can test if the framework works as expected.

A week ago, when talking about juicy things that make your game looks better I found Juice it or lose it video, and how to make simple things look better by adding small animations, or small things that give more feedback to the player and make the game experience a experience of the 21st century based on 20th century technology. So I decided to animate the Cat's character tail that was a static 2d sprite with springs simulation to wave it but it didn't look nice enough for me, so I tried different 3d and 2d techniques without much success, I couldn't make it look good enough given the time I wanted to spend on it, so doing it in 3d requires a lot of work modeling and animating all the vertices the way I wanted, and 2d polygons do not deform very well with a shape like a tail, so after a few tries I decided to go back to the traditional frame by frame animation, and make about a dozen frames like the picture below.

You can check the progress in this video from a very rought sketch to a clean final animation.

I am still wondering if I can make a 2d patch deformed polygon that can show 2d textures with appropiate deformation and corrected perspective in 2d, but so far I haven't been able to find a good way to do it without having to invest a lot of time and effort, given that, 2d traditional animation seems to be the right path in this case.