• Portal Prelude 5 1
Currently:  

Author Topic: Portal Prelude  (Read 227182 times)

0 Members and 1 Guest are viewing this topic.

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Portal X
« Reply #150 on: April 12, 2010, 10:25:59 pm »
Wouldn't you only need to detect 4 directions each frame for each object?  If you're detecting more than once per frame, then you can save those cycles with a compensation by detecting how far past the collision the object is when it collides.  Then just snap it to where the collision was supposed to happen.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Builderboy

  • Physics Guru
  • Project Author
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Portal X
« Reply #151 on: April 12, 2010, 10:30:16 pm »
By directions do you mean collision calls?  There needs to be 10 collision calls per frame for the main character (5 pixels per side across 2 sides) and probably 2 or 4 for boxes, a single for plasma balls.  What do you mean by saving the cycles?

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Portal X
« Reply #152 on: April 12, 2010, 11:18:45 pm »
I sent you an email with optimizations using some math tricks for your collision detection.  Should be a little faster.

The other thing I was talking about, I'm still not sure exactly what method you're using for collision detection.  Why does the character need more points checked than the boxes?
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Builderboy

  • Physics Guru
  • Project Author
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Portal X
« Reply #153 on: April 13, 2010, 01:36:31 am »
Because boxes will only be 2x2 and the character is 5x5.  For boxes i also might be able to get away with some little cheats, since it is so small, and only do 1 collision per side.  Thanks for the optimizations!  Even though the division is still there, the boolean logic was a bit help, i think i see what you did so i will try to extend this to different portions  :)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Portal X
« Reply #154 on: April 13, 2010, 03:29:39 am »
On a side note, for those who didn't download/try it yet, I am attaching a screenie of Portal X demo in action (tool-assisted), captured at 9 fps.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Portal X
« Reply #155 on: April 14, 2010, 03:50:08 am »
And here's an ad video of the game in action on Youtube! :D



For some reasons, even if I played the game at 5% speed (capture set back to max speed) without listening to music, from time to time it somehow ended up in sync with the song I added to the vid afterward. :P
« Last Edit: April 14, 2010, 03:53:03 am by DJ Omnimaga »
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

SirCmpwn

  • Guest
Re: Portal X
« Reply #156 on: April 14, 2010, 10:24:11 am »
Nice video!

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Portal X
« Reply #157 on: April 14, 2010, 11:35:58 am »
Yeah. That looks really sweet.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Portal X
« Reply #158 on: April 14, 2010, 12:56:32 pm »
Thanks ^^

Btw that song has nothing to do with Super Mario
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Portal X
« Reply #159 on: April 15, 2010, 09:30:17 pm »
Wow, Portal X is looking Amazing!  I can't wait to see more levels! ;D

[sarcasm]
Oh, and Builderboy, I wish you luck making 2^int(X) = 5. :P
[/sarcasm]

Builderboy, as always, you're programs are Awesome! :D
« Last Edit: April 15, 2010, 09:30:54 pm by ztrumpet »

Offline Builderboy

  • Physics Guru
  • Project Author
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Portal X
« Reply #160 on: April 16, 2010, 06:28:52 pm »
Whew, that was tough!  The greatest issue that i had to deal with was the fact that there is no definite value to move the position by to make it move 1 pixel (since the ratio is 51.2:1) So even something like checking 1 pixel ahead of you was really tricky to get right.  The Portal Gun code i couldn't touch at all, it just wasn't working, i added a flag to change the collision sub back to global screen coordinates, and the portal gun code uses the regular slow division :P It doesn't matter that much, since it is only being run once in a single frame.

On to implementing the map decompresser!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Portal X
« Reply #161 on: April 16, 2010, 07:30:56 pm »
glad you found solutions :D, how is the speed now btw?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Builderboy

  • Physics Guru
  • Project Author
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Portal X
« Reply #162 on: April 16, 2010, 07:42:13 pm »
Its a bit faster, but the potential is much higher :) The LCD update is the only thing limiting the speed now, and i can add a lottt more collisions and still maintain the same frame rate.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Portal X
« Reply #163 on: April 16, 2010, 07:45:11 pm »
wow nice to hear :)

In future versions will we be able to push/grab objects and have them fall on the ground below like in SirCmpwn HL2D clone?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Builderboy

  • Physics Guru
  • Project Author
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Portal X
« Reply #164 on: April 16, 2010, 07:49:09 pm »
Yeah, im looking into implementing crates that you can pick up and move.  However, it will not support full physics, as trying to get physics and forces to work through Portals would be a nightmare.  Whats going to end up happening is there will be little 2x2 black crates that you will be able to pick up with 2nd, and then carry around and place onto buttons and things.  However, they will not stack, collide with other boxes, and you will not be able to stand on them.  They will have velocity and momentum however, so you will be able to drop them through portals and watch them fly ;)