Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - squidgetx

Pages: 1 ... 3 4 [5] 6 7 ... 9
61
TI Z80 / AxeSynth
« on: April 28, 2011, 05:09:36 pm »
Although I can't upload the program, I'll at least make this post..(after seeing zero44's axe piano)
This is another sound program written in Axe, named (obviously) AxeSynth that I finished last week. The keys are arranged like a guitar's, using the five columns of keys as the guitar strings. Of course, this way each string only gets about 5 or 6 frets' worth, so pressing up/down will adjust the tuning of all the strings by a half step. Pressing left/right will toggle between the top 5 strings and the lower 5 strings. With these adjustments, 7 and one eighth octaves are available, from C0 to C7

There are also 6 modes to play notes:
continuous (note sounds for as long the key is held down)
fixed
major chord (root major third fifth octave)
power chord (root fifth octave)
minor chord (root minor third fifth octave)
custom: you can set the chord pattern, which is pretty cool imo

The note length can also be adjusted, with presets of 1024,2048,4096,8192,16384,24576,32768,49152, and 65535. In continuous mode, the note length can be toggled to adjust sound quality (1024 sounds pretty staticky while 65535 is a bit smoother)

Once I get my computer fixed, I'll upload it. Currently I'm recording a cover of Lady Gaga's Poker Face with it lmao XD

62
Miscellaneous / 10 day absence
« on: April 15, 2011, 09:03:10 pm »
Tomorrow I'm leaving for spring break ;) Basically, I guess that means that I won't be around for a bit. Expect some progress on Ash:Phoenix by the time I return.

Farewell for now XD

63
Axe / Slope Physics Tutorial Part II
« on: April 07, 2011, 04:40:35 pm »
Slope Physics Tutorial II-Adapted from Builderboy’s method in Chainfire Pinball Library.
First, let us remind ourselves of a few basic vector operations…

Think of it as if you are following a path. These two vectors, when you add them, will take you to the same place that vector C would take you. Hence, they are equal.
Now, how do we add vectors? Easy; if you keep them in component form Ax+Bx= Cx and Ay+By=Cy
Now, let’s take another look at our slope diagram. This time, let’s give the object some starting velocity. In this method of slope physics, we will only apply the physics if a collision is detected. In order to roll, the ball will have to collide with the slope every frame, and every frame the velocity will be modified appropriately.

In the diagram, the velocity is taking the object into the slope. We want to modify the velocity so that it is pointing in the right direction—we want the velocity to be transformed to become Vf. How can we do this? Note that adding the original  velocity and the vector labeled Nf will give us Vf. So now all we need to do is find Nf
Now we will use another type of vector math called the dot product. A dot B is defined as Ax* Bx+ Ay* By. The dot product also has another convenient property:

The || signs mean the magnitude of the vector; its linear length. Use the Pythagorean theorem to get it.
Now, more importantly, we can use this along with a little bit of trig to figure out what N f is…If we move the normal vector over to where N f is…

Remember that N f and the original normal vector have the same direction. So, now that we have the magnitude of N f, we can divide it by the magnitude of the original normal vector to get the ratio of their magnitudes. Then we can multiply that by their x and y components to get the components of N f:
Nfx= Nx*| Nf|//|N|
Nfy= Ny*| Nf|//|N|
And now add these to our velocity components to get our final new velocity. Happy coding 


64
TI Z80 / TIny Wings
« on: April 07, 2011, 03:57:21 pm »
I am officially unveiling my secret project that I have been working on over the past couple of weeks: an Axe clone of the popular iPod/iPhone game Tiny Wings. This is the product of many many hours spent during physics and math class not paying attention to electromagnetism and polar calculus in order to fully realize the incredibly annoying physics of the game. And yes, this is what prompted that slope physics tutorial; ironically I don't use anything in that tutorial here...I'm going to add another section...

For those of you who don't know, the goal of Tiny Wings is to go the furthest before time runs out. By pressing 2nd, you can make yourself heavier (well actually, gravity gets stronger) and attempt to launch yourself off of the many hills.

Features:
-Physics that work :o
-Zoom in/out appropriately
-A score counter
-Clouds that sort of work

To be added:
-More realistically moving clouds
-Time limit
-The different islands/slopes
-Coins
-Cloud-touch, perfect slide, and fever mode bonus points
-A menu
-Optimizing
-Textures for the hills

Installation: Send appvar TW to RAM and run T.8xp with Asm()

65
Music Showcase / Ride
« on: March 29, 2011, 07:41:49 pm »
Ride; composition #3 :D

Drums/guitar/piano/bass again. let me know what you think. LMMS ftw :D

http://www.omnimaga.org/index.php?action=downloads;sa=view;down=643


66
Axe / Slope Physics Tutorial
« on: March 29, 2011, 04:44:32 pm »
Slope Physics Tutorial
Well basically I hate slope physics. So in order to help myself figure out what the hell is going on here, I’m going to write a tutorial! Makes perfect sense. Let’s get started. First, a little background. If you are relatively well-versed with physics in an Axe environment, you can skip this part.

Part 1: Gravity.
First off let’s introduce the concept of gravity. Universal force that acts downwards. All objects fall at the same rate; or rather they all accelerate at the same rate. According to Newton, Force=mass*acceleration. More force=more acceleration. In real life, the acceleration of gravity is about 9.8 meters/second/second. Which makes sense: meters/second is a measure of speed, so meters/second/second is a measure of acceleration.
In our game world, we’ll set gravity to whatever quantity we want.

Part 2: Integer Math
Well, we’ve got no decimals. That is certainly a problem. Well, to simulate decimals, we can inflate all our values by a certain number. The standard is 256, although theoretically you could use any value. How does this work?...Let’s go with an example. Let’s do a simulation of an object being affected by gravity!
We want the y position to accelerate every time, so let’s set up the following code with gravity being 1 pixel:
Code: [Select]
0->Y
Repeat getKey(15)
ClrDraw
Y+1->Y
Pxl-On(5,Y)
DispGraph
End


Wait, but that’s way too fast! Let’s try the same example, but with inflation of values by 256
Code: [Select]
0->Y
Repeat getKey(15)
ClrDraw
Y+1->Y
Pxl-On(5,Y/256)
DispGraph
End
See? Each time you add 1, it’s like you’re adding 1/256th of a pixel….Anyway, let’s move on to…

Part 3: The Slope

So now, let’s draw a diagram of all the forces acting on an object on a slope. Forces are vectors; in other words, they are numbers with direction. And they can be split into different components.

 Remember, sin is opposite/hypotenuse, and cos is adjacent/hypotenuse.

Now, we can see that the force dragging an object down a hill is equal to the force of gravity times the sine of the angle. Remember that F=ma, so the force of gravity is mg. In games, unless you’re planning to change the mass, I would set it to 1 for simplicity’s sake. So we get F=g. Easy enough. The force that pulls you down the hill is equivalent to gsinθ, with the direction of θ. The Fn up there is called the normal force. Basically, it just cancels out the y-component of gravity, which is why we don't talk about them much.

Notating Vectors
We can either express vectors in component, or in magnitude+direction formats. In games, it is more common to store vectors as components, so let’s start with that.

The problem is, how do you increment your objects’ velocity diagonally? Well, let’s move on to some more trig….

And there you have it. Every frame, increment x velocity by gsinθcosθ and y velocity by gsinθsinθ
But wait…Is it really that simple?

Part 5: Applying this concept in an Axe environment
Here is the tricky part. Axe sets us up with a great coding environment designed on speed and efficiency. Unfortunately, this means no decimals. Which is a HUGE problem.

Axe’s sine and cosine functions are a little bit different from your traditional sine and cosine functions. First of all, they use a system of binary degrees Basically, one period or revolution is 256. You can use the conversion factor of 32/45 to convert from traditional degrees to binary degrees, or a factor of 128/π to convert from radians.
Code: [Select]
Degrees | Radians | Circle | Binary Degrees
0       | 0       | 0      | 0
45      | π/4     | 1/8    | 32
90      | π/2     | 1/4    | 64
180     | π       | 1/2    | 128
270     | 3π/2    | 3/4    | 292
360     | 2π      | 1      | 256
But that’s not the end of our problems. Since there are no decimals, Axe’s sine and cosine functions have an amplitude of -127 to +128 (or something like that, I don’t remember the exact limits). Take a look:
Code: [Select]
Degrees | sin | cos | Axe sin | Axe cos
0       |  0  |  1  |     0   |   128
30      | .5  | .87 |    64   |    93
45      | .71 | .71 |    53   |    53
90      |  1  |  0  |   128   |     0
180     |  0  |  -1 |     0   | 65409
270     | -1  |  0  | 65409   |     0
Basically, the decimals that the traditional sine and cosine values output are multiplied by 256, rounded off, and then have the value 128 subtracted from them.
So how do we apply this in Axe?
Code: [Select]
G*sin(θ)//128*sin(θ)//128 || G*cos(θ)//128*sin(θ)//128
It’s messy, but at least it works.

Part 6: Wait! How do I figure out the angle????
Ah, I thought you’d never ask.
Well, there are a few ways to do this. In traditional math and physics, we have this handy tool called the inverse tangent function. Unfortunately, we don’t get that in axe so....

Method 1: Tilemap.
Yay! Everybody loves tilemapping. Fast, easy, etc. Basically, all you have to do here is give each tile an angle associated with it. Then, if you detect that your player is *on* the tile, apply the slope physics. I would use pixel testing for collision here.
How do you figure out what tile you’re standing on? Well first, make sure you’re standing on something….If not, apply gravity. Otherwise….
Code: [Select]
{Y/8+8*(map width)+(X/8)+(pointer to map location)}should give you the tile you are standing on

Method 2: Pixel based method
This method is a bit more complex.  Basically, we shall look at the two pixels directly below us to determine the angle of the slope.

(The numbers in parentheses are binary degrees) Then, we’ll store this information in a lookup table (LUT)  since we don’t get a tan^-1 function….
Code: (LUT) [Select]
Data(51+64,45+64,32+64)
Data(0,32,45,51)->GDB1
I believe that this method works because the lines on the screen are all pixelated anyway. The total slope physics generated will all average each other out.
Note: This method can be easily adapted to memory reads instead of pixel tests if for some reason you have pixel heights stored in memory. Also, it may be easier for some to store the precomputed sin and cos values instead of the angle, for possible increased accuracy or speed.
Code: (pixel testing loop) [Select]
.Note- make sure this runs before your sprite is drawn on screen
0->{L1}^^r
For(B,0,1)
For(A,0,7)
If pxl-Test(X+B,Y+A-3)
A-3->{B+L1}
End
End
End
{{L1}-{L1+1}+GDB1}
.^^this returns the angle value

Part 7: Multiple or Dynamic Slopes
All right, now we know how to deal with one slope. But what about slopes that change direction and stuff? Here is the time to use the other notation for vectors: magnitude-angle.

Basically, it’s relatively straightforward. Remember how the acceleration on the ball on the slope was Gsin θ? Well, changing the velocity with magnitude-angle notation is *almost* as simple as just adding gsinθ to the speed (S). Then, you have to store theta somewhere as the angle. To retrieve the x and y velocities, we can break the speed back into components: X speed=Scos θ and the Y speed= Ssin θ

However, one tricky part is that the acceleration angle and the velocity angles are not the same. Do not rely on using the same angle for both of them, as that will turn out…not so pretty. Here’s an example of what it might look like…

Correcting this problem, we get this


(Credit to Runer112 on the concept on how to make this hilly terrain)

…And that’s all I have for now :/
As I learn more, I’ll add more; Future additions include collision with an angled surface, and flying and other random stuff. Happy programming! :)

67
Axe / Trig Challenge....
« on: March 27, 2011, 04:20:33 pm »
All right.

We've got an X-velocity (v) , and a Y-velocity (w) that can both get pretty large (ie, past 256). What's the best way to calculate the total speed (a scalar number) while maintaining at least some accuracy? Pythagorean theorem is out because squaring a number greater than 255 will go over our 65535 limit. (If anyone wants to give me assembly hex that's cool too :))

68
Music Showcase / On the Lighter Side (song)
« on: March 23, 2011, 04:22:23 pm »
Second song, this time done with LMMS.

69
News / Insight for Casio Prizm
« on: March 21, 2011, 03:28:14 pm »
A promising new addin for the Casio Prizm called Insight by SimonLothar was updated yesterday. The demo program included runs at about 23 FPS (which isn't quite shown in the screenshot, unfortunately :P)

It can be downloaded here

Insight version 1.03:
a little display demo: moving and bouncing objects; a HTMLHELP-file with some information concerning syscalls of fx-9860- and fx-CG-systems (to be continued).

EDIT: ah, yes. @cfxm: and a new pair of my cute icons, which everyone loves. ;D

Also, in the same thread, the Prizm's mini SDK was updated as well :)

70
Math and Science / Pi is Wrong
« on: March 19, 2011, 05:17:18 pm »
http://www.youtube.com/watch?v=jG7vhMMXagQ&feature=player_embedded

Watch O.o

(For some reason it won't embed properly with the [youtube] tag <_<)

Something not mentioned in the video. Take a look at what happens to our circumference formula.
C=τr
And to our area formula
A=∫C dr=∫τr dr
=1/2τr2

Now how beautiful is that? Falls right in line with our
Gravitational Acceleration Function: y=1/2gt2
Hooke's Law: U=1/2kx2
Kinetic Energy Function: 1/2mv2

71
Music Showcase / My first song :o
« on: March 11, 2011, 08:12:11 pm »
Wooo
Let me know what you guys think. I think it's an interesting mix of rock/electric and classical :P

72
Computer Programming / Looking for info...about java
« on: March 07, 2011, 04:13:43 pm »
What kind of language is Java? I've heard various phrases tossed around, like "object oriented," etc. And, as a low-level programmer highly proficient in something like Axe, would it be easy or hard to pick up?

73
News / leafiness0 releases Graviter Demo
« on: March 05, 2011, 05:07:26 pm »
leafiness0 has just recently released a demo of his project Graviter; a gravity-inverting platformer written in Axe. It features realistic physics, allowing interaction with various objects, switches and doors, a ninja-star-like enemy intent on running you over, and the coolest death animation I've ever seen.


The demo features three levels that showcase many of its cooler features. It can be downloaded from this post.

I don't think it deserves a news article, but nevertheless it has arrived!
This demo features 3 levels, one from the previous screenshot and 2 never-before seen ones. Level 2 is another puzzle, and level 3 is a reflexology thing :) Have fun.
Use + or - to cycle through the levels.
Reply if there are any problems.
No spoilers - also post feedback on these levels.

74
TI Z80 / Notepad
« on: March 02, 2011, 07:18:55 am »
This is a little side project I've been working on; a simple word-processor for 83+/84+ (written in Axe of course)

Features/Controls
Letter keys: Type stuff. Insert mode is on by default :o
Alpha: Cycle between lowercase, caps, and numeric mode. Use XT0N for exclamation points. In numeric mode, you can also type parenthases, commas, carrots, squared key = sign with MATH, and the operation symbols. Lowercase mode is auto-activated after typing a single letter in uppercase mode for your convenience.
2nd: Jump immediately to caps mode.
Enter: Newline
Del; Backspace
Graph: Your keyboard's End button
Trace: Your Home button
Y= Open the file menu, where you are greeted with a full filesystem. You can open, save, create new, or save your text file as a program, protected program, or appvar.

Although the program is less than 5k, I packaged it as an app too, for convenience. But there's also the no-stub version attached to this post.

The files this creates are *supposed* to be compatible with real notepad files (.txt), but I have to work out some flaws/glitches in it. I am also planning to add a symbol menu for characters such as $,%,$, etc.

Do not try and create/open files that are >8kb. Also, this is kinda unstable in random places, so back-up before using :)

75
Miscellaneous / Neave Strobe
« on: February 25, 2011, 03:46:03 pm »
So while I was researching LSD for a school project, I came across this.

It's soooooooooooo cooooollll  :w00t:

*Do not click if you suffer from photosensitive epilepsy*

Pages: 1 ... 3 4 [5] 6 7 ... 9