Alice Community  

Go Back   Alice Community > Alice 2 > Works-In-Progress

Reply
 
Thread Tools Display Modes
My Final Project: and FPS
Old
Ch0pStickS
Guest
 
Status:
Posts: n/a
Default My Final Project: and FPS - 01-28-2008, 07:50 PM

Go to my latest post to see complete version.
Attached Files
File Type: a2w Final.a2w (2.40 MB, 2051 views)

Last edited by Ch0pStickS; 05-24-2009 at 05:40 PM.
   
Reply With Quote
Old
danica
Junior Member
 
Status: Offline
Posts: 3
Join Date: Feb 2008
Default 02-09-2008, 03:04 PM

hi, thx for posting your work here.
but the project is so complicated that i cant even understand how you did.
would it be possible for you to post only the camera control part, as its the most important part for a bunch of ALICE user, as i understood.

thx again.
ps: a few explanations would be great too.
________
Recall Zoloft
________
Sexdollxx

Last edited by danica; 08-14-2011 at 11:34 AM.
   
Reply With Quote
Mouse Control Demonstration
Old
Ch0pStickS
Guest
 
Status:
Posts: n/a
Default Mouse Control Demonstration - 02-11-2008, 08:49 PM

alright, turns out i put a half done copy in there, so actually half of it isn't implemented, but the controls are mouse to llok, wasd to move, and 1,2,3 to go to a certain weapon.

Here is a simplified version using only the camera, and movement.

W- move forward
A- move left
S- move backward
D- move right

hold enter and click on the crossfire to calibrate screen.

Look by using the mouse.

To permanently save calibration to your screen setup, go to world properties, and run the world so that you can see both variables, calibrate left and calibrate top.
Calibrate in world, memorize the numbers that pop up, end the world, input the numbers into the reverted calibrate left and top, save the world.

Also in world properties is Sensitivity. Choose 1-10 and by increasing sensitivity, the mouse looks faster.

Calibration just measures if you are pressing enter or not.
Attached Files
File Type: a2w MCD.a2w (903.0 KB, 1539 views)
   
Reply With Quote
Old
danica
Junior Member
 
Status: Offline
Posts: 3
Join Date: Feb 2008
Default 02-12-2008, 01:04 PM

thank you, i try it immediately .
________
LIST OF MAZDA PLATFORMS HISTORY
________
Web Shows

Last edited by danica; 08-14-2011 at 11:35 AM.
   
Reply With Quote
Old
Ch0pStickS
Guest
 
Status:
Posts: n/a
Default 02-28-2008, 06:35 PM

any thoughts of it?
   
Reply With Quote
Old
lanceA
Guest
 
Status:
Posts: n/a
Default 02-28-2008, 09:41 PM

I'm not into violence so I haven't downloaded it. However I do believe that one of the subscribers made a valid comment when he said he could not understand your code.

Regardless of the project, you should always include comments in your code so that others might understand what your are doing.

Good luck with your continued programming.
   
Reply With Quote
Old
Ch0pStickS
Guest
 
Status:
Posts: n/a
Default 02-29-2008, 01:49 PM

no not the game im talking about, the MCD thats a attatchment in one of my previous posts. It's supposed to be a plain demo of how it works without any game. so theres no violence, just a screen that moves with your mouse and WASD keys
   
Reply With Quote
Old
DrJim
Guest
 
Status:
Posts: n/a
Default 03-01-2008, 11:04 AM

Actually Lance A would probably like the game if he downloaded it, since it seems impossible to actually hit anything, no matter how much violence you try to use.

But I would certainly echo his point about the importance of comments in your code, even if you donít plan on ever giving the code to anyone else. First, the comments give you a framework to organize the code, and second, the probablility of you remembering what all of the actual, fairly abstract programming details meant a few weeks after the code was written is not too high.

For example, you comment that you can permanently enter the calibration for the center of the screen. Unless you have figured out how to freeze the size of the play window (which I canít find in the code), this simply isnít true. I suspect you found this out during development - but either that fact never regisitered explicitly (you undoubtedly had a lot else on your mind) or then, with the more stable code, the fact slipped your mind.

I am not being critical Ė you said you were pressed for time on this project and it is a very nice piece of code. Itís actually the first time Iíve seen code that was able to relate key and cursor controlled actions to specific points in an Alice world Ė something both others and myself have tried without your success.

Code that doesnít work is not worth documenting Ė and usually if the code works and fills enough of a need, someone will come along and complete the documentation. It has been my experience however, that the easier the latter task is, (i.e., the better internal documentation there is in the code) the better the final result turns out to be.
   
Reply With Quote
Old
Ch0pStickS
Guest
 
Status:
Posts: n/a
Default 03-02-2008, 06:15 PM

well for the little thing about freezing the calibration point to a certain degree, i just thought that if you run alice on the same computer, the screen always loads to the same exact position and size, but that's just what ive seen through my version of alice, (windows vista). Alright so here's how i did it, and it's not really a lengthy and complicated code. It uses alot of the world functions, mouse distance from top edge, and mouse distance from left edge. I made a certain box where it wouldnt move if it was in it, because it would be annoying to have to enter the mouse exactly in the center to stop the screen from moving. So i just did If (mouse distance from ___ edge is > than the calibrate left" (which is technically the mouse distance form left edge if the mouse is in the center) minus 15) then you can move the screen. So that technically makes a box where the screen doesn't move instead of a single center point. So now that it wont move in the center, we have to make it move out of the center. To do that i just made it so that the x-axis (which is actually just a sphere that i tried to make as close to the center of the screen as possible, which is invisible) will turn left at speed = calibrate left minus mouse distance from left edge so for example, when you calibrate it, then the calibrate left is the same as the mouse distance from left edge when the mouse is in the center. So calibrate left minues mouse distance from left edge is 0 when the mouse is in the center, so it wouldnt move at all. but if it is at the edge, then calibrate left minus distance from left edge would be calibrate left.. So you would turn left at speed calibrate left. But if you turned that fast it would be crazy... so, i minimized it by. making a sensitivity variable. So that number, would be divided by 11 - sensitivty and multiplied by 400 so it would divide it by that AND 400. I found 400 with guess and check. So if you set sensitivity to 10 it would not divide it at all besides 400, and if it was 1, it would divide it by 10*400 so the greater the sensitivity the faster you would turn. Same thing with the up and down, but instead of x axis, it is the camera, instead of calibrate left, it is calibrate top, and instead of mouse distance from left edge, i made it mouse distance from top edge. I made these methods do together and also had it loop infinitely. So to sum it all up it is, turn "this speed" per second for .05 of a second.
y-axis vehicled to camera which is vehicled to x-axis.

Also, for the movement part, i just made the wasd keys made the x-axis move forward backward, left or right depending on which key you press.

For Calibrate I made it so that when enter is pressed, it changes "calibrate" to true, and when it is let go it changes "calibrate" to false, so it technically measure when enter is pressed. Then i made it so if mouse is pressed on y-axis/cursor, then if calibrate is true, it will set calibrate left to mouse distance form left edge, and set calibrate top to mouse distance from top edge.

The whole aiming part can be found in world method, Aim

Movment can be found in world events

Calibrate can be found in world events/ world method, Calibrate

if there are any further questions, let me know
   
Reply With Quote
Old
Ch0pStickS
Guest
 
Status:
Posts: n/a
Default 03-02-2008, 06:19 PM

what do you mean by documenting code?
   
Reply With Quote
Reply

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.