Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Share Objects (http://www.alice.org/community/forumdisplay.php?f=8)
-   -   Over 300 objects, all sorted and with icons for your gallery [ V2 - 21 AUG 2011 ] (http://www.alice.org/community/showthread.php?t=7113)

Mr Kidnapper 01-05-2012 02:11 AM

There are two kinds of "Bests" when it comes to that. You can either go with User Friendliness or Most Efficient.
I'm wagering you're looking for the most efficient method.

And so: There are two kinds of mouse calibration, scripted automatic calibration (Arty and I's), which is very user friendly due to its lack of interaction, and there is calibration point method, which involves the user clicking a small sphere located in the center of the window.

In terms of user friendliness, scripted calibration is quite nice in that it is very precise. Finding the center of the screen you will be at the most, one pixel off-center, which is a very precise fit. The biggest pros of this method is that it is completely immune to window moves and resizes.
For calibration points, it's a lot easier on the maker's end and requires no scripting. You can multiply the mouse's distance from the edges by 2 to find either the window length or width. The problems with this method is that it is not immune to resizing because it is typically only ever done once. After a window resize, the window length and widths will become inaccurate and any methods involving window itself will be screwed. Another notable problem is that it is not very precise—the region for error is as big as the radius of the sphere in pixels.

Now, let us look at efficiency. Efficiency is hard to judge in Alice; It's not as easy as in computer programming to figure out what method is the most efficient. In computer programming, you generally find the one that makes the least amount of actions. Alice is a bit different in that you don't really know how many actions it's taking because the code is very simplified.

In scripted calibration, what we do is set a variable, say WindowX and WindowY to the length and width respectively of the window screen and there we have our window size. Very easy, only two actions.

In calibration points, you get the user to click the sphere and set a variable WindowX and WindowY to the mouse distance from the left edge and top edge respectively. Now, I had actually read the source code for how Alice gets the mouse distance from the edges. What it does is find the window's position on the screen, and finds the mouse position on the screen, and subtracts the mouse's X or Y by the screen's X or Y. That is about five actions right there. Note that this method only finds [I]half[/I] of the window's length and width, which is good for the next step.

And now to aeronautical mouse movement:
What Arty does in his Air Ace thing is that it makes the plan roll and turn at a speed of a calculated percent of 1 meter/second.
It first gets the mouse's location relative to the center of the screen, found in the previous method. Then it checks if the mouse is outside of a theoretical series around in the center of the screen called "Bounds", which forms a sort of thick cross in the center of the screen. If the mouse exceeds these lines, the camera will roll or turn in the direction the mouse is facing, unless the Y-Axis is inverted, in which case it will turn in the opposite direction.
So these "Bounds" are used to prevent movement at the center latitudes and longitudes of the screen.
Now for how the speed is calculated:
It subtracts the mouse distance from the respective edges by the center of the window, or the other way around depending on where the mouse is relative to the center of the screen (The total Window sizes divided by 2 if you used scripting.) So, the further away from the center of the window the mouse is, the faster you rotate, which is much like how real games act.
Then it divides this number by the center of the screen, getting a percent.
This number is used to revolve the object at the speed at a rate of 0.01 seconds (An arbitrary number which otherwise means "Constantly".) Due to the quick nature of this method you may want to divide it further and add sensitivity levels in order to reach the desired revolving speed.
Remember that you must do this for each of the four directions: turn up, turn down, roll left, and roll right (In event that you're using a plane.)

[B]Extra:[/B]
In the event that you are using an organic being, things get a bit more complicated. You want your thing to turn up, down, left, and right, however the X axis, left and right, have to be set up in a special way. You need to create a dummy object that is aligned to the world (Or the ground, in the event that it is tilted) and this dummy object follows ([I]not vehicled[/I]) the camera or object that is being rotated. Then, you must set up your rotation method to turn left or right as seen by the dummy object's X Axis. This will prevent accidental rolling of the camera and will be more like how cameras rotate around in real games. Optionally you can make a maximum turning angle for the Y Axis, so that the camera doesn't do any sort of somersaulting or ridiculous exorcist neck bending.
You can also make a mouselock for FPS makers. This however can [I]only[/I] be done with scripting, because it requires the location of the window as well as the size of the window, because mouselocking is relative to the screen, and also because forcibly moving the mouse to a location requires scripting in the first place. This [I]can[/I] be done with a calibration point (You have to find the mouse distance from the edges relative to the screen, which is an option in the More dropdown box.), however I do not vouch for it as it won't be immune to resizes or window moves.

room14 01-05-2012 03:26 AM

where is this arty's game you speak of?

arty-fishL 01-05-2012 03:31 PM

[QUOTE=PikachuCLS;45253]I really ought to give you a +reputation, arty-fishL![/QUOTE]Thanks, I hope you get the models you wanted.

[QUOTE=Mr Kidnapper;45258]There are two kinds of "Bests" when it comes to that. You can either go with User Friendliness or Most Efficient.
I'm wagering you're looking for the
[... a lot of text ...]
an option in the More dropdown box.), however I do not vouch for it as it won't be immune to resizes or window moves.[/QUOTE]You've pretty much cracked it there. Are your tutorials (you are making, or planning on making, tutorials aren't you?) going to be like this? You described it better than I could (I'm not very good at describing).

[QUOTE=room14;45259]where is this arty's game you speak of?[/QUOTE]
[URL="http://alice.org/community/showthread.php?t=7691"]Air Ace (flight sim) WIP[/URL] :)

room14 01-06-2012 04:45 AM

Oh yeah, guys, I made a stable ai that does not spin around in circles.still tweaking it.

room14 01-06-2012 04:49 AM

I wonder what happened to rich0e0rick

bumenot 03-23-2012 05:03 AM

Thank you!

arty-fishL 03-23-2012 09:47 AM

[QUOTE=bumenot;47545]Thank you![/QUOTE]You're welcome!

EmmaLee 03-31-2012 07:59 PM

Great objects!
 
Thank you for sharing your talents and your works. I can't wait to start using some of your stuff in some of my Alice assignments.

vakuzar 05-07-2012 07:34 AM

individuals?
 
hey man , thanks so much for sharing, but im having a hard tim edownloading it , do u think that you could add dowloads for the individual objects, or at least the most of them , thanks!

arty-fishL 05-07-2012 10:22 AM

[QUOTE=vakuzar;48587]hey man , thanks so much for sharing, but im having a hard tim edownloading it , do u think that you could add dowloads for the individual objects, or at least the most of them , thanks![/QUOTE]Sorry, I really haven't got time. You can find most of these models in the "share objects" section of the forums. If you have any specific requests then I can search the pack for you and upload several objects if I find them, but not over 300 things.


All times are GMT -5. The time now is 02:05 PM.

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