Game Development Community

Invalid Projectiles

by Robert Stewart · in RTS Starter Kit · 04/18/2005 (3:52 pm) · 12 replies

Ok, when I get a unit to attack another unit, it says Connection error: Invalid packet.. in the console and a dialog with stuff about projectiles not matching. What is a good way to fix something like this?

#1
04/24/2005 (9:23 am)
Is this a code issue or script? im using default crossbow.cs and default rtsprojectile.cc
#2
04/26/2005 (3:47 pm)
OK I GET IT. not a good enough description. Just give me some general trouble shooting for this.
#3
04/26/2005 (3:55 pm)
Heh..well, to be honest, you do tend to not provide enough information to even give you a clue as to where to begin looking. Nothing personal, but many times it causes a ten thread response chain just to find out what you are doing!

Invalid packet can come from many many different situations, so it's next to impossible to even make a guess.

Are you running a dedicated server, or does this happen single player?

Did you make a custom projectile? Obviously the stock one works, so something has to have changed here.

If I remember correctly, you may have been playing around with that client side only projectile code that was introduced here--is that code in place anywhere?

Could you show us the logs so that we can see what the error is instead of guessing at it?
#4
04/26/2005 (6:07 pm)
Ok well first I cant get Torque to give me any usefull info in debug mode. Second what I wrote in my first thread was basically cut and paste from the console, but ill get it exact in a sec here. I made big changes I have Merged TGE with RTS and added many code changes"I dont even know how I do it.". My game looks like it is comming along really good with small bugs like this in the way. And yes Ill try and dig some more info up. Oh also Im just using the default custom projectile. Um changes I made to get TGE with RTS, I merged RTSConn with GameConn .cc and not much else.. basically just added in the extra .cc/.h files.

EDIT: Ok all I can find out is that it stops somewhere in processtick.. I think. Here some info that pops up i5.photobucket.com/albums/y173/warvstar/1.jpg
#5
04/27/2005 (3:48 am)
Well, right there with your "I merged RTSConn with GameConn"--that's your problem. Something in there is merged incorrectly!

I think this came up in a different post with you, or it may have been someone else, but you may not be understanding the concept of a "debugger" as well: a "debugger" is a separate application that allows you to interact with your executable while it is running, and track exactly where in the source code things are happening. For example, running your game under a debugger here would allow you to, as soon as you get that window, go to the debugger, and find out not only exactly what line of c++ code you are on, but also all of the most recent functions that were called prior to that, as well as the state and values of the variables.

Which debugger is available for use depends on your build environment (TBE? Microsoft VC6/7? Minsys/MinGW?), so if you want further info, you'll have to look it up based on that.
#6
05/07/2005 (4:49 pm)
Hey Zepp would you look at my GameConnection.cc? Because my VS wont desbug without freezing and it sounds like you might be able to spot this just by looking at it. Ill pay you something via PayPal if you like.
#7
05/07/2005 (6:13 pm)
What you may want to do if you can't use a debugger in VC is to start putting in echo and Con::printf messages at the start and end of functions you have modified, and even ones that you haven't, but are part of the execution flow. That will help you narrow it down to at least which area of the code to look at more closely.

Unfortunately, me simply looking at the file isn't really going to help too much, becuase there is just too much you may have changed (as well as what I have changed in my builds) to be able to figure it out at a glance.
#8
05/07/2005 (7:19 pm)
Ok well in RTSProjectile.cc nothing is changed it appears to break onAdd(), in the game i see one fire shot at least before it breaks. Cant see anything really wrong in gameconnection. Ill keep looking just thought I would post that It appears to break onAdd(). Also is it normal for onAdd to be called in Projectile.cc aswell? because it does.
#9
05/08/2005 (7:36 am)
Stupid question but I looked in rifleman.cs player.cs crossbow.cs and I cant find anywhere to set the projectile on a unit.
#10
05/08/2005 (9:42 am)
Just a quick note ...

We are GIDing with the RTS pack, and I think we came across a similar issue. When a whole bunch of units die in a short space of time, we get a projectile related error (similar to above one). Now, the funny part is, we don't actually use projectiles ;-) The only units in the game are melee units who's melee attack is to commit suicide by exploding. I am thinking it's a bug in the RTS SK, but I really cant be bothered to put any time or thought into it at the moment.

That said, your invalid packet error suggests that some packUpdate() or unpackUpdate() method is broken, so it may not be the same issue, but as a first guess I'd check that the projectile's packUpdate() and unpackUpdate() methods are both correct. Also, use a merge tool like winmerge or beyond compare (use google to find them) to compare your source to the original RTS SK source and see what you've changed, it may give you some clues.

T.
#11
05/08/2005 (10:48 am)
@Tom: There is a discovered bug in how sendAttackEvent() works in that between the posting of the NetEvent, and the actual broadcast of the Event to the clients, if the unit doing the attacking has died, it will crash. I don't remember if this was displayed as a projectile error or not, but it can be bypassed by not actually posting AttackEvents in certain cases.

I plan on eventually going back and fixing this error, but when it happened I just didn't have the time to delve deeply enough into it to fix it up.
#12
05/08/2005 (12:06 pm)
Stephen,

Ah, thanks. Interesting. Maybe I'll have time to look at it but I dont really feel like debugging at the moment so it will probably get left.

T.