« first day (1731 days earlier)      last day (3585 days later) » 

user92578
14:33
How would I implement ledge slipping?
user92578
Really?
user92578
I think it'd be nice if you couldn't stand on a ledge with a quarter of your one foot
user92578
See the green player position:
user92578
14:35
No!
@Tyyppi_77 Shouldn't be too hard. Can you detect the shape you're standing on?
user92578
Not sure actually
Hm
You kinda need to to be able to detect how much you're over the ledge.
user92578
Yeah
Anywho, when you can detect it, simply calculate how far over the ledge the player is. If he is more than 25%, you apply a bit of force towards the ledge, which will make him fall over.
This way the player has a chance to save his situation
user92578
Yeah
14:38
If you allow sneaking, a great feature would be to make him not slip when sneaking. :)
user92578
Sneaking is one thing I've considered
So to fire at people over the ledge you need to sneak to the edge to avoid falling.
user92578
But I've had a lot of trouble with changing the hitbox size of the player
Sneaking could have other effects than size.
Give projectiles a chance to pass through along with of course lower move speed.
user92578
I was kinda thinking about adding two extra collision boxes below the player's feet, that both need to collide with something for the player not fall
14:39
Perhaps enemies wont turn and face you as long as you're sneaking.
user92578
Which reminds me that I need smarter AI
user92578
14:50
Maybe I should implement some sort of raycasting?
Seems like overkill :)
user92578
Send a ray down from the player, get the first hit and decide that the player is standing on that box (if the player isn't in air ofc)
user92578
Well that's true
user92578
The last collision recorded with vertical velocity should be the block the player is standing on right?
Aye
Unless he's hit by projectiles.
user92578
15:17
right
user92578
So how do I figure out the over-the-ledge amount?
user92578
I guess I could just do separate detecting depending which side the player is on
user92578
Wait but I also need to check that there's air below the player's feet
user92578
Starting to think that ray-casting is the solution
No you don't.
if(player.right > ground.right) over the ledge
if(player.left < ground.left) over the ledge
user92578
15:26
Except if there are two boxes next to each other forming a "ground" of sorts
The amount is calculated as: amount = abs(player.right - ground.right)
user92578
yeah I got there
Ah
Yeah
I guess you need to check both sides.
Actually, it could get complicated if you were standing on even more pieces.
user92578
See, the green player is at the border of the two collision boxes:
user92578
15:27
I guess ray might actually be the way as well yeah.
user92578
Maybe one ray per foot
4 checks. If 3 of them don't hit anything, start sliding.
user92578
or what you said
user92578
The thing is that I don't have raycasting implemented
user92578
15:28
But it'd be cool and usefull to add
user92578
Nah I need to do my own
user92578
But as a reference it might be nice to have something
user92578
So maybe I could have a look?
I'll put it in a gist :)
user92578
15:29
It's in XNA?
user92578
Okay
user92578
I have no idea how I would implement something like that
user92578
But I guess as I have effecient QuadTrees it shouldn't be that hard
user92578
15:30
Thanks :)
Yeah, I use the code I posted and then check against everything my quadtree returns.
var a = this.Position;
var b = target.Position;
var minX = (Int32)Math.Min(a.X, b.X);
var maxX = (Int32)Math.Max(a.X, b.X);
var minY = (Int32)Math.Min(a.Y, b.Y);
var maxY = (Int32)Math.Max(a.Y, b.Y);
var rect = new Rectangle(minX, minY, maxX - minX, maxY - minY);
var point = b;
var ray = new Ray2 { Position = a, Direction = b - a };
foreach (var entity in this.Instance.QuadTree.GetObjects(rect).OfType<Wall>())
{
    Vector2 p;
    OverlapHelper.RayIntersectsBox(ref ray, new Rectangle((Int32)entity.Position.X, (Int32)entity.Position.Y, (Int32)entity.Width, (Int32)entity.Height), out p);
That's the code I use to check if my entities have light of sight to the player
user92578
Right
user92578
So wait what would I query from a quadtree
user92578
All the objects below the player?
I guess how far you think is needed
user92578
15:32
right
user146722
Wow, your brain turned off as soon as you accepted using someone else's solution instead of creating your own
So player.bottom + magicNumber
user92578
yup
@SelflessPsychopath That's not the case.
My code is C# his isn't. We use different quadtrees, structures, etc.
user146722
1 min ago, by Tyyppi_77
So wait what would I query from a quadtree
15:34
It's only code to help him out with how he could make his solution.
user92578
Yeah
user146722
I'm not blaming you lol
user146722
I just thought it was interesting
user92578
Is there a time limit on gists or can I safely bookmark that?
@Tyyppi_77 It's permanent :)
user92578
15:34
nice
My oldest gist: Last active on 11 May 2012
user146722
Hey I know it's a bad time for this, but I think raycasting is overkill anyways
user92578
I feel like it's the easiest way out of this
user92578
And not a bad functionality to have in hand for future anyways
user146722
I'm sure it could be handy as fuck but you really are only trying to ask the math if you're somewhere inside "Box.Left < Player.X < Box.Right", and if so, you know the box is "Player.Y - Box.Top" units below you
user92578
15:37
@William'MindWorX'Mariager Thanks for linking that once again, I myself would probably have ended up with a 1x1 collision box that I would have moved pixel by pixel to a direction and checking collisions against that box
@Tyyppi_77 Haha, yeah, I've done that as well. :P
user146722
@Tyyppi_77 Why? You could make one 1xTall rectangle and check that once
user92578
Because rays can go to any direction
@SelflessPsychopath No he's not. He needs to detect how many points is "standing", regardless of the surface being 1 piece or 100 pieces.
user146722
That's exactly the insight that leads me to point all this out
user92578
15:39
Yeah
user146722
Rays can go any direction.
user146722
You only want to ask about "straight down"
user146722
MUCH easier math.
user92578
True
user92578
I think I'll put this functionality to the Level class
15:46
lol isn't he so cute?
user92578
cool
user146722
@BlueBug triangles are "she"
user92578
@William'MindWorX'Mariager Single == float, right?
user92578
15:50
Sorry for asking so much, but should I add the method as List<RayCollisionsByDistance> CLevel::GetRayCollisions(CRay ray) or just RayCollision CLevel::GetRayCollision(CRay)? (Pseudo codish)
user146722
I just went to draw a picture for you @Tyyppi_77, you can have it if you want, but it made me absolutely and completely sure that there is a better tool for the job than raycasting
user92578
Sure I can take a look
user146722
How do you test your player box currently?
user146722
Is it something like testing it 1 pixel below to see if it's on top of something?
user92578
No
user92578
15:51
I get boxes close to the player's bounding box
user92578
And check collisions against those
user92578
First with Y velocity and then with X velocity
user146722
So it sounds you're doing exactly what I just meant?
user92578
well then I am
user146722
Ok so you make a "ghost box" already
user146722
15:53
Why can't you bump it one unit over, and test it again to see if you should add slipping too?
user92578
If I understand you correctly, that would mean that I have to use multiple collision boxes
user146722
You could get crazy if you want, and instead of generating "true / false" from your player box, generate "true by 2 units" and then check if it's only 1 unit
Sounds like your approach would mean changing the underlying collision code.
user146722
That's not my approach, just a crazy way to get rid of actually doing more work to get the more info he wants
In which case the raycast will make infinitely more sense. :)
user146722
15:57
Lol, how?
user92578
So if the red box is the player's collision box, and the blue boxes are solid level geometry, both these cases here would result in slipping getting performed, even though it should only happen in the right case:
user92578
user146722
Adding code that's big and complex, to do more work getting useless extra info?
user146722
Or use existing code, to get the exact right answer?
Rewriting the underlying code opens up a whole array of things that can go wrong, and he'll end up spending a lot of time on it.
user92578
15:58
Or slipping not happening in either case
user146722
@William'MindWorX'Mariager I recommend against re-writing it the "crazy" way
Where as the raycast is something he'll want in the long run anyways, so implementing it has zero time cost.
user146722
I just pointed out how my algorithm is so much better, that you can even fit it into the work you're already doing if performance matters.
user92578
Currently ray-casting seems like just implementing the ray-vs-box code and then an interface method to the level class
user146722
Or, you can just test a clone of the player box 1 pixel left, and 1 pixel right, if either of those fail, you're slipping.
user146722
15:59
Done.
user146722
user146722
Can you understand yet or should I give up?
user92578
I understand, I've understood for a while now
user146722
@Tyyppi_77 I figured you do, I meant @William'MindWorX'Mariager lol
user92578
Aight
user146722
16:06
Also you guys are missing some cases that make raycasting seem so retarded.... hold on another picture coming up
awww I am loving how cute it's coming along! she looks so cute <3.
@SelflessPsychopath
falling in love with my own art
user146722
user146722
@Tyyppi_77 @William'MindWorX'Mariager
The physics would handle that.
The ray only determines if a force need to be applied or not.
user146722
So it's OK to magically get stuck in corners like that? Being pushed with slight force?
user146722
The force pushes you against the wall so you can't actually slip off, you just stay in the "force" area until you escape it somehow.
user146722
It's BEGGING for glitches down the road
user146722
And if you think writing a function that you understand now even compares to debugging one you forgot about later.... lol then nvm
@SelflessPsychopath You mean walk left? :P
user92578
Yeah :D
user146722
16:17
@William'MindWorX'Mariager Great hack, for now!
The force wouldn't be something that you couldn't overcome. That's the whole idea of the force being there. :P
user146722
How about when a real glitch happens? Not just the SIMPLEST POSSIBLE example?
It's something that can warn you, compared to just throwing you over the edge.
user92578
Yeah I think I need to add a concept of a "force with friction" to entities
Sure, code for future glitches you think might happen.
user146722
16:17
@William'MindWorX'Mariager It means that the method can not be re-used safely because it's buggy
I'll stick with writing code and getting progress.
user146722
You're choosing to use a buggy implementation, because you emotionally want to "beat" me
user146722
My method has a faster runtime and requires less complex formulas
user146722
And provides perfect results, instead of "just let the physics fix it up"
user92578
None of your boxes are actually helping with the slipping currently as they're not detecting any ground collisions
user146722
16:18
@Tyyppi_77 That's you misunderstanding deltas
user146722
You're supposed to adjust the box you had adjusted with the velocities earlier
user146722
Not the player's current position
This is an image that's an example of why you shouldn't try to code for possible glitches.
user146722
@William'MindWorX'Mariager Irrelevant, players are never round.
user146722
I showed you a real glitch, it causes an annoying bug where you walk left too slow while standing on a ledge.
16:20
This isn't pertaining to his game, this is about how coding for something that "might" happen is a silly idea.
user146722
It's a real glitch, it affects gameplay.
And a waste of time.
user146722
It can get you killed, in-game.
user146722
You choose to allow that glitch, just so you can try to beat me emotionally here.
user146722
Your method is inferior by every metric, period.
user146722
16:20
You are now just trying to demote mine, instead of showing how yours is any better.
user92578
@SelflessPsychopath How?
user146722
@Tyyppi_77 You're on the ledge with the top part, you want to shoot an enemy, he sees you and shoots. You press left JUST IN TIME, but the glitch slows you down, you get hit by the rocket and die. Game over.
user92578
The player is not getting stuck on a ledge like you drew, he can just walk out of there
user146722
You just lost the world championship, 2nd place, to a glitch.
user146722
16:21
He's not stuck, just slowed down.
You gotta calm down @Selfless. You're defending your way like it's the only solution there is. Raycasting works, and solves the problem. And that's what programming is about.
user92578
Enemies can't shoot vertically
I'm trying to show you that trying to fix possible glitches is a waste of time.
user92578
And you cannot out run projectiles
Just make something that works and stick with it until it doesn't.
user146722
16:21
@Tyyppi_77 45 degree angle
user146722
Why is running out of projectiles even slightly related?
user92578
Projectiles don't have vertical velocity
user146722
So you can't shoot someone up on a ledge, ever?
user92578
@SelflessPsychopath In case the projectile was coming from a side
user146722
Then lets imagine it's a jump over a rocket.
user146722
16:22
The rightward force pushes the player into friction against the wall, neutering the jump
user146722
Rocket hits the bottom of your foot, lose world championship.
user146722
It's a damn glitch. Period.
user146722
I don't care how you do it, and I am actually calm believe it or not.
user146722
I enjoy trying to help the world :)
user92578
I don't think that the horizontal force will neutralize a jump
user146722
16:24
But the friction will.
user92578
What friction?
user146722
The friction against the wall on the right.
user92578
As it stands, my engine has no concept of friction
user146722
I always complain about video game glitches, so I figure I should do anything I can to reduce them in the world.
user92578
Also, my game is tile based
user92578
16:25
So a gap like that won't happen. Period.
user92578
Player is thinner than a tile
user146722
@Tyyppi_77 Then you're so far down the wrong path already that you're just screwed
user146722
This must be a learning project, your first game from scratch?
user92578
No
Don't be condescending.
6
user92578
16:25
Yeah
user92578
I feel like we've found a new Mick to entertain us
user146722
@Tyyppi_77 I want to help you understand why this is ridiculous, but I can sense that I'm hurting your emotions somehow.
user92578
(no offense Mick if you happen to read this)
user146722
I wish you would just get over it and learn :) but I have to say "oh well" for now.
user92578
Well let's say that when you attend to the GunHero World Championships and lose because of this "glitch" in a not-going-to-happen situation you can come and yell at me
user146722
16:28
lol no thanks
Selfless, You're the one defending fixing things that aren't a problem. You can ask anyone in here, they'll all tell you it is a waste of time, and it is not how you're going to make it as a developer.
user92578
@SelflessPsychopath .
user146722
I thought your game was something way different before
@SelflessPsychopath Don't be an idiot.
user146722
I used to love old school DOS games
user146722
16:29
@William'MindWorX'Mariager better?
user92578
@SelflessPsychopath that's right, edit that shit
Take it easy @Tyyppi_77
user92578
kk
Remember the ignore button.
16:30
The ignore button is a beautiful thing
user92578
Oh I had totally forgot about that
user92578
Thanks guys
user146722
I'm glad everything worked out nicely :)
My first passive ability is working
Adds three shields with a cooldown.
Each shield can take a few hits before dying.
So I think I know where you were going with the 4th cooldown... can't decide if I like it though
16:38
With it just idling on green?
No. With it spinning around another time even though you have max shields
I want to say most games would trigger the cooldown after losing the first shield
not sure
Yeah, I was just about to suggest it.
Otherwise you effectively get 4 shields
because when one goes its immediately back
Fixed
Now the cooldown only goes down when you're not on max shields.
Err
The gif compressions has made it buggy. :P
It should show just a dimmed hex. :P Which it does every second time for some reason.
Are objects in JS values or references
var a = {};
var b = a;
Would b point to a or be a copy of a?
user146722
@William'MindWorX'Mariager point
user146722
copying is a pain, sometimes the easiest solution is "b = JSON.parse(JSON.stringify(a));"
I'll try it. Thanks
user92578
17:03
@William'MindWorX'Mariager could you explain the t1 & t2 variables quickly for me?
user92578
In your ray code
@SelflessPsychopath Whoa just got a chance to try out your latest version, it's super fast :D
user146722
@TheMuffinCoder :) how did it do on IE10 xbox?
lol I wish I could test it out rn but this time am sure I cant interrupt my younger brother
user146722
@Tyyppi_77 Hey I didn't mean to hurt your feelings my dude. I think it's best if we forgive, forget, and forge on.
17:10
Managed to convince him to let me run the test :D Just waiting to see the results now
@William'MindWorX'Mariager wooha! that heart is a fancy looking! cool
user146722
@TheMuffinCoder lol run it twice!
I will! Going to do as many as I can before he could use it again
@SelflessPsychopath :D The Last three came out as the fastest :^)
user146722
But within those 3, how do they compare?
lol they were different by 0.2
user146722
17:12
awesome lol, that's convenient
Okay I reran and now the last one was the fastest by 0.02 :P
@SelflessPsychopath lol why do so many people's feelings get hurt
user146722
I expect the last one to be the fastest
You're like one of the nicest guys here
user146722
Even though it's 4 loops deep
Yea it's super efficient, dont have to retrieve the pixel data again
user146722
17:15
@TheMuffinCoder I don't know, I need help sometimes, need people to encourage my nice side for me to be nice all the time.
@SelflessPsychopath Yep! When people are nice you get treated nicely back :D Like you :) am so thankful for all the time and effort you have put into making the scaling method more efficient
user146722
Thanks for the kindness and appreciation, that sure evens out the morning here for me :)
:D
@SelflessPsychopath :D I followed you on twitter :P
user146722
lol awesome, I haven't used my twitter profile yet
:P I just noticed how new your SE account is
user146722
17:26
I used to not really go on the social side of the internet
lol neither did I
For like 6 years I didnt have any accounts
user146722
lol but aren't you a teenager?
@SelflessPsychopath Yea :P
Last 2 months I made like everything Facebook, Twitter, Instagram, Skype
Only had a Stackoverflow account to help me out with my problems xD I was so new to programming I didnt even know which IDE to use
17:55
@BlueBug Yeah, I'm going for a crystal like UI :)
@Tyyppi_77 Raycasting against boxes is done basically by finding the time t when there is an intersection with one of the sides of the box.
I don't remember 100% how it works, but if I recall correct t1 or t2 holds the smallest time there is an intersection.
Chairs aren't very aerodynamic.
Behold, the 20+ ton flying chair.
18:43
I should start a kickstarter to make this a reality.
Flying by the seat of my pants.
19:09
@Pip I can play dota again! :D
user146722
@MickLH did you see the design doc? I missed your reply...
19:44
Has anyone used the Image Effects for Unity?
Like Color Correction or Lookup table?
Pip
Pip
@KevinvanderVelden !!!!!!
I saw you are ingame
@KalaJ I have not, sorry
I just had this crazy idea
With how "good" MS has been lately.... what's the chance that DX will go open source sometime in the near future?
(few years)
That DX12 SquareEnix demo looked amazing for being "in engine"
or whatever the proper term is

« first day (1731 days earlier)      last day (3585 days later) »