« first day (2918 days earlier)      last day (2396 days later) » 

00:59
@Almo FYI..!
 
7 hours later…
08:19
I swear, every time I look at ECS stuff I see someone doing it radically differently
There are people who don't even store data in entities
they have a mapping of entity ID to whatever
I'm sticking with my "entities are JSONs" thing for now
I find that people who obsess over ECS end up in the same issue of those who obsess over OOP.
I just find that "yes, subdividing my objects by concerns is good."
Yep, architectural obsession over a system meant to solve it
Meanwhile, I've been taking some breaks playing with P5, making 50-line scripts that do stuff like this:
Nice!
08:49
I'm actually going to teach this so
take students that kind-of know how to code, but haven't done anything fun in their life, and get them into creative coding, maybe even some gamedev
09:09
My collision system with ECS is destroying my performance
no idea what to do
Before I get into shiny grid optimisations or whatever I'd like to know what is making it run so much worse than the hacky game before
The profiler says it's the collision system but not much more
No joke, apparently it was the hash access
ookay
What language are you using?
And what type are you hashing?
09:41
@AlexMitan usually the thing that destroys collision system performance is checking every object against every other object, when instead a quad tree (in 2D, or an octree in 3D) or something like it should be implemented to minimise the number of proximity checks.
09:56
I think that's what he means by "Before I get into shiny grid optimizations [...]".
JS
What seemed to kill performance was extracting attributes one by one
instead of doing one big destructuring
also, AABB collision using objects was significantly slower than a function that takes in 8 params
10:30
@AlexMitan What was that function? o_O
Usually AABB is pretty useful in narrow phase collision detection for quickly identifying or disqualifying potential collisions.
(Are you familiar with the ideas of broad phase & narrow phase collision detection?)
AABBs and quad/oct-trees go hand in hand
@DMGregory I'd love to but I still have a 3+ month question ban
@TheMaskedRebel Question bans don't fade with time AFAIK, instead you work your way out of them via positive contributions to the site.
They're entirely automated and based on some kind of point system that's kept secret and which is based on how your content gets received.
There'd be a link advising on what action you can take to address the question ban.
For example, if you've figured out how to draw a sphere in opengl and lwjgl3, you could answer explaining the correct method with code examples and mention where you were tripping up on it for future visitors' warning.
11:05
@TheMaskedRebel So you know you're not allowed to ask questions currently, and you tried to circumvent that site rule rather than respect it. That's not OK. If you break the rules and get more downvotes/reverts, your ban could be extended.
@doppelgreener Do I just paste it here?
@DMGregory Oh, do they actually wear off over time?
What I have now is this:
function rangeIntersect(min0, max0, min1, max1) {
return Math.max(min0, max0) >= Math.min(min1, max1) && Math.min(min0, max0) <= Math.max(min1, max1);
};
function boxIntersect(x0, y0, w0, h0, x1, y1, w1, h1) {
return rangeIntersect(x0, x0 + w0, x1, x1 + w1) && rangeIntersect(y0, y0 + h0, y1, y1 + h1);
}
@AlexMitan what are you actually doing
what I used before was a version of the second function that took two objects as params, and accessed their xywh properties
11:09
@AlexMitan That looks like it's just a normal AABB collision detection
@doppelgreener They might. I had one for a while on StackOverflow because a coworker who already had one asked me to post for him.
@TheMaskedRebel Remaking a small shooter in ECS
I really, really vibe with the way ECS does things
But these days StackOverflow has become bloated anyway. Either your answer exists there or your question will never be answered.
@AlexMitan oh, so accessing their x, y, h, and h properties only once each is a speed-up here, compared to your original that accessed each of them multiple times?
(that's concerning tbh because that shouldn't be a large speedup :P accessing those properties should not be slow... but maybe it's JS's fault)
There's a reason Unity automatically gives each component a reference the transform of their entity. Some things are common enough to be easily accessed even if it's not ideal ECS.
11:11
@DMGregory So just to clarify, do I get the face normals AND the cross product of the edges and test that.
@doppelgreener ...I extracted x and y from the position component, w and h from the collider component, then recreated the objects only to pass them in for each collision check
it's really cringy
And of course then there's people doing this
I'm not going to do that right now, I just want to get used to everything
@AlexMitan That's not a terrible way to do certain things, though. I once wrote a RenderingManager that had a vector of pointers to everything drawable (well, actually an unordered map but whatever).
@Garan I'm going to ping you in the discord server
I suppose my concern right now is not forgetting to clean everything up, and I'm having some filterng errors
@doppelgreener I believe so, though I'd still recommend your suggestion of improving downvoted content to clear the ban, rather than just waiting. That both ends the restriction AND makes the site better. Win-win. :)
11:18
@doppelgreener You get a chance after 6 months to ask a well received question
If it is poorly reccived, than you get banned again
@AlexMitan my own AABB checking code has generally just looked like this:
Jun 17 at 12:58, by doppelgreener
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;
}
if i had to create the AABB on the spot, I'd pass in...
let aabb = {
  min: {
    x: obj.position.x,
    y: obj.position.y
  },
  max: {
    x: obj.position.x + obj.collision.width,
    y: obj.position.y + obj.position.height
  }
}
right, exactly
that's what I did too :D
was that quite slow? :O
the second thing is lightning fast compared to the first
if you pass in the eight parameters it's super fast
that's very surprising!
there's gotta be more to it going on, but i guess i'll just have to never know :P
as long as it's working well now that's good. :D
11:30
Honestly I can't wait to wrap up this little project to start working on a game I can actually love
This project has one and only one goal: experiment with ECS
and I love, really really love ECS
It's exactly my kind of system, nice, chunky, modular, data-driven...
and I'll play with a bit of messaging to simplify some stuff too
Honestly I like the kind of coding I do these days... some gamedev... some graphical programming... making courses...
Life is good
I've read almost everything that he posted online ever yes
his gamedev blog, his language design blog, his blog blog
he's one of my personal heroes and I love him
First time I read that article was a long time ago, and he mentioned elusive ECS systems where there's no logic in the game objects, and I scoffed, oh how I scoffed at the unnecessary restriction
But now I see the light
11:43
I've always love the idea behind ECS. The execution is difficult though.
@doppelgreener You say AABB is useful in narrow phase here. I've always seen AABBs as an addition to the broad phase.
Assuming objects have freeform shapes, I have an AABB for the object, AABB is used to sort it into a quad tree and for the quick check you mention. This is all broadphase to me. Then narrowphase is checking if the actual shapes overlap/intersects in any way.
I guess broadphase vs narrowphase might be kinda fluid. It depends on the kinds of collisions you're dealing with. If you had all rects, AABB would be the narrow phase.
Hmm, you're right. If we've sorted out what might be colliding with what in a quadtree, we don't need to then also check their AABBs again afterwards to see what to check against what: we can jump into finer detail there.
I remember the first time I tried quadtrees :P
What an amazing improvement.
I was doing basic circle-circle collision detection.
And the n² started to hit hard.
Then I switched to quadtrees ... and all performance issues were just gone.
During my first year of University my friend dumped a million tiny floating pellets into a scene and recorded the performance with and without quad trees.
11:57
Whatever performance hit the partitioning had, it was nothing.
and then he grabbed me and was all like LOOK AT THIS!! LOOK AT THIS AMAZING THING I FOUND!
[play scene without quad trees, barely functioning]
[play scene with quad trees, pellets gliding around super smoothly at 60fps]
I really like that aspect of making a collision detection system. You really get to feel how minor changes can affect things majorly.
Again, with the basic circle-circle collision. Cutting out the square root was a major improvement as well.
Damn, I'm too used to C++, I keep forgetting that I declare AND define a function all at once in C#.
Want to switch Garan?
I'm stuck in C++ land. I miss my C#.
@WilliamMariager I was sincerely considering writing the code for my current project as a native plugin for Unity instead of C#.
But none of the major benefits of c++ would help me so I figured it would be too much effort to set up.
*would be relevant to me
12:01
I've yet to find any major benefits of C++.
I was weighing up unity vs godot for my revisit to game development, and I'm inclined to try godot (because it's an underdog and because it gives me the dark theme for free)
Main thing in C++ is probably the better memory management.
But you'd have to do something special for that to matter.
There's something to be said for knowing EXACTLY what your language will and won't do. So you know that if you're shooting yourself in the foot, you know exactly how and why.
So relaxing
Whoa, that's pretty.
12:08
I hand-drew the first one:
But then I put two emitters on sine-waves
You can play with it here. Press play and drag around the canvas :D
12:37
0
Q: How to store and retrieve user data in a multiplayer game

ShashimeeI am building a multiplayer game with a team and each player will have a multiplayer rank, a matchmaking rating (MMR), a username, and possibly a picture, a description etc. We are planning on delivering the game on multiple platforms such as Steam, itch.io and GoG. Since I am using Unity, how ...

12:53
@AlexMitan So cool! :D
Thanks! :D
p5 is the real deal, I love it so much
I wish I could be more confident about building games on it, as can clearly be done
The confidence comes with time. Hopefully but not always with the skill to back up that confidence. ;)
I'm worried about UI on canvas basically... with SVG you have mouse events for every shape in the sim
with canvas...
might have something to do with the fact that I have yet to work on a game that I LOVE, rather I've been doing architectural prototypes
I have serious trouble working on things I don't love, especially if I'm kind of tired
Everyone is like that.
Learning to move beyond it is an important skill.
13:05
If not, you end like 90% of people in here. A ton of half projects.
@AlexMitan Good find. :)
Call it procrastination, lazyness, passion, productivity, whatever. It comes down to the same thing. You need to find a way to deal with it.
13:16
Morning!
o?
Oops
Mornin. :)
o/
13:49
@WilliamMariager I've managed
@AlexandreVaillancourt Good evening
@TheMaskedRebel :)
@AlexMitan Oooh. That's cool.
How do I get the normals of a face(It doesn't matter which way they are pointing)
14:06
A face has only one normal, doesn't it?
I meant the normals of an object
How do I get them with a list of vertices
@AlexandreVaillancourt gamedev.net/forums/topic/…
that is what i want to do
Oh, ok, I don't know sorry.
Not the whole steps just getting the normals of an object
hey @Jimmy
hi
didn't you ask this like, a long time ago
either: 1) you store the normals of each face in an object. or 2) you calculate the normal of a face by taking the cross product AB x AC where A, B, C are the positions of the three vertices, but this only works if your mesh has a defined winding order
I don't mind if the normals point inwards or outwards
14:17
in that case, then the cross product should work for you
Thanks Jimmy
When you have the time you may want to read over the series at blog.wolfire.com/2009/07/…
it covers stuff like this
Do you want to join a private gamedev server @Jimmy
no
We talk about gamedev stuffs and we help and talk about other people's games
14:21
like here, but in private?
Yes
Also you get a copy of my game
^ a relevant excerpt from that blog
@TheMaskedRebel I don't really want to sit in a bunch of chat channels, even just this one is a productivity killer sometimes
@Jimmy also we help and talk about our games and sometimes we play an RPG
> chat channels
>productivity killer
What is the line for
14:32
a quote and a failed quote
I was going to quote two lines, but I failed at appeasing the chat markdown deity
14:50
@Jimmy Show me how to do it
15:03
how to do what
the line thing
just type "> something"
15:40
@AlexandreVaillancourt is the new place good?
@Almo I don't know. I'd have to go there, and sit and wait to be served. It's a "service at the table" restaurant now, with table cloth and metal cutlery...
Not sure I'll ever want to spend the time and go there (alone).
OOOH
wow
16:24
Heyhey does anyone know a java based "Chat & Messages" Framework or API for using it in a multiplayer game ? :)
Is this server-client based or peer-to-peer (I don't know but this will help find one)
server - client based... i could write my own approach but honestly im lazy and want a fast solution :D
Well... thanks :D
@Jimmy "sometimes"
16:35
Hey, I too am lazy and wanted a fast solution.
 
2 hours later…
18:32
I'm making an evil language based on macros and "eval"s to cool off while I do some game design
It'll be the joy of everyone who hates "eval"
 
2 hours later…
wow FF XV mobile is a soulless horrid game :(
 
3 hours later…
23:31
@Almo But they rated it 4.1/5!

« first day (2918 days earlier)      last day (2396 days later) »