Post news Report RSS Black of Space, Update June 1 2010

Let me tell you about my trials and tribulations. I decide to switch back to Windows Vista for some games I haven't played in a while (that and the newest EVE release is not so how with wine, framerate issues). So, I start my game and.....

Posted by on

Introduction
Let me tell you about my trials and tribulations. I decide to switch back to Windows Vista for some games I haven't played in a while (that and the newest EVE release is not so how with wine, framerate issues). So, I start my game and.....

Cannot find any units....I had accidentally deleted the units folder! So, I recreated the units...Mysteriously I cannot build any units. I had to fix that, the windows file system (The : in C:\) was throwing off my code. Next, I had to fix the fact that a \ is a "literal" and had to find a way to replace every \ with a /.

Anyhow, I then was able to make some real progress.

Rotation
It's here folks: Unit Rotation! Now when you give them a destination, they rotate to face it and then thrust for it. This provides a delay, for example in combat, when units cannot immediately escape. Also, it just looks awesome.


This was not easy to implement. I used a formula to calculate a theta (the angle change) between the NPC and its destination, it goes something like this:

Theta = 1/(distanceY/distanceX)*100.

That formula has a minor drawback. Extremely long horizontal paths negate it, giving angles greater than 360 degrees. So, I simply made it so if a relatively horizontal path was detected it rotated totally horizontal. Solved.

One funny thing was that to get it to rotate, I had to totally rewrite a lot of my graphics rendering and creation code, but it was worth it.

Group Orders
Ever wanted to select all units of a type? In most RTS games, this task comes up frequently. So, I have implemented a group select using Ctrl-Click. It's very straight forward. It allows you to give orders to all the units of a certain type.


Plans
With rotation and group select implemented, the path has been paved to creating fitting code. The reason these were needed is that you don't want to manually fit every frigate, you want to be able to fit all of a certain type as well.

Contact
Questions? Comments? Feel free to contact me via ModDB.com or via masternerdguy@yahoo.com .

Post comment Comments
dirtbag007
dirtbag007 - - 521 comments

nice :)

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: