
r/howdidtheycodeit

Aiming guns like WoT and similar games
Hey folks, Im making a game about vehicle combat and having an issue making an aiming system that feels good.
In the game one controls vehicles with one or more guns from a third person camera. In working on the aiming system there seem to be two options, yet both of them seem bad:
One option is for the guns to aim at the point the camera is looking at. This will make all bullets hit in the same spot (which is good if you are looking directly at the enemy, as the guns adjust for distance correctly). However, if the enemy's background is something far away (say, the horizon/sky) and you try to aim ahead of the enemy to adjust for bullet travel time, suddenly your shots will miss because the camera is looking at something far away, and thus the guns adjust for that distance, rather than the distance the enemy is at.
The other option is for guns to look in the same direction as the camera. In this case bullets from different guns will hit in the pattern of where they are on the vehicle, instead of hitting in one spot, but this makes the shots more predictable, because there is no issue adjusting to the distance. However there is an issue that in very close combat some guns will just miss.
Yet games like world of tanks and such seem to have it figured out, and the aiming seems to be pretty effortless - from me playing those games years ago, I dont remember having any issue hitting targets and leading shots. Any clue as to how they solve this? Or is this simply not an issue because tanks have only one gun that is centered with the camera?
Here's How I'm Implementing A Camera That Tracks The Players
I'm working on a local multiplayer PvP shooter, and I wanted to implement a camera which could keep all players on the screen while not being too zoomed out.
So I created a "camera tracker" object which finds the middle position of the two players and moves the that position every frame. Then I attached a Camera2D node to the tracker and smoothed its movement out.
Next step will be to create a way to control how zoomed in the Camera2D node is!
[question] How does CSFloat make their screenshot tool work?
Hey i'm wondering how CSFloat get such high quality screenshot preview for every existing item in the game? I'm mean everysingle one of them even 1/1.
I see they log all of them into a subdomain or whatever called csfloat pics (by going right click open image link in a new tab).
But how do they run their magic? How is the lighting so good, how do they get the models and textures for each skins? Because clearly those previews are NOT from any ingame screenshots, they are ran on their own engine.
Does anybody have a clue? I'm trying to build one for fun and fuck I can't find any documentation about it. And it hurts...
Thanks for your answers!