Vectors are pretty nice and easy. And without any CPU usage either, even better! (: |
![]() Feb 8 2011, 5:36 pm (Edited on Feb 8 2011, 5:43 pm)
|
|
Vectors are just a way of thinking about information, really. Can't imagine how the maths behind the vid you've shown would've been different had you never learned about them. Well, there are some ways, I suppose. Their significance is more apparent in more advanced 2D physics or 3D, though.
|
Yeah. You're right, but they just seem so easy and beneficial to BYOND in my mind. (:
|
Yes, they give you a very easy way of thinking about things. That's their benefit. Mind, you don't have to have a 'vector datum' or somesuch to think in vectors! In any case, props (yea+) for setting up elegant & accurate collision detection in that video. :)
|
Yeah, although jt_vectors helps a lot in doing vector math automatically, it's always going to be faster to just use 2 or 3 simple variables.
And I don't see any "elegant & accurate" collision detection, or any collision detection at all in that video. Still, BYOND can do a lot with vectors. Nowhere near as fast as I would like, but still. |
Well, collision is next, and hopefully it won't take a ton of CPU to do. I'd like to keep it really really close to 0%.
|
And I don't see any "elegant & accurate" collision detection, or any collision detection at all in that video. Doesn't he do polygon detection to check when the car is on or off grass? I was sure I saw the car slow down when it went on it. Maybe I didn't see it right, though. If so, I guess you can keep the yea as future investment? Yeah, although jt_vectors helps a lot in doing vector math automatically, it's always going to be faster to just use 2 or 3 simple variables. This is entirely inaccurate, and using jt_vectors is not going to slow your game down by any amount humanly noticeable. In fact, it might speed it up, by encouraging proper form. |
...by any amount humanly noticeable. In this and other "pixel movement" systems, a lot of procs and /vector objects are being created and deleted per tick. Smoothness using this style of movement requires more frames per second(through lowered tick_lag), putting increased strain on the CPU. BYOND's designed for using the built-in movement system. If pixel movement were ever built-in and supported by BYOND's design, it would be used everywhere instead, but it isn't supported, so it isn't used commonly. And don't bring up any of IainPeregrine's games, because(he's a genius, and) ~3 doesn't count as being commonly used. Foomer's Space Conquest to my knowledge also uses jt_vectors, but on a much slower scale, and is therefore not noticeable. |
I don't know what Iain does, but I have a hard time believing he does or needs any special optimisation in his games. Rather than argue this point, perhaps you should try the following: replicate Oasiscircle's game, once using datums, the other not using datums. Host it with a few friends, and see for yourself if you experience any major slowdowns. I am convinced you won't.
|
Just so the people know, I don't use datums for this system that I'm using.
I'm currently working on collision using bounding-circles placed upon a rotatable median line on atoms to allow for easy movement and for quick and easy changing in degrees. |
Out of sheer curiosity I spent the last hour or so creating this: http://files.byondhome.com/Toadfish/vectors.zip. I used jt_vectors and made sure to have absolutely no optimizations. I added some physics calculations for kicks, but they are sort of arbitrary since, writing this as quickly as I could, I didn't bother tweaking the mass. tick_lag is not changed and I have no macro optimizations or anything. You can click a mob to make it start moving randomly (or just run into it). #DEBUG is on so you can profile things. I had no problem running this with hundreds of mobs. I was going to add rotation but I forgot about it, but I'm not sure if the rotation vector shows in the stat panel or not. If it does, it doesn't really do anything.
Edit: playing around a bit it looks like I forgot to bound the acceleration with collisions, so expect some dizziness, lol! |