experiment

1246710

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    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 . . . . . :o :smile: )

    [Usual Youtube story, runs super smooth in GS, but looks a bit stuttery/low frame rate once Youtube has done its compression thing]

  • SocksSocks London, UK.Member Posts: 12,822

    @timolapre1998 said:
    wow thats amazing! really cool!

    Cheers @timolapre1998 :)

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    Hot Dang!

  • LumpAppsLumpApps Member Posts: 2,880

    Now make Elite...

  • Braydon_SFXBraydon_SFX Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,271

    Must..Not...Give...Forum Reaction points....

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2014

    @RThurman said:
    Hot Dang!

    I thought you'd like it :smile: 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 !

  • SocksSocks London, UK.Member Posts: 12,822

    @LumpApps said:
    Now make Elite...

    I'm sure it would'd be too hard, I'm going to try and make a manoeuvrable tank (like BattleZone).

  • SocksSocks London, UK.Member Posts: 12,822

    @Braydon_SFX said:
    Must..Not...Give...Forum Reaction points....

    I'll crack you eventually . . . . lol :smile:

  • LumpAppsLumpApps Member Posts: 2,880

    Ah, Battlezone. Please bring us there. Perhaps we will finally know what is in the hills. ;)

  • MantoManto Member Posts: 796

    @Socks said:

    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?

  • SocksSocks London, UK.Member Posts: 12,822

    @LumpApps said:
    Ah, Battlezone. Please bring us there. Perhaps we will finally know what is in the hills. ;)

    The hills ! :)

    Here's a very rough steering test:

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2014

    @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!! :smile: ) 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_SFXBraydon_SFX Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,271

    @Socks said:
    asdf;lkjasdfjas ;lkajsdf lj ;laksdjfkasdf kaksldkf;ja jaskdflaj ;alskdjf ;alskdjf jj kei keyas sldkfla sdf;lkjasdfjas ;lkajsdf lj ;laksdjfkasdf kaksldkf;ja jaskdflaj ;alskdjf ;alskdjf jj kei keyas sldkfl......

    >
    >
    >

    Basically, the whole operation is not very complex...

    Obviously...

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2014

    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)

  • JSprojectJSproject Member Posts: 730

    Awesome stuff @Socks :)

  • LumpAppsLumpApps Member Posts: 2,880

    Perhaps Gamesalad should hire you so we have a 3d engine in 2015 :)

  • SocksSocks London, UK.Member Posts: 12,822

    @JSproject said:
    Awesome stuff Socks :)

    Cheers ! :)

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2014

    @LumpApps said:
    Perhaps Gamesalad should hire you so we have a 3d engine in 2015 :)

    I'm not cheap, I won't get out of bed for anything less than . . . .

  • LumpAppsLumpApps Member Posts: 2,880

    Hired!

  • gamestudentgamestudent Member Posts: 504

    Yes! that is awesome. I feel A song coming on for GS A Whole new world...

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2014

    @Socks said: asdf;lkjasdfjas ;lkajsdf lj ;laksdjfkasdf kaksldkf;ja jaskdflaj ;alskdjf ;alskdjf jj kei keyas sldkfla sdf;lkjasdfjas ;lkajsdf lj ;laksdjfkasdf kaksldkf;ja jaskdflaj ;alskdjf ;alskdjf jj kei keyas sldkfl......

    Basically, the whole operation is not very complex...>

    @Braydon_SFX said:
    Obviously...

    Lol :) Well, it's more straightforward that it sounds.

  • SocksSocks London, UK.Member Posts: 12,822

    @gamestudent said:
    Yes! that is awesome. I feel A song coming on for GS A Whole new world...

    Cheers :)

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2014

    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

  • lycettebroslycettebros Member, PRO Posts: 1,598

    The light effect is brilliant - the 3D is brilliant!

  • KnightStarKnightStar Member Posts: 162

    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.. :smiley:

    -- J

  • mhedgesmhedges Raised on VCS Member Posts: 634

    @Thunder_Child said:
    Never heard of Qix? I think I personally financed those game makers with the shear number of quarters I put in that machine !!!!

    Qix... one of the best games ever! Sorry for the thread hijack. ;)

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @Braydon_SFX said:
    Obviously...

    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

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2014

    @tatiang said:
    I thought GameSalad couldn't do 3D. Nice work!

    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. ;)

Sign In or Register to comment.