Home  >>  Star Wars: The New Era  >>  Developer Diary
Our IRC Channel
IRC Channel:
#invision-games

IRC Network:
Quakenet

Connect to channel
Latest Articles
8 Months later....

Behind the scenes: Success stories

Status info, gameplay changes, request for more coders

New music and developer diary

Composing music for Star Wars: The New Era
  [1] 2 3 4 5 6 7 8   Next

RSS Syndicator
RSS Click here for RSS
Latest Posts
Status info, gameplay changes,
request for more coders

Posted by Fettness
September 6, 2010

Articles
By Millz
Published: March 17, 2008
Updated: March 17, 2008
Print    Email

Hey folks, I'm Emiel Regis - The New Era's coder. Although there are many things I work on, I'd like to share my experience with dynamic scope system I finally got to work lately.

Dynamic scope means that there is a texture in appropriate place in the viewmodel (the scope of course) which is a render target. What does that mean? The current view of the character is drawn dynamically into the scope, which, combined with ironsights, gives a very realistic feel for zooming with scope-equipped weapons. Instead of just drawing a full-screen zoomed overlay, you see a realistically zoomed image appearing on the three-dimensional scope.

Question arises - how to do it? I started with MirrorView article on developer.valvesoftware.com. Theoretically, the code there would work for scopes with only little modifications. The reality proved otherwise - after many hours of coding, changing the render target texture (which needs to be compiled with an external tool) and cursing over, it became apparent that the method lacks a certain detail - initilization of the very render targets. Without this, a purple checkboard or just a plain black texture would appear on the scope. After searching the MP SDK which TNE is built on I was quite puzzled: There wasn't any reference for render targets initilization in the code - but it must be done somewhere, otherwise things like water reflections would not work, while they did.

At this point I started asking fellow coders from hlcoders mailing list. It was not until I joined their IRC channel and talked with guy named omega, who happened to have working render targets in his mod and willing to share - huzzay I thought 8-) After another few hours of work and cursing, the thing actually started to work! Here are a few screens of dynamic scope on the A-280:


Looks cool, doesn't it? The obvious disadvantage of this method over a simple overlay is that all pixels in the view need to be drawn twice - however, with current optimizations of Source Engine and moreover multi-threaded Orange Box code, which is out there and waiting to be merged with existing TNE codebase, the problem does not seem so acute anymore and peformance decreases only slightly.

 



View Comments (7)
Login Panel
Username:
Password:
Remember Me

Not registered?
Register now!

Forgot your password?
Users Online
Online Now: 2
0 Members | 2 Guest

Most users ever online was 46 on February 29, 2008 at 06:21 AM.
Affiliates

Mod DB - Change the Game