Jump to content
• Advertisement

# eedok

Member

3299

982 Good

• Rank
GDNet+

## Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

1. ## Figuring out where a projectile will go

Haven't gotten to go through the answers yet, but to be clear there's only ever 1 gravity source per scene. I like the idea of using iterators and will probably try that approach over the weekend and see how it performs
2. ## Figuring out where a projectile will go

I have an old school space game during a game jam and want to turn it into a full game, only issue I'm having is making an AI that can A) Hit things accurately and B) realize when projectiles are coming towards them and avoid them. What makes it difficult is the projectiles have wonky paths because they're affected by a crude approximation of gravity:   Now how the projectiles move is the star in this picture has a component called Gravity Source on it, and it supplies the force calculations: using UnityEngine; using System.Collections;   public class GravitySource : MonoBehaviour {     public Vector3 ForceAtPoint(Vector3 xyz)     {         var newForce = transform.position - xyz;           if (newForce.sqrMagnitude > 0.0f)         {             newForce = (newForce / newForce.sqrMagnitude) * 5000.0f;         }           return newForce;     } } and the missiles & player have a Gravity Receiver, the missiles having a 10x multiplier and players 1x using UnityEngine; using System.Collections;   public class GravityReciever : MonoBehaviour {     public float gravityMultiplier = 1.0f;     public GravitySource gravitySource;     Rigidbody rb;       void Start()     {         rb = GetComponent<Rigidbody>();     }   void FixedUpdate () {         rb.AddForce(gravitySource.ForceAtPoint(transform.position) * Time.fixedDeltaTime * gravityMultiplier, ForceMode.Acceleration);     } } Now my question is, how do I calculate where a projectile is going so I can have my AI make decent shots as well as dodging incoming fire?        https://dl.dropboxusercontent.com/u/168938/Games/Space%20Melee/OrbitProjectileExample.zip (a copy of the physics code with all the assets removed to play around with/make examples)
3. ## How we solved the infamous sliding bug

you should try it out, it's a really good game: http://www.awesomenauts.com/   on the other hand: Maybe you shouldn't :p
4. ## eedok

Not a fan of dodging Ping Pong paddles at work, never had to do any of the sort with Smash Bros

6. ## eedok

I wonder how much #CS55rocks will improve #CS5rocks any why rocks instead of stones?
7. ## eedok

I don't get the people that don't love #aprilfools I've only seen what Blizzard and Thinkgeek have done and I think it's awesome
8. ## eedok

Apple keeps making policies that fark people over, and it's well known. Why again do people buy Apple products?
9. ## eedok

hopes that 800lbs of Stars doesn't cause any hesitation for @jonesry28's getting in front of the net
10. ## eedok

Bieber post puberty doesn't exist (@jonesry28)http://yfrog.com/hsk6qlfj
11. ## eedok

Wonders if there's a way to punch an OS, damn OSX idiosyncrasies
12. ## eedok

also wtf is up with reddit marking all my submissions as spam, I am not a spambot reddit
13. ## I have returned

It's kind of strange having GDNet+ again, as the last time I had GDNet+ I was in the struggling student phase, juggling the burden of university with working enough to pay for university, as well as maintaining my long term relationship. Since then I've dropped out of university and went to a technical institute and got a diploma there and though I did it with the intention of getting a programming job so I could make enough money to go back to university, it's looking very highly unlikely that I'll go back. Things have changed since then as now I'm married, have a full time job as a game programmer at XGen Studios (working on my art abilities, have been able to do a few assets for our upcoming stick figure game now), and had a little girl on March 16, so things are much better now. So with the reintro aside, I'll post what got me back on GDNet+ my entry to the 3HGDC! When the 3HGDC was announced I was kind of bummed at the date, as it was my great aunts birthday and she was going to have a barbeque. Come the day of the 3HGDC Alberta weather took over and there was a terrible wind storm so the barbeque got cancelled and gave me a chance to participate, so I took to IRC until the contest was announced. With the theme of Spring/Puzzle I though of an action puzzler where you'd try to get spring to spring using a pinball like spring to launch spring time elements to the earth (I had springs on the mind at the time), so I through it together as quickly as I could using the environment I'm most familiar with. The first hour was spent quickly cobbling together assets, drawing very frantically and skipping the whole fixing the mistakes in the art, and pulling out the microphone and making noises I thought suitable to be sound effects. Hour two was spend half and half programming and play testing and I found a couple of problems. The first problem was the spring launcher was too hard to use accurately, and also posed an problem for instructions so it was scrapped in favor of a mouse control that would spring towards the cursor, which resulted in the balls becoming much easier to control, which I found made the game more fun to play. The other issue was with randomly choosing balls made the game frustrating when you had time and picked ones you had no use for, and made it impossible to win when you were running low on time, so I altered the ball generation to be based on which blocks remain, I created a list of which balls were needed to advance each block and then picked an index of the list at random, it was simple to implement and balanced it so that when you had more blocks of the same type you were more likely to get the ball you needed. Around the end of hour 2 my great aunt had called and had made a restaurant reservation, so it meant my last hour was cut in half. The last half hour I used to put in scoring and an instruction screen, then fixing an issue where the levels got too hard when the balls weren't falling fast enough, so I changed the game to have the ball falling speed increase with each level. At this point I sent the game off to capn_midnight for evaluation and went out for the birthday dinner. Play the 3HGDC Entry(Flash 9 required) I was happy with the results of the contest, and what I came up with. Doing my entry in a way that wasn't derived from another game I've played means I could probably make a few design changes and flesh it out to a full game in the same vein as Spate(which I'll explain in another entry), as well as netting me third place of the five people who submitted which in turn lead to a part of this GDNet+ subscription. I say part as capn_midnight was generous enough to throw in enought for a 3 month subscription, I decided to make it a year long one. I feel this contest broke me out of a development slump, and with a Journal availble for the whole year it might spark me to make something neat just so I can update this journal with the progress. A big thanks goes out to capn_midnight for hosting the contest. Now off to come up with something cool to make to blog(journal?) about
14. ## Freebies

notepad++ do I win at gd.net?
15. ## Week 3: Present

unless you're from Canada and Hulu doesn't support your location
• Advertisement
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!