2D Court Camera Perspective

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 ! ;) )

2D Court Camera Perspective

Postby Left Foot Brake » 04 Oct 2022, 15:09

tunnel.jpg
Okay - it has seriously taken me about 5 hours to get my head around it... I can see I am walking in the footsteps of others so I will try to clarify what these posts mean... please correct me if I am missing something. :sweat:

Okay we add this to our Stadium.ini

[Camera]
Angle = -18.740917972385
Focal = 2.96122860908508
Dist = 3707.25
Height = 1128.78125
AspectRatio = 16:9


So this is standard in the Stadium.ini..... but if we want the "Auto Line Drawing" feature enabled on our court, we add these entries.

AutoU1 = 0.318
AutoV1 = 0.256
AutoU2 = 0.827
AutoV2 = 0.829


So in layman's terms, let me explain my menial grasp on these parameters... :thinking:

Angle - the angle of the court with respect to the player's view. So the more negative the number means the camera is placed higher (like, the higher in the stadium the camera is) so the view angle down to the court is more acute. The more this number is towards 0.0 means lower camera position, so down to court level perspective. I assume positive numbers would therefore be viewing from underground, so that probably won't work.

Focal - How much zoom the camera has... so how much the camera zooms in at the "focus point". I think of this imaginary point as a tennis ball lying in the middle of the court.

Dist - How high on the screen the court lines are drawn. Big numbers move it out of the top of the screen, lower move it towards the bottom. Handy to tune if you have if you have the right camera perspective but the court is drawn in the wrong spot on the court. I imagine this as this distance from the ball in the centre of the court to the camera, on an angle... so the hypotenuse if you imagine a right-hand triangle. So...like, the commentary box or the Royal Box at Wimbledon.

Height - Changes the height of the point of focus.... so now the ball is on opponents baseline. Cranking this up zooms the camera in on the top of the screen. Minor adjustments can tweak the perspective... I find I have to adjust the DIST as well to maintain perspective. If you move it too far down, the bottom half of the court disappears.

Aspect Ratio - Changes the Aspect ratio, amazingly enough. If you try to have a 16:10 on a 16:9 screen, it will cut off the sides of the image (letterboxing).

The AutoU1, AutoV1 stuff is relatively straightforward as explained in the other thread....it requires a bit of maths and but seems to work okay.....if you have a background with a nicely defined court. So if you have a hard court with a different coloured surface or a carpet court or something... it works fine. But clay, grass, cement, sand, ice, tarmac and dirt are all a bit hit and miss especially if you are using a bodgy screenshot as a base. I have found more success manually moving the camera around via Notepad on these courts... but there's probably a smarter way to do it.

Important Note That If I Knew Would Have Saved Me About 10 Hours Work - if you have the AutoU1/ AutoV1 entries in the .ini I believe this locks the camera's perspective in the Settings-->Camera tab. This gives you the "this court relies on this perspective and therefore can't be changed" or something message. I made a bunch of courts that couldn't be used with the dynamic camera view for no reason... I ended up re-doing them... I will probably be re-visiting some of the 75 courts I have made so far to adjust the camera. :oops: So the first one is as The Tunnel, which I had do do via the manual method, and the second one is using the AutoU1 method. These two stupid images probably have taken me 10+ hours to make.... :sweat:

Anyway, I hope this info helps to clarify my understanding of this and hopefully other's as well.
:bounce:
Attachments
prague.jpg
Left Foot Brake
court crocodile
court crocodile
 
Messages: 24
Gaming Since: 04 Aug 2022, 14:49
Location: Australia

Re: 2D Court Camera Perspective

Postby manutoo » 05 Oct 2022, 06:50

Hello,

1) a picture is worth a thousand words :
2022-10 - TE4 - Camera Parameters.jpg
2022-10 - TE4 - Camera Parameters.jpg (31.67 KiB) Viewed 2931 times

And the Focal is the zoom (like on a camera).


2) You shouldn't move the camera with the Notepad, but with the keypad : https://www.managames.com/tennis/doc/HowToMod.html ("Moving the camera for the 2D Courts" section, but use the Shortcuts as seen at the end of TE4 -> Settings -> Controls)


3) AutoU/V should still be easy to calculate if you have the original image with the court lines, or any visual hint to their placement.


4) If you turn on the 2D Background, the Camera menu will state :
The 2D Background is enabled in Video -> Advanced, and thus the camera position depends on it and can't be changed.

I added that because many people didn't understand that a 2D Court isn't in 3D and thus the camera position cannot be modified.
ManuTOO
== Mana Games ==

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

Re: 2D Court Camera Perspective

Postby Left Foot Brake » 07 Oct 2022, 07:54

prague3.jpg

Thanks for the feedback, Manu. Yes, I think this works well - I wish I could get this court to retain the same perspective as my others... but as I am not prepared to spend the next 6 weeks of my life fixing it pixel by pixel... I am content with the result. :bounce:
It looks okay, don't you think? I will make the net
Left Foot Brake
court crocodile
court crocodile
 
Messages: 24
Gaming Since: 04 Aug 2022, 14:49
Location: Australia

Re: 2D Court Camera Perspective

Postby manutoo » 07 Oct 2022, 10:48

Yes, it looks alright there.
Although the original lines seem to not be exactly straight, so maybe there's a little fish-eye effect on the original effect.
ManuTOO
== Mana Games ==

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


Return to Modding - TE4

Who is online

Users browsing this forum: No registered users and 2 guests