Welcome, Guest
Username: Password: Remember me
Talk about modding the game or post your mods you want to share here.

You can also post requests for specific funtions or variables if you need any and we will see what we can do about them. (No guarantees though).

Please be advised that since the game is still in development many aspects of how the game operates are likely to change.

TOPIC: Body Modding

Body Modding 3 years 4 months ago #1

  • Murray
  • Murray's Avatar
  • Offline
  • Mid-size car maker
  • Posts: 81
  • Thank you received: 7
  • Karma: 5
I'd LOVE to be able to create low riders, monster trucks, SUV's, and maybe they're coming in V?? Also wide wheels, hood scoops, spoilers,hatchbacks if for nothing more than my own gratification.



I'd love to be able to add features to the data fields and see them become reality


Thanks as always.
Last Edit: 3 years 4 months ago by Murray. Reason: spelling
The administrator has disabled public write access.

Re: Body Modding 3 years 4 months ago #2

  • Merced
  • Merced's Avatar
  • Offline
  • Developer
  • Posts: 539
  • Thank you received: 91
  • Karma: 19
Body modding is probably the hardest thing to mod as the game does not have any models for the cars but generates them by using what I like to call rounded rectangles.

You can take a look at the file bodytypes.dat in the Data directory as that file contains the body descriptions. For each type (or generation) there need to be Dragpoints and Parts specified.


Exampel for a Dragpoint (Type 1 car, engine hood length)
Point 7 Rem Engine Hood Length
Location 0, p15+p10/2, p1-0.5
DragAxis z, p1-0.9, p1-0.3
AI -lengthENG
Parent 1
condition curtech ehood01
EndPoint

DragPoints are always defined between Point and EndPoint, the Location is the default position of the dragpoint which is dragable along the axis given in DragAxis within the confines given with that command.
The AI command tells the AI what this point does, while the Parent command links this dragpoint to dragpoint 1 (meaning if dragpoint 1 is moved, this one [7} will move with it).
The condition requires the component ehood01 installed on the car for this point to exist.

And this a part of the engine hood itself:
Part Engine-Hood
Vertex 1, p22, p16, p4
Vertex 2, 0, p15, p1
Vertex 3, 0, p15, p7+0.01
Vertex 4, p22, p16, p7+0.01
Edge 1, p22, p15, p1
Edge 2, p22, p15, p7+0.01
Material body
mirror
steps 1, 6
snaptoz Front, p1-0.1, p4+0.1
condition curtech ehood01
EndPart

The 4 Vertices given are the corner points of the rounded polygon, with the Edge points "pulling" the sides to a round shape. You can have up to 5 Edges, the 5. being a pullpoint above the center of the polygon, connecting points 3 and 4.
Material defines what type of material this part is to be rendered in, while mirror tells it that this part is to be mirrored from left to right, to make both sides of the car.
Steps gives the amount of steps to render the curves in, in this case the polygon is flat in one direction (1 step) and broken up into 6 steps in the other. Don't overdo this, as it will let your polygoncount explode.
The snaptoz crops the last line of vertices along the axis, in this case it causes the engine hood to stop at the rounded front of a gen 1 car and not go into the passenger area. This one is probably pretty hard to work with as this is the only instance it is being used and will probably not work under different circumstances.
The condition is the same as in the DragPoint: This part will only be created if the component ehood01 is present on the car.

Adding components is a bit tricky at the moment. You will need to add it to components.dat, add them in the bodyeditor.dat (this part will soon be revised as I don't want to have to add every part manually) and you will need to add them to the supportedtech line in bodytypes.dat. After that you can set select it, still needs to be added to the body definition like the one above with the right condition.

As I said this is probably the hardest thing to do right now ;-)
Last Edit: 3 years 4 months ago by Merced.
The administrator has disabled public write access.
The following user(s) said Thank You: Murray

Re: Body Modding 3 years 4 months ago #3

  • Murray
  • Murray's Avatar
  • Offline
  • Mid-size car maker
  • Posts: 81
  • Thank you received: 7
  • Karma: 5
I tried, but thanks for a great game. If it's one think it's rock solid stable and I don't think I want to change that....
The administrator has disabled public write access.

Re: Body Modding 3 years 3 months ago #4

  • Pie and Chips
  • Pie and Chips's Avatar
  • Offline
  • The Inner Circle
  • Posts: 47
  • Thank you received: 4
  • Karma: 3
I had a quick look and made some silly changes to the wheel sizes:



So, the values next to each vertex, the p22, p16, p4 etc, are they the co-ordinates of each vertex in x,y,z?
The administrator has disabled public write access.

Aw: Re: Body Modding 3 years 3 months ago #5

  • Merced
  • Merced's Avatar
  • Offline
  • Developer
  • Posts: 539
  • Thank you received: 91
  • Karma: 19
lol, I like the one with the tiny wheels.

Yes, the 3 values given after a vertex (and it's number inside the part) are x, y, z coordinates. Each of the values can be a simple mathematical calculation, so you can make their position dependant on the dragpoints, it is however important to note that these caluclations are rather "quick and dirty". They are performed from left to right only - no order of operation rule and no brackets. The p-values themselves are the coordinates of dragpoints (defined further up in the file). So if you use a p22 in the calculation of the x-position of a vertex, p22 will be replaced by the x-position of dragpoint 22. The y-position of the vertex will reference the y-position of the dragpoint and so on.
If you need to reference another axis you can simply replace the p with an x, y, z.

Example:
Vertex 1, 0, 0, p17-x12


This will set the position of Vertex 1 to x = 0, y = 0 and z = (z-position of dragpoint 17)-(x-position of dragpoint 12)
The administrator has disabled public write access.
The following user(s) said Thank You: Murray, Pie and Chips

Re: Body Modding 3 years 2 months ago #6

  • Pie and Chips
  • Pie and Chips's Avatar
  • Offline
  • The Inner Circle
  • Posts: 47
  • Thank you received: 4
  • Karma: 3
Thinking more on this topic... Is this the way that you created the vehicles (entering all of the vectors manually)? Or did you use another program to draw the vehicles graphically and then convert them to the vector format in the dat file?
The administrator has disabled public write access.

Re: Body Modding 3 years 2 months ago #7

  • Merced
  • Merced's Avatar
  • Offline
  • Developer
  • Posts: 539
  • Thank you received: 91
  • Karma: 19
Yes, all of that was entered manually.

I did use some crude drawings to visualize the most important points and later created a tool that would pair a text editor, a preview that would just need me to press "update" to see the geometry changes and a way to quickly get to the definitions. But it's still entered manually.

I would release that tool, but aside from being hard to use (unless you know exactly what to click you can screw the entire file up) it is also hard coded to the directory structure of my projects folder as it was never intended to be released.

Given the time needed to get a releaseable version it is unlikey that there will be one, at least of that editor/helper. Especially since I am intending some more and extensive changes around v0.50 or 0.60, in part based on all the suggestions I have received. So for now you are probably stuck with plain text editors.
The administrator has disabled public write access.
The following user(s) said Thank You: Murray, Pie and Chips
Time to create page: 1.987 seconds
Powered by Kunena Forum