[UTRP] "UT 2341" port into Unreal Tournament

Need some nice Mods? Here, you are right!
Post Reply
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: UT Remodelling Project (UT SDK addon in closest future)

Post by Feralidragon »

Dr.Flay wrote:Ferali, is this a sensible way to make a ziiiiiiip-pop sound for the sniper rifle ?
The sound can be played in any way the coder wants to. If you want a "bullet-weezing" sound, a way would be to spawn an actor near the player (and just for that player) in the calculated trajectory of the bullet (the most efficient way however would be to always have this kind of actor present in the client through the whole game, to avoid unnecessary actor spawns).

The bullet-ricochet sound you hear right now in UT is done in a similar fashion, except that it comes directly from the hit effect and is spawned for all players nearby.

But I must say, that "bullet-weezing" is a great idea. I heard it in some FPS and TPS games, and it gives you a much better sense of danger rather than just seeing the opponent firing or ricochets or actually getting hit by it.
Torax
Adept
Posts: 406
Joined: Fri Apr 20, 2012 6:38 pm
Personal rank: Master of Coop
Location: Odessa, Ukraine

Re: UT Remodelling Project (UT SDK addon in closest future)

Post by Torax »

@Ferali
But how to let player determine from where the hell are bullets coming?))
Unreal. Alter your reality..forever...
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: UT Remodelling Project (UT SDK addon in closest future)

Post by Feralidragon »

Torax wrote:@Ferali
But how to let player determine from where the hell are bullets coming?))
What do you mean? If the sound is played from an actor in one of the player sides for example (defined by the calculated bullet trajectory), the audio driver should be the one giving the stereo location by the way it separates it by both audio channels (now which audio driver is best for the job, it's debatable, Galaxy doesn't seem that good at it).
In other words, it's like in real life: your perception of the origin of a sound depends on the difference of intensity of one hear to the other.
Torax
Adept
Posts: 406
Joined: Fri Apr 20, 2012 6:38 pm
Personal rank: Master of Coop
Location: Odessa, Ukraine

Re: UT Remodelling Project (UT SDK addon in closest future)

Post by Torax »

Feralidragon wrote:
Torax wrote:@Ferali
But how to let player determine from where the hell are bullets coming?))
What do you mean? If the sound is played from an actor in one of the player sides for example (defined by the calculated bullet trajectory), the audio driver should be the one giving the stereo location by the way it separates it by both audio channels (now which audio driver is best for the job, it's debatable, Galaxy doesn't seem that good at it).
In other words, it's like in real life: your perception of the origin of a sound depends on the difference of intensity of one hear to the other.
I mean that if use some actor that will play sound when bullet is coming and this actor will have same coordinates as player - will i hear sound in mono?
If yes so how i will hear centered sound and have no ability to determine direction from where shots coming. Or there are another ways to spawn this actor relatively to direction of incoming bullets?

And besides what audio driver better to use? I'm still having troubles with sound...
Unreal. Alter your reality..forever...
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: UT Remodelling Project (UT SDK addon in closest future)

Post by Feralidragon »

You don't spawn that actor in the players coordinates, you spawn it at the point where the bullet trajectory is closest to the player.
This is mostly a trigonometric problem.

In order to find this point you need to, from the mathematical standpoint (and from the top of my head, since I didn't do any of this yet):
Spoiler
1 - Calculate the hypotenuse represented by the distance between the player and the bullet origin, as so:
h = VSize(Player.Location - BulletOriginLocation);
This vector must be the hypotenuse since the cathetus must be:
1.a - the distance between the player and the closest point of the bullet trajectory;
1.b - the distance between the bullet origin and that same closest point;
and since the shortest distance has to make an exact angle of PI/2 radians between these 2 vectors, and that angle is only valid for cathetus.

2 - Calculate the angle (in radians), or better yet, the angle cosine between the direction from the bullet origin to the player and the direction of the bullet itself, as so:
cosAngle = Normal(Player.Location - BulletOriginLocation) dot BulletDirection;

3 - From there, since you have the hypotenuse and one of the angle cosines, you can determine the length of the cathetus represented by the distance between the bullet origin and the closest point it passes by the player at, as so:
c1 = h * cosAngle;

4 - Now, since you have both the length of the vector from the bullet origin to the point it past closest to the player, and its direction as well, all you need is to multiply both and add them to the the bullet origin location, as so:
spawnPoint = BulletOriginLocation + c1*BulletDirection;
This all translated to code (a function), it would look like this:

Code: Select all

function vector getBulletPassByLocation(vector PlayerLocation, vector BulletOrigin, vector BulletDirection)
{
local float h, c1, cosAngle;

    h = VSize(PlayerLocation - BulletOrigin);
    cosAngle = (Normal(PlayerLocation - BulletOrigin) dot BulletDirection);
    c1 = h * cosAngle;
    return BulletOrigin + c1*BulletDirection;
}
Or you could even reduce the whole function to 1 single line to be slightly faster:

Code: Select all

function vector getBulletPassByLocation(vector PlayerLocation, vector BulletOrigin, vector BulletDirection)
{
    return BulletOrigin + c1*(VSize(PlayerLocation - BulletOrigin) * ((Normal(PlayerLocation - BulletOrigin) dot BulletDirection)));
}
I don't know if there's any mistake in my calculations above (I didn't test them), but theoretically, it should be that way.
From there, it all up to the audio driver to be able to divide the sound between left and right side (stereo) so you can realistically get the perception of its origin. I never tried anything other than the standard Galaxy so far, but as far as I can tell, Galaxy is acceptable for the job.
Torax
Adept
Posts: 406
Joined: Fri Apr 20, 2012 6:38 pm
Personal rank: Master of Coop
Location: Odessa, Ukraine

Re: UT Remodelling Project (UT SDK addon in closest future)

Post by Torax »

Thanks a lot :tu:
I'l try this out and post the results.
And the best way to call this actor to game? I think there are several ways - call with mutator, call from weapon script...what is the best and faster way?
Unreal. Alter your reality..forever...
User avatar
Shadow
Masterful
Posts: 743
Joined: Tue Jan 29, 2008 12:00 am
Personal rank: Mad Carpenter
Location: Germany
Contact:

Re: UT Remodelling Project (UT SDK addon in closest future)

Post by Shadow »

I've got good news about the sdk that are especially worth mentioning for this project. I found a way to finally get multiple textures and materials working on meshes and static meshes. So these weapons can have multiple skins, detail textures, environment maps and other fancy stuff (texture rotators, emissive textures, texture panners etc.) that was only working on BSP and particles before.
Image
Torax
Adept
Posts: 406
Joined: Fri Apr 20, 2012 6:38 pm
Personal rank: Master of Coop
Location: Odessa, Ukraine

Re: UT Remodelling Project (UT SDK addon in closest future)

Post by Torax »

Shadow wrote:I've got good news about the sdk that are especially worth mentioning for this project. I found a way to finally get multiple textures and materials working on meshes and static meshes. So these weapons can have multiple skins, detail textures, environment maps and other fancy stuff (texture rotators, emissive textures, texture panners etc.) that was only working on BSP and particles before.
It's AMAZING news mate! :gj: :gj: :gj:
You made me happy :rock:
Unreal. Alter your reality..forever...
User avatar
Dr.Flay
Godlike
Posts: 3348
Joined: Thu Aug 04, 2011 9:26 pm
Personal rank: Chaos Evangelist
Location: Kernow, UK
Contact:

Re: UT Remodelling Project (UT SDK addon in closest future)

Post by Dr.Flay »

Ooo, very cool news.
showing different textures for team weapons, weapon-mode or damage level etc. should be quick to do.
Who knows? maybe people will end up making skin-packs for weapons, so they can have shiny things like their COD playing friends ;)

I'm thinking back to playing Infiltration, and I remember adding/updating weapon sounds with mutator packs.
If the weapon and bullet sounds can be handled in mutator form, then it would also be possible to have a mutator that works for all UTs, as this functionality does not require the SDK.

Q: Are you making the new weapons a sub-set of the originals or starting a new branch ?

When it comes to audio, I recommend looking forward, the same way you are with the SDK.
The Galaxy and DX7 renderers are a thing of the past.
The EAX patched Galaxy renderer does make the original maps sound very cool, but no one knows how to make the "eol" profiles so EAX effects have stayed a thing of the past.
The Oldunreal renderers add an extra ZoneInfo actor to UEd, so EFX can be attached or summoned in a standard way that can be built-in to maps or vehicles etc.

Creative and nVidia have quietly closed all the OpenAL sites, since Win7 has made EAX/OpenAL a thing of the past, so my new Win7 PC has no HW support for EAX on my Realtek chip.
If you have HW support, you should probably use the OpenAL renderer, as the sound positioning should be perfect, but if you only have software support I recommend the new SwFMOD renderer.
The new audio renderers do have the ability to mimic the old Unreal reverb and distance culling so old maps sound correct, but then you miss the advantages of the new features.
Torax
Adept
Posts: 406
Joined: Fri Apr 20, 2012 6:38 pm
Personal rank: Master of Coop
Location: Odessa, Ukraine

Re: UT Remodelling Project (UT SDK addon in closest future)

Post by Torax »

Dr.Flay wrote:Q: Are you making the new weapons a sub-set of the originals or starting a new branch ?
I will compile new weapons under new subclass of "TournamentWeapon" class or even whole "Weapon" class, because i want to add few improvements to the core functions. This will need to overwrite them.
Unreal. Alter your reality..forever...
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: UT Remodelling Project (UT SDK addon in closest future)

Post by Feralidragon »

Torax wrote: And the best way to call this actor to game? I think there are several ways - call with mutator, call from weapon script...what is the best and faster way?
The most efficient way (imho) is to spawn either a client mutator or any other client-side actor, and let it manage those. Basically whenever the weapon fires, you can call a function in the client from the server, and once in the client, if the sound actor doesn't exist yet, you spawn it, and from there you just set its location to the one returned by the function I provided above and play the sound.
Torax
Adept
Posts: 406
Joined: Fri Apr 20, 2012 6:38 pm
Personal rank: Master of Coop
Location: Odessa, Ukraine

Re: UT Remodelling Project (UT SDK addon in closest future)

Post by Torax »

@Ferali
Understood.

LAST NEWS
Progress over the mod is continues.
Currently working with Shiock Rifle models. Will post some work when have some results. :wink:

Also started to work over code part of the mod. For now hardcoding new possibilities for visual effects, overwriting some original functions etc...

As the progress with coding will reach some of my targets, i will release a kind of very "Alfa" version, with few recoded original weapons, mostly to show you how the new weapons and stuff should act and look in-game.
Thinking to finally add some new models, but this will be possible only if i will raise my lazy ass, start to texture things and work with animation :mrgreen:

PAPERCOFFEE your time is coming :wink:
Unreal. Alter your reality..forever...
ASLY

Re: UT Remodelling Project (UT SDK addon in closest future)

Post by ASLY »

A stupid question.
If every weapon will done, we can use it normally in UT?... Or we need UT SDK Render if we want to play with these weapons?
Keep it up guys! :D
Torax
Adept
Posts: 406
Joined: Fri Apr 20, 2012 6:38 pm
Personal rank: Master of Coop
Location: Odessa, Ukraine

Re: UT Remodelling Project (UT SDK addon in closest future)

Post by Torax »

ASLYE702 wrote:A stupid question.
If every weapon will done, we can use it normally in UT?... Or we need UT SDK Render if we want to play with these weapons?
Keep it up guys! :D
Well, main idea is to update models to make them fit better with possibilities of SDK, and make them also look better.

But in cause that there's no accurate date which shows when final UT SDK should be released with all planned features, i will make separate release with only usage of original UT code and content, also with ability to port stuff into Unreal 227.
I'm currently working also with port of UT stuff into Unreal with usage of new possibilities of Unreal 227.
The main goal - prepair separate pack which contains effects to be used when i'l finish new UT models.
Unreal. Alter your reality..forever...
Torax
Adept
Posts: 406
Joined: Fri Apr 20, 2012 6:38 pm
Personal rank: Master of Coop
Location: Odessa, Ukraine

Re: UT Remodelling Project (UT SDK addon in closest future)

Post by Torax »

I'm about to ask you guys one thing.
What if i should make all the HitScan weapons (except Shock Rifle) projectile shooting?
I mean to let Enforcer, Minigun and Sniper rifle shoot projectiles (bullets), not trace?

I'm asking because projectiles are more interesting for work on and more configurable and editable comparing to Trace function.
I can make them so carefully that you will never found the difference if will not know that thitscan weps become projectile-shooting. And it's possible and more easy to add more FX stuff for projectiles.

How do you look at this? Asking for opinion of everybody who read this.
Unreal. Alter your reality..forever...
Post Reply