Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facility vehicles 001 - Road roller #9164

Merged
merged 26 commits into from Sep 24, 2014

Conversation

Projects
None yet
3 participants
@Aenye
Copy link
Contributor

commented Sep 21, 2014

Adds the first road construction vehicle on my list - road roller. Based on a flatbed truck (tried to emulate the single-man cabin to some extent), it features a row of heavy duty drums at the front and at the back. These can be deconstructed only, yielding some steel plating and debris.

Wanted to make it spawn in the public works (can it be done ?), but it seems that the building is non-mapgen.

@Aenye Aenye changed the title Facility vehicles 001 - Road roller Facility vehicles 001 - Road roller [WIP] Sep 21, 2014

Aenye added some commits Sep 21, 2014

Makes road rollers spawn randomly
Adds road roller to the list of randomly spawned, parked vehicles with a 3% probability, slashed out from the pool for electric cars.

@Aenye Aenye changed the title Facility vehicles 001 - Road roller [WIP] Facility vehicles 001 - Road roller Sep 21, 2014

@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 21, 2014

Looks proper. Couldn't find any code to set the type/amount of damage on collision with vehicle part, so I gave the roller drum a lot of health and mass.

Aenye added some commits Sep 21, 2014

Removed "OPAQUE" on roller drum
This could be considered just a really big wheel - impassable surely, but with a slightly elevated driver's position, should be able to see past it.
"item" : "hd_steel_drum",
"difficulty" : 7,
"location" : "center",
"flags" : ["OBSTACLE"],

This comment has been minimized.

Copy link
@KA101

KA101 Sep 21, 2014

Contributor

These should probably have the WHEEL flag, since they're intended to flatten all in their path. ;-)

Aenye added some commits Sep 21, 2014

Removes wheel from roller
With roller drums getting the wheel quality, the roller doesn't need "standard" wheels anymore - removing them and updating the vehicle blueprint.
@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 21, 2014

Gave them the wheel quality and removed the wide wheels in the vehicle blueprint. Looks more "trucky" now.

@KA101

This comment has been minimized.

Copy link
Contributor

commented Sep 22, 2014

Looking at this one now. It's entirely possible to add the steamroller to the public works, just needs some tinkering in mapgen.cpp around line 5853. You up for it?

@KA101 KA101 self-assigned this Sep 22, 2014

@KA101

This comment has been minimized.

Copy link
Contributor

commented Sep 22, 2014

Initial trial: the roller drums are missing the drive-function of tires. Needed to add one before it would go anywhere. Not familiar with vehicle coding so not yet sure what to fix.

The roller FLIES once it has wheels. 119 MPH was quite feasible. Unfortunately the drums aren't quite armored enough to flatten a car that I hit at 69MPH. Ended up going through the drums and getting the windshield torn up. Will try a horde and a house shortly.

Hordes: SPLAT. Would recommend aftermarket frame-replacement if you plan on making this a combat vehicle, though. (Leave it as standard frames. It's not intended to pave people.)

Forest: Don't try to use the Roller to make a road. Loses v. trees, but then so can tanks.

Houses: Breach and back up. The collapse won't do your ride any good.

@KA101

This comment has been minimized.

Copy link
Contributor

commented Sep 22, 2014

Found the problem. Rollers need a width and a bigness value. vehicle.cpp, wheels_area.

OK. Needs to have an entry in var_vehicle_parts.json so it can have a bigness value, and then needs a wheel_width in the vehicle_parts.json. With those in place, the rollers can serve as the most durable wheels you'll ever have.

FWIW: http://www.cat.com/en_US/products/new/equipment/compactors/tandem-vibratory-rollers/18350130.html
(Or this one might be a better fit? http://www.cat.com/en_US/products/new/equipment/compactors/tandem-vibratory-rollers/18350540.html )

@KA101 KA101 removed their assignment Sep 22, 2014

@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 22, 2014

Thanks - will be working on it today and tomorrow (work again). I'll try doing the public works as well.

( There's a "damage_modifier" parameter that can be set (typically 50 or 60) - if I understand correctly, setting it at, say 20, should significantly reduce the dmg taken by drums, right ? )

I'll get on setting the numbers and testing ASAP. Thanks for the mouthwatering links - I want to have my survivor drive such a monster ^^

Adds wheel_width to roller drums...
...and sets it at twice the width of armoured wheels.

@Aenye Aenye changed the title Facility vehicles 001 - Road roller Facility vehicles 001 - Road roller [WIP] Sep 22, 2014

Aenye added some commits Sep 22, 2014

Removes roller drum from melee.json
Moved to var_vehicle_parts.json, so it can have a bigness.
@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 22, 2014

Checked vehicle.cpp - wheels_area doesn't need any modifications, after I added the bigness and width, does it ?

Adds road roller to public works
Should substitute a road roller for the flatbed truck in 25% of public works specials.
@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 22, 2014

Added some random number checking to mapgen.cpp for whether the vehicle atp ublic works will be a flatbed or a roller. Everything should work fine now - will be testing tomorrow (sorry for being so sluggish !).

"price": 50000,
"material": ["steel"],
"weight": 22600,
"weight": 185000,

This comment has been minimized.

Copy link
@KA101

KA101 Sep 22, 2014

Contributor

Yikes! two weight lines. (One of the reasons I posted those links: the drum on the smaller roller weighed a little over 800000 grams per segment--five drums/segments to front/back of the Roller. Top speed was 7.5 MPH. The road roller should be a heavy monster.)

"item" : "hd_steel_drum",
"difficulty" : 7,
"location" : "center",
"flags" : ["OBSTACLE", "WHEEL"],

This comment has been minimized.

Copy link
@KA101

KA101 Sep 22, 2014

Contributor

Needs the variable-size flag too. Sorry.

"symbol": "m",
"color": "light_gray",
"name": "large steel drum",
"description": "A large cylinder fashioned out from thick plates of hardened steel, that is normally found on road rollers. Numerous massive spokes, attached to a central axis, reinforce its structure even further, making it an unstoppable force once it starts rolling.",

This comment has been minimized.

Copy link
@KA101

KA101 Sep 22, 2014

Contributor

Nitpick: either "fashioned from" or "fashioned out of". Sorry. :-/

@KA101

This comment has been minimized.

Copy link
Contributor

commented Sep 23, 2014

Looking forward to it.

Haven't seen the damage_modifier, so not sure. Sorry. wheels_area takes those values and 8-) rolls with them, so yeah, should be good to go there. Public works looks good.

Aenye added some commits Sep 23, 2014

Fixes weight/volume and description
Removes duplicated weight line (how did that get in there ? Sorry). Increases the mass of a drum section to a whooping 500 kg and ups the volume slightly - this IS supposed to be a huge and extremely massive drum after all.
Makes roller drums vary in size
Adds variable_size flag to roller_drum
Adds more stuff upon roller breakage
Significantly increases the amount of lumps/chunks/scrap dropping when a roller drum breaks - 500 kg of steel does not simply "vanish".
Updates roller deconstruction recipe
Time to deconstruct increased threefold, amount of consumed welder/toolset charges doupled and item drops increased a bit.
@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 23, 2014

Testing out the damage modifier and the numbers that are in ATM - let's see how this ...rolls out.

Adds "null" to materials for roller drum
Putting "steel" as the only material resulted in a "expected string" error. Now works properly.
@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 23, 2014

Works nicely now - still not massive or resilient enough, but it takes an entire truck to destroy a single row of drums...

Also, "damage_modifier" seems to modify the maount of damage taken by anything a part hits , hence it is upped for blades and spikes (250 / 300 respectively) and lowered for doors and windshields (50/80 respetively). Setting it at 500 should reflect what happens to things when they get rolled over by something like this.

Aenye added some commits Sep 23, 2014

Ups the weight/bigness of roller drums
Weight/bigness increased yet again, this time by 50%
Updates roller drums
Adds a damage modifier of 500 (visualise getting rolled over - at least twice the damage of getting hit by a blade/spike) and increases durability (from 3500 to 7500) of roller drums.
@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 23, 2014

Updates helped - "safe speed" with 10 roller segments is around 70 km/h (top speed at almost a thousand is ...odd). Hitting cars deals a lot of damage, but standard ones typically don't break the drums anymore. Tried plowing through a forest - went about a house's length into it before the last of the drums gave out.

IMHO is ok now.

@Aenye Aenye changed the title Facility vehicles 001 - Road roller [WIP] Facility vehicles 001 - Road roller Sep 23, 2014

@Mshock777

This comment has been minimized.

Copy link
Contributor

commented Sep 23, 2014

Maybe change v12 to something cheaper and less powerful?

@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 23, 2014

You're right - set it to v8. On the other hand, though, a roller should have an immense (and gas guzzling) engine - even that would allow it only a little speed. While I could set the drum size/width to have this, the values for that seem to be unrealistically high...

I would say that the wheel_area system needs to be tuned, but I'm not yet sufficiently adept at coding stuff (as everyone can see).

Ok, it needs an update:
Keeping a roller I've found (51' rollers, so wheel bigness was a constant, done on v12 engine), I was changing width (w) and mass (m) of the roller drum, while jotting down the safe/maximum speed (sp) that was attainable:
w=200, m=750 kg -> sp 33/1239
w=200, m=1500 kg -> sp 33/1239
w=200, m=15000 kg -> sp 33/1239

w=60, m=750 kg -> sp 95/1239
w=60, m=1500 kg -> sp 95/1239
w=60, m=15000 kg -> sp 94/1239
w=60, m=1 g -> sp 95/1239

w=20, m=750 kg -> sp 197/1239
w=20, m=1500 kg -> sp 197/1239
w=20, m=15000 kg -> sp 189/1239

The mass of the wheels/whole car seems to be under-represented in the current system. Is there any reason for that (i.e. making mass a bigger factor would break something) or can I think about meddling with it ?

@Mshock777

This comment has been minimized.

Copy link
Contributor

commented Sep 23, 2014

I think max speed is only determined by engine?
int vehicle::max_velocity (bool fueled)
{ return total_power (fueled) * 80; }

@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 23, 2014

Ah, I see it. Also found-

int max_velocity (bool fueled = true);

-in vehicle.h. If the max speed is dependent only on the type/amount of engines, it pretty much tells you "if you suspended the engine on a float, this is how fast it could go". IMHO this looks redundant and could be scrapped in favour of the k/mass dynamics parameters we can already see. That or there's some other factor I'm unaware of (if so, sorry).

@KA101 KA101 self-assigned this Sep 23, 2014

@KA101

This comment has been minimized.

Copy link
Contributor

commented Sep 23, 2014

Last one to seriously grapple with vehicle code was @ianestrachan, IIRC. Pretty confident @i2amroy did something in vehicles more recently, but I'm not sure how thorough it was. Hopefully they'll be better informed about this, though changing the system should wait until after 0.B hits.

For now, Rapid Roller will probably be OK.

@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 23, 2014

Thanks ! I'll work out the formulas and if we can scrap max/safe speed in favour of accleration, we should be able ot make the roller into a slow-but-nigh-unstoppable fortress... If we get inertia as well, this could make for a nice solution to collisions and the "tree problem". Might also find some use for other stuff...

@@ -5854,21 +5854,45 @@ __________ f \n",
if (t_west == "public_works" && t_north == "public_works") {
rotate(1);
if (x_in_y(2, 3)) {
add_vehicle ("flatbed_truck", 2, 0, 90);
roller_check=rng(0,100)

This comment has been minimized.

Copy link
@KA101

KA101 Sep 23, 2014

Contributor

Detail I missed: these roller-check rolls need semicolons afterward. I'm fixing 'em in the merge.

@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 23, 2014

Whoops, sorry and thanks for correcting ! :D

@KA101 KA101 merged commit 326ab5e into CleverRaven:master Sep 24, 2014

1 check failed

default Unmergeable pull request.

@Aenye Aenye deleted the Aenye:facility_vehicles_roller branch Sep 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.