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
(18.26 KiB) Downloaded 35 times

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 comma, 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.

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


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
ManuTOO
== Mana Games ==

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


Return to Modding - TE4

Who is online

Users browsing this forum: No registered users and 1 guest