View Single Post
Advanced FPS/TPS Concepts - need lots of help
Old
Stiivais
Guest
 
Status:
Posts: n/a
Exclamation Advanced FPS/TPS Concepts - need lots of help - 04-09-2011, 07:21 AM

Hi, im a new user, just started messing around with Alice.
Previously used Scirra Construct, the 2 D game maker written in python and C++... It is kind of similair to this one, just 2D.

But as soon as i started making and TPS game, i encountered some problems...
So, here are my questions.

1) Camera.
How do i make camera fixed to a position over character's shoulder?
I got the camera pointing towards the characters head and something like this:
if distance to character > 8 meters, then move 2 meters towards character...
But that isnt good enough. I need a camera, that updates its position every tick, is over the shoulder and also sets angle towards mouse position.
Also, can i make a camera, that is just 1 meter in front of player model and make it mouse controllable, so that player could see his/her body?

2) Reticule.
How do i create a reticule? I mean, how do i make an sprite/object, that is always heading away from camera, at a constant distance from player (lets say, 30 meters), it is always at mouse position,
AND if there is an object, that is < 30 meters to player, then the recticule will not stay behind that object, but change its position, so it is always visible, and 4 meters infront of that object.
Recticule moving along surfaces until 30 meters away from player would be perfect, but if it is not possible, the previous method would do.
EVEN if none of this is possible, simple recticule following mouse would be great.

3) Variables and Math.
This is kind of confusing.

3.1) Lets say, that i want player model to have an turning rate towards mouse, but with an modifier.
Lets say: Turning speed = Fixed Variable * (|Player orientation(degrees) - Mouse orientation(relative to player orientation, degrees)|).
Example: Lets say, that player rotation is 0.
If mouse rotation is 40, then movement speed: 0.2*(|0-40|) = 0.2*40 = 8 degrees per second.
If mouse rotation is -40, then movement speed: 0.2*(|0-(-40)|) = 0.2*40 = 8 degrees per second .
If mouse rotation is 60, then movement speed: 0.2*(|0-60|) = 0.2*60 = 12 degrees per second.
So the idea is, the further the mouse angle from player angle, the faster the turning speed. Also, the numbers in || have to be positive, is there a way to do this in Alice? Not just how to make this kind of function, but WHERE to put it, im a newb...
*In scirra i could set: if (myformula).value <= 0, then (my formula)*-1, so i get positive results if they are negative, but there must be an easier way to do this.
This should apply to both vertical and horizontal orientation.
** ALSO, i would like to make exactly the opposite with revolver object. Making its vehicle the camera looks cheap and really bad, i would like to use formula similair to this, just the faster the camera turns, the more weapon stays behind (the kind of effect you find in modern FPS), UNTIL it is almost offscreen... Any ideas?

3.2) How do i set variables using formula. Lets say, i have an numeric variable and i want it to set itself to camera distance from object x. Or even:
object z distance from object x - (object y distance from object x), or maybe something including multiplying or dividing multiple parameters.
How do i accomplish this?

3.3) Acceleration
Pretty simple. I want to have an object that accelerates the longer the specific movement key is held. Any ideas? I guess, that Alice doesnt have any physics... Soooo, there must be some kind of function to do this... But HOW?
Traction with surface, theoretically should have some formula too, any ideas?

3.4) Set position relative to object
* In scirra it was simple... Set myobject.X to targetobject.X + 100 or
set this.Y to that.Y - 200 or even an function: set a.X to (b.X +(b.X / 100))
So far, i have only seen things like, move x meters towards that object...
But is there set X/Y/Z command? If yes, where, and how could i use for camera positioning?

3.5) Private variables (per object specific, i.e. they are different for every object of the same kind)
Can i make multiple objects of the same kind have private variables? Is there even such a thing in Alice? I mean, yes again, in scirra i could make objects have private variables that apply just to them. If a bullet collided with object, and it was told to decrease that object's variable "health" by some value, it affected only that object... Again, are there this kind of variables, are there private variables, if yes, where, and how to work with them?

4) Image points, vectors, offsets, whatever...
In scirra, there were so called image points... They are like offset points relative to object... Is there such a thing in Alice? I have seen an offset tab in placement options, but how do i specify offset? It just showed me NONE, or something similair... Help?

5) Also, can anyone help me with making an private variable controlled AI?
If alice has those variables, of course.
I would like an cowboy movement AI. Like, if they have less than 10 health AND are within an specified distance to player, they move away... Or maybe you could tell me, how to implement line of sight, make them evade facing the player (be seen by player) etc.

6) The simplest Q in my book...
How does if statement work? I want to have an action:
if object x distance less than 100 to object y then: some actions....
But when i add if, it just shows if true...



PLEASE TRY TO ANSWER THESE QUESTIONS, AND IF YOU CANT, PLEASE ASK SOME PROS/VETERANS/ADMINS/WHATEVERS WHO CAN...
Also, if you give links i would like them to be specific, same for any tips... Not just "read the manual."
Oh, and please, dont make it too complicated, except for the AI, because i am only 14 years old and i am not even in middle school. Gonna get there in 2 years, for now im at 8th grade, and they dont teach us IT anymore, even when they did, they teached us just MS Word, Excel, whatever...
So, ive been learning by myself.
Excuse any typos, grammar mistakes etc. because english is not my main language, but i guess this post is mainly composed of formulas (ok, not really), so this shouldnt be a problem

Also, if you would like to make great games, just check out "Scirra Construct".
Its totally free and open source, just google it...

Thanks for any help you will give/gave to me...
   
Reply With Quote