Author Topic: Graviter  (Read 164740 times)

0 Members and 1 Guest are viewing this topic.

Offline leafy

  • Project Author
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Graviter - Axe
« Reply #105 on: February 12, 2011, 01:13:06 am »
I'll upload a quick demo.
Known issues:
You can stick to walls (Also, things hitting walls will change the y-velocity to 0 - I know where the error is located, but i don't know how to fix it. I'll figure it out someday)
Picking up an item on top of another item will interact with both items

If you see any other glitches please post them.
I've remapped the keys - 2nd is pick up items, alpha is swap gravity, mode is suicide.
In-progress: Graviter (...)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Graviter - Axe
« Reply #106 on: February 12, 2011, 01:36:54 am »
WoW!  That is an amazing explosion of death!  I love the interphysics and everything!  This sure is looking a lot like PortalX XD maybe it could even tie into the storyline somewhere o.O

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Graviter - Axe
« Reply #107 on: February 12, 2011, 01:41:30 am »
WoW!  That is an amazing explosion of death!  I love the interphysics and everything!  This sure is looking a lot like PortalX XD maybe it could even tie into the storyline somewhere o.O
Hmm. Portal and HL2 take place in the same world and are some what related. In portal you are armed with a portal gun. In half life 2 you have the gravity gun. Gravity gun = Graviter. Coincidence. I think not!!  ;)

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline leafy

  • Project Author
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Graviter - Axe
« Reply #108 on: February 12, 2011, 02:11:01 am »
Hm...the Black Mesa Gravity reversal device?
o.O
In-progress: Graviter (...)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Graviter - Axe
« Reply #109 on: February 12, 2011, 02:21:36 am »
Sounds like a plan to me! :D And a good idea for a storyline if there isn't one already?

Offline leafy

  • Project Author
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Graviter - Axe
« Reply #110 on: February 12, 2011, 01:06:21 pm »
I need help fixing this code:

Spoiler For Broken code:
If {I*15+L2+13}
While sub(GT,{I*15+L2}r/64+{I*15+L2+9}-1,{I*15+L2+2}r/64) or sub(GT,{I*15+L2}r/64+{I*15+L2+9}-1,{I*15+L2+2}r/64+{I*15+L2+11}-1)
{I*15+L2}r-64->{I*15+L2}r
0->{I*15+L2+4}r
End
{I*15+L2}r+{I*15+L2+4}r->{I*15+L2}r
Else
While sub(GT,{I*15+L2}r/64,{I*15+L2+2}r/64) or sub(GT,{I*15+L2}r/64,{I*15+L2+2}r/64+{I*15+L2+11}-1)
{I*15+L2}r+64->{I*15+L2}r
0->{I*15+L2+4}r
End
{I*15+L2}r-{I*15+L2+4}r->{I*15+L2}r
End

This is the cause of the sticking to wall glitch. This is only the gravity downwards case.
{I*15+L2} is x pos*64
{I*15+L2+2} is ypos*64
{I*15+L2+4} is x velocity
{I*15+L2+9} is width
{I*15+L2+11} is height
{I*15+L2+13} is direction (1 is right, 0 is left)

If you need any more clarifications, just ask. I need to fix this D:
In-progress: Graviter (...)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Graviter - Axe
« Reply #111 on: February 12, 2011, 01:35:37 pm »
Code: [Select]
I*15+L2->r6
If {r6+13}
{r6}r+{r6+4}r->{r6}r
While sub(GT,{r6}r/64+{r6+9}-1,{r6+2}r/64) or sub(GT,{r6}r/64+{r6+9}-1,{r6+2}r/64+{r6+11}-1)
{r6}r-64->{r6}r
0->{r6+4}r
End
Else
{r6}r-{r6+4}r->{r6}r
While sub(GT,{r6}r/64,{r6+2}r/64) or sub(GT,{r6}r/64,{r6+2}r/64+{r6+11}-1)
{r6}r+64->{r6}r
0->{r6+4}r
End
End

I optimized a bit, and changed a very small thing, making the velocity be increased *before* the collision check.  I am doing this because I am anticipating other parts of your code, so it may not work, but try it and see.

Also, since you seem to be dividing by 64 a lot, it might benefit you in speed and size to make a /64 subroutine that /2/2/2/2/2/2, and call it whenever you need to divide by 64.  like Xsub(D64) for example.

Offline leafy

  • Project Author
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Graviter - Axe
« Reply #112 on: February 12, 2011, 02:12:36 pm »
Wow, it worked perfectly. Dang, BuilderBoy, why are you so good at this?
In-progress: Graviter (...)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Graviter - Axe
« Reply #113 on: February 12, 2011, 02:27:25 pm »
I have lots of experience :) I noticed that you were moving your character *after* you did the position check, which would mean that if you were moving into a wall, the character would be inside the wall for a whole frame until it moved itself back out again.  This was most likely causing another section of your code to think that the character was standing on the floor, and so the velocity would be reset to 0. By checking for collision right after you move it, if you move into a wall you immediately move right back out again :)

Offline leafy

  • Project Author
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Graviter - Axe
« Reply #114 on: February 12, 2011, 02:50:41 pm »
Yeah, I knew that it was staying in the block for a frame, but I had a brain fart and couldn't figure it out D: Thanks!
In-progress: Graviter (...)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Graviter - Axe
« Reply #115 on: February 12, 2011, 02:51:28 pm »
No problem :D Glad its working ^^

Offline leafy

  • Project Author
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Graviter - Axe
« Reply #116 on: February 12, 2011, 05:07:47 pm »
Hooray onto turret and rocket physics :)

EDIT: Okay, the way I'm going to program in switches and doors is into L3, using an add routine and the arguments (switchx,switchy,switchorient,doorx,doory,doororient)
Should be fun.
Oh yeah, there's also a new update - using just that shortening optimization by Builderboy I was able to shave off more than 1000 bytes, which is fairly awesome.

EDIT2: Also, i've begun work on a level editor, so everyone can join in on the fun.
« Last Edit: February 13, 2011, 01:11:27 am by leafiness0 »
In-progress: Graviter (...)

Offline leafy

  • Project Author
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Graviter - Axe
« Reply #117 on: February 13, 2011, 01:15:14 pm »
Okay, i've got the code down for switches and doors. stay tuned for later updates!
In-progress: Graviter (...)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Graviter - Axe
« Reply #118 on: February 13, 2011, 01:31:04 pm »
Can't wait to see some screenies :D

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Graviter - Axe
« Reply #119 on: February 13, 2011, 02:59:05 pm »
Okay, i've got the code down for switches and doors. stay tuned for later updates!

How do doors work? Do you have to press a button, just touch them?