|
3 registered members (AndrewAMD, Grant, Neb),
908
guests, and 6
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Hitboxes
#1720
04/19/01 07:57
04/19/01 07:57
|
Joined: Mar 2001
Posts: 1,825 London, England
Keith B [Ambit]
OP
Expert
|
OP
Expert
Joined: Mar 2001
Posts: 1,825
London, England
|
ASallade this is a brilliant idea, thanks. I have thought more about it, and this is my plan: different vertices of the model will be assigned to chest, face, back, legs etc. When a character is in an attack animation, the fist or feet vertices will be tracked. Then each character will have code to say something like: if face vertices come within a certain distance of attacking vertices (eg. a kicking foot), play hit_in_face animation and detract health accordingly. In theory this should allow pixel-perfect collisions for an accurate fighting game, made possible by the ent_vertex() command. My only questions now are: what is the best way of keeping track of the chest, face etc vertices? Should it keep track of the position of all the vertices in a defined area at any one time (if so, how can I do that - follow a lot of vertex positions, I mean)? Or should I somehow use the vertex positions to define a square area which will detect collisions when an attack vertex passes through it - again, if so, how? Any suggestions on how I might do this will be, as always, greatly appreciated. I think this should work, it's just going to take a helluva lot of ironing out and then a lot of headaches coding it. Thanks! -Keith P.S. I have the Commercial version, not the Professional, so I can't use text files to store variables. [This message has been edited by Ambit (edited 18 April 2001).]
|
|
|
Re: Hitboxes
#1721
04/19/01 01:12
04/19/01 01:12
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
You must remember that when you SHOOT at someone you are normally shooting from the MY.P0S which is dependant upon the MDL itself. In order to control the position being hit you also need to control the angle of the SHOOT, where it is coming from, and where it is going to. If it is a kicking sequence, the SHOOT would need to start from a position near the foot of the attacker and angle up to the ultimate end position of the attacking foot. Now I believe trace() is being used--same difference. A question might be--How do you get the trace to follow the trajectory of the foot. For example a round house kick or a reverse back kick (that might be easy) or a spinning back kick (or whatever they are called)? Just my 2 cents. DW
|
|
|
Re: Hitboxes
#1722
04/19/01 03:55
04/19/01 03:55
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
You cant load variables from a text file except for Pro version?!!? What is that all about? Damb,I just checked my manual, thats a rotten trick. I gues you will need to save as .wdl instead of txt and include them. Is there a way to include .wdl scripts on demand? ------------------ "Dare to Do, what others Dare to Dream..." Currently Recruiting for a Commercial CRPG Project based on a Published Pen & Paper Game: www.talislanta.com www.tamerlin.com www.talislanta.com/talislanta/images/talpromo-56.ram See our thread in 'User Projects' Forum
|
|
|
Re: Hitboxes
#1723
04/19/01 04:09
04/19/01 04:09
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
Its okay now, A5 has File Read/Write instructions on page 52 of the manual. I recommend using byte-blocks to store your vars in a special file, called "Model_name.vtc" or something, use a hex editor to code the vertices, in order, for each limb, then use the "var = file_asc_read (handle)" command to parse your bytes (holding vertice info) into an array for use in your traces. You could also simply use a text file, that is comma delimeted and use the "file_str_read(file,string)" command Find all this in the manual on pages 52-53 under File Instructions. It looks like it should work on all versions of A5. -Aaron ------------------ "Dare to Do, what others Dare to Dream..." Currently Recruiting for a Commercial CRPG Project based on a Published Pen & Paper Game: www.talislanta.com www.tamerlin.com www.talislanta.com/talislanta/images/talpromo-56.ram See our thread in 'User Projects' Forum [This message has been edited by ASallade (edited 18 April 2001).]
|
|
|
Re: Hitboxes
#1724
04/19/01 04:52
04/19/01 04:52
|
Joined: Mar 2001
Posts: 1,825 London, England
Keith B [Ambit]
OP
Expert
|
OP
Expert
Joined: Mar 2001
Posts: 1,825
London, England
|
Thanks a lot Wolf, for the trace suggestion, and many thanks again ASallade for all of your help and suggestions. I'm checking out both of these ideas. I'm thinking that if I can store and use vertex positions to calculate a number of hitboxes, then use the trace function to calculate point of hits, then I should be able to get accurate collisions with blood/hit spots appearing at the exact point of collision... One more thing: Sorry if I've missed something, but can you think of a good way of defining a hitbox using vertices? ie So I can detect a hit by calculating if an attacking object (ie fist trace ray) is passing through the parameters defined by several vertices (for instance, the normal bounding box for collisions is calculated by a min_x, min_y, min_z and a max_x, max_y, max_z position - is there a way to define a similar sort of box using vertex positions, so that there will be several virtual sort of boxes for each character that move and rotate with the character animation? - sorry if that's totally unclear). Thanks again, all the help is *really* appreciated. -Keith
|
|
|
Re: Hitboxes
#1725
04/19/01 12:04
04/19/01 12:04
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
Use VEC_DIST to measure the distance between the foot and head vectors. When the distance is equal to the desired size of the head box, minus the desired size of the foot box, you have a hit. The boxes dont exist, they are mathematical. Visualize this: The Head vertice you track is right in the middle of the Head. you decide that a sphere with a 100pt RADIUS would create a good "hit box" for the Head (note you can only use spheres for this technique) Now imagine your model, there with his vertice in his skull, and a glowing sphere around his head. Picture a string (like thread, not text ) from his vertice, stretching out a few hundred points. The string is your trace command, the vertice is your vertice, and the orb is your distance for a hit. If the distance from the weapon (the far end of the string) is less than or equal to the desired hit box (just a number! In this case, 100) then you have a hit. this works regardless of angle or trajectory. If the distance between 2 points is less than (BoxA <sphere actually> + BoxB), then HIT. -------------- Did that make sense? Hey, you could always join my commercial project when your done with your game, you have excellent ideas and a good drive, we'd love to have you on board  ------------------ "Dare to Do, what others Dare to Dream..." Currently Recruiting for a Commercial CRPG Project based on a Published Pen & Paper Game: www.talislanta.com www.tamerlin.com www.talislanta.com/talislanta/images/talpromo-56.ram See our thread in 'User Projects' Forum
|
|
|
Re: Hitboxes
#1726
04/19/01 18:00
04/19/01 18:00
|
Joined: Mar 2001
Posts: 1,825 London, England
Keith B [Ambit]
OP
Expert
|
OP
Expert
Joined: Mar 2001
Posts: 1,825
London, England
|
That is brilliant and simple - why didn't I think of that??? Another beauty of it is that it means keeping track of less vertices for each model - there only needs to be one for each hitbox rather than six (which is what I was thinking before). Also, in the manner of all good fighting games, any inaccuracies in collision can be hidden with the blood splats, and the hit character will slide back a little when hit so that the punching fist doesn't pass through the face... And I can calculate the orientation of the attacker to figure out which way the character should fall... Looks like I have the theory of my collision system sorted out, now just the headache and slog of coding it (which is also the fun part). Thanks again Aaron for all your invaluable help, if I ever get to such a stage you will definitely be in the credits... What is your commercial project, by the way? Cheers, Keith
|
|
|
Re: Hitboxes
#1727
04/20/01 01:54
04/20/01 01:54
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
great idea ASallade!! Thanks 
|
|
|
Re: Hitboxes
#1728
04/21/01 14:25
04/21/01 14:25
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
You can see info on the game world setting and art at www.talislanta.com There is a multimedia tour here: Multi Media and samples of the original soundtrack here: Song 1, Song 2 More about the project is at www.tamerlin.com (go to the "Team" page) Well there it is...;) I like working on these new code concepts for WDL. I have a list of requirements for my game, and I just assumed I would have to code these features as needed, so when you brought this one up, I had to look through the manual to see what kind of features are supported and how to create the systems needed with them. I've been working with WDL and A5 in general for about 3 weeks now, but was hand coding C++ Graphics engines prior to this, so I have a pretty good idea of the logic behind the system. It's just a matter of producing it in WDL ;) Well your turn for show and tell...what are you working on for your game? I asume that it is a fighting game, but how extensive? I have a section in my game where some gladitorial arena combat takes place, I will use this code for that area, but not for the rest of the game play. Best of Luck in all your coding, and let me know if you get this one working before I do, its not on my list to do for another month yet... Regards, Aaron Sallade ------------------ "Dare to Do, what others Dare to Dream..." Currently Recruiting for a Commercial CRPG Project based on a Published Pen & Paper Game: www.talislanta.com www.tamerlin.com www.talislanta.com/talislanta/images/talpromo-56.ram See our thread in 'User Projects' Forum
|
|
|
|