Game Development Community

Hitbox Crashing

by Westy · in Torque Game Engine · 11/11/2003 (11:14 am) · 33 replies

I am having a huge problem with hitboxes from this resource:

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3981

This does actually work, but it crashes the game quite quickly.
i was wondering if anybody else has tried this resource and got it to work ok? Details of the problem are on the resource page.

Any help would be very appreciated!
Page «Previous 1 2
#1
11/11/2003 (6:08 pm)
Hi Kyle !

I tried that one to and hade huge problem !
Even posted the author many time !
And got files from him ....
But i still having bad crashes
If i run around myself the hitboxes are there and works
fine ,but when i put in another player or ai it crashes bad.
Im no skilled coder so i cant fixit.
Hope someone else have this working !?

-Billy
#2
11/11/2003 (7:19 pm)
Yes, seems the problem is that the hitbox details are not updated at each tick, i noticed this with VC6 Debug.

Any mHitbox.* does not recieve a value.

However as i didnt write this resource im not sure how to rectify it.
#3
11/12/2003 (7:47 am)
Does this mean that the author never tested it, and we are the only ones who have tried it? :S

What files did Josh send u billy?
#4
11/12/2003 (8:21 am)
It means that it worked for some specific revision of Torque, but that something has since changed and broken it, probably...
#5
11/12/2003 (10:26 am)
I helped hacking that code too, and it did work, not sure what's happening with it now, It would need some work I guess.
#6
11/12/2003 (1:11 pm)
I think i found the source of the problem.

The function requiring the hitbox recieve it from castRay using info->hitbox

but the actual data its sending can be seen in this pic.

www.gameshots.co.uk/rayinfo-hitbox.jpg
I think Josh missed something from the .doc
#7
11/12/2003 (11:18 pm)
Hey Kyle !

have you tested it online or with a bot ?
It worked fine for me to but when i aimed at a bot or
another player i got bad crashes !
And got crashes to when i went from first person to third .
If its working now ,what lines did you change ,this is a good resource if its working and i think many would like to use it later .
Can you do a updated resources or simular ?

-Billy
#8
11/12/2003 (11:21 pm)
Forgot to say this kyle
this is the same error i got !!

-Billy
#9
11/13/2003 (4:54 am)
No i didnt get it working :(

I can reproduce crash everytime by switching to thir person, and lowering view (or trying to switch back to third).

I beleive the prob is castRay.

castRay is supposed to contain info about hitbox and send it by info->hitbox

However it contains no such info.

I dont know how Josh intended this castRay to work, or maybey castRay chnaged after he did this resource.

Eitherway we will be stuck without Josh as he is the one who knows how castRay is supposed to work with this.
#10
11/13/2003 (3:10 pm)
Read the code and you will understand it too, it isn't magic. I guess it should take only a couple of hours to find the problem at most.
And josh didnt miss anything, it was working when it was released.
#11
11/13/2003 (3:40 pm)
There was no code added to castray apar from a hitbox value to return :S

Its just using info->hitbox
#12
11/14/2003 (1:42 am)
I dont no about the code was working or not Xavier .
I send my code to Joshua Taylor , he changed things he forgot in the resource, so the resource is not working as it is !
The boxes line up ok works in the network and so on,
But when you run around suddenly you get a error in
CheckHitBoxes function .
If i bypass the checkcode its works fine but when using it
i get an error in the lastlocation function after a while.

-billy
#13
11/14/2003 (1:51 am)
Xavier i know that your hitbox tut is working with the meelee
one,hope we talk about same thing here !
This is Joshua Taylors Hitbox tut !
#14
11/14/2003 (9:56 am)
@Billy: There's another Hitbox tutorial? Since you said Josh I was talking about Josh Alberch, who did the original melee/projectile hitbox detection.
#15
11/14/2003 (10:08 am)
Yes i know Xavier !!!
I know about the first one and who did it !
But this is differnt from the one you and alberch did.
Its another resource only .
If i said josh before then i was wrong !
I dont mean any bad things here, but this resource dont work
as it is only .

So sorry Xavier if you thought i was insulting you !!

-Billy
#16
11/14/2003 (10:34 am)
To straighten this out so we talk about same thing !
This is Josh Alberch Resource
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3374

And this is the one we talking about !!
This is Joshua Taylors Resource.
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3981
#17
11/14/2003 (2:47 pm)
I think he knew the difference billy :p

This resource was 'based' on the first once, but utilises castRay (which is the thing thats not working) for the collision.

I did look at first once, but there was far too much stuff in it for me to make sense of it all..
#18
11/15/2003 (12:09 am)
A strange thing is i can shoot on a bot in 3dperson
and get the hits on the boxes but after a while i get
the crash you get !
it works sometimes and sometimes not .
so its working but something makes the crash and
i cant figure out what !
#19
11/17/2003 (10:10 am)
Ye kyle i have seen that in the debug .
on the Temp.max and min i get no value after a while
and that makes the crash !
Im not a skilled coder so dont no all parts of the code
but i have really tried alot !
#20
11/17/2003 (3:49 pm)
Ok heres a fix.

In player.h

PlayerData Class

chnage

U32 CheckPattern[3][NUMHITBOXES];

to

U32 CheckPattern[4][NUMHITBOXES];

In player.cc

PlayerData::PlayerData

change

CheckPattern[0][k] = temp1[k];
CheckPattern[1][k] = temp2[k];
CheckPattern[2][k] = temp3[k];

to

CheckPattern[0][k] = temp1[k];
CheckPattern[1][k] = temp2[k];
CheckPattern[2][k] = temp3[k];
CheckPattern[3][k] = temp3[k];

Not Sure if this matches the hitboxes right, but just adjust the temp pointer so it does (if its wrong).
Page «Previous 1 2