Isometric multiple floors

Get help using Construct 2

Post » Fri Jan 23, 2015 8:33 pm

@MultipleChoice
@lennaert

Thanks a lot for your constructive feedback and ideas.
I will try your ideas and will let you know if it actually worked.

I still don't think that your idea will work thought lennaert. From what i've tested so far the collisions were always global, no matter what i've tried.
On my previous tests, ones a Peer walked to the 1st floor, all deactivated collisions of objects on the ground were set.
So there's no way that any other peer could colide with anything placed on the ground anymore, unless with the activated objects on the 1st floor which shouldn't happen.
Also not by filtering using "pick Peer where Peer.UID = Peer.UID"

But i will give my best and just test myself through your specific example.

This may take some days weeks, but i will reply within this topic and let you guys know what i've achieved ;)
B
39
S
8
G
3
Posts: 158
Reputation: 2,995

Post » Sat Jan 24, 2015 12:32 am

> @Everade : Since I actually never did an isometric engine, I found it interesting to try out, if my proposal works fine.

So here it is:

* No Variables needed
* Good for you to Layout, since you can build your floors on different layers, or even using more layer per floor
* Complete Floors will set to solid off, and if you even switch off collisions of those families, you will save a lot of performance (way less collision-tests)

The only issue you have to solve is when the player turns around after colliding with the stairs (on the stairs, without entering the top floor. Now that messes up the right floor actually. That can be fixed of course, but since its way beyond your issue...

Take a look at the capx-file and Enjoy!
You do not have the required permissions to view the files attached to this post.
B
8
S
3
Posts: 197
Reputation: 1,207

Post » Sat Jan 24, 2015 1:15 am

If you insist on using collisions I would suggest using the projection method.
Collisions for iso squares is going to be a little iffy...
Image ImageImage
B
168
S
50
G
163
Posts: 8,224
Reputation: 105,067

Post » Sat Jan 24, 2015 12:20 pm

Everade wrote:@MultipleChoice
lennaert

Thanks a lot for your constructive feedback and ideas.
I will try your ideas and will let you know if it actually worked.

I still don't think that your idea will work thought lennaert. From what i've tested so far the collisions were always global, no matter what i've tried.
On my previous tests, ones a Peer walked to the 1st floor, all deactivated collisions of objects on the ground were set.
So there's no way that any other peer could colide with anything placed on the ground anymore, unless with the activated objects on the 1st floor which shouldn't happen.
Also not by filtering using "pick Peer where Peer.UID = Peer.UID"

But i will give my best and just test myself through your specific example.

This may take some days weeks, but i will reply within this topic and let you guys know what i've achieved ;)



I made a working example, its easier then expected, I even got the host/multiplayer movement restrictions/limitations worked out :)
But I am not fond of the way my stairs/elevation object works :
As the solution which I used, the key lays in the overlaps check.

Both player and wall have solid, and only the player has pushout solid too.

events:
for each wall
wall overlapping with player
sub
wall.activelevel = player.activelevel
action: wall set solid enabled
else - action wall set solid disabled



global mylevel (prevents having to pick)

event:
for each allobjects
sub:
allobjects.activelevel = mylevel
action: set opacity 100
else
action: set opacity 50%

event:
player.peerid = multiplayer.myid
action
mylevel = peer.activelevel


The only thing more needed is the stair (going up or down) action, to set the players activelevel.

Running these on both peer and host, will determine how each player responds to colliding with a wall.


I have 2 small platforms somewhere in the top middle of the map of my tankwars game see it working here
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Sat Jan 24, 2015 4:10 pm

it actually works ;:O

you're awesome!

Gonna try to implement this on my game now :D
About the stairs, upon my testing it seemed to be the best idea to create 2 overlap sprites, one for going up and one for going down. The distance of these 2 should be big enough so that it's impossible to overlap both at the same time.
With that you can ensure that you're always on the correct floor.

Like my sketch on my very first post :P
That worked perfectly fine for me.
B
39
S
8
G
3
Posts: 158
Reputation: 2,995

Post » Sat Jan 24, 2015 5:09 pm

In my example I used 2 sprites, but I used an approach that required there being a moment of both overlapses and some booleans set ... got ugly after several attempts, gonna think about it, there's likely a better way to achieve that. will let ya know if I find something better.
Gonna use this same approach in some of my games too ^_^

I see we have a same interest in game type :D
Got a couple of these games in the pipeline.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Sat Jan 24, 2015 7:05 pm

seriously can't find anything related to "pushout solid"
where is it ?

--------

Update:

Nevermind... found it within Custom Movement.
"sigh" if i knew that earlier ^^
B
39
S
8
G
3
Posts: 158
Reputation: 2,995

Post » Sat Jan 24, 2015 8:44 pm

> @Everade, @lennaert, @newt

Just for fun, I enhanced the layer solution. Now the "engine" has all features you need.

- You can easily register any new elevation type (e. g. ladder, as I already added, or elevator)
- Different types of walls or furniture (with any size)

Of course the same can be done with overlapping, but I restricted collision-checks for the 8-dir-behavior and collision checks in the code as much, as I could.

What do you guys think about it? If there is any part, that can be solved better, still working correctly, I would be keen to know!
You do not have the required permissions to view the files attached to this post.
B
8
S
3
Posts: 197
Reputation: 1,207

Post » Sat Jan 24, 2015 8:57 pm

@MultipleChoice wrote:> Everade, lennaert, newt

Just for fun, I enhanced the layer solution. Now the "engine" has all features you need.

- You can easily register any new elevation type (e. g. ladder, as I already added, or elevator)
- Different types of walls or furniture (with any size)

Of course the same can be done with overlapping, but I restricted collision-checks for the 8-dir-behavior and collision checks in the code as much, as I could.

What do you guys think about it? If there is any part, that can be solved better, still working correctly, I would be keen to know!


That looks pretty good, hard to actually read them formula haha.
You should try it in a multiplayer scenario, and test the peers extensively.

EDIT:

for those wondering, the pushout plugin can be found under custom movement or from rex's plugin manager, the pushout solid behavior.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Sat Jan 24, 2015 11:19 pm

@lennaert

I've implemented your idea and tested it under most conditions.

But it's interfering within a very specific scenario, which actually could happen quite a lot.
Well, it really depends on the situation and how you do the collision check.

For my test i've created a rather big sprite on the Players position.
It's my OverlapMask which should check if i'm currently colliding with any object on a specific floor.


During my tests, i wasn't able to get it to work without using any Overlap Masking, since it seemed that the player was never really able to overlap anything as it was colliding already... i don't know what's the exact issue on that.



Whatever...
Let's say Player#1 is walking into an object or a wall... Now the OverlapMask is always in touch with this specific solid which has the same .activelevel instance as the player.
Which means, it would trigger "Solid Enabled".

Now if Player#2 on a different .activelevel comes by, he will collide with this solid because it will stay enabled as the Player#1 is still overlaping this object.

Player#2 will be able to walk through as soon as Player#1 stops walking into the object, other than that it will stay solid forever.


Do you have any idea how this could be worked out?
I really wasn't able to get it to work without this overlapmask (which isn't solid by the way)

In your Tank Game it seems like you weren't using anything to overlap, but for some reason it triggers properly for you while for me it doesn't.
Or are you having the same issue?

Unbenannt-1.png
You do not have the required permissions to view the files attached to this post.
B
39
S
8
G
3
Posts: 158
Reputation: 2,995

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: FlyingRam and 9 guests