Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

graveyard filla

what to do when.... (things go bad)

This topic is 5184 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

high, last night i decided to completely re-vamp my engine. basically, making every one of my classes inherit from a "world" class, so that i could group everything togeather nice and neat. anyway, everything worked great. except, for some VERY strange reason, only one of my enemies will fire his gun. i dont know why, its very weird. theres 3 enemies on the map, and only 1 is shooting... the other 2 enemies will still chase me, but wont shoot. i step through my code, and it looks exactly the same when a broken enemy is shooting and when the enemy that shoots is shooting.. anyway, should i sit here, tareing out my hair for possibly all night and into the next day, trying to figure out what the problem is? OR, should i roll back to the old code (only from last night but still hours worth of work).. what do you think? i mean, i hate not understanding how bugs work, you know? just wondering if i should stick it out and try to find out WHY this is happening, or should i roll back, and slowly add things making sure everything works (this could also turn up WHY..) thanks for advise!

Share this post


Link to post
Share on other sites
Advertisement
yeah, roll back and slowly add things up till everything works. maybe you missed a few classes and some of them don''t inherit from world? you could also windiff the files and see what exactly you changed and try to work out the effects of the changes.

good luck
VStrider.

Share this post


Link to post
Share on other sites
I''d go for a walk and maybe start thinking about dinner.

Failing that, when I make massive overhauls like that, I just put print statements everywhere, starting from the beginning. Put them in constructors too to make sure everybody gets built right, and put them in your Update()s as well.

Share this post


Link to post
Share on other sites
Forget about it. You'll solve the problem easily if you just leave it for a day and make sure NOT to think about it in any of your spare time.

Just make sure you understand your new architecture, and your subconsious will solve the problem for you.

[edited by - twix on June 8, 2004 8:16:53 PM]

Share this post


Link to post
Share on other sites
Mnh, it depends on you.

I have these kind of problems, and I solve it reading the old code and the new.
The most common cause of these kind of bugs are pointers to wrong code.
if I where you, Ill check my code and learn what Im doing wrong.

Share this post


Link to post
Share on other sites
Everything inherits from a "world" class?

That sounds like a very bad design that is going to bite you real hard down the line. Does the statement, "the player is a world," make sense? It could even be the source of the problem you''re describing, in some way or another.

Share this post


Link to post
Share on other sites
quote:
Original post by jpetrie
Everything inherits from a "world" class?

That sounds like a very bad design that is going to bite you real hard down the line. Does the statement, "the player is a world," make sense? It could even be the source of the problem you''re describing, in some way or another.

nahh, he''s probably just using an abstract class so he can upcast different classes. doesn''t really matter if he''s calling the class "world" or "object" or "myabstractclassthatdoesnothing".

VStrider.

Share this post


Link to post
Share on other sites
yes im using c++ and yes its just a ABC that does nothing by itself... i dont consider my player to be a world... but i do consider my player to be a world_update() object..

anyway, this is really pissing me off. if i step through my code, walking near an enemy that *should* be fireing his gun at me, it will get to this line

weapon.Fire();

the yellow arrow will point to this line in the debugger (MS.net) telling me this code should be executed.. however, it will never go inside this function. the line gets to this function, then skips over it, continueing on.

if i move toward the enemy that actually IS fireing at me, the same thing will happen... the red dot will reach the line of code, only right after, it will actualyl go inside this function and fire the bullet (theres breakpoints inside the function.. so i can see that its going through with the working enemy, but never going through with the ''broken'' one)..

does anyone know why this could be? why would it skip over these lines of code? everything else is fine, hes chasing me, colliding with walls, but he wont fire his gun, it just gets to that line and keeps going.. and why would one of the enemies work? i do the exact same thing to all of them and they are all created dynamically... i dunno, maybe someone spots something obvious? thanks for any help!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!