Adjusting the player’s weapon aim (Part 2)

Now that Roll, Pitch and Yaw are clearer, it’s almost time to focus on pitch and how we are going to use this to aim the players weapon up or down hill.

There are a few rules that have to be considered first, so to aid with visualising the issues, I’ve drawn a few diagrams. When I have a problem to overcome, I try to visualise real world logic and in this case I intend to use two traces to look for a collision with the ground and any other objects.

1) Aiming straight ahead on a flat surface with no obstructions.

In this first diagram. The first trace goes from the player (1) to a position in front of the pawn (2) which is equal to the weapon’s height from the ground. Then from that point (2) another trace is run to gauge the distance from the ground (3). In this example the ground is flat, the first trace has no obstruction and the second trace will register the height ahead as no different from the weapon’s distance from the ground.

A) The pawn should shoot directly ahead without changing pitch.

Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Adjusting the player’s weapon aim (Part 1)

At the moment, the player has been set to only fire directly in the direction that the pawn is facing. This would be fine for a completely flat level, but as soon as we add inclines or drops, the player would continue to shoot straight ahead and if facing an uphill slope, the player would shoot directly into the ground, causing any zombie hoards that are a little uphill from the player to be completely safe.

In this prototype, this happens because I fixed the pitch of the pawn aim rotation to 0.

simulated singular event Rotator GetBaseAimRotation()
{
   local rotator   POVRot, tempRot;

   tempRot = Rotation;
   tempRot.Pitch = 0;
   SetRotation(tempRot);
   POVRot = Rotation;
   POVRot.Pitch = 0;

   return POVRot;
}

Before I go on, I want to make sure that Pitch, Roll and Yaw are understood so I have made a little diagram.

Pitch Roll and Yaw

Roll, Pitch and Yaw.

Lets start with Roll. Roll affects the X axis, which in UDK is the direction the player is facing (Unless I’m mistaken, various engines and 3d modelling apps use different axis in different ways). Imagine a drill bit rotating. If this were applied to the pawn, it would end up doing cartwheels.

Pitch affects the Y axis and for the purposes of aiming uphill, is the rotation method we are interested in. If you imagine a fighter pilot dive bombing a submarine, he has to change his pitch to fly towards the ground. Look up at your ceiling, the look down at your keyboard, you’ve just pitched your head.

Yaw is something I’ve already tinkered with. Yaw affects the Z axis and we have used yaw to enable the player to face the direction of the dual sticks. Look behind you, your body and head have just changed their yaw.

 

 

Posted in UDK | Tagged | Leave a comment

Crowd Systems in UDK

The very good videos that 3D Buzz created are now sadly out of date in places. The crowd system in particular has changed and as per usual, the documentation in UDK is lacking and in places incorrect. Don’t get me wrong, it is hard to be able to knock something that is free, but with the constant changes it becomes very hard to find tutorials that are actually current. So I was rather happy last night to find a crowd tutorial that was created in May 2011 beta. So thank you to  on youtube.

The video cannot be shown at the moment. Please try again later.

Posted in UDK | Tagged | Leave a comment

A question of scale.

To stop myself going mad, I thought it was time to do something a little more creative, so it became time to bung in a terrain. After a few UDK crashes later I had a nice big landscape with gorges, hills and cliffs. Due to the nature of 3D games, one would seek to block the player from running beyond the intended route with nicely generic items such as walls, fences, cars and not invisible barriers (Too Human is a terrible recent example of this). With the terrain tool, steep inclines is the optimal and natural way to stop a player from finding the edge and the KillZ. So off I went, carving out valleys in the terrain, and ending up with something much like this…

UDK editor with terrain.

The valleys of Testland in the Editor

Nice deep canyons! This should make the game interesting. Then I find something that bugs me straight away and would definately turn of any potential player.

Continue reading

Posted in UDK | Leave a comment

Dual Sticks shooter in UDK.

The video cannot be shown at the moment. Please try again later.

I’m starting to get my head around UnrealScript a bit more and I have managed to implement Dual Sticks to the game. This is intended to become a game along the lines of  Zombie Apocalypse, Lara Croft and the Guardian of Light and Geometry Wars, so for the time being, I am working on the presumption that the user will use a XBox controller. If you are now up in arms that for an engine that is mainly played on a PC, stop right there. I am making this for me at the moment and I really don’t like to play games on a PC. This is intended to be a balls to the wall, arcade style (Add Gauntlet, Alien Breed, Smash TV and Robotron to the list of influences) so for me, a mouse keyboard combo isn’t on my list of musts. That said a Keyboard mouse combo would be an eventual feature, W,A,S,D for movement and the mouse to rotate, but I had enough headaches getting to this point. Anyway, I do digress. Since last time I have added some more features, stripped out some and arrived at a point that I’m happy with, although it is occurring to me that shooting up a hill or ramp will be a problem, but I have an idea about that…

Continue reading

Posted in UDK | Leave a comment

Back to Scripting…

After a bit of time marking, moderating and other work related duties, I’ve decided to revisit RoyChr’s tutorial for creating a Isometric Camera.

What I have achieved today is a combination for his tutorial and a 3rd person camera script created by syntaxerror22.

With RoyChr’s tutorial, it has mouse based movement which is something that I didn’t want. I did get up to the end of Chapter 1 but previously I lost the actual mesh for the pawn. After reading that the source download had been updated, I implemented his newer code and found my guy had returned. Not being overly happy with the angle I adjusted the pitch to -45 degrees and the Yaw to 45 degrees. I moved the camera out to (-1536,-1536,2048) and changed the FOV to 17 degrees. In testing I am using a 360 controller and this currently has no modification in any way.

The video cannot be shown at the moment. Please try again later.

Continue reading

Posted in UDK | Leave a comment

Updating blogs on the move.

image

To be honest, this post is just a chance for me to try out a blogging app on my Android tablet. It seems to be working quite nicely if I do say so. Also I’m starting to get used to the swype keyboard interface although it is quite far from the speeds of a proper keyboard.

Also I’ve taken a photo just to see if I can blog on the move and upload images.

Cheers now.

Posted in General | Tagged | Leave a comment

Isometric Camera in Kismet

UDK hurts my head. It hurts my head a lot. Nothing stays the same, each month features come and features go, class names change, tutorials go out of date quicker than milk and often the community surrounding UDK can be elitist snobs. The support is woeful and UDK crashes often, but it is free, it is powerful and it is used a lot in industry. Look at Gears of War, Unreal, Bulletstorm, Batman: Arkham Asylum, Borderlands and um… Undertow…

Continue reading

Posted in UDK | Leave a comment

Welcome

Well, you’ve found this blog. Well done, well done indeed, give yourself a hearty slap on the back. You maybe wondering at this moment what combination of keywords you entered into Google (Or other generic search engine) actually lead you to this blog. To be honest at this moment I have no idea, but welcome all the same.

Continue reading

Posted in General | Leave a comment