Add anything to the 3D stadium (eg: put the tournament name)

Everything about Modding the game, from new courts to the modifications of the player & tournament bases (and including all the bugs they may be creating ! ;) )

Add anything to the 3D stadium (eg: put the tournament name)

Postby manutoo » 14 Jun 2022, 11:42

Hello,

in the v0.65 (hopefully coming in a few days), you'll be able to load additional 3D objects into the game, using the .obj format, as well as removing the existing ads, to put your own.

This will allow you, for example, to put the tournament name on the ground.

Before reading further, you should be accustomed to the new way to Mod stadiums & surfaces : topic60-33904.php .

1) Extracting the existing ads to an .obj file, to edit them

If you want to get an editable .obj file for the existing ads, add this line to your Tennis.ini, under [3dEngine] : (HowTo => topic19-32161.php )
Code: Select all
ExportAds   =   1

Then when a 3D stadium is loaded, the game will export 2 files, in the same folder as your Tennis.ini, for example :
- AdsAustralianSlam.obj : contains the vertex & faces lists
- AdsAustralianSlam.mtl : contains the material parameters
These 2 files should be loadable in 3DS Max, Blender, and most 3D editing software.


2) Loading your custom Ads

in your Stadium.ini (or Stadium_Mod.ini), add this :
Code: Select all
[Modding]
ImportAds   =   Ads/AdsAustralianSlam.obj


Replace "AdsAustralianSlam" with the name of your ads file. You can put your ads in "Mods/MySuperMod/Courts/" or any subfolder. With the name in the example above, the game will try to load "Courts/Ads/AdsAustralianSlam.obj" in every Mod currently installed.

If you want to remove the ads, use this instead :
Code: Select all
ImportAds   =   


If you want to use the same material as the current ads, you don't need to have the .mtl file beside the .obj file, just be sure your material is correctly named (ie: "Logo_Test" or "Logo_Test2"). You can even Mod the material using the rules explained in topic60-34019.php .

If you want to use a new material, read the next section to see from where the textures will be loaded.

The 1st object loaded with ImportAds, or the object containing "Ads" in its name will have its color controlled within the Stadium.ini, with SignColor under [Stadium], eg :
SignColor = 0xFF1F1F1F
So its material color and any Modded material color will be ignored.


3) Loading additional objects

Download this example Mod, which adds text on the ground, to see how everything fits together :
TextOnGround.zip

Copy the "TextOnGround" folder into your Mods folder.
It'll put the text "Rome" on the ground for the Rome tournament (if your Tour.ini isn't Modded, or if the Rome tournament is still in the section [Tournament031]).

The additional objects to load are defined per stadium & per tournament. To do so, for example, add this line in your Stadium.ini (or Stadium_Mod.ini), under [Modding], or in Tour.ini (or Tour_Mod.ini), in the section of the tournament you want :
Code: Select all
Custom3dObj   =   Models/TextOnGround.obj


For example, this would load the file "Mods/MySuperMod/Models/TextOnGround.obj".

If you want to add more than 1 .obj, separate the names by a semicolon, like this :
Code: Select all
Custom3dObj   =   Models/TextOnGround.obj ; Models/MyOtherStuff.obj


Usually, if you need new materials, the .mtl file should be alongside the .obj (except if you specify a different path in the .obj file) ; else, you don't need a .mtl file.

Textures for new materials will be searched in these folders, from the .mtl file location, if their path isn't rooted : "<NameOfMtlFile>_Textures", "Textures", then finally in the same folder as the .mtl file.
If their path is absolute (eg: starting by "c:"), then the absolute path will be ignored, and only the texture name will be used to look for in the mentioned paths.
If their path is rooted (ie: starting by "/"), then the textures will be searched only from the Mod root folder ; eg: "/MyTextureFolder/MyTexture.png" will match the file "Mods/MySuperMod/MyTextureFolder/MyTexture.png".

The specular texture (specified with "map_Ks" in the .mtl file) will be actually used as a Unity Metallic texture : the Red channel is for the metallic value, and the Alpha channel is for the smoothness value. You can also specify "-bm <SmoothScale>" (eg: "-bm 0.5") after the name of the texture to scale its smoothness.

You can also manually add this for your material in the .mtl file :
glossmapscale <SmoothScale>
SmoothScale can be from 0 to 1.
By default, the value is 0.5.

Notes :
a) if you name a material like an existing material in the stadium, then its parameters will be ignored and the existing material will be used instead
b) all the new materials & textures loaded can be Modded by the same rules as the existing ones : topic60-34019.php
c) using b), it means you can use the example TextOnGround Mod as a base to add your custom tournament names ; just add a Modded "TextOnGround.png" texture for each tournament, specified its path by adding a "StadiumTexPath" entry to each tournament in your Tour.ini
d) In a general way, if you always Mod a texture added from an .obj, then that texture size should be 8x8 all white (with an alpha channel if required), so it'll be fast to load (ie: it avoids loading 2 different big textures)
e) To test in the Training Club, you can add these entries to your Tennis.ini, under [TrainingClub] : Custom3dObj, StadiumTexPath & StadiumMatPath
f) The .obj & .mtl files are in text, so you can check them and edit them with any raw text editor (eg: Windows Notepad) ; this allows to easily check and/or change the materials & texture names

4) Different shaders for the material
You can add a "Shader <NameOfShader>" just after each material declaration in the .mtl file.
The name can be :
- TOO/Decal : used to display text on surfaces (eg: the ads)
- CutOut : similar to Decal, faster to render, but can't be used very near another polygon, and no anti-aliasing


5) Moving the NPCs & Props around

To change the Chair Umpire & Player Chairs position, add this example line in your Stadium.ini, under [Data] :
Code: Select all
ChairUmpirePos   =   0.1 0 0

=> this will move them all by 10cm to the right.

or this :
Code: Select all
ChairUmpirePos   =   0.1 0 0 ; 90

=> this will move them all by 10cm to the right and rotate it by 90° (careful : the net ballboy center is in the center of the court, not in the center of the ballboys, so turning them will look strange)

Side note : if you want to have only the chair umpire without his chair nor the player chairs, use this under [Stadium] :
Code: Select all
ChairUmpire   =   ChairUmpire-Alone


To move the other NPCs & Props, 1st enable Modding in your stadium by adding this to your Stadium.ini :
Code: Select all
[Modding]
Enable      =  1

This will make the engine print the NPC & Prop list in the engine log. For example, you'll get :
Code: Select all
Modding: Stadium has 18 NPCs & Prop => BallBoyNetL ; BallBoyNetR ; BallBoyStandBR ; BallBoyStandBL ; BallBoyStandFR ; BallBoyStandFL ; CameraMan ; CameraMan ; CameraManFR ; CameraManBR ; MicrophoneCL ; MicrophoneCR ; MicrophoneBR ; MicrophoneBL ; MicrophoneFR ; MicrophoneFL ; Photographer ; Photographer ;

You can move any model that has an uniqe name (I'll try to make all names unique in the future).

For example, to move the Ball Boys on the net by 1 meter away from the net to the left/right, add this to your Stadium.ini :
[Npc&PropPosition]
BallBoyNetL = -1 0 0
BallBoyNetR = 1 0 0

To hide the middle line judge, add this line in your Stadium.ini, under [Data] :
LineJudgeMiddle = 0


6) Modifying the indoor & night-session lights

To modify the inddor lights, 1st enable Modding in your stadium by adding this to your Stadium.ini :
Code: Select all
[Modding]
Enable      =  1

This will make the engine print the light list in the engine log. For example, you'll get :
Code: Select all
Modding: Stadium has 4 Lights => Court_Spot_BL (Pos = (21.8, 15.0, 32.0) ; Rot = (15.0, 25.0, 35.0), Intensity = 5) ; Court_Spot_BR (Pos = (-21.8, 34.8, 32.4) ; Rot = (40.6, 152.4, 63.2), Intensity = 3.2) ; Court_Spot_FL (Pos = (21.8, 34.8, -32.4) ; Rot = (39.9, 333.6, 55.7), Intensity = 3.2) ; Court_Spot_FR (Pos = (-21.8, 34.8, -32.4) , Rot = (39.4, 26.8, 292.5) , Intensity = 3.2 , SpotAngle = 50) ;


Then in your Stadium.ini, you can modify any light by adding something like this :

Code: Select all
[LightParams]
Court_Spot_BL   =   21.8 15 32
Court_Spot_BL-R   =   15 25 35
Court_Spot_BL-I   =   5
Court_Spot_BL-SA   =   5

1st line => position
-R => Rotation
-I => Intensity
- SA => Spot Angle


7) Moving the Speed & Match time texts around

To modify the board texts, 1st enable Modding in your stadium by adding this to your Stadium.ini :
Code: Select all
[Modding]
Enable      =  1

This will make the engine print the board text list in the engine log. For example, you'll get :
Code: Select all
Boards => ServeSpeedB : Pos = (9.70 1.02 -18.41), Rot = 145, Scale = (0.60 0.80), Colors = 005F00 / 009000 ; ServeSpeedF : Pos = (-9.60 1.02 20.39), Rot = 335, Scale = (0.40 0.40), Colors = 676615 / 575900 ; ServeSpeedB-Unit : Pos = (9.70 0.54 -20.41), Rot = 155, Scale = (0.40 0.40), Colors = 676615 / 575900 ; ServeSpeedF-Unit : Pos = (-9.60 0.54 20.39), Rot = 335, Scale = (0.40 0.40), Colors = 676615 / 575900 ; MatchTimeB : Pos = (-9.80 0.55 -18.12), Rot = 180, Scale = (0.20 0.40), Colors = 00005F / 000090 ; MatchTimeF : Pos = (10.12 0.55 19.41), Rot = 25, Scale = (0.40 0.40), Colors = 676615 / 575900

Colors are encoded in RRGGBB hexadecimal format (ie: 256 values per component) ; the 1st color is the base color, and the 2nd is the specular color ; the 2nd color is much more visible than the 1st one.

Then in your Stadium.ini, you can modify any text by adding something like this :
Code: Select all
[Boards]
ServeSpeedB   =   9.70 1.02 -18.41 ; 145 ; 0.6 0.6 ; 006000 ; 009000
MatchTimeB   =   -9.80 0.55 -18.12 ; 180 ; 0.5 0.5 ; 000060 ; 000090

[Boards2D]
ServeSpeedF   =   -9.70 1.02 18.41 ; -35 ; 0.2 0.4 ; 006000 ; 009000
MatchTimeF   =   9.80 0.55 18.12 ; 0 ; 0.2 0.4 ; 000060 ; 000090

ie: add 1 entry with the text name followed by its new position, its new rotation, its new scale, its base color, and its specular color. There are 2 different sections, one for the 3D mode and one for the 2D mode.
You do not have the required permissions to view the files attached to this post.
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 19750
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: Add anything to the 3D stadium (eg: put the tournament n

Postby manutoo » 24 Jun 2022, 08:43

In the v0.65, entries have been moved from the [Stadium] section to the [Modding] section ; eg :
Code: Select all
[Modding]
ImportAds   =   Ads/AdsAustralianSlam.obj
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 19750
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: Add anything to the 3D stadium (eg: put the tournament n

Postby manutoo » 27 Jun 2022, 08:09

SubBuild 2022.6.27 added this :

The specular texture (specified with "map_Ks" in the .mtl file) will be actually used as a Unity Metallic texture : the Red channel is for the metallic value, and the Alpha channel is for the smoothness value. You can also specify "-bm <SmoothScale>" (eg: "-bm 0.5") after the name of the texture to scale its smoothness.

You can also manually add this for your material in the .mtl file :
glossmapscale <SmoothScale>
SmoothScale can be from 0 to 1.
By default, the value is 0.5.
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 19750
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: Add anything to the 3D stadium (eg: put the tournament n

Postby manutoo » 27 Jul 2022, 16:12

I just noticed that the shadows were not displayed on the text. In the next update, add this line under "newmtl Material__25", in TextOnGround.mtl :
Shader TOO/Decal

The TextOnGround.zip above is already updated.

So now, you can add a "Shader <NameOfShader" just after each material declaration in the .mtl file.
The name can be :
- TOO/Decal : used to display text on surface (eg: the ads)
- CutOut : similar to Decal, faster to render, but can't be used very near another polygon, and no anti-aliasing
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 19750
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: Add anything to the 3D stadium (eg: put the tournament n

Postby manutoo » 10 Aug 2022, 11:57

Added "5) Moving the NPCs & Props around", which will be available in the v0.68.
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 19750
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: Add anything to the 3D stadium (eg: put the tournament n

Postby manutoo » 17 Nov 2022, 10:08

Added "6) Modifying the indoor lights", which will be available in the v0.75.
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 19750
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: Add anything to the 3D stadium (eg: put the tournament n

Postby manutoo » 07 Feb 2023, 14:07

Added to 2) Loading your custom Ads for clarification :
The 1st object loaded with ImportAds, or the object containing "Ads" in its name will have its color controlled within the Stadium.ini, with SignColor under [Stadium], eg :
SignColor = 0xFF1F1F1F
So its material color and any Modded material color will be ignored.
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 19750
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: Add anything to the 3D stadium (eg: put the tournament n

Postby champi1986 » 28 Aug 2024, 15:03

manutoo wrote:I just noticed that the shadows were not displayed on the text. In the next update, add this line under "newmtl Material__25", in TextOnGround.mtl :
Shader TOO/Decal


Hi, I've noticed that this works when playing with the sun, but not in the night session, the shadow doesn't appear on the letters. :fear:
champi1986
court stakhanovite
court stakhanovite
 
Messages: 47
Gaming Since: 27 Feb 2017, 20:10
Location: Spain

Re: Add anything to the 3D stadium (eg: put the tournament n

Postby manutoo » 28 Aug 2024, 16:33

champi1986,
indeed the shadows were working only with the sun. It's fixed for the next update (likely coming in a few weeks), thanks to your report ! :yes:
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 19750
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: Add anything to the 3D stadium (eg: put the tournament n

Postby champi1986 » 28 Aug 2024, 18:30

Great. :applause:

Thanks Manu.
champi1986
court stakhanovite
court stakhanovite
 
Messages: 47
Gaming Since: 27 Feb 2017, 20:10
Location: Spain

Re: Add anything to the 3D stadium (eg: put the tournament n

Postby skyfuzzball8312 » 23 Oct 2024, 10:10

is [Boards2D_Test] use the same formula as auto camera position?
and how can I calculate the value in Boards2D_Test section?
skyfuzzball8312
crazy of the little yellow ball
crazy of the little yellow ball
 
Messages: 83
Gaming Since: 25 Aug 2024, 14:03

Re: Add anything to the 3D stadium (eg: put the tournament n

Postby manutoo » 24 Oct 2024, 05:22

skyfuzzball8312,
there's no "[Boards2D_Test]" ; you meant "[Boards2D]", right ?
Its format is written : "add 1 entry with the text name followed by its new position, its new rotation, its new scale, its base color, and its specular color". (scale & colors will be available in the next update)
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 19750
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: Add anything to the 3D stadium (eg: put the tournament n

Postby skyfuzzball8312 » 24 Oct 2024, 08:07

How to get these data for adding it to my custom court?
skyfuzzball8312
crazy of the little yellow ball
crazy of the little yellow ball
 
Messages: 83
Gaming Since: 25 Aug 2024, 14:03

Re: Add anything to the 3D stadium (eg: put the tournament n

Postby manutoo » 25 Oct 2024, 06:41

Ouch, I checked and it didn't work with the 2D Background. I fixed that for the today's update but I didn't test so let me know if it's still not ok.
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 19750
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: Add anything to the 3D stadium (eg: put the tournament n

Postby manutoo » 26 Oct 2024, 08:43

skyfuzzball8312,
the Board modding with the 2D Background still doesn't work in yesterday's version. It's fixed for the next update.
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 19750
Gaming Since: 24 Jan 2004, 15:38
Location: France


Return to Modding - TE4

Who is online

Users browsing this forum: ClaudeBot and 0 guests