« first day (2873 days earlier)      last day (2154 days later) » 

12:17 AM
@FreezePhoenix worst case scenario: you flag messages when you get back :p
 
 
2 hours later…
2:12 AM
@doppelgreener Yep, nice, that was the natural evolution to that query :D
 
 
3 hours later…
5:12 AM
0
Q: Is "general feedback on game" on-topic?

Niklas RosencrantzI am working on an Android game scenario inspired by Moon Patrol. I am making progress and I don't have any very specific problem. I have posted the code for code review https://codereview.stackexchange.com/questions/196658/improved-android-game-inspired-by-moon-patrol The beta version is availa...

 
 
6 hours later…
user92578
11:15 AM
it's like none of the rasterization tutorials actually discuss the issue of going from world coordinates to screen coordinates
 
11:26 AM
@Tyyppi_77 I think i know something about that
 
user92578
actually I managed to finally found a tutorial that uses fixed point coordinates and the result looks pretty damn good
 
@Tyyppi_77 can you show a screenshot please
 
user92578
11:43 AM
 
user92578
Ignore the missing textures, but you can see that there are no longer artefacts in the scrollbars, and the radio button circles are smooth
 
nwp
That font is even worse than your last one :P
 
12:00 PM
If I put a post on gamedev about aabb collision detection and collision response will it be well reccived
 
nwp
I would expect it to either be closed as a duplicate or as 'Questions of the form "why doesn't my code work?" belong on stackoverflow'.
 
user92578
here we go
 
user92578
 
@Tyyppi_77 Cool... but you could do better with the font
but everything else is pretty good
 
user92578
I actually can't, that's the font ImGui provides
 
nwp
12:09 PM
AA would help.
 
@Tyyppi_77 Can't you overwrite it
the chilller font is much better
it looks like another language
but the translation isn't working
does anyone know of anymore easter eggs. I'll go to the sandbox with them now
 
user92578
12:28 PM
@TheMaskedRebel yeah I could but that would be relatively annoying, but that's up to the user anyways
 
user92578
@nwp yup, I definitely want to try that out
 
@doppelgreener I see you do y then x. Does it make a difference which axis you do first
 
user92578
lol obviously no
 
12:53 PM
	public boolean isColliding(AABB aabb) {

		boolean x = entity.getMin().x < aabb.getEntity().getMax().x &
		getEntity().getMax().x > aabb.entity.getMin().x;
		boolean y = entity.getMin().y < aabb.getEntity().getMax().y &
		getEntity().getMax().y > aabb.entity.getMin().y;
		boolean z = entity.getMin().z < aabb.getEntity().getMax().z &
		getEntity().getMax().z > aabb.entity.getMin().z;

		return x & y & z;
	}
can someone help me with this code.
 
user92578
why aren't you using the code doppelgreener kindly provided you?
 
it is aabb vs aabb collision but it is returning loads of false negatives
 
user92578
you are also using bitwise and
 
@TheMaskedRebel it does not matter. you can randomize the order of those four statements and it won't matter.
@Tyyppi_77 good catch
 
user92578
i won't really bother reading through that
 
user92578
12:56 PM
when you have working code provided to you
 
@TheMaskedRebel the reason i wrote it as if (one comparison) return false; was both to simplify statements and also to short-circuit the evaluation: if they do not match on the first axis, i do not need to make the rest of the comparisons, we have already determined they do not collide.
 
user92578
your code is also a lot cleaner
 
function colliding(AABB a, AABB b): boolean {
  if (a.max.x < b.min.x) return false;
  if (a.min.x > b.max.x) return false;
  if (a.max.y < b.min.y) return false;
  if (a.min.y > b.max.y) return false;
  if (a.max.z < b.min.z) return false;
  if (a.min.z > b.max.z) return false;
  return true;
}
there's the 3d version
@Tyyppi_77 it does make it a lot cleaner
 
nwp
@doppelgreener You can write a loop for that and trade simplicity and code duplication for an increase in WTFs/minute.
At least in some languages you can.
 
@nwp brilliant
 
1:01 PM
@doppelgreener I dont see the point of doing two if statements for one axis
 
@TheMaskedRebel it's more straightforward to read
but that's subjective
 
@doppelgreener I meant why check the min and max twice instead of once
 
[fixes a typo]
@TheMaskedRebel we check it twice anyway
 
@nwp Not languages, code style. My code style doesn't allow it
 
@TheMaskedRebel he's joking, it's a terrible suggestion made in jest
 
1:03 PM
@doppelgreener I know but why are we checking it twice
 
well, we check each dimension twice. we check two things in each dimension:
1. that the minimum of A is greater than the maximum of B, or
2. that the maximum of A is less than the minimum of B.
so we're not checking any one fact more than once.
we have six facts to check to determine if the AABBs are colliding.
(in two dimensions, we only have four facts to check: two facts per dimension)
this is also a perfectly reasonable way to write that code:

function colliding(AABB a, AABB b): boolean {
  if (a.max.x < b.min.x || a.min.x > b.max.x) return false;
  if (a.max.y < b.min.y || a.min.y > b.max.y) return false;
  if (a.max.z < b.min.z || a.min.z > b.max.z) return false;
  return true;
}

but it's the same thing.
 
nwp
@TheMaskedRebel Doesn't allow what? Loops?
 
@nwp Yes. If I use an array I would actually try what you were saying :D
 
don't do it with a loop over the properties though, that was a joke :P
 
@TheMaskedRebel used
 
nwp
1:08 PM
What is one value of a point, like x, called? It's not coordinate.
 
@nwp it is a coordinate. If a vector is defined as (x,y,z) then the x value is the x coordinate.
 
@doppelgreener I can't do it with the properties atleast in java
 
@TheMaskedRebel Good, you should not, it was a joke and is a bad idea.
 
nwp
@doppelgreener x coordinate is good, but when I don't want to specify that you mean the x coordinate but any of x, y, or z coordinate what do you say? If you just say "coordinate" it's for the tuple (x, y, z).
bool colliding(const AABB &a, const AABB &b) {
	for (auto v : {&Point::x, &Point::y, &Point::z}) {
		if (a.max.*v < b.min.*v)
			return false;
		if (a.min.*v > b.max.*v)
			return false;
	}
	return true;
}
Glorious!
 
            if(entity.getMax().x < aabb.getEntity().getMin().x) return false;
		if(entity.getMin().x > aabb.getEntity().getMax().x) return false;

		if(entity.getMax().y < aabb.getEntity().getMin().y) return false;
		if(entity.getMin().y > aabb.getEntity().getMax().y) return false;

		if(entity.getMax().z < aabb.getEntity().getMin().z) return false;
		if(entity.getMin().z > aabb.getEntity().getMax().z) return false;


		return true;
 
nwp
1:14 PM
Now I kinda wanna learn Haskell again. I think they do such things all the time. Except they would say the 2 ifs still have redundancy in them that you can factor out :P
 
the code is still giving false negatives @doppelgreener
 
user92578
you need to provide us with an example input
 
user92578
what is rect 1's min and max, what is rect 2's min and max
 
@Tyyppi_77 all I can say is that it never registers a collision even when there was one. I actually fixed this problem before by checking the center and radius before.
but I lost that code
 
user92578
that's not all you can say
 
user92578
1:18 PM
figure the conflicting inputs out
 
user92578
put in the debugging work
 
what you can do is check what the output is for entity.getMin(), entity.getMax(), and the same for the other AABB you're providing this function.
My suspicion is your mins and maxes are not correct.
 
@doppelgreener It adds the position to the min
 
because like ... that code, it works, it is code i have used in 4 different projects now.
 
	public Vector3f getMin() {
		return Vector3f.sub(position, model.getMin(), null);

	}

	public Vector3f getMax() {

		return Vector3f.add(position, model.getMax(), null);

	}
 
user92578
1:21 PM
and wtf is model.getMin() and model.getMax(), and where is position?
 
what i mean is: have your code literally output, to the console:
this min: (a vector)
this max: (a vector)
other min: (a vector)
other max: (a vector)
or inspect these in the debugger using a breakpoint. and then make sure these are sensible outputs (all the min coordinates are lower than the max coordinates, and they should/shouldn't provide a collision).
 
@Tyyppi_77 position is fine and I'll get where I calculate my min and max later
@doppelgreener I WILL DO THAT AND COME BACK IN AN HOURS TIME
 
cool beans
 
user92578
good stuff
 
@Tyyppi_77 speaking of that model.getmin/getmax thing, that strikes me as something an AABB should not be doing. the AABB itself is defining its min/max, and shouldn ot be requesting it from the model. if the model changes somehow in space, the model updates its AABB to store the min/max. does that sound right?
i.e. the AABB should itself be a simple struct consisting of two coordinates, a min and max, and some information derived from those coordinates (its center, and its width/height/depth dimensions), and it should be the source of truth for the min/max of a model. the model should be asking its own AABB what its min/max are, not the other way around.
 
user92578
1:34 PM
My game has a wrapper around an AABB called "HitBox" that holds an AABB that has just a min and a max, and it combines the data from the model or object it represents and the AABB
 
user92578
so for an example HitBox contains an offset that is applied to the entity's position
 
user92578
but I would definitely advocate for an atomic AABB
 
something that comes to mind is that if it's asking the model, then the model is probably calculating it every time it's asked
which means looping through lots of vertices
instead the model should do that once ... then store it as an AABB.
to me AABBs are atomic, like you say, they're a fundamental building block that get used by all kinds of things, and can't afford to be tied exactly to relying on a model.
a fireball might also have an AABB distinguishing its hitbox, and that hitbox AABB is bigger than the fireball and has nothing to do with the fireball model's dimensions.
 
user92578
@doppelgreener yup this is what i was trying to get to, for some reason i had a hard time communicating that
 
2:00 PM
I have increased quality a little and drastically increased render distance. Now this is a view from top of a mountain.
 
is that thing on the right the matt bat
also lookin' neat
 
A sword. On the right part of the screen. Or you mean something in the distance?
 
@TheMattbat999 no i meant that. :)
 
@doppelgreener ok.
 
Goodbye my freinds :) About to board the vehicle...
 
2:05 PM
@FreezePhoenix what vehicle?
 
A minivan :)
 
Oh that camping trip. Have fun and watch for bears and dragons :P
 
Uh... dragons? I'll toast them with the marshmallows :)
2
 
@FreezePhoenix Enjoy your trip!!
 
@FreezePhoenix right on!
And crocodiles. If one comes at you, climb a tree. There little legs can move fastee than they appear.
Also, see y'all. I got church
 
2:12 PM
🐊
 
user92578
jesus christ
 
it's alright it's just an emoji crocodile
3
 
Alligators and Crocs are like aquatic dinosaurs... not good :).
 
@doppelgreener I think you are right
player min Vector3f[2.233209, -0.056646, 0.877621] max Vector3f[2.523937, 10.652402, 1.000001]
stone132 min Vector3f[-339.40967, 19.437544, -217.50972] max Vector3f[-339.5972, 22.416004, -217.50972]
player min Vector3f[2.233209, -0.056646, 0.877621] max Vector3f[2.523937, 10.652402, 1.000001]
tree132 min Vector3f[-891.38776, 23.900341, -108.938446] max Vector3f[-893.91284, 63.121464, -115.58468]
player min Vector3f[2.233209, -0.056646, 0.877621] max Vector3f[2.523937, 10.652402, 1.000001]
stone136 min Vector3f[209.99886, 3.1807537, -382.74744] max Vector3f[209.81134, 6.159214, -382.74744]
@doppelgreener those are the outputs
 
Alright now I am gone :)
 
2:26 PM
@TheMattbat999 ttfn!
 
user92578
@TheMaskedRebel not helpful alone, need to also know what the false outputs are
 
player min: Vector3f[2.233209, -0.056646, 0.877621] max: Vector3f[2.523937, 10.652402, 1.000001]

stone144 min: Vector3f[587.173, -1.9083759, -461.1881] max: Vector3f[586.9855, 1.0700842, -461.1881]

player min: Vector3f[2.233209, -0.056646, 0.877621] max: Vector3f[2.523937, 10.652402, 1.000001]

tree144 min: Vector3f[-539.3927, 17.240902, 4.370716] max: Vector3f[-541.9178, 56.462025, -2.2755146]

player min: Vector3f[2.233209, -0.056646, 0.877621] max: Vector3f[2.523937, 10.652402, 1.000001]

stone148 min: Vector3f[291.46225, 8.9611845, -286.47507] max: Vector3f[291.27472, 11.939645, -286.
 
user92578
anyways I'd just build a simpler test case, with just two AABBs that return a false result
2
 
@Tyyppi_77 I've already debugged them and I've disovered that the method aways returns false
it never returns true
 
yeah, you'll want to build up a much, much simpler test case
using unit testing if possible
 
user92578
2:31 PM
^
 
@doppelgreener I think I've found part of the problem
the min and max values look very close together
here is how I calculate them
	private static Vector3f getExtreme(final List<Vertex> vertices,
	        final BinaryOperator<Float> op) {
	    final float x = vertices.stream().map(v -> v.getPosition().x).reduce(op).orElse(0f);
	    final float y = vertices.stream().map(v -> v.getPosition().y).reduce(op).orElse(0f);
	    final float z = vertices.stream().map(v -> v.getPosition().z).reduce(op).orElse(0f);
	    return new Vector3f(x, y, z);
	}
Vector3f min = getExtreme(vertices, Math::min);
Vector3f max = getExtreme(vertices, Math::max);
 
user92578
where is the model's origin?
 
at the position
I'm pretty sure about that
 
user92578
no if I render a model at (0, 0), what part of the model is at (0, 0)?
 
user92578
center? topleft?
 
user92578
2:35 PM
bottom?
 
@Tyyppi_77 The center
@doppelgreener Nope the model only calculates it once than stores it in a variable and the aabb accesses it.
 
@TheMaskedRebel the variable it should be storing it in should be the AABB itself
 
@doppelgreener True but... its kinda a weird coding style.
 
it really isn't
your AABB is the defining unit for the bounding box
 
user92578
I think your issue is that you are subtracting the min, but you want to add it instead
 
user92578
2:40 PM
public Vector3f getMin() {
    return Vector3f.add(position, model.getMin(), null);
}
 
oh yeah, if the minimum is already defined as a position relevant to the origin, you need to add the minimum to the origin
different way to write that extremes function as well (in pseudocode):

function determineExtremes(List<Vector3> vertices) returns AABB {
  Vector3 min = new Vector3(float.max);
  Vector3 max = new Vector3(float.min);

  foreach (Vector3 v in vertices) {
    if (v.x < min.x) min.x = v.x;
    if (v.y < min.y) min.y = v.y;
    if (v.z < min.z) min.z = v.z;

    if (v.x > max.x) max.x = v.x;
    if (v.y > max.y) max.y = v.y;
    if (v.z > max.z) max.z = v.z;
  }

  return new AABB(min, max);
}
that loops over each set of vertices only once
 
user92578
^ as opposed to 6 times
 
user92578
wait no, 12 I think
 
@doppelgreener I loop through the set 0 times
 
user92578
yeah you don't loop, but Java loops behind the scenes
 
2:42 PM
final float x = vertices.stream().map(v -> v.getPosition().x).reduce(op).orElse(0f);
 
user92578
map does a look and so does reduce
 
user92578
That happens for each of the 3 components, twice for min and max respectively
 
user92578
2 * 3 * 2 = 12
 
map() loops through each element of this array, so does reduce().
so you're saying "for each element in the vertices, loop through this, then loop through it again." you do that three times (once for x, y, and z) for one extremes function call, and then you call the extremes function again.
 
user92578
@doppelgreener I just wanted to say that I really like your pseudocode style, it's really cool
 
2:43 PM
@Tyyppi_77 oh hey thanks. :)
 
now for collision response
how do I do it with aabb's
google wasn't well informed on the subject
 
user92578
that fixed the aabb collisions?
 
@Tyyppi_77 Yes it did
thanks for your help @doppelgreener @Tyyppi_77
 
awesome!
 
user92578
are we using the same google? I get a ton of promising looking results
 
2:47 PM
@Tyyppi_77 everyone's google is a different google :P
 
@Tyyppi_77 I get loads of gamdev results
 
the other day i was googling a bunch about magic cards, and now google frontloads anything gaming related even when i'm not trying to google anything gaming-related
 
like everything i see points to gamdev
 
user92578
for an example this looks promising: reddit.com/r/gamedev/comments/6bonca/…
 
user92578
@TheMaskedRebel and?
 
2:49 PM
@Tyyppi_77 the topics i see arnt very useful
 
user92578
learning to google is very important for beginner programmers
 
should I use SAT on aabbs
@Tyyppi_77 Can you give me a couple of good algos that you know and I'll google them up
 
@TheMaskedRebel you should read that reddit link, since it already describes some and provides an algorithm
 
the reddit thread itself also describes ways to handle it
 
3:16 PM
5
Q: How do I make a collision between AABBs slide?

PeeSI have a room with objects inside. Each object has it's own AABB. I know how to check for collisions between the objects with an AABB-AABB intersection. How do I calculate an appropriate collision response to make them frictionlessly slide against each other as they collide?

that is what I found.
 
3:57 PM
Is the velocety a vector or a float value
 
user92578
vector
 
i use a float value
@Tyyppi_77 And it is added to the position, right
 
user92578
yes
 
4:13 PM
how do I find the contact normal of an aabb defined max, min
 
4:29 PM
without using ray intersection
this room is dead ( ; ; )
@Tyyppi_77 How did you get the contact normal of two aabb's in GunHero
 
4:46 PM
it's sunday + not everyone is going to be available & willing to answer all your questions whenever you have them :P
 
@doppelgreener thanks for the tip. I'm going to make a main site question about it
 
user92578
@TheMaskedRebel Like I said, that's not how I resolve collisions
 
user92578
man that match was a big fucking disappointment
 
0
Q: How do I get an aabb's collision normal

The Masked RebelI have two aabbs and I need to know the collision normal of the to help me slide the aabbs across themselves. I have searched google but nothing really came up. How do I get the collision normal of two aabbs colliding together

@Tyyppi_77 What match
 
user92578
germany vs mexico
 
4:53 PM
who won
 
user92578
mexico
 
5:40 PM
Hello!
 

« first day (2873 days earlier)      last day (2154 days later) »