Null Reference?

Topics: Developer Forum, User Forum
Mar 14, 2009 at 10:43 PM
Edited Mar 14, 2009 at 10:44 PM
Well i was porting my game over to a new project (the old one was getting kinda bulky) and i went to set up the physics engine (i'm pretty sure that i set everything up right) but when the engine tries to process a collision, it crashes with a NullReferenceException. I would tell you exactly where i am having the problem, but the farseer physics project i have added has been pursuaded that it isn't in debug mode or it has optimizations on (even when i make sure both are set right) so it won't step into the update message. Any ideas? On a side note, i've settled on a name for the game: Amazing Gadgets. Whaddya think?
Mar 15, 2009 at 1:36 AM
well if just porting them over to another new project and seeing if that works doesnt help,
then maybe you have not put all of the using statements including farseergames.farseerphysics; alone,
or perhaps you did not create a reference to the farseer project from yours.
But considering that it does everything but collisions correctly it may be having troube accessing a collision class from the xna project folder(nullreferance, your telling it look to the collision class but it doesnt see anything there), perhaps import that class yourself and delete the old one?
Sorry i cant be of more help but thats my opinion.

And what is the game your making?
Mar 15, 2009 at 2:45 AM
Edited Mar 15, 2009 at 3:09 AM
Well i solved the problem. Apparently there is a bug in TytanNET (search for it on codeplex) which causes it to add improper references if you tell it to make an inter-project reference. I'm making a game similar to Fantastic Contraption. However; i plan to leverage the features in farseer to make more interesting things like loose bridges, bouncy platforms, new modes, and more! However i am in whatever is before the alpha stage and have around 90 percent left. I plan to release it via Xbox Live Community Games. However; i may not stick with farseer because i have (partially) developed an engine of my own that may fit are needs more (assuming i can finish a few features). Don't worry, i'll stick around!
Mar 15, 2009 at 5:03 AM
Edited Mar 15, 2009 at 5:04 AM
*searches fantastic contraption*
INTERESTING, it reminds me of coconut run, except cocounut run had a bit more freedom and choice and was more fun because of it,
but anyway i had fun playing it but gave up as i wasnt in the mood for challengin my mind(and the music got wicked annoying)

If you make a physics engine will it based off of farseer but with additions?
Or is it something completely seperate?
In anycase 2 questions
1. could it be used in tandem with farseer?
2. would you release it to the public (me)
Mar 15, 2009 at 6:11 AM
Edited Mar 15, 2009 at 6:12 AM
Well currently i am using a (slightly) modified version of farseer but if i can add a couple of features to my engine ill probably switch to that.
About your questions:
1. No not really its a whole separate thing with a different intent (hopefully it will be better than farseer but it needs my attention to get there and im busy with my game)
2. I'm (probably) planning on writing an article about it and sending the engine to CodeProject (as i think a lot of people are in need of a good physics engine). It will be downloadable from there (assuming you don't mind registering for a user ID).
Also, do you know of the URL for this "coconut run"? i think it would be interesting to try.
Mar 15, 2009 at 4:59 PM
yerp its
you can basicaly build whatever you want, and you control the movement.

For your engine, will it work like farseer?
Will it create bodies and geometries and everything function like farseer?
Youve got me very interested haha
can you spill the beans on any of the intended features?
Mar 16, 2009 at 11:07 PM
Yes it works fairly similar to farseer, but it uses one type of thing: an Atom. (a circular object with basic dynamics/collision attributes)
i'll elaborate more on the engine in its current state later, but i want to get line to line and line to circle collision working. The engine (so far) is fast and can handle hundreds (thousands if i had a better computer) of Atoms, and if i can get lines working i will be able to make all manner of soft/hard bodies. I might release it without the lines if i can't get them working right now.
Thanks for the URL btw!
Mar 17, 2009 at 12:35 AM
that sounds amazing!
I wouldnt mind an earlier release even without the lines just so i could try it out.
Mar 17, 2009 at 3:50 AM
well its lacking a few things right now and im giving my full attention to Amazing Gadgets (because there is like a page and a half of to do items and i took a few months break up until recently) and i really want to have those things done before i release it sorry.
Mar 17, 2009 at 5:14 AM
thats alright i can look forward to amazing gadets instead haha
Mar 17, 2009 at 6:21 AM
Well assuming you have an Xbox and a few hundred points (in a year or so ;) ). Also, i tried coconut run and after a few different designs, i cracked the thing and got like a 73 percent efficiency rating. The problem with it is that it has only 1 "level" and is not too hard to beat. Particle Pro was even easier (after i watched the tutorial and tool a look at the example)!
Mar 17, 2009 at 7:02 AM
Edited Mar 17, 2009 at 7:03 AM
i got 94% haha
but the fun me and my friends have with cocunut run is just messing around, making coconut launchers and several other things, it gives a great amount of freedom.
But i never tried particle pro, it looked like some room designing bull crap which didnt involve flinging coconuts into giant meat grinders, so i lost interest.
Mar 17, 2009 at 8:23 AM
hmm...interesting idea (with the launchers ill have to try it). Actually you use splitters and funnels and reflectors and such to direct particles to specific loactions. Its kinda neat, but also... eh....
Mar 18, 2009 at 3:38 AM
*how* *in the world* did you get 94 percent efficiency? the best i can do is 85 (30 seconds delivering all of my coconuts) which was achieved using a couple of ginormus wheels and a bucket in the center. (sorry off topic!)
Mar 18, 2009 at 5:19 AM
hahaha its alright it is your topic after all,
but the size of cart is relevant, if its huge it will go slower.
I made a big front front wheel, a medium back wheel, and a small carriage with a funnel and a latch to contain them,
this lets me take off quickly without the worry of losing coconuts, and the big wheel lets you make it over the bumps and hills easier.

Or you can just make a small cart and go fast while hoping the cocounuts stay in.
Mar 18, 2009 at 5:54 AM
Hmm how do you make latches?
Mar 18, 2009 at 6:32 AM
just make a line and joint it to the opening, then when you start moving it will swing down, or you can make a little funnelling system so the coconuts go in but because of the zigs and zags in the system its hard to get them out.
I see you are interested in it, you may be able to understand why its so intriguing even though its just one level.
Such a well designed game, whether they meant it or not.
Mar 18, 2009 at 6:44 AM
Well after some redesigning i built a cart with 90 percent efficiency and im happy with that. If only there were different levels... *goes back to coding*