Skrakle Posted May 29, 2015 Share Posted May 29, 2015 Here's another version of the platform.lua with additional options. - The entity waypoint has been replaced with multiple Vec3's allowing multiple waypoints. - Looping. (clockwise or ping-pong) - Pause timer between waypoints. (in milliseconds) - Randomize starting waypoint. Here's a video demonstration of the script in action: https://www.youtube.com/watch?v=-1Q4qAcW40k&feature=youtu.be platform_slider.lua 3 Quote Link to comment Share on other sites More sharing options...
YouGroove Posted May 30, 2015 Share Posted May 30, 2015 That's great. About workflow i would use Pivots instead of having to enter values : it's a old programmers hard and long way of making games Instead of having to gather the coordinates in the editor each time, you place pivots that are visible in the editor so you have instant feedback where your platform will move , and you just bind pivots to your script with drag and drop. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Skrakle Posted May 30, 2015 Author Share Posted May 30, 2015 I agree, it definitely would make it easier to setup while editing but that's a matter of preference, some people need to see things visually more than others. For me, it's a matter of memory and performance, the choice was Initializing a Pivot object with tons of properties and methods vs a single Vec3. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted May 30, 2015 Share Posted May 30, 2015 the choice was Initializing a Pivot object with tons of properties and methods vs a single Vec3. A pivot is an empty object and initialisation is just done one time at game start on the entity start() function, so i don't think it is some optimisation needed here. Benefit of pivot is having having game level modifications is also more easy as you just move pivots visually, and you can't loose lot of time gathering coordinates and enter them if you had a big level with thousand platforms. It would be anti level designer productivity Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Skrakle Posted May 31, 2015 Author Share Posted May 31, 2015 (edited) A pivot is an empty object and initialisation is just done one time at game start on the entity start() function, so i don't think it is some optimisation needed here. If you read my previous post again, you'll notice that i'm not only talking about speed optimization but memory as well which is my point. As for the pivot being an empty object, that is completely wrong, once initialized, there are objects in it are automatically initialized as well whether you're using them or not and will use extra (and unnecessary) memory... You should do some testing before making assumptions like that. Benefit of pivot is having having game level modifications is also more easy as you just move pivots visually, and you can't loose lot of time gathering coordinates and enter them if you had a big level with thousand platforms. It would be anti level designer productivity It's like i said, there are people (such as you obviously) that need to see such things visually to be more productive, i don't. Edit: - I initialized 20000 Vec3s and it took about 1mb of memory - I initialized 20000 Pivots (without using or modifying them, just a simple Pivot::Create) and it took about 88mb. I rest my case. Edited May 31, 2015 by Skrakle 1 Quote Link to comment Share on other sites More sharing options...
YouGroove Posted June 1, 2015 Share Posted June 1, 2015 - I initialized 20000 Pivots (without using or modifying them, just a simple Pivot::Create) and it took about 88mb. The problem is within the Pivot object in LE3 to take so much memory, compared to a really empty "node" object you can find in JME3. I doubt i'll have 2000 pivot in a scene level, specially when it's not a open world. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
tjheldna Posted June 2, 2015 Share Posted June 2, 2015 . Quote Link to comment Share on other sites More sharing options...
macklebee Posted June 2, 2015 Share Posted June 2, 2015 1Mb per pivot??? er.. his test was 88MB for 20,000 pivots. so basically 4.5kB per pivot. 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted June 2, 2015 Share Posted June 2, 2015 It looks like a pivot entity takes up 4616 bytes. It has the full functionality of all entities, so it is fairly heavyweight in great numbers. In the above example using them will make absolutely no difference. Just do what you feel most comfortable with. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
tjheldna Posted June 2, 2015 Share Posted June 2, 2015 Mental note to self, read posts properly. Removed it to avoid confusion Quote Link to comment Share on other sites More sharing options...
Skrakle Posted June 2, 2015 Author Share Posted June 2, 2015 Yeah i know 20000 pivots seems extreme as a test, that was merely to demonstrate the consumption factor. Even if it's insignificant, it still good practice, especially if one day, the engine ever goes to console. Quote Link to comment Share on other sites More sharing options...
tjheldna Posted June 2, 2015 Share Posted June 2, 2015 So what if your game is heavily dependent on Pivots like ours? Quote Link to comment Share on other sites More sharing options...
Josh Posted June 2, 2015 Share Posted June 2, 2015 Yeah i know 20000 pivots seems extreme as a test, that was merely to demonstrate the consumption factor. Even if it's insignificant, it still good practice, especially if one day, the engine ever goes to console. Is it good practice to design systems that are harder to use, in the name of imaginary optimizations that aren't really there? That's a good design lesson for you to learn. Personally, I suspect you really feel more comfortable with the Vec3 design, which is fine. So what if your game is heavily dependent on Pivots like ours?Do the math. If your memory consumption gets into the hundreds of megabytes, you may have a problem. I calculate you can support about 500 houses with just 100 mb memory, so that does not seem like it will be your bottleneck.. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
macklebee Posted June 2, 2015 Share Posted June 2, 2015 So what if your game is heavily dependent on Pivots like ours? In the above example using them will make absolutely no difference. Just do what you feel most comfortable with. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted June 2, 2015 Share Posted June 2, 2015 No, I actually meant the OP. That wasn't very clear. Interesting discussion, anyways. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.