#4473122 - 05/06/19 03:37 AM
TMod hard points
|
Joined: Jan 2006
Posts: 1,506
Brit44 'Aldo'
Every Human is Unique
|
Every Human is Unique
Member
Joined: Jan 2006
Posts: 1,506
|
I make a few assumptions here: The editing tools are publicly available, discussing how they work is not in violation of the NDA, and SimHQ does not object this discussion.
Ray, Jelly PM me about this. You want to add something to TMods? What is it you want to add? I do not have the EAW editing tools and my internet is not secure (and painfully slow) so I will not rejoin the GEN. If this is better done with email or PM, then ask to add you to the PM.
My guess is that you want to add some bits of data from the aircraft 3DZ to the landscape 3D models. It may be as easy as adding the data to the end of the file structure, but it could also require multiple data reads be updated to handle the size and format change of the data change. I assume a few sub routines will need to be copied from the planes and added to the landscape objects.
I hope your doing well Ray, I'm working on getting my head and life stabilized. Thank you for being one of the first to be blunt with me that I have a problem. Allen
Last edited by Brit44 'Aldo'; 05/06/19 03:38 AM.
TPA who TWI "The 10th Amendment simply says that any powers that aren’t mentioned in the Constitution as belonging to the government belong to the states themselves."
|
|
#4473126 - 05/06/19 08:58 AM
Re: TMod hard points
[Re: Brit44 'Aldo']
|
Joined: Feb 2006
Posts: 4,859
Rotton50
3DZ / campaign designer
|
3DZ / campaign designer
Senior Member
Joined: Feb 2006
Posts: 4,859
Cape Charles, Virginia, USA
|
Brit, thanks for responding. We can go through the exercise right here if that's OK. I think the audience would appreciate knowing a bit about what we do and how we do it. This is a two part problem, one old and one new. The new one first: In the past, if you wanted to raise a TMOD you had to do so using 3DZ Editor by raising the model in the Z axis. The problem was, the hit bubble remained fixed to the ground to you couldn't properly target the TMOD, you had to shoot below it OR change the hit bubble size so that the bubble reached up to the TMOD, making the hit bubble way too big. I used this approach in my 2015 ETO target upgrade. It worked OK for things like deck cargo on freighters and AA guns on warships but not so good for anything high up, like a flak tower or carrier deck planes. Recently Jel found a way to use the "Z smoke offset" data point to raise individual TMOD's up off the ground as long as they weren't moving ground object (MGO's). On ship MGO's the "Z smoke offset" data point is used to set the location of smoke coming out of the funnels. I've used this to possibility to great advantage: The AA on the side of a Jap carrier - Folded wing Corsairs on an American carrier - AA and jeeps on a freighter - The problem is that at certain angles the underlying main TMOD renders before the add-on TMOD- An important point here is that these are static models that only appear to move by the addition of a wake behind the ship. If they were MGO's you'd run into the next problem. That is, we don't have a way to keep the pieces together as they travel along. Whether it is or add-on TMOD's or multipart main models. You see, we've been working on and off on the idea of having multiple section TMOD's, just like hi-res aircraft which are cut up into sections to give the skinners more territory to paint and freeing up mode nodes to be use to make the models less jagged but again, we don't have a way to keep them together. The solution to both problems would be to add attachment hardpoints to the TMOD's so they would function the same way the aircraft do. That's where you come in.
Heck, even paranoids have enemies.
|
|
#4473220 - 05/06/19 10:09 PM
Re: TMod hard points
[Re: Rotton50]
|
Joined: Aug 2000
Posts: 7,427
Moggy
EAW Old Timer and Bodger
|
EAW Old Timer and Bodger
Hotshot
Joined: Aug 2000
Posts: 7,427
A slit trench at RAF Gravesend
|
Hey, long time no postings. Busy Brexiting? Seriously, it would be a YUGE upgrade to have those carriers replace the ones in SPAW. Biggest project on hand at the moment is digitising all our LPs and casette tapes, The Cds are done easily, but the others have to be done in real time. Don't mention Brexit.
Last edited by Moggy; 05/06/19 10:10 PM.
|
|
#4473246 - 05/07/19 03:58 AM
Re: TMod hard points
[Re: Brit44 'Aldo']
|
Joined: Jan 2006
Posts: 1,506
Brit44 'Aldo'
Every Human is Unique
|
Every Human is Unique
Member
Joined: Jan 2006
Posts: 1,506
|
This is most likely in a manor that Jelly has already done with the Z offset data. Comments or simpler solutions are welcome in this discussion. I am not a professional programmer. I try to keep my modding ego in check. Here is one possible solution: It seems that what you need is a parent/child hierarchy. This is not too difficult if you have room for a single bit flag and all child objects hit bubbles (or some other search range setting) intersect within the parents search range. Your bit flag is 0 = no link, 1 = parent and 2 = child. An example (with verbiage for those who do not understand bit masks): Because your bit flag is small enough, you can hide it in any 8 bit value that is being used as either a Boolean (but is not declared a Bool) or a numerical value that can compensate for the 2 additional value possibilities. 0 = false (and no link), 1 = true (and no link), 2 = false and parent, 3 = true and parent, 4 = false and child, 5 = true and child, 6 = BUG false and both child and parent, 7 = BUG true and both parent and child. When your unused numerical value is greater then 15 you can separate the the true-false question from the parent child question. When we get to multi part models you may need to understand bit masks as the possible bugs increase as the size of the data mask increases. The flag can be hidden within any size data where one of the HEX value 'F's is not used. Simply put, if your original value is not large enough to use all of the HEX 'F's in the data, you can use the free 'F's to include more data. I am starting to type a class on HEX. Suffice it to say that 8 bit is 0xFF, 16 bit is 0xFFFF and 32 bit is 0xFFFFFFFF. Each F = a multiple of 0 to 15 (plus 1 if it is not the first 'F'). 0x1 = 1 and 0xF0 = 16 Once you have a bit mask to trigger a new sub routine, it will require a test that is similar to the subroutines that check if an object is within the search criteria. If an object with the child mask is found within the search criteria, then the data is applied to that TMod also. Not to get sidetracked, but why does Moogy's screen shot show ground craters on a water tile? Moving multi part models and/or static multi part models that need damage applied to all parts need a parent/child hierarchy. Ray's "Empty F" 3DZ uses a loop in the code that creates a parent/child hierarchy. You could mimic this in the TMod code or you could use a bit mask that triggers a new sub routine to call the rendering of a TMod who's model is already loaded into memory but not placed on the landscape. clear as mud LOL
TPA who TWI "The 10th Amendment simply says that any powers that aren’t mentioned in the Constitution as belonging to the government belong to the states themselves."
|
|
#4473254 - 05/07/19 10:09 AM
Re: TMod hard points
[Re: Brit44 'Aldo']
|
Joined: Feb 2006
Posts: 4,859
Rotton50
3DZ / campaign designer
|
3DZ / campaign designer
Senior Member
Joined: Feb 2006
Posts: 4,859
Cape Charles, Virginia, USA
|
You lost me at "Here's a possible solution". Hopefully, Jell will understand what you wrote. All I know is that we have multi-part aircraft so logically we should be able to have multi-part TMOD's. But I've been wrong before so.............. PS - We can't use letters for new HP codes as they're used for the aircraft models. We also can't use numbers 1 through 9 because they're used for weapons HP codes and we can't use 15 because that is used for the gunsight HP in the cockpits. So if this were to go any further we'd be best using some higher numbers, say 20-40.
Heck, even paranoids have enemies.
|
|
#4473298 - 05/07/19 04:24 PM
Re: TMod hard points
[Re: Brit44 'Aldo']
|
Joined: Apr 2002
Posts: 12,497
MrJelly
Veteran
|
Veteran
Joined: Apr 2002
Posts: 12,497
Montagnac, L'Herault, France
|
Too complex for me at this stage, but I have been working on some related aspects which may eventually lead to a solution I have gone back to Moggy's multipart carriers running on invisible railway lines. The relevant file "TList31.mpf" file has this data: 100 99 95 96 97 98 101 102 0 0 113 0 10 10 10 25 -1 0 1 ******************************************************* 19 items
vehicle0 vehicle1 vehicle2 vehicle3 vehicle4 vehicle5 vehicle6 vehicle7 vehicle8 vehicle9 vehicle10: Two extra vehicles added here for engine and tender vehicle11 Convoy size s Convoy size m Convoy size l Convoy speed (knots) Convoy additional spacing (feet) Convoy width (feet) Number of columns
Vehicle10 = TMod113 and this is the hull and the equivalent of the locomotive Vehicle11 is NULL because there is no tender The rest of the "train" (Vehicle0 (TMod100) ...Vehicle7(TMod102)) are the other parts of Moggy's ship. Vehicles 8 and 9 are NULL because there are no other parts to this ship. Convoy additional spacing (feet) is set to -1 Because it is negative the exe renders every vehicle at the same spot, so we see the complete ship The Convoy speed (knots) = 25 for each part so they all move in unison. What I have done today is to add a little code so that if the hull is badly damaged or destroyed then the convoy speed is set to zero and the entire ship stops moving. Previously something could be damaged, so some things stopped but others carried on moving. Jel Edit: In the same way that these moving TMods are grouped in the "TList31.mpf" file we could have a system in which static TMods are grouped in a "SList31.mpf" file, and that when the hull is destroyed then the things on the deck are also destroyed and go down with the ship. My initial thoughts are that the file would be a list of TMods starting with the hull.
Last edited by MrJelly; 05/07/19 04:43 PM. Reason: More info
Fly EAW online at GameRanger: GameRanger SiteFaceBook Pages UAW 160 downloadsEAW ClubMark Twain: I am quite sure now that often, very often, in matters concerning religion and politics a man's reasoning powers are not above the monkey's.I am now of an age at which I no longer need to suffer fools gladly
|
|
#4473405 - 05/08/19 03:31 PM
Re: TMod hard points
[Re: Brit44 'Aldo']
|
Joined: Jan 2006
Posts: 1,506
Brit44 'Aldo'
Every Human is Unique
|
Every Human is Unique
Member
Joined: Jan 2006
Posts: 1,506
|
Tony, The advantage of using a bit mask is that you are not limited for the combination of objects. Your way of using a list is valid and faster code to execute, but the speed advantage is small in this case. The bit mask method would also require the target editor to be modified so that the bits are added to the saved data.
Also, look at the functions destroy_grid and blow_up_building. They may do what you need to destroy all TMods in a grid. Ray, The letters and numbers you currently use for aircraft are hard coded. The code reads like a list. Look for xx file, If xx is found then render it. Look for xy file, if xy is found then render it. Your empty F method essentially adds parts to the list. When the game is loading, it stores which parts were found so that the test does not need to be done every time the plane is rendered.
TMods already use this method, but the list of parts is much smaller. Your multi part TMods will be limited to one model for each type. IE all cargo ships with jeeps will use the same 3D model and take up one slot of the TMods list. If you want a caro ship with trucks, it will require a new 3D model and take up another slot (TargetData[MAX_TARGET_TYPES_POSSIBLE]).
typedef struct _TargetInfo will need the addition parts added to it. load_target_model will need the addition parts added to it. free_target_model will need the addition parts added to it. draw_target_object will need the addition parts added to it.
As to rendering: DirectX tends to render much larger polygons over small polygons. If the ship can be made of smaller polygons then DirectX will do a better job of rendering with out a dedicated rendering sequence (RS).
Look at draw_target_object. Model types less then or equal to 2 do not use floating point rendering. ModelType 0 = no model, 1 = plane sized object, 2 = ground sized object
TPA who TWI "The 10th Amendment simply says that any powers that aren’t mentioned in the Constitution as belonging to the government belong to the states themselves."
|
|
#4473411 - 05/08/19 04:05 PM
Re: TMod hard points
[Re: Brit44 'Aldo']
|
Joined: Jan 2006
Posts: 1,506
Brit44 'Aldo'
Every Human is Unique
|
Every Human is Unique
Member
Joined: Jan 2006
Posts: 1,506
|
For more rendering sequences, take a look at make_target_tree.
If you choose to use the bit mask method for multi part TMods, then UBYTE ModelType looks to be the logical place. UBYTE Smoke is currently used as a Boolean for on/off smoke graphics so numerical values above one are available. Both have a reasonably few entries in the code that would need an &0x3 added to separate them from a multi part TMod
Simplest flags would be if greater then 3 then multi part model = true. If & 0x4 then parent, if & 0x8 then child. ModelType would need to be investigated to verify the numerical values currently used.
Edit 2: The function destroy grid could be used as a templet for destroy child
Last edited by Brit44 'Aldo'; 05/08/19 04:19 PM.
TPA who TWI "The 10th Amendment simply says that any powers that aren’t mentioned in the Constitution as belonging to the government belong to the states themselves."
|
|
#4473483 - 05/09/19 03:51 AM
Re: TMod hard points
[Re: Brit44 'Aldo']
|
Joined: Jan 2006
Posts: 1,506
Brit44 'Aldo'
Every Human is Unique
|
Every Human is Unique
Member
Joined: Jan 2006
Posts: 1,506
|
A destroy child object function would look something like this. I am sure it has a few bugs //============================================================================= // Based upon the EAW original routine destroy_grid // Used if a damaged TMod has been flagged as multi-part // It checks an individual grid. You need a loop to check all locations of the // parent model
void destroy_child(long x, long y) // x and y are the grid locations // Use a for loop or whatever to cover the parents X and Y and call this function for each grid location { T_T_D* TTD; // names have been changed to protect the NDA TI* pTT; // names have been changed to protect the NDA TILE_T* pTileT; // names have been changed to protect the NDA
long gX = Mine_MAPX(x); // names have been changed to protect the NDA long gY = Mine_MAPY(y); // names have been changed to protect the NDA long i;
TTD = FetchTarget(gX,gY); // get all TMods at this grid
if (TTD != NULL) // If you found TMods { pTileT = TTD->targets; // these are the TMods within the grid for (i = 0; i < TTD->ntargets; i++, pTileT++) { pTT = &(TargetData[pTileT->id]); // the for loop advanced search and the slot of the found data // it looks like we are finding a dedicated model, this may need some work
if (pTT ->ModelType & 0x8) // child object found // verbiage for above line may be wrong for PTT pointer, we are checking if the TMod matches our child flag { if ((pTT->MaxDamage > 0) && !(pTT->TargetType & TAR_MGO)) // we may not care if it is a MGO { /* this section probably adds to the kill score, could be campaign related You may or may not want the stacked TMods to add to this data
last_target_hit.gridx = gridx; last_target_hit.gridy = gridy; last_target_hit.id = i; */
// Here is where I stopped DLTHit(FALSE); } } } }
return; }
TPA who TWI "The 10th Amendment simply says that any powers that aren’t mentioned in the Constitution as belonging to the government belong to the states themselves."
|
|
|
|