Adam's Lair Forum
https://forum.adamslair.net:80/

2D Collider
https://forum.adamslair.net:80/viewtopic.php?f=18&t=963
Page 1 of 3

Author:  eyeliner [ 2016/10/04, 15:17 ]
Post subject:  2D Collider

This is my latest thing:


I want to fight against the use of rigidbodies in platformers, dammit! xD

I just need to know how to integrate this as a plugin.

It uses a tilemap as a colliding mask, gets positions from tiles that have a certain baseindex, and then using another rectangle (the character), the barebones platformer is born.

More to come. I promise.

Author:  gtkampos [ 2016/10/04, 16:57 ]
Post subject:  Re: 2D Collider

Nice!! Keep the good work! :+1: B) :1+:

Author:  eyeliner [ 2016/10/07, 18:57 ]
Post subject:  Re: 2D Collider

Holy jeebus!

I made it so that it finally stops ranting because of MethodNotFoundException by stealing from Duality and DualityPrimitives.dll

Bad things:
I had to make it framework agnostic, so the setup is a bit on the hard side.

I have already solutions up my sleeve, so to hide some redundant structs I had to implement like Vector3 and Rectangles.

I'll instead rename Rectangle to BBox (or some other name), so I can further expand it, by adding other info, like if it is passable when coming from the underside, etc.
A bit harder will be hiding my personal implementation of Vector3, but that shouldn't be that hard to manage.

I'm aiming towards simplification, but alas, implementing Duality's libs made it behave weirdly, so I had to make my best and make it really all purpose.

Author:  Adam [ 2016/10/07, 20:59 ]
Post subject:  Re: 2D Collider

eyeliner wrote:
I made it so that it finally stops ranting because of MethodNotFoundException by stealing from Duality and DualityPrimitives.dll


That doesn't sound right :eh: MethodNotFoundException is often the cause of mismatched package versions, like having an up-to-date plugin with an outdated Duality core or similar. What's the story behind that?

Copying Duality core code like Vector3 and Rectangle instead of using the library is generally not a good idea - because your Vector3 will be different from Duality's Vector3, so all other libraries will have trouble talking to yours. Not ideal xD

Author:  eyeliner [ 2016/10/08, 18:11 ]
Post subject:  Re: 2D Collider

Indeed.
The rectangle struct is just a placeholder for something different, and doesn't get used directly by the user. The tilemap plugin gives the information, and I just do a quick math. Nothing major.
Now, to make most of the previous paragraph irrelevant, apparently, when one builds a library that depends on other libraries, some measures have to be taken care of because of paths.

I made the issue go away by copying duality.dll and dualityprimitives.dll to the plugins folder. After that, all worked ok.

I just have to set the paths right next time.

Author:  Adam [ 2016/10/08, 20:38 ]
Post subject:  Re: 2D Collider

eyeliner wrote:
I made the issue go away by copying duality.dll and dualityprimitives.dll to the plugins folder. After that, all worked ok.


That doesn't sound too good either - it might cause the Duality core to be loaded twice, which can potentially cause all sorts of weird bugs and hard to trace type cast exceptions.

Right now I'm not sure what's happening or where the error could be. Can you provide a setup and / or steps to reproduce this? I think it would be better if we found a proper solution for this. ^^ It's definitely not something that you should regularly encounter developing a plugin / game, regardless of whether or not you use any libraries or dependencies.

Author:  eyeliner [ 2016/10/10, 15:11 ]
Post subject:  Re: 2D Collider

Ok, so...

I discarded my Vector3 implementation, referenced Duality.dll and DualityPrimitives.dll
refactored stuff a bit, all worked ok with my library in the Plugins folder.

Yay me!

But, if I use the Tilemap plugin, it gives the MethodNotFoundException. Moving my plugin to the main folder, all works ok.

My main motivation is actually using the Tilemap plugin.

I'm fine with that.

Onwards! Still a lot of stuff to do!

Author:  Adam [ 2016/10/10, 20:17 ]
Post subject:  Re: 2D Collider

I can't reproduce this behavior locally. Referencing the Tilemaps plugin worked fine in my tests. I understand that you've found a workaround, but it if you could reproduce this, pack the entire Duality folder (except Backups) and upload it somewhere so I can debug this, it would be incredibly helpful. If not, please do report back if that issue appears again!

Back to topic: That video you posted looks definitely neat ^^

Author:  eyeliner [ 2016/10/10, 23:12 ]
Post subject:  Re: 2D Collider

Ok, I'll try to make something small and try to see if the problem resurfaces.

Author:  eyeliner [ 2016/10/12, 14:30 ]
Post subject:  Re: 2D Collider

Well, here's a test.
To make this really quick to test, just try to launch the launcher as is.
Then, move Duality.AABB.dll to the root folder, and run the launcher again.

https://www.dropbox.com/s/zkhomjvgfxne6eq/bleh.rar?dl=0

Page 1 of 3 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/