Page 3 of 4

Re: BF 1942: Modding: first train made!

Posted: Sat Dec 07, 2013 5:27 pm
by Swaffy
The only problem I can think of is the locomotive's center of mass. It's too high and so it tends to lean over a lot. And I mean a lot, it wobbles left and right on the track.

Re: BF 1942: Modding: first train made!

Posted: Sat Dec 07, 2013 8:07 pm
by Vilespring
Swaffy wrote:The only problem I can think of is the locomotive's center of mass. It's too high and so it tends to lean over a lot. And I mean a lot, it wobbles left and right on the track.
Oh yeah. That looks a bit odd

"Hey guys! LOOK AT ME"

......./../
..../--..._
.../...O../
../......./..........?
./......./..........O
/_...../.......... /|\
....---/............/.\

Re: BF 1942: Modding: first train made!

Posted: Thu Dec 12, 2013 3:34 am
by Vilespring
Is there an update to the train yet? I would like to see it become better. It is hard to think of something like that getting better! :lol: (well, few things, like it is odd to drive vehicles across the tracks.)

Re: BF 1942: Modding: first train made!

Posted: Thu Dec 12, 2013 6:12 pm
by BotHunter
Vilespring wrote:
Swaffy wrote:The only problem I can think of is the locomotive's center of mass. It's too high and so it tends to lean over a lot. And I mean a lot, it wobbles left and right on the track.
Oh yeah. That looks a bit odd

"Hey guys! LOOK AT ME"

......./../
..../--..._
.../...O../
../......./..........?
./......./..........O
/_...../.......... /|\
....---/............/.\
you have too much time on your hands :D

Re: BF 1942: Modding: first train made!

Posted: Fri Dec 13, 2013 3:13 am
by Vilespring
BotHunter wrote:you have too much time on your hands :D
I tend to have that issue! :lol:

Re: BF 1942: Modding: first train made!

Posted: Fri Dec 13, 2013 8:00 am
by Swaffy
He just has a bit of perfectionist in him, every modder/developer can use some perfectionism in them. Me ... I might be more of one than I should be.

Re: BF 1942: Modding: first train made!

Posted: Fri Dec 13, 2013 5:03 pm
by exe
Vilespring wrote:Is there an update to the train yet? I would like to see it become better. It is hard to think of something like that getting better! :lol: (well, few things, like it is odd to drive vehicles across the tracks.)
I'm finished with it, it's now up to the individual mod devs to change what they don't like. ;)

Yes it leans a bit but that's not really a big issue imo.

Re: BF 1942: Modding: first train made!

Posted: Sun Mar 30, 2014 7:56 pm
by exe
Although I said differently I decided to take a second look at the train and fixed/changed a lot of things. Everything has been tested on a dedicated server (though only with 2 ppl and for about 1/2 hour).
  • Overall a lot less glitches and jitter
  • Switches are usable now, change direction with A/D, a vehicle icon on the minimap indicates the chosen direction
  • Carts don't lean anymore on turns
  • Any vehicle can now pass over the rails
  • All wheels rotate
  • Added placeholder sounds (really crappy ones sorry) :lol:
  • Carts don't lag behind anymore when in driver position in multiplayer
  • For testing purposes I modified Stalingrad a bit more
To make it work that vehicles can pass over the rails you have to invest a bit more time on the map now, basically it's the regular Vanilla Rail with an almost Vanilla COL. Beneath that is the "guide rail COL" hidden (suffix "_drive_m1"). Only the train interacts with that (use of ApacheThunder's c_CGStaticObjects trick). Sadly I couldn't find a way to attach a second COL to an object which isn't ignored by the wheels. If you have an idea please let me know.

Because of that you have to place each rail twice (regular "_m1" + guiding rail "_drive_m1") on the map at the same exact position. To avoid errors I think it's best to do it in notepad and not in the map editor so I copied all rail positions from the staticobjects.con and replaced each one with the correct name. Doing that by hand is extremely tedious so I programmed a quick MS Word macro which does the work for me. You can see the result in the TrainGuideRails.con in the provided map.

Some may find it strange how I coded the loco driver but I advise to not change the hierarchy or you'll get a nasty surprise in multiplayer. :P

Link: https://drive.google.com/file/d/0ByT8vo ... sp=sharing

Re: BF 1942: Modding: first train made!

Posted: Sun Mar 30, 2014 9:58 pm
by Vilespring
Ah!
I must see now! :lol:

okay, I looked at it, and it is MUCH better than the last version.
I see the vehicles running over the tracks are better, they don't take as much damage.
could you try making the invisible track out of sand bag material? sandbags don't hurt vehicles at all, no matter how fast it's going!

Re: BF 1942: Modding: first train made!

Posted: Mon Mar 31, 2014 5:24 am
by Apache Thunder
Vehicle damage is simply a matter of material settings and would be quicker to change the materials for the tracks used in the mod instead of creating more objects to get around it (changing materials on collision meshes works as a server side mod too. ;) ). Perhaps alter the materials used on the visible track portion of the tracks to use a alternate material that doesn't damage vehicles. 107 is the material used by sandbags.

Example image. I made the collision mesh see-through to show the visible track LOD. The vanilla tracks actually have a ramp as their edges. If that was not the case vehicle damage would be worse, and vehicles would get struck trying to pass over it. Vanilla tracks are already configured like this. But any new tracks or modded ones need to retain this feature for best results when it comes to vehicles trying to pass over them. You can change the material of the entire mesh, but the selected faces shown below are really all that you need to change to fix vehicle damage problems:

Image
(thumbnail, click to enlarge)

The current material for the tracks is 8 which is one of the terrain materials. (Gravel in this case) Ground materials have considerably higher damage settings then building materials and for objects like these, I would not recommend using them. But tell that to EA. :P

Ground materials have materialDamage set to 30 while most buildings have it set to just 1. Sandbags is set to zero which is why it doesn't damage anything. ;)

Just about any building material could be a suitable replacement to the ground materials used on the track meshes. I'd recommend one that uses similar projectile impact effects as the original. Sandbag material is fine, but you'll get the sand bags leaking effect if you shoot at the tracks with that material. Try something like concrete. If it still damages too much, you can either use the sandbags material or material 98 which is labeled "Iron stairs" and usually just has a metal related impact effect in the projectile damage settings. MaterialDamage is not even defined for that material so I have to assume it's also zero like sandbags.