playMaker

Author Topic: [SOLVED]Creating a Room-Brush system with Playmaker? (SNAPPING)  (Read 1159 times)

tcmeric

  • Hero Member
  • *****
  • Posts: 638
    • View Profile
Re: Creating a Room-Brush system with Playmaker?
« Reply #15 on: February 14, 2018, 05:17:54 AM »
Hi, so I made a snap grid placement system. Basically you can set the distance of the points on the grid in 3d space. Ie, 1 or 0.5. by my custom script.

Then, when you click on the screen, you use a playmaker action to get the nearest grid point. Then place your object on that grid point (ie, force it to the grid point).

Its still early stages, but you might find it useful. I can make a video for it in the next few days if you are interested.

The grid points are made dynamically, so there is no real overhead as far as I can tell. It does not use arrays.

I am not sure this could/would work with the cutout part, but its another idea anyways  8)

Bipolar

  • Playmaker Newbie
  • *
  • Posts: 41
    • View Profile
Re: Creating a Room-Brush system with Playmaker?
« Reply #16 on: February 14, 2018, 05:40:44 AM »
Here 's a video.

You can Switch between first person and top down only when you use the cabinet.

I forgot to insert a tile... anyway tile's size is great the like the cabinet ceiling(maybe smaller).

I placed the various FoundationMarker and Edges Marker as you can see in the pic... doesn't it burdening the scene's performance?

Video:
https://www.youtube.com/watch?v=Hu0zkXpcCcA&feature=youtu.be

Bipolar

  • Playmaker Newbie
  • *
  • Posts: 41
    • View Profile
Re: Creating a Room-Brush system with Playmaker?
« Reply #17 on: February 14, 2018, 05:44:56 AM »
Hi, so I made a snap grid placement system. Basically you can set the distance of the points on the grid in 3d space. Ie, 1 or 0.5. by my custom script.

Then, when you click on the screen, you use a playmaker action to get the nearest grid point. Then place your object on that grid point (ie, force it to the grid point).

Its still early stages, but you might find it useful. I can make a video for it in the next few days if you are interested.

The grid points are made dynamically, so there is no real overhead as far as I can tell. It does not use arrays.

I am not sure this could/would work with the cutout part, but its another idea anyways  8)

Thanks. You are so kind. However I'll never improve myself in this way. but if your grid snapping system is made on Playmaker I can also see the FSM and learn something. :)

tcmeric

  • Hero Member
  • *****
  • Posts: 638
    • View Profile
Re: Creating a Room-Brush system with Playmaker?
« Reply #18 on: February 14, 2018, 05:54:38 AM »
Here it is in action. https://imgur.com/gallery/imLV5

The grid is created in c# and is very short actually. Then I custom made the action for playmaker to work with it.

Anywho, I will make a full video tutorial later anyways and you can check it out as well.

Good luck!

Doh

  • Junior Playmaker
  • **
  • Posts: 88
    • View Profile
Re: Creating a Room-Brush system with Playmaker?
« Reply #19 on: February 14, 2018, 06:05:51 AM »
Cheers for the video, from what I can see there I totally misjudged the scale of the building area. The idea proposed in reply #14 of this thread is far more efficient.

So I'd go with no pre-placed Foundation Markers or Edge Markers. Just the Snap Marker that moves with the cursor, as a child of the Snap Marker have one Foundation Marker and it's four Edge Markers. Each with an appropriately placed collider set as trigger. An FSM on the Foundation Marker and each of the Edge Markers, you want the "trigger event" action to check if an object already exists in its space.

Bipolar

  • Playmaker Newbie
  • *
  • Posts: 41
    • View Profile
Re: Creating a Room-Brush system with Playmaker?
« Reply #20 on: February 14, 2018, 06:19:20 AM »
Cheers for the video, from what I can see there I totally misjudged the scale of the building area. The idea proposed in reply #14 of this thread is far more efficient.

So I'd go with no pre-placed Foundation Markers or Edge Markers. Just the Snap Marker that moves with the cursor, as a child of the Snap Marker have one Foundation Marker and it's four Edge Markers. Each with an appropriately placed collider set as trigger. An FSM on the Foundation Marker and each of the Edge Markers, you want the "trigger event" action to check if an object already exists in its space.

So Do I need just one Snap Marker child}FoundationMarker child} the 4 markers + placemente rounded by 10 units in world space?

I ask about the rounded units because... ok, it should work, but what about spawning a tile in the center so without near tile to snap from?
« Last Edit: February 14, 2018, 06:29:55 AM by Bipolar »

Bipolar

  • Playmaker Newbie
  • *
  • Posts: 41
    • View Profile
Re: Creating a Room-Brush system with Playmaker?
« Reply #21 on: February 14, 2018, 06:31:45 AM »
Here it is in action. https://imgur.com/gallery/imLV5

The grid is created in c# and is very short actually. Then I custom made the action for playmaker to work with it.

Anywho, I will make a full video tutorial later anyways and you can check it out as well.

Good luck!

The grid is 300x300 units. Are you sure this won't burdening on performace?

Doh

  • Junior Playmaker
  • **
  • Posts: 88
    • View Profile
Re: Creating a Room-Brush system with Playmaker?
« Reply #22 on: February 14, 2018, 06:36:38 AM »
It shouldn't matter as long as all five (1xFoundation 4xEdge) are children of the Snap Marker. This is just so the Foundation and Edges inherit the position of the Snap Marker.

All you'll need to do to limit the building area to your 300x300 grid would be to prevent the Snap Marker from operating outside of the XZ coordinates of your building area.

Bipolar

  • Playmaker Newbie
  • *
  • Posts: 41
    • View Profile
Re: Creating a Room-Brush system with Playmaker?
« Reply #23 on: February 14, 2018, 12:51:17 PM »
I'm confused, maybe I didn't undestand.

There will be problems (I think).
For Example you start building from a corner within the limit... ok, it will be snapped, but if I would choose the center of the grid as first tile placement point? The tile placement won't be imperfect because there aren't colliders to hit/nothing tiles to build from?


Doh

  • Junior Playmaker
  • **
  • Posts: 88
    • View Profile
Re: Creating a Room-Brush system with Playmaker?
« Reply #24 on: February 14, 2018, 04:23:22 PM »
I don't understand what you mean, could you elaborate? Have you tested this and found an issue? If so could you illustrate or more clearly explain.

Bipolar

  • Playmaker Newbie
  • *
  • Posts: 41
    • View Profile
Re: Creating a Room-Brush system with Playmaker?
« Reply #25 on: February 15, 2018, 07:05:47 AM »
Ok. The first example is what I understood from what you said (but I maybe misunderstood).

So I fhe first image shows a build system when you can build only starting by placing the first place in a corner, if you don't start from a corner or from another tile... it should appen what I drawn in the second pic: the snap won't work because there aren't object next to the tile to place.

The third image is what i want to make: a system who allows to snap also without tile around the piece to place.

I hope I was understantable.

Bipolar

  • Playmaker Newbie
  • *
  • Posts: 41
    • View Profile
Re: Creating a Room-Brush system with Playmaker?
« Reply #26 on: February 15, 2018, 03:40:00 PM »
I did the snapping system only, that's how! ^-^

https://youtu.be/m6lOgSp6qxU

Doh

  • Junior Playmaker
  • **
  • Posts: 88
    • View Profile
Re: [SOLVED]Creating a Room-Brush system with Playmaker? (SNAPPING)
« Reply #27 on: February 16, 2018, 08:07:40 AM »
Sorry I've been away for the last day.

Just watched your video, awesome work!

tcmeric

  • Hero Member
  • *****
  • Posts: 638
    • View Profile
Re: [SOLVED]Creating a Room-Brush system with Playmaker? (SNAPPING)
« Reply #28 on: February 16, 2018, 09:03:35 AM »
Nice, cool to watch. I got sucked into making my own placement system as well. Good to see another example.