Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
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, 08: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
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,143
Join Date: Dec 2010
Location: The Twilight Zone!
Default 04-09-2011, 08:55 AM

Would you mind uploading the world so I can take a look at it? I didn't quite understand your post, but I may be able to understand it in greater detail if you upload your world.


██████████████████████
█░░░░░░░░░░░░░░░░░░░░█
█░▓▓▓▓░░░▓░▓░▓░░▓▓▓▓░█
█░▓░░░▓░░▓░▓░▓░░▓░░░░█
█░▓▓▓▓░░░▓░▓░▓░░▓▓▓░░█
█░▓░░░░░░▓░▓░▓░░▓░░░░█
█░▓░░░░░░░▓░▓░░░▓░░░░█
█░░░░░░░░░░░░░░░░░░░░█
██████████████████████

________________

Alice Hater? Rant Here!: http://tinyurl.com/HateAlice
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 04-09-2011, 11:42 AM

Well, I dont know if it would really help but If you want to look at a moderate advanced FPS then you can check out my Halo game. Its got a lot of the stuff your looking for. Feel free to use the codeing in there..

you can download it here...
Click_Here


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
Stiivais
Guest
 
Status:
Posts: n/a
Default 04-09-2011, 12:12 PM

Quote:
Originally Posted by David B View Post
Would you mind uploading the world so I can take a look at it? I didn't quite understand your post, but I may be able to understand it in greater detail if you upload your world.
excuse me, BUT HOW CAN YOU NOT UNDERSTAND THE POST??? It's all plain english... Well, a little bit complicated, but if you try, you can understand it...
Even if you can't, download scirra, mess around a week in it, and it will all become clear soon ...

But seriously, can you set things like camera movement speed towards a position with an matematical formula?
AT LEAST the camera movement speed towards a position???
   
Reply With Quote
Old
Stiivais
Guest
 
Status:
Posts: n/a
Default 04-09-2011, 12:18 PM

Quote:
Originally Posted by jediaction View Post
Well, I dont know if it would really help but If you want to look at a moderate advanced FPS then you can check out my Halo game. Its got a lot of the stuff your looking for. Feel free to use the codeing in there..

you can download it here...
Click_Here
Thanks, dude. Gonna do that sometime
Im making an third person horror something... maybe shooter...
So far, im working with the flashlight.
I created 2 cubes, first for light position, second for light heading. then i those cube's vehicle the camera and camera's vehicle player model.
Seems to be working, but this brings up another 2 questions:

1)why hasnt ground got any lighting? How can i make lights display on it?
2)how do i make fluid movements...
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 04-09-2011, 12:27 PM

Well. Answer to questions 1, you cant make light really show on the ground. Alice, is not capable really. Unless you bring in a 2d pictures of the light of the ground, and you wouldn't be able to turn up and down, but that would stink. Fluid movements? What kind?


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
Stiivais
Guest
 
Status:
Posts: n/a
Default 04-10-2011, 03:40 AM

Quote:
Originally Posted by jediaction View Post
Well. Answer to questions 1, you cant make light really show on the ground. Alice, is not capable really. Unless you bring in a 2d pictures of the light of the ground, and you wouldn't be able to turn up and down, but that would stink. Fluid movements? What kind?
thx dude... thats kind of bad, though...
but making an light image with low opacity appear on ground would be an good workaround... anyways, i checked the halo game, but i didnt understand the way mouse controls work. i guess it just gets the reticules position and there was something about distance from edge of screen...
could anyone explain that formula to me? and how to make it?
and how were i able to create fluid movement system? you know, fps, wasd controlled system?
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 04-10-2011, 01:31 PM

Well, the smooth movements is pretty much at for Key pressed events. Then in the during section of the events, put the "character"(or whatever your using) move that direction of the key for how many seconds and style is Abrupht


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 04-10-2011, 09:13 PM

Firstly, may I say, I understood your post just fine.

Now as for your questions...

To fix any object to another object, set the object's vehicle property to the object you'd like it to be fixed to. Simply move the camera to the desired position relative to the character, then click the camera in the item list, then click properties, then set the vehicle property from World to the character.

A reticule is a small purse. A reticle can be made by importing a png, then making its vehicle the camera when it's in the proper position. Not difficult at all, really.

Having a reticle follow the mouse will be more difficult, especially if you want the mouse to turn the camera, as you'll need to balance the camera turning vs the dead zone of mouse motion with no camera motion to accommodate aiming. If you DON'T plan on making the mouse turn the camera, you can do it by using a somewhat complex method involving an infinite loop, the mouseDistance world-level functions and a few dummy objects. If you'd like to know more, let me know.

Your first desired formula could, in theory, be done, though I've never done so. By having the camera/character turn according to a method which compares two sets of corresponding variables, the first set representing the X/Y coordinates a millisecond before and the second set representing the X/Y coordinates currently, outputting a faster turn with a higher difference between the two sets.

Or if you mean having the camera turn according the mouse's distance from the center of the screen, that's easier. Just have the camera turn according to a number that subtracts the center point's coordinates from itself.

There's a draggable tile which lets you set a variable's value to pretty much anything number-related.

Acceleration: Also easy. Make a variable, then make that variable increment as the object moves.

You can do something similar in Alice. Use the set point of view method, set the duration to zero, then put a move method after that, also with a duration of zero.

Private variables: Yes, though it's somewhat unreliable. I use the built in variables like opacity or specularHighlightExponent to represent health, since they work just as well and mean less work. If you want special variables, you'll need to use the "variable named []" function located at the bottom of any given object's function list.

Offset: Not sure about this one. I've never had to work with anything requiring offset. Could you give me a specific task you'll need it to perform?

That next one's a complex one, so let's save that for later.

If statements: Oh, so you're that new, eh? Then I recommend reviewing the tutorials included with Alice. They'll teach you a few things about how to work with the dropdown menus and draggable tiles.

If you need a simpler explanation for anything, go ahead and ask. I might be talked into making an example world to demonstrate a few of the concepts if I'm not busy or bored or both.

Have fun,
X

P.S. Lighting: Yes it is supported in Alice, though it's somewhat simple. It shows on the ground in circles if you use spotlights, but if you use lightbulbs it lights literally the whole world. it can be used to emulate some cool stuff, if you're creative, like flickering candlelight, muzzle flash, lightning, and more.

Last edited by x2495iiii; 04-11-2011 at 09:18 AM.
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 04-11-2011, 08:36 AM

Quote:
Originally Posted by x2495iiii View Post
P.S. Lighting: yes it is supported in Alice.
Thats pretty much what I said. X, if your asnwering questions that are already answered, your just like adding little things that are like already known....But was he asking for detail detail?


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Reply

Tags
first person, mouse and keyboard, offset, third person, variables

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.