• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code Defining the

DevilDog (Teufelhund)

Grizzled Veteran
Feb 25, 2006
156
0
USA
I’m hoping this is an easy answer and I will try to keep it short (but do not count on it). :) As always any help is greatly appreciated.

This is last little nagging issue on the M1937 AT-Gun that I’ve just not been able to fully put to rest. I am trying to setup the driver hit point for the cannon (aka gun). It may be more that I do not understand all the different interactions between the code and the model also. Hopefully someone can help the light bulb come on.

Anyway, I am trying to setup the “VehHitpoints” array in the M1937Cannon class that extends off ROTankCannon. The current way I have it setup is below.

VehHitpoints(0)=(PointRadius=15.0,PointHeight=0.0,PointScale=1.0,PointBone=com_player,PointOffset=(X=0.0,Y=0.0,Z=0.0))
VehHitpoints(1)=(PointRadius=20.0,PointHeight=0.0,PointScale=1.0,PointBone=com_player,PointOffset=(X=0.0,Y=0.0,Z=-25.0))

I’ve been trying a number of different values for the PointOffset and even com_attachment for the PointBone but it just does seem to ever move into the right place. I want to move it back further behind the shield. The “right” place would be to the rear of the gun behind the shield where the “stick” figure is placed. Now you know why I do not do textures…..

m1937.JPG


My questions are these:

1: In the editor I have setup the collision boxes under mesh tab in the Animations for the turret. Does the collision box(s) define the area in which you can place or move the VehHitpoints? I’ve noticed that if I make the collision box to small for the body (carriage) it affects the area in which I can attach to the gun.
2: What is the reason for the second collision box in the turret of the tanks? Does it provide the area for the VehHitpoints?
3: In VehHitpoints there are the 0 and 1 indexes. Does 0 represent the pawn’s head and 1 the torso? I’ve seen a comment in the code that 0 is the driver.
4: Would it just be simpler to move the bone to where I need it?
5: Is there a tool or other way to measure out the distances for the offset or PointRadius versus trial/error/experience? I’ve been using the change the code, compile, run test map, shoot at player on gun, back to start method.

Again, thanks for the help. If the answers lie in the UnReal wiki just let me know. It’s blocked at my office, so I only have the RO forum to use right now.
 
Have you checked the collision models for the tanks? You will find a sphere placed where the drivers head would be.
Same goes for the turrets. The exposed variable on the different viewports only state wether the player should be killed there or not. Imo you would have to create a collision model for you gun that also includes the player. Since you would have to check wether the vehicle is hit first.
 
Upvote 0
Yeah there is a much easier way to set up the player collision for this. Here are the steps you need to follow:

1) Make certain that you have collision for the where the player is going to be setting for your cannon set up in the editor. You should basically have a blue collision box (when you turn on show collision in the editor) around the entire area where the player's body will be. This is what the engine will use to determine if it should check the more specific player collision defined by the VehHitPoints. See the attached DriverCollision0.jpg for reference (the top blue box is the collision box I am referring to).

2) Next you need to do something to enable the special player collision debugging. Hopefully this works right for modders, as I have never tried it with the SDK. What you will need to do is recompile the ROEngine.u with making a modification to the ROLevelInfo.uc file. At the very bottom of ROLevelInfo.uc you will see a variable named bRODebugMode. Set this to true, and recompile ROEngine.u. You will probably have to place this modified ROEngine.u in your mod's system directory, ortherwise it will be overwritten by Steam when you start the game.

3) Launch the game and walk up to your AT gun in game. At the console type the command "drivercollisiondebug" (without the quotes). This will show you some neon green spheres that represent the location of your actual player hit detection for your cannon.

4) Once you have the special collision sphere debugging turned on, you should now edit your collision spheres to be where the players body will be while using your AT gun. This can be accomplished with some special console commands. If you aren't already in Windowed mode, switch to windowed mode with Alt+Enter. Then type this console command "editactor class=M1937Cannon". This will pop up a window that will allow you to directly edit variables for your cannon (or any actor for that matter) in real time. You should see something now that looks like DriverCollision1.jpg.

5) Just modify the values of the VehHitPoints array directly until they are the size and location that you want them to be in. Then, plug these values back into your M1937Cannon.uc file. An example of modifying the values is seen in the attached DriverCollision2.jpg.

Anyway, I hope this helps.
 

Attachments

  • DriverCollision0.jpg
    DriverCollision0.jpg
    38.8 KB · Views: 0
  • DriverCollision1.jpg
    DriverCollision1.jpg
    95.6 KB · Views: 0
  • DriverCollision2.jpg
    DriverCollision2.jpg
    94.4 KB · Views: 0
Upvote 0
hmm, i have a problem then :S
a mod folder is not really an option for me...
Ah well, i will find a way.

Edit: tried to do the changes to the ROLevelInfo actor anyway, but am stuck when compiling the ROEngine new
when importing defaults for ROPawnSoundGroup. Doing anything wrong there?
 
Last edited:
Upvote 0
Anyway, I hope this helps.

I'm sure it will. Thank you so much! I'll give this a try ASAP. And here my wife thought this was coming to an end......

If we've learned anything making this and the BT-7, it's been that we have a much better understanding of the time and effort that goes into creating a vehicle.

Cheers!
 
Upvote 0
hmm, i have a problem then :S
a mod folder is not really an option for me...
Ah well, i will find a way.

Edit: tried to do the changes to the ROLevelInfo actor anyway, but am stuck when compiling the ROEngine new
when importing defaults for ROPawnSoundGroup. Doing anything wrong there?

Problems compiling ROEngine also.

Would adding parentheses to bRODebugMode allow us to change it via the map and the Actor properties window? Could this be changed in a future update to ROEngine? Silly idea, but it's a thought. :)

If anything, the first step has helped and I learned some more.
 
Upvote 0
It sounds like you guys are compiling within wotgreal. In this instance, you need to compile from a DOS prompt, or from a batch file (details on launching ucc from a batch file can be found here: http://www.redorchestragame.com/forum/showthread.php?t=14452)

The reason you have to compile from a batch file, is that UCC is asking you a question which requires you to type y or n (for yes or no) when it reaches a certain point in the compilation. Wotgreal doesn't support this, so you have to use the DOS or batch file methed. So you should see a question pop up after ROPawnSoundGroup gets compiled that says this:

The file '..\ROEngine\Inc\ROEngineClasses.h' needs to be updated. Do you want t
o overwrite the existing version? (Y/N):


Type N and then it should finish compiling. It doesn't look like you even need to do the whole mod directory thing either that I mentioned above. Just run the game after recompiling with the changes I mentioned in my first post and then do all your collision debugging. When you are done doing your collision debugging, delete ROEngine.u and then verify the cache for Red Orchestra to force steam to redownload the proper ROEngine.u(otherwise you won't be able to connect to any servers). Alternatly you could just create a backup copy of it.
 
Upvote 0
so, i managed to compile me a new ROEngine with the ROLevelInfo changed.
But i get nothing with the drivercollisiondebug. Also no errors...

Have I missed something?

Worluk and I figured this out the other day after talking to each other in IRC. Seems you have to save the map you are going to be testing this stuff on after the code has been recompiled with the debugging enabled.
 
Upvote 0
Same results.... After fixing some self-inflicted compiler issues :rolleyes: I got ROEngine compiled.

I doubt this will help, but just in case I tried a few things. Unfortunately none worked. Maybe it will give you an idea or spark a thought.

- Added ROLevelInfo to my test map through the actor browser. I was getting command unrecognized with "drivercollisiondebug" until I did this.
- Hosted my test map. Thought that maybe it would work the same way as debugging penetration does in the ShouldPenetrate functoin where it has to be done on a server. Or, at least in my experience that is how it displays.
 
Upvote 0
Same results.... After fixing some self-inflicted compiler issues :rolleyes: I got ROEngine compiled.

I doubt this will help, but just in case I tried a few things. Unfortunately none worked. Maybe it will give you an idea or spark a thought.

- Added ROLevelInfo to my test map through the actor browser. I was getting command unrecognized with "drivercollisiondebug" until I did this.
- Hosted my test map. Thought that maybe it would work the same way as debugging penetration does in the ShouldPenetrate functoin where it has to be done on a server. Or, at least in my experience that is how it displays.

The drivercollisiondebug will definitely not work in multiplayer. It will work offline only.
 
Upvote 0
Sorry for all the trouble sorting this out guy, it looks like there is one more thing you need to do. If you are trying to do this debugging on a level with a skybox, you need to turn skybox rendering off for the debugging to work. You can toggle the skybox rendering with the "show sky" console command.

I had totally forgotten about this step, since the map I use to set up my vehicles has no skybox. Anyway, I can guarantee this should work if you follow all the stuff I listed in the previous posts above and turn off the sky box as I just tested it with the mod SDK on my home computer. Good luck guys, and sorry for the all the convoluted explainations.
 
Upvote 0