Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / DIrection Indicator/Target Lock

Author
Message
XFS Illusion
20
Years of Service
User Offline
Joined: 20th Apr 2006
Location:
Posted: 26th Apr 2010 04:33
Okay so i'm at the near final stages of a space shooter i've been working on, and it occurred to me that space is so big, I can't find nothing to shoot at! My radar has limited distance. My solution to this problem is to add two things, one being a directional indicator, kind of like a 2d arrow(I think starwraith has a nice one) that points to the object/target near my fighter. A 2nd thing I would like to add, would be a target lock, you know, the little box that surrounds the selected target. Only problem is, I don't know how to do these things(yet)! I have searched and searched these forums and I can't find anything to even give me a hint at what i'm trying to do. Any advice/code would be greatly appreciated. When the project is done I plan to release the code on these boards for all those others attempting to make this type of game.

Sepnon
16
Years of Service
User Offline
Joined: 7th Feb 2010
Location: Brazil
Posted: 26th Apr 2010 04:59
space shooter.. i love one called "Freelancer", look some youtube vids

to make a target lock, take a look at those commands

XFS Illusion
20
Years of Service
User Offline
Joined: 20th Apr 2006
Location:
Posted: 26th Apr 2010 05:53 Edited at: 26th Apr 2010 07:32
Sounds like a command I can use, thanks i'll check it out. A directional arrow would still be nice, but i imagine I can use a plain unless someone has something better. Freelancer was a great game! The one i'm making is a straight forward go in an blast em type game...MP of course. If I remove the radar cam, it works fine.

XFS Illusion
20
Years of Service
User Offline
Joined: 20th Apr 2006
Location:
Posted: 26th Apr 2010 06:29
Not working right. I have an overhead camera acting as radar, it shows up on there, but not on the main screen. Weird.



Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 26th Apr 2010 13:57
The overhead camera radar is a fairly substantial drain on performance, could you make a 3D or 2D one instead? - I mean personally I'd rather see an Elite style radar, as it's really clear when things are above or below, something along those lines would save you a lot of cycles I think.

That's what I'm thinking is causing your issues - if you consider that with 2 cameras, you have 2 possible object screen locations, so you might have to set the current camera back to 0: SET CURRENT CAMERA 0.
Then any screen position calculations should be done on the main camera, but if you can get rid of the extra camera, then you'll be much better off I think. If you wanted, you could even check out ImageKit, which allows you to draw directly onto an image in memory. Like you could have a cockpit and the radar screen as an object that you texture with the drawn image.


Health, Ammo, and bacon and eggs!
XFS Illusion
20
Years of Service
User Offline
Joined: 20th Apr 2006
Location:
Posted: 26th Apr 2010 20:57
I got it working right, Set camera did it. I am noticing a bit of lag since adding the second camera, I may replace it with a vector based radar.

Login to post a reply

Server time is: 2026-07-27 20:18:15
Your offset time is: 2026-07-27 20:18:15