Monday, June 2, 2014

How to set up a vector for a projectile to move along

This isn't that hard, I just felt like writing a blog on the subject.

You are going to need several things.

You need the point you are firing at, they point you are firing from, and trig.


Pseudo code written in java.  


I'm using this code to calculate the trajectory that my lasers need to take on my ship on a case by case basis.
This allows all the bullets to converge into one point in space.

Leave a comment if you have any questions.

Friday, May 30, 2014

New update

This week I've primarily worked on making it easy to build custom ships. In the future I'll make the ship building process more rigorous. Here's the YouTube video.



I muted my mic so there is no sound. Tough luck for you guys wanting to hear my wonderful voice.


Here is the download: No guarantees on how stable the game is. It'll prolly crash.

Game Download


Tuesday, May 27, 2014

Can't Sleep So You Guys Get an Update

A big new feature that I'm adding to this game will be the ability, or requirement, for you to build your own ships.  I'm in the process of making a ship builder.  Here are some screen shots of my progress.
I'll add more ship parts once I get the ship moving around the map.  It shouldn't be too hard.





You'll be able to make the ship as big or small as you want so long you have the parts!
I'm gonna have to figure out how to render these mofo's though... Gonna be a pain when I try to rotate the ship.

EDIT: figured it out. You have 2 for loops.   each going the length of the of the array that holds the individual blocks.  That part wasn't hard.  The hard part was figuring out the offsets.






Saturday, May 17, 2014

RayCasting



I've been pretty busy this week with family over for my brother's high school graduation and haven't had a chance to upload many videos or work on my game.

I'm running into a problem with my game and collision detection.

From what I've I can tell is there are a few main ways of detecting collisions.  Up until this point I've been using discrete stepping.  Move objects from group A  at a certain speed along a certain vector.  Then check to see if objects from group A overlap objects from group B.

This is fine Unless the bullet moves more than the object's width in 1 frame.

The problem is with the second case. This happens frequently with projectiles in games eg: bullets In FPS games, or in any game with fast moving projectiles in that case.

Another way to to is to look at two trajectories and see if the objects would ever intersect,  Basically fire, calculate if they are going to hit, wait a certain time then proc a hit. This method is very processor efficient because the only thing you need to keep track of is a timer (if they are going to hit), but it does not account for objects that change their trajectory.

The final method I've found is raycasting.

"This uses linear algebra to determine whether a line representing body A's trajectory is intersected by another line representing the boundary of some other solid body B. "

http://gamedev.stackexchange.com/questions/22765/how-do-i-check-collision-when-firing-bullet

I need to use some modified form of raycasting to determine if the objects intersect.  Instead of ray's I need to use spheres,  although I may be able to get away with using a ray for the bullet instead of a sphere.

http://www.realtimerendering.com/intersections.html

Gotta read that site up.

I'll post a video next week when I have more work done.   Wish I paid more attention in calculus,  lol fml. Bet you didn't think video games were so hard to make.

Guess it's a good thing the courses didn't transfer..


Friday, May 9, 2014

Precisely

I ran into some problems with losing precision on my floats. Float is a data type for numbers.

When you deal with really large numbers using floats it gets converted to scientific notation.  so you end up losing some precision.  The top numbers are correct, but the lower numbers are wrong, or simply not accounted for. This has given me some trouble with the math I am using to move entities that are far away from the (0,0) point.  To counter this I'm going to use separate coordinate system for each area that the ship enters.





My goal is to turn this game into a massive exploration, rpg, rts.  You'll have to protect your home planet from ever increasing threats which will culminate in some sort of boss battle.  You'll collect upgrades along the way for your ship and home planet.  Once your system is safe you'll venture out to other systems to defeat the civ that started the attack on your planet in the 1st place.   Or something like that.  I'll hash out a better story once I get the game engine working better.

I'd like to add pvp and pve multiplayer, that be fun.

I still need a name for this game if anyone has any suggestions. (You'll get your name in credits as well as .001% of profit from this game.)

Monday, May 5, 2014

LMAO

For a while I thought i was doing my coding wrong, then i looked at the numbers and relied i wasn't.  The universe is bigger than i can honestly comprehend.  It's baffling to find out how much empty space there is in the solar system.

Look at this post

I'm planning on doing a scale system of the solar system for the game.  I'll just have to scale the distance between planets back by a lot.

I scaled it back by 20 and that helped significantly, but damn the solar system is so large,   I'm going to run into rounding errors working on this game.  I'm going to have to figure out a way to handle it.

I'll have a semi working solar model by this Friday for you guys to play with.

I have my finals in a few hours,  then I'm done with school for this summer,  I'll look for a summer job, but I honestly hope I don't find one so I can devote all my time to this game and to Minecraft plugins,  I'll be able to make some money off of that once we get rolling.

Thanks for your support.


Friday, May 2, 2014

Version 2

Java game Version two.

Change-log:
Ship controls
Victory condition: survive for 60 seconds.
defeat conditions: hit comet or let 20 comets hit earth.
various internal code clean up.

Game Preview


Download Link:


This game might turn into a RPG RTS.