Here's an idea, if you were to move four points around a circular path, one starting at 0°, one at 90°, one at 180° and one stating at 270° . . . . so basically set them up as a normal circular path but offset each one by 90°.
Which will look like the four corners of a rotating square.
Now squash the circular path vertically by 50%, so instead of the width being - for example - 300 and the height 300, you would make the circular path 300 wide by 150 high.
Which would look something like this:
Constrain X position to 300 * cos (angle) . . etc
Constrain X position to 150 * sin (angle) . . etc
Now join up each of these 4 points with a line (basically the same idea as the first post in this thread) - to form a square.
This is simple enough, just create a line actor and - for example looking at just the line that joins the 0° point to the 90° point - use the vector to angle of the 0° point to the 90° point to work out what angle the line actor needs to be, use some simple maths to work out where the line actor needs to be (basically halfway between the 0° point and the 90° point), and then use the magnitude behaviour (again measuring the 0° point to the 90° point) to work out how long the line actor needs to be.
Right, so we have just drawn a line from the 0° point to the 90° point.
We would then do the same for all the points, join 90° to 180, 180° to 270° and 270° to 0°.
Once all four points are connected by 4 line actors, we will see a rotating square made from our four line actors, and as our circular path is squashed vertically, this rotating square is isometric (well, not quite, but here's not the place to go into that !).
So, then we duplicate a second set of 4 lines, identical to the first, with all the same rules and values - but offset them vertically (simply add +400 (or whatever value you want) to their constrain self.pos Y rule)
Ok, now we have 2 isometric rotating squares, one vertically above the other.
Now we join up the four corners of the top square the the four corners of the bottom square, this is very straightforward, just make up another line actor, basically a tall thin square, and constrain its position to - for example - the 0° point, then offset it vertically so it sits exactly between the top square and the bottom square, make it long enough (tall enough) to fill the gap between the two rotating squares.
Do the same for all four points.
Result, a spinning 3D isometric cube.
Then you can dive in and start to have fun with making controls for all sorts of values, for example a slider control to change the radius of the 4 points (which will make the cube wider and flatter), or maybe a slider to change the offset between the top and bottom square, to make it taller . . . . . and so on.
It sounds like a lot of work, but it's surprisingly straightforward, especially as once you've done one thing, you just have to duplicate it three times and change a few values around for the other three corners/points.
Hope that all makes sense !
(now to think of game idea for it . . . . . )
[Usual Youtube story, runs super smooth in GS, but looks a bit stuttery/low frame rate once Youtube has done its compression thing]
I thought you'd like it the thing that surprised me was how easy and straightforward it was, I sat down with the idea to make an isometric rotating cube, and it was pretty much done 10 minutes later, I've had more trouble trying to get an object to interpolate between two positions !
@Manto1 said:
Wow. Awesomed. Looks very smooth to me.
Cheers, it's actually a lot smoother than it appears in the Youtube clip, things from GS always look a little less smooth on YT.
@Manto1 said:
Did you constrain actors to other actors attributes directly or constrain all to game attributes (game.time)? In other words how do you synchronize the actors? Constraining them to others or only game.time?
Like I say in my explanation above, I started with 4 points (just actors with visibility switched off), they are sent in an elliptical orbit, spaced 90° from each other, then the lines that join them together are placed into the scene and unlocked so I can extract information from the orbiting points.
Although I did make some game.attributes for the controls, but to be honest it was very thrown together, made up as I went along, in hindsight it could be much much more efficient, for example for the lines on opposite sides of a square I was using long vector to angle and magnitude calculations for each one . . . when obvioulsy (if I'd been paying any attention!! ) you could just extract the angle and the length of one side and use it for the other ! No need to force GameSalad to calculate the same stuff for each side, and it's the same deal with the top and bottom of the cube, no need to have the lines that make up the lower square go through long calculations to work out constantly changing angles and constantly changing lengths when I could have just taken that info from the lines above . . . and so on, basically the whole operation is not very complex but can be made much much more simply than how I threw it together, but sometimes you need to construct something to realise this stuff.
But anyhow even as it is, with its slightly bloated code it still runs very smoothly.
Braydon_SFXMember, Sous Chef, Bowlboy SidekickPosts: 9,273
Another couple of things occurred to me, firstly the way this vector-isometric set up works means you have an enormous amount of control over collisions, you can - with certain caveats - have a kind of polygonal collision detection, where the actual shape of the main object is what will detect the collision. But you can also just select individual elements to collide, which is pretty useful (in the below example only the base of the box pushes the circles around).
Also using the Replicate behaviour to shade the sides of your isometric object is a very lightweight (on the processor) way of working, you can cut the Replicate behaviour in and out depending on the angle of the isometric face it is applied to, literally nothing more complex than - for example - if rotation is > 0° and <90° then Replicate behaviour. So your shaded walls on your isometric object can disappear out of view as they rotate (as they should !).
Another thing would be to also use the Replicate behaviour to create shadows for objects (very quick example in the video below) - and you can even lock the colour of the replicated object to its rotation, so that there is an ambient light source, for example let's say the light is coming from the righthand side of the screen, you would constrain the colour channels so that when facing the right (based on rotation of the object) that side gets a lot lighter and when facing the other way it falls into shadow . . . I've not had time to stick that in yet, but it's just another bit of simple maths (I hope! ).
Damn you Youtube ! Like all the other examples, these all run incredibly smoothly in GameSalad, probably because there is no artwork (besides a circle in this one) but screen grabbing them and then Youtubing them turn them all jittery - so for anyone whose interested here's a little clip straight from the screen capture, not perfect but better than Youtube: https://www.mediafire.com/?cii38ubvw2wot14
Anyhow, I think I've typed enough for one day
A more 'above' perspective (it's actually a 'military' axonometric perspective)
I've got a light source on the isometric object now, the light is coming from the right, so the sides of the object catch the light when they are facing towards the right, and fall into shadow when turned away.
Ok.....Now I've been following this thread for a while and continuing to watch how @Socks is making me look impotent as a GS coder with this 'experiment' but I need to ask a simple question -
Is there any way this data and code can be packaged up into a format that can be used in games / apps and more importantly easily accessible as a functional and workable tool for other GS devs?? (and make no mistake - I'd be happy to pay cash-money for a good tool or template that uses tech like this..)
I'm stating the obvious here in that this sh*t is brilliant.. and when I say brilliant, @Socks makes me (and probably a lot of the rest of us) feel like I'm a coding Neanderthal thumping on a keyboard with a thigh-bone and a wooden spoon..
Comments
wow thats amazing! really cool!
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
I thought @StormyStudio might like this one.
Here's an idea, if you were to move four points around a circular path, one starting at 0°, one at 90°, one at 180° and one stating at 270° . . . . so basically set them up as a normal circular path but offset each one by 90°.
Which will look like the four corners of a rotating square.
Now squash the circular path vertically by 50%, so instead of the width being - for example - 300 and the height 300, you would make the circular path 300 wide by 150 high.
Which would look something like this:
Constrain X position to 300 * cos (angle) . . etc
Constrain X position to 150 * sin (angle) . . etc
Now join up each of these 4 points with a line (basically the same idea as the first post in this thread) - to form a square.
This is simple enough, just create a line actor and - for example looking at just the line that joins the 0° point to the 90° point - use the vector to angle of the 0° point to the 90° point to work out what angle the line actor needs to be, use some simple maths to work out where the line actor needs to be (basically halfway between the 0° point and the 90° point), and then use the magnitude behaviour (again measuring the 0° point to the 90° point) to work out how long the line actor needs to be.
Right, so we have just drawn a line from the 0° point to the 90° point.
We would then do the same for all the points, join 90° to 180, 180° to 270° and 270° to 0°.
Once all four points are connected by 4 line actors, we will see a rotating square made from our four line actors, and as our circular path is squashed vertically, this rotating square is isometric (well, not quite, but here's not the place to go into that !).
So, then we duplicate a second set of 4 lines, identical to the first, with all the same rules and values - but offset them vertically (simply add +400 (or whatever value you want) to their constrain self.pos Y rule)
Ok, now we have 2 isometric rotating squares, one vertically above the other.
Now we join up the four corners of the top square the the four corners of the bottom square, this is very straightforward, just make up another line actor, basically a tall thin square, and constrain its position to - for example - the 0° point, then offset it vertically so it sits exactly between the top square and the bottom square, make it long enough (tall enough) to fill the gap between the two rotating squares.
Do the same for all four points.
Result, a spinning 3D isometric cube.
Then you can dive in and start to have fun with making controls for all sorts of values, for example a slider control to change the radius of the 4 points (which will make the cube wider and flatter), or maybe a slider to change the offset between the top and bottom square, to make it taller . . . . . and so on.
It sounds like a lot of work, but it's surprisingly straightforward, especially as once you've done one thing, you just have to duplicate it three times and change a few values around for the other three corners/points.
Hope that all makes sense !
(now to think of game idea for it . . . . . )
[Usual Youtube story, runs super smooth in GS, but looks a bit stuttery/low frame rate once Youtube has done its compression thing]
Cheers @timolapre1998
Hot Dang!
Now make Elite...
Lump Apps and My Assets
Must..Not...Give...Forum Reaction points....
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
I thought you'd like it the thing that surprised me was how easy and straightforward it was, I sat down with the idea to make an isometric rotating cube, and it was pretty much done 10 minutes later, I've had more trouble trying to get an object to interpolate between two positions !
I'm sure it would'd be too hard, I'm going to try and make a manoeuvrable tank (like BattleZone).
I'll crack you eventually . . . . lol
Ah, Battlezone. Please bring us there. Perhaps we will finally know what is in the hills.
Lump Apps and My Assets
Wow. Awesomed. Looks very smooth to me. Did you constrain actors to other actors attributes directly or constrain all to game attributes (game.time)?
In other words how do you synchronize the actors? Constraining them to others or only game.time?
The hills !
Here's a very rough steering test:
Cheers, it's actually a lot smoother than it appears in the Youtube clip, things from GS always look a little less smooth on YT.
Like I say in my explanation above, I started with 4 points (just actors with visibility switched off), they are sent in an elliptical orbit, spaced 90° from each other, then the lines that join them together are placed into the scene and unlocked so I can extract information from the orbiting points.
Although I did make some game.attributes for the controls, but to be honest it was very thrown together, made up as I went along, in hindsight it could be much much more efficient, for example for the lines on opposite sides of a square I was using long vector to angle and magnitude calculations for each one . . . when obvioulsy (if I'd been paying any attention!! ) you could just extract the angle and the length of one side and use it for the other ! No need to force GameSalad to calculate the same stuff for each side, and it's the same deal with the top and bottom of the cube, no need to have the lines that make up the lower square go through long calculations to work out constantly changing angles and constantly changing lengths when I could have just taken that info from the lines above . . . and so on, basically the whole operation is not very complex but can be made much much more simply than how I threw it together, but sometimes you need to construct something to realise this stuff.
But anyhow even as it is, with its slightly bloated code it still runs very smoothly.
>
>
>
Obviously...
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Another couple of things occurred to me, firstly the way this vector-isometric set up works means you have an enormous amount of control over collisions, you can - with certain caveats - have a kind of polygonal collision detection, where the actual shape of the main object is what will detect the collision. But you can also just select individual elements to collide, which is pretty useful (in the below example only the base of the box pushes the circles around).
Also using the Replicate behaviour to shade the sides of your isometric object is a very lightweight (on the processor) way of working, you can cut the Replicate behaviour in and out depending on the angle of the isometric face it is applied to, literally nothing more complex than - for example - if rotation is > 0° and <90° then Replicate behaviour. So your shaded walls on your isometric object can disappear out of view as they rotate (as they should !).
Another thing would be to also use the Replicate behaviour to create shadows for objects (very quick example in the video below) - and you can even lock the colour of the replicated object to its rotation, so that there is an ambient light source, for example let's say the light is coming from the righthand side of the screen, you would constrain the colour channels so that when facing the right (based on rotation of the object) that side gets a lot lighter and when facing the other way it falls into shadow . . . I've not had time to stick that in yet, but it's just another bit of simple maths (I hope! ).
Damn you Youtube ! Like all the other examples, these all run incredibly smoothly in GameSalad, probably because there is no artwork (besides a circle in this one) but screen grabbing them and then Youtubing them turn them all jittery - so for anyone whose interested here's a little clip straight from the screen capture, not perfect but better than Youtube: https://www.mediafire.com/?cii38ubvw2wot14
Anyhow, I think I've typed enough for one day
A more 'above' perspective (it's actually a 'military' axonometric perspective)
Awesome stuff @Socks
Perhaps Gamesalad should hire you so we have a 3d engine in 2015
Lump Apps and My Assets
Cheers !
I'm not cheap, I won't get out of bed for anything less than . . . .
Hired!
Lump Apps and My Assets
Yes! that is awesome. I feel A song coming on for GS A Whole new world...
Lol Well, it's more straightforward that it sounds.
Cheers
I've got a light source on the isometric object now, the light is coming from the right, so the sides of the object catch the light when they are facing towards the right, and fall into shadow when turned away.
Oh yeah, and I made a crappy little flag
Link to screen capture movie, a little less crappy than Youtube, but still not as smooth as the actual GameSalad project - https://www.mediafire.com/?286bx5vb7tr0w0i
The light effect is brilliant - the 3D is brilliant!
Ok.....Now I've been following this thread for a while and continuing to watch how @Socks is making me look impotent as a GS coder with this 'experiment' but I need to ask a simple question -
Is there any way this data and code can be packaged up into a format that can be used in games / apps and more importantly easily accessible as a functional and workable tool for other GS devs?? (and make no mistake - I'd be happy to pay cash-money for a good tool or template that uses tech like this..)
I'm stating the obvious here in that this sh*t is brilliant.. and when I say brilliant, @Socks makes me (and probably a lot of the rest of us) feel like I'm a coding Neanderthal thumping on a keyboard with a thigh-bone and a wooden spoon..
-- J
No doubt @socks is a math genius!
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Qix... one of the best games ever! Sorry for the thread hijack.
My Blog / App Store / Google Play
lol
Sorry, @Braydon_SFX, I've already "awesomed" a bunch of @Socks' posts on this page.
I thought GameSalad couldn't do 3D. Nice work!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Cheers, not sure it qualifies as actual 3D, I like to think of it as more of a hybridised-pseudo-vector-axonometric-illusory-isometric-2D/3D.