Page 1 of 1

D3: Handling a shockwave

Posted: Sun Apr 08, 2007 4:07 pm
by Floyd
does anyone know how to use the following array?

Code: Select all

obj->mtype.shock_info.damaged_list[i]
the struct is \"shockwave_info\" in \"object_external_struct.h\". unfortunately, there are no comments as to what it actually contains (handles? ids?). no matter what i do, if i read its contents in \"OnServerObjectDestroyed\", i read trash. :(

Posted: Wed Apr 11, 2007 8:00 am
by Diedel
Did you try to see if and how this data is used in other parts of the program? One way to find out would be to simply do a global file search for \"damaged_list\" in all D3 source files, set the program up in a debugger, set breakpoints on these lines and check where and why they get hit. All provided you have the source files and can debug the program.

Posted: Wed Apr 11, 2007 11:13 am
by Munk
There is no source for D3 out.

Posted: Wed Apr 11, 2007 11:50 am
by Diedel
Floyd,

where do you have that piece of code from, and how do you access the data it points to?

Posted: Wed Apr 11, 2007 11:52 am
by Diedel
Floyd,

where do you have that piece of code from, and how do you access the data it points to?

Posted: Wed Apr 11, 2007 12:26 pm
by Foil
Diedel, it's from the D3 SDK code, if I'm not mistaken.

There are quite a few things in there that point to things in the full D3 source which we don't have access to.

It's interesting that you're always getting gobbledygook when looking that structure for objects... Hmm, here are a couple of thoughts I had:
- Could they be vector-values? Rather than storing handles/ids for objects damaged, could it be storing some type of directional value, indicating a speed/direction for the results of a shockwave?
- It could be an unused structure, maybe something planned as a D3 feature that was never implemented.

Posted: Wed Apr 11, 2007 1:04 pm
by Diedel
mtype stores movement values. Probably that variable holds a handle (object array index) of an object receiving (splash) damage from a shockwave.

Is there any way to get the full D3 source code? You bet I'd be willing to fix any bugs/flaws in there.

Posted: Wed Apr 11, 2007 1:11 pm
by Floyd
yes, the struct is from the d3 sdk 1.4.
i've gotten a little further. after a while tryin to read that list from the weapon that caused a shockwave, i'm now reading the info from the shockwave (which is also an object). duh.
however, i only read one single entity from the list, at least the other values show 0, though that doesn't help much if one entity shows as 0...
strange is, that although i hit several objects at once, i always get only one entity in the list. my theory is, that it's actually the index to the object, neither ID nor handle (like the returned value of ObjectCreate). but there's not the object i was looking for at that index. this makes sense, as long as it's always the same number for each object. actually, it is - until i change the weapon. so the good news is, it's not totally random numbers anymore, just weapon specifically different.

it's not that great of a loss afterall, i can live with it. since descent handles shockwaves, it must be implemented somehow, just undocumented. or that struct is out of date, since i miss a damaged_objects_count or such.
i'll try one last idea: reading the struct straight from memory and see if it contains anything else.

thanks for the suggestions though :)

EDIT:
Diedel wrote:mtype stores movement values. Probably that variable holds a handle (object array index) of an object receiving (splash) damage from a shockwave.
that's what i initially derived from the arrays name. splash damage IS the shockwave object.

if there was a way to get hands on the source, D3 would not be at the state it is right now anymore ;)

UPDATE:
i checked the complete struct contents. it contains all zeros instead of that first byte. since it's reproducable, i'm sure it's the right array to look at. outrage could have done it different and have left and forgot that struct however.

nevermind ...

Re:

Posted: Wed Apr 11, 2007 2:07 pm
by Foil
Diedel wrote:Is there any way to get the full D3 source code? You bet I'd be willing to fix any bugs/flaws in there.
People have been trying to get the D3 source released for years. Barring some kind of miracle, it's probably not gonna happen.

Posted: Wed Apr 11, 2007 3:58 pm
by Diedel
I know. :/

Is there a contact address with the guy(s) who have the D3 source code, and the rights to it? (Is it Kevin Bentley?)

Posted: Wed Apr 11, 2007 7:38 pm
by Sirius
Diedel got DMB2, don't count him out yet. ;)

Posted: Wed Apr 11, 2007 10:02 pm
by Grendel
Matt Toschlog owns the D3 source.

Posted: Thu Apr 12, 2007 12:29 am
by Diedel
Is there a way I can reach Matt?

Re:

Posted: Thu Apr 12, 2007 12:35 am
by DCrazy
Grendel wrote:Matt Toschlog owns the D3 source.
Not anymore, I don't think, with Outrage's sale to THQ. Unless there was some special provision that handed him the source code, copyright was transferred to THQ when they absorbed Outrage.

Last time I emailed him about it he said that due to lawyer issues it would be nigh impossible. Then again, this is coming from the president of a company that wanted to license the D3 engine for $50,000. I can't imagine there NOT being lawyerly problems.

Posted: Thu Apr 12, 2007 10:40 am
by d3jake
Perhaps while the source is in hands that may not know that it has it\\know the full value of it we should put in for it to be released, if they're not planning on using it, then maybe we can talk them into giving it up. Unless they'll do it like M$ did with Mechwarrior...

Posted: Thu Apr 12, 2007 10:39 pm
by Kyouryuu
I honestly have no clue who owns the Descent 3 source at this point. Volition highlights Descents 1 and 2 on their main page, but not 3. Outrage was acquired by THQ and shut down after Alter Echo and I believe Alter Echo ran on a heavily modified Descent 3 engine. But THQ has nothing to do with the periodic re-duplication of the game and even if Alter Echo did run on Fusion, that doesn't necessarily imply that THQ thus owns Fusion.

Personally, I have to believe it is as DCrazy said because if Volition could release the source for FreeSpace, Outrage should have been able to do it for Descent 3 unless the terms were significantly different.