Whew! Formations

5 hours of straight, hard working programming, and the fundamentals of the Formation system are in game.  The player can now choose what formation their soldiers will deploy in.  The soldiers will be in that RELATIVE formation, but they still might be a bit off depending on their intelligence, experience, skill in drill and ceremonies…

It adds an interesting twist to the pre-combat strategy, as well as psychology and the various skills.  Although I still need to implement choosing which EXACT soldier goes into which exact slot.  Always more to do…

Welcome, meet the Ghost…

Having somewhat implemented the majority of basic combat (Made rockets fire the correct way regardless of facing, rockets now point towards the target during flight, smaller explosion for rockets, future expansion for grenade blast sizes, etc), I decided to take a break and implement one of the non-standard enemies. Today’s enemy, as has been hinted at before:  the Ghost.


More nimble, aggressive, and better trained than your average enemy trooper, Ghosts are also never seen without their scout rifle.  Ghosts are faster moving and tougher than a normal trooper, the elite shadow arm of the enemy army.  Although never seen in large groups, a single Ghost is enough to turn the tide of a closely fought battle.  Allied troops are recommended to avoid Ghosts until they’ve gained enough experience or have numbers on their side.  More intelligence will be forwarded as it becomes available.


Burnt out

Whew!  Was working on a couple stubborn bugs which gave me new insight into Unity…

Can’t even remember exactly what else I did today.

I think I implemented flipping sprites when they’re headed different directions.

But also implemented Heavy weapons, which means rocket launchers right now.  Rockets have to be specially modified so they’re effective against tanks and power armor.

Basically, if a rocket hits tank or power armor, there’s no explosion, but it does massive damage.

Sounds simple, but having it detect if it “hit”, then aborting the standard explosion if it did, but continuing if it didn’t was a bit tough.

Then there was an error with weapon swapping code.  I’ll spare you the details, but it came down to the debugger behaving differently if you watched it than if you didn’t.

A lot of progress today though.

Another day, another dollar…

Status update:

Implemented the dual weapon system with some minor AI.  Enemies will only carry 1 weapon (Except maybe later grenades + weapon), and have unlimited ammo.  Players will now use whichever weapon has range, and then if the enemy comes closer switch to the shorter range weapon.  If the player has grenades and the enemy steps within range, the player will automatically arm grenades.

Heavy weapons and grenades have limited ammo: if the player runs out they will swap to another weapon.  If that other weapon was also a grenade/heavy, they will swap to a default pistol.  (Which was a pain, creating stats for a weapon that the player doesn’t “have”, so they can’t sell it for a weird, endless cash bug…)

Working with my talented artist, all weapons now have a reload animation, and those were edited and hooked up.  Reloading takes as long as the animation, plus the cool down of the weapon.  They look brilliant, by the way. :)

Besides having retarded AI, combat is pretty much done, in its basic form.  Time to move to formations, research, base management, story telling elements, leveling, interface, polishing and balancing…..


Producer, Director, Programmer, Manager

Short update:  Reviewed and gave further direction to my music and art teams.  (ie, the music guy and the art guy.)

Working with some very skilled individuals, and just finished negotiations with the sound guy.  Will provide some examples later when it gets further along, but very excited.

My art guy is working non-stop, as he’s leaving for vacation soon and I want him to do as much as he could so I can continue my work.  But here’s an example of what he cooked up yesterday:

Ghost walking

It’s a joy working with him.  Today has been an admin day.


Alrighty, short overview of today:

Finished grenade arc.

Implemented grenade explosion damage.

Doesn’t seem like much, but doing the grenade damage was difficult.  Given the entire system is mocked up for 1 on 1 shooting, basically the grenade does a sweep of all the people in range and shoots at them.  Even worse, I had programmed it so that distance checks were only calculated between soldiers, so I had to create a phantom soldier per grenade blast…

Long story short, grenades now work!  Up next?  Bazookas if I’m ambitious, a bit of a break if I’m not…


The Life of a Programmer/Designer

Alright.  So I got a bunch done today.

I added Bazooka shooting animations, added enemy machine gun animations, updated this website, created a combat scene, cut apart the explosion animations, created a new animation library for explosions, created a new sprite library for explosions, rockets, grenades, then I programmed the grenade object, the explosion object, the code to throw a grenade…

It’s been a long day.

But what got me caught up for an hour or two was getting the fake 3D, 2D grenade parabola correct.

It started out simple.  2 second throw, so take the start, take the end, divide by two, use that speed as the translation.  Great if you want to throw the grenade at the enemy like a fast ball.

Now, add a gravity like parabola?  On TOP of that linear motion, because in 2.5D that 2 dimensional move is just supposed to be the X…?

Well, I added a sine curve on top of the position each frame, but then that made the grenade just fly off into space.  Ah, adding every frame is taking the integral of the sine curve, which of course keeps growing.  So we need to add the difference.  But oh, hey, just in case it wasn’t confusing enough, the standard sin function is in radians, so make sure you remember your degrees to radians conversions.  And then remember you want the sine to divide by two because of the 2 second flight time.  And don’t forget that you want this to be frame dependent speed, so make sure to play with Time.deltaTime…  Anyways, at one point the line of code was like this:

transform.position.y += (Time.deltaTime * 10 * Mathf.Sin((Time.time – throwStartTime)/2)*Mathf.PI) – (Time.deltaTime * 10 * Mathf.Sin((Time.time – throwStartTime + Time.deltaTime)/2)*Mathf.PI);

See what I did there?  I hope not.  If so, please go make your own game.  Or work for me cheap.

Anyways, finally got it working after beating my (admittedly non-engineery) head against a wall for a while.  Here’s final code:

var arc : float;

//Flat travel variables

transform.position.x += Time.deltaTime * xspeed;

transform.position.y += Time.deltaTime * yspeed;

//Parabolic arc for Y

arc = 5*Mathf.Sin((Time.time – throwStartTime)/2*Mathf.PI) – prevYHeight;

transform.position.y += arc;

prevYHeight = 5*Mathf.Sin((Time.time – throwStartTime)/2*Mathf.PI);

Admittedly, after two seconds the grenades curve up amusingly, as per the sine curved, but I’ll handle that in a bit…

Hello world!

Ah, Hello World.  The classic programming introduction.

Anyways, thus begins the website of War Heroes, the greatest game to come to iOS!  Ever!  Forever!…

Or, at least here begins what information I can get to you about the game as I attempt to program, manage art, UI, etc, etc, etc…

May there be mercy on my soul. -.-