Archive for January, 2013
An Unexpected problem
I want to start off by apologizing about missing my post on Monday, I missed work because I wasn’t feeling well, and it completely slipped my mind.
Anyway in the last week I ran into an interesting problem that I didn’t actually expect to run into. The problem is: “Rotating towards an entity along a single axis”.
I did a bunch of variations of math using quaternions and suggestions from the forums and none of them seemed to truly work the way I wanted. So I deleted all my code and came up with a method using Quaternion.LookRotation along with using the Dot Prodcut to find the pitch. I’m sure there are better ways to do this, but not knowing all the ins and outs of Vicious this is the best one I could find. What I really wanted to do is to project the vector to the target onto the forward vector and then perform a dot product between the two normalized vectors, first determining if the object is in front or behind the turret. If in front I would know the change in that angle, if behind I could very easily begin rotating to resolve the angle. For some reason though, when assigning the euler angles with this math ( which I was 99% sure was correct ) the turret would spin uncontrollably. I consider myself very good at vector mathematics, but still very new understanding how this would all work in Unity. I also read a suggestion about using LookAt and then zeroing the unneeded angle rotations, but this resulted in even more sporadic behavior.
What I have since figured out is that the forward vector of the turret actually was rotating with the child node I was changing the rotation on. What this was causing is the constant spinning. I think I could of made my initial math work great if I just used the world forward instead of the mesh forward. So my math before was correct just missing one very small piece of the puzzle. The assumption I had made was that the forward vector of the parent of the node would remain stationary, but in fact this wasn’t the case, so my 99% of certainty was indeed wrong. Without serious testing its hard to figure out the exact cause for the change in rotation of the forward vector of the parent, was it an animation, was it the child effecting, could it of been something with the way it was exported, or the way the hierarchy was set up, or maybe it was just an error in my code.
Needless to say I wasted quite a few hours doing what I thought to be a trivial task, and here is the code that I ended up with.
Vector3 toTarget = newTarget.transform.position – transform.position;
Quaternion quat = Quaternion.LookRotation( toTarget,Vector3.up );
Vector3 eulerFinal = new Vector3( transform.eulerAngles.x, quat.eulerAngles.y + 90.0f, transform.eulerAngles.z );
transform.eulerAngles = eulerFinal;
Transform tilt = transform.Find( “D_TurretPivot” );
eulerFinal = new Vector3( tilt.eulerAngles.x, tilt.eulerAngles.y, ( Mathf.Rad2Deg * Mathf.Acos( Vector3.Dot ( toTarget, Vector3.up ) ) ) – 90.0f );
tilt.eulerAngles = eulerFinal;
Debug.Log( eulerFinal );
Thanks for reading, and until next time.
Gatecrash has been fully spoiled, and the release is quickly approaching. I am a huge fan of Magic the Gathering along with many other card games. I’m going to start by going over the cards i’m the most excited about. These don’t include rare or mythic rare cards, but instead commons and uncommons that I believe will have an impact in limited, and potentially standard as well.
[mtg_card]Syndic of Tithes[/mtg_card]
I feel in this set grisly bears are going to be very mediocre, but in an aggressive deck like the ones I like to play in draft, I think this card is really going to shine. I imagine getting in a single attack with this guy and then just pinging my opponent non stop throughout the rest of the game. I feel extort in draft is going to be extremely strong if played correctly. I’m excited to try out my theory on this card, as I really don’t see many other strong white cards in this set at common or uncommon, I believe this one will picked a bit higher just because of the limited options white has.
To be honest this card could be a complete bust, but the idea of a 0/1 flyer on turn 1 consistently growing to be a 5/6 dragon really excites me. The real issue I see is drawing this card with an empty hand, honestly this card needs to be played in a certain type of deck, and actually works better if there was some sort of looting ability to pitch it later on. I actually could see Evolve being a complete bust in draft, or being a total knockout depending depending on how the draft meta game ends up.
Honestly this is a really easy pick for limited, its removal that scales, it won’t always be cheap, but this card will be picked extremely high in draft where removal matters. In standard this card will have no effect at all, in fact removal has gotten increasingly worse lately, but there are still better options than this at the moment.
Red is very aggressive in this set, and I believe bloodrush is going to have a huge impact not only in limited but also in standard. This guy is an efficient beater early game that doubles as a combat trick later on. Playing around bloodrush is going to become exceedingly difficult.
Again Evolve may end up being a complete bust, but this card has some real potential, The regenerate ability alone is the reason this card is my pick for green. Once this guy becomes big enough to start trading, you’ll then be able to keep him alive only to grow again and cause some more havok.
Multicolor cards are the next ones i’ll go over, stay tuned, and let me know what you think about my picks.
I want to go over a few of the systems that I’ve been working on for Adventure Amazon.
State Machine System
I am a huge fan of state machines, in my opinion they simplify development, speed up debugging, and force cleaner code. I want to build a state machine system in Unity that is user friendly and powerful at the same time. I’ve started exploring the ability to create editor windows. Here is a quick prototype that I put together.
The idea here is to create a system that allows the user to graphically design their state machine full while even allowing state hierarchy’s ( 1 state deriving from another ). This is pretty ambitious undertaking for this project, but since I’ve proven that the editor tools support this addition, I have started working on the actual system behind the scenes now. Feedback is always appreciated, but right now the plan is to have an empty text window open that displays the current code, or can be modified so the user doesn’t have to dig through code to find the generated stubs. Another idea is to make each state an individual class instance, but to be honest I don’t feel that is the best way since we need data to be shared between states. Although with that implementation it would allow each state to have their own data, that is instanced to the state instead of the entity. (more…)
AirMech is game that I stumbled upon because Amazon was running a special where any digital download purchase of video games got you a free 9.99 bundle for AirMech. I honestly didn’t even know the promotion existed until I saw it in my email. So I jumped on and downloaded it, later again on Steam, since I prefer just keeping all my games there. Anyway the game is fantastic, I’ve been playing it for the last few days, and have already powered through to Level 11.
You play a mech unit that flys and can transform into a giant mech warrior to jump into the ground battle. You select a load out of turrets, units, bombs, and misc other things before going into battle. Some items are only purchasable after reaching a certain level in the game. The game levels up similar to League of Legends, where you have an overall level outside the game, and in each game you start at level 1, and continually level up your mech and unlock items from your load out to now make at your outposts. Units are built and picked up by your mech at any of your owned bases. You can give units orders or just drop them off into a battle and they will start attacking immediately. Start off by playing solo against the computer, as its the easiest way to understand to get the feel for everything.
The thing that really impresses me in this game is the amount of depth it offers. In fact I’ve enjoyed it so much that I dropped $10 for a package deal they were offering so I could unlock some of the items a bit faster. Anyway I highly suggest everyone tries this game out. The game is still in beta, and appears to be constantly updated with new items and cosmetic treats. This is the perfect mix of MOBA and Starcraft 2, and I really want to see this games community grow.
Also you can check me out streaming this game from time to time. http://www.twitch.tv/maddogawl
Technical Design Document
Please Note this is not a complete document, and will constantly be a work in progress, but I hope it helps give you an idea about what we are setting out to accomplish.
Adventure Amazon offers a unique mix of tower defense and real time decision making, with the player protecting their ship while trying to escape the dangers of the amazon. The player will be able to upgrade every aspect in the game, including the number of equipped weapons, the abilities and stats of the weapons, and the ship itself.
General Development Guidelines
- Use Prefabs for any object that will be spawned or duplicated more than once.
- Comment each function, so its easy for anyone to jump and understand the code.
- Keep the TDD and GDD up to date
- Member variables names will start with a capital letter and each additional word in the name will begin with a capital letter.
- Local variables will begin with a lowercase name, and each additional word will begin with a capital letter.
- Function names will begin with a capital letter.
- All code will be written with C#.
- Class names will begin with a capital letter and each new word will begin with a capital letter. (more…)
Starcraft 2 Heart of the Swarm is quickly approaching release so I want to take some time and preview the differences I’ve noticed after playing a lot of the Beta. Please note this is a beta so things I write about may no longer be valid in the build your playing or the final shipped version.
My Starcraft 2 History
I have played Starcraft 2 WOL since release mainly as Terran. I do have an account for each race though. I have roughly 4000 games of 1v1 played in Wings of Liberty. I have reached Masters 2 seasons as Terran, while Diamond is my highest ranking for Protoss and Zerg.
I have had the HOTS beta for a little over a month now and have roughly 100 games played so far. I have played as all 3 races, although I am still more skilled with Terran.
I know the one thing everyone wants to hear about is the new units. I have played with and against all the new units so I’ll start going through one by one.
Initially I was really excited about the idea of the battle hellion, but I feel like it fails to accomplish what it was set out to do which is make mech viable again. The battle hellion is a great at absorbing damage and the fact that it can be healed by medivacs is insane, but sticking it into a ball of bio just doesn’t work as I was hoping. (more…)
Over the last month I have been working on learning the basics of CUDA, and I have come to realize the methodology in using CUDA is most likely the future of how development will be done. As processors scale not by speed but by number of cores, it is only going to make sense to use the same ideas when working on the CPU. Granted CUDA only works on NVIDIA Cuda enabled devices but the work that has been done to support very simple parallel processing across the GPU is phenomenal. I have attempted to utilize CUDA to solve some of the http://projecteuler.net/ problems, but I still find the biggest bottleneck is in the size of values that are supported in 32 and 64 bit float and integers. I have a custom integer class that supports infinitely large values, but I don’t have anything for floats yet. Truly when working on those problems its best to stick with the algorithm design and use a language that supports infinitely large numbers such as python.
A few things that I am really thinking about is how to design and architect a cpu api or engine that supports what CUDA does on the GPU but rather on the CPU. There are already some paradigm’s that work in tasks, where every action is a task, and some tasks have dependencies which force the order of tasks, but truly I believe there is more room to improve. I think we need to step back and rethink how programming is done. We have been so ingrained in to object oriented programming that the thought of doing something different seems illogical. I believe we need to start thinking about the data first which I have been hearing talks about over the last few years. Think about it this way, the code we develop is just a small fraction of the memory in a large scale application, while a huge percentage is the data we are processing ( textures, audio, meshes, etc). When we work in objects we aren’t truly utilizing the cache or optimizations that the CPU can make for us.
I want to make a new prediction that in 10 years game development as we know it will be completely different. Data Oriented programming is the future, and Object Oriented will start to teeter out.