Isometric multiple floors

Get help using Construct 2

Post » Thu Apr 06, 2017 3:02 pm

This thread brings back some memories ^_^

A simple basic filter approach could be; solid interaction when the objects in question are on the same layer.
Who dares wins
B
57
S
17
G
21
Posts: 1,880
Reputation: 19,628

Post » Sun Apr 09, 2017 4:18 pm

Everade wrote:Still searching for a solution, my further tests all ended up bad.
Would be awesome to have some experienced constructers working on this since Scirra doesn't work on Multiplayer.

(Solution for multiple floors within an online multiplayer scenario where individual players are able to not bump into solid objects while the others don't due the fact that they are moving on a different floor

Main issue being: Solid objects are only globaly set and can not be set individualy for each object.


Won`t it possible to make custom pushout code for each so called "solid object" if player 2 is on floor 2 dont apply push, but player on floor 1 gets pushed out from objects.

Maybe this video series help you. That guy makes simple custom physics, there are multiple episodes.
Part 1 he makes simple dot to bounce , part 2 he compines and makes simple box with sticks adds physics and collision checks/push out. Maybe it gives you some ideas.
Part 1: https://www.youtube.com/watch?v=3HjO_RGIjCU
B
38
S
22
G
15
Posts: 22
Reputation: 10,784

Post » Sun Apr 09, 2017 7:03 pm

@SnipG

Thanks for the tip, i've watched the video but i've no idea how that's supposed to help me.
I'm not a coder, that's why i'm here using Construct. ^^
So i won't be able to code my own push out behaviour.

The only thing i'm aware of is Rex's PushOut behaviour but that one relies on the official solid behaviour as well, which is the main issue here.
As long as solids are being globally handled i'm kinda lost.

If i would be able to code i would have created my own custom solid behaviour a long time ago (or something similiar).


@lennaert
Were you ever able to get this to work?
From what i can remember your last version of the tank game used push out as soon as you've overlapped a non-solid object while at the same time activating the solid to prevent the player to walk through.

As long as the player was constantly touching the solid, other players were also coliding.

Somehow you got a workaround for that but there was a bug that as soon as the 2 players touched each other, the player who's supposed to be pushed back fell through.

Nethertheless there were always some kind of bugs which you also weren't able to fix.

Or were you actually able to get it to work in the end?
B
42
S
8
G
3
Posts: 159
Reputation: 3,074

Post » Sun Apr 09, 2017 8:34 pm

I've created an example capx for those who're interested into taking a closer look at it.
It uses the following plugins:
rex_zSorter
rex_layer

http://92.51.171.10/construct/floors_online.capx

In this particular case the enable and disable solid is even entirely broken and i can not explain why.
I worked on older Construct 2 versions from what i can remember.
Replacing the "Set solid Enabled / Disabled" (inside the Common Mechanics/ Solid Picking part) works just fine.
So i was able to simply move the objects instead for example.

Maybe it's just a smaller mistake i've created while testing all the time.

By walking over the red box you are being considered to be standing on floor 0 (ground)
By walking over the green box you are being considered to be standing on floor 1
B
42
S
8
G
3
Posts: 159
Reputation: 3,074

Post » Sun Apr 09, 2017 8:45 pm

I haven't read all posts (sorry but I'm a bit tired now), but I would use different layers. When the player would overlap an object (last step on stair - the trigger sprite), the main gameplay layer would be invisible and the floor one would go visible. Want more depth? Make the floor layer visible with less than 30% opacity and a bit difference in parallax, like 2%.
Again, is just a thought, I can't and won't test it right now or for some time.

Hope it works :)
B
5
Posts: 15
Reputation: 255

Post » Sun Apr 09, 2017 8:51 pm

Those are just details i'm currently not bothering about.
The problem is collisions within an online multiplayer environment when using multiple floors.

<-------------
PlayerA on floor 1 should not collide with objects from floor 0.
PlayerB on floor 0 should not collide with objects from floor 1.

------------->
B
42
S
8
G
3
Posts: 159
Reputation: 3,074

Post » Mon Apr 10, 2017 1:09 am

I made really fast something, not sure if it helps. It has no real z ordering and very simple collision that fails alot(floor 1 collision gets even worse but you could improve it (: ), but i think you get the basic idea.
https://drive.google.com/open?id=0B22kE ... 202TmlNazA
B
38
S
22
G
15
Posts: 22
Reputation: 10,784

Post » Mon Apr 10, 2017 3:23 am

Hi Everade!

I must have overlooked this thread previously since it seemed like you already had plenty of help, but I guess it was never resolved to satisfaction. I'm trying to get caught up here, let me know if I missed/misunderstood something.

Goal - You need objects to interact with solids conditionally in certain situations (different "floors").
Additional requirements - Within the same layout, due to multiplayer
Problem - Solids can only be set globally, also you cannot enable and disable them as needed in a multiplayer environmnent, as different players may be on different floors at any given time.
Attempted Solution - Custom solids/collision behavior, with conditionals based on y axis z order (not ideal, as isometric view causes much complication, or layers, which gives you pretty good control but you have to have a good method to switch layers.
New problem - Custom solids are hard to do correctly. Collisions and blocking movement not satisfactory, especially with high velocity/time discrepancy introduced in multiplayer, resulting in bouncing.

So assuming you're OK up to the layer system for logic defining who should be able to collide with what at any given time, the next step would be to set up a good collision system. The first thing that comes to mind for me is using SAT to prevent anything from overlapping to begin with, rather than colliding/overlapping first and then pushing your objects away which causes undesirable bouncing.

Ref: https://gamedevelopment.tutsplus.com/tu ... amedev-169
Example: r0j0-039-s-experiments_t91829 (first one)

This would need to be applied on both the host side and the peer side. If applied to both consistently, neither host nor peer should see any discrepancies outside of normal lag/desync issues.

Basically, it comes full circle with your request to have the solid behavior allow for conditionals. If the official behavior doesn't support it, we'll need to build our own. While most of the other behaviors are pretty simple to recreate with events, solids have a lot more to take into consideration due to their interaction with a variety of different objects and behaviors. I'd be interested to see the logic behind how the official one is put together.

Sorry I don't have a working example, this is a bit complicated and beyond my ability to put together quickly.
Mistakes were made.
B
62
S
30
G
134
Posts: 1,974
Reputation: 75,475

Post » Mon Apr 10, 2017 10:40 am

Thank you very much for the detailed analysis of my issue.

I took a closer look at the example given by R0J0hound
It looks much simpler than i thought.

This basically means that i would have to create this system for each of my players, enemies and anything else that can move and collide.
B
42
S
8
G
3
Posts: 159
Reputation: 3,074

Post » Mon Apr 10, 2017 6:24 pm

@oosyrag

I've just done some first tests using this custom collision system.
During my tests i kept bugging through the wall, so it does not really seem to be reliable in that particular case.
I'm also bouncing back and forth a lot.
And the player sprite also seems to move a little bit further than the actual coliding "Peer" if you keep moving towards an object "without bouncing back"

On the other hand i doubt that this custom solids is going to work with the pathfinder behaviour either.
Which means this would lead to an even much more complicated approach since i will have to code my own pathfinding system as well.

But thank you so much! It works already within a multiplayer environment using multiple floors!
I hope there are ways to further improve this custom solid system since the collision detection is not really as smooth as in the example.
Maybe because that one was made for circles ?
I'm not sure if this code is able to support all different kinds of shapes.


Here's the latest example capx:
http://92.51.171.10/construct/floors_online.capx
Last edited by Everade on Mon Apr 10, 2017 7:04 pm, edited 1 time in total.
B
42
S
8
G
3
Posts: 159
Reputation: 3,074

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: mike20227, urkokan and 9 guests