Adam's Lair Forum

game development and casual madness
It is currently 2017/04/29, 23:27

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: 2D Collider
PostPosted: 2016/10/04, 15:17 
Forum Adept
Forum Adept
User avatar

Joined: 2015/03/15, 02:49
Posts: 351
Location: Out there
Role: Hobbyist
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.

_________________
Hello there! Nice to meet you!
I have github. Apologies in advance for bad coding practices.


Top
 Profile  
 
 Post subject: Re: 2D Collider
PostPosted: 2016/10/04, 16:57 
Novice Member
Novice Member
User avatar

Joined: 2016/09/19, 12:38
Posts: 24
Role: Observer
Nice!! Keep the good work! :+1: B) :1+:


Top
 Profile  
 
 Post subject: Re: 2D Collider
PostPosted: 2016/10/07, 18:57 
Forum Adept
Forum Adept
User avatar

Joined: 2015/03/15, 02:49
Posts: 351
Location: Out there
Role: Hobbyist
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.

_________________
Hello there! Nice to meet you!
I have github. Apologies in advance for bad coding practices.


Top
 Profile  
 
 Post subject: Re: 2D Collider
PostPosted: 2016/10/07, 20:59 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 1949
Location: Germany
Role: Professional
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

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
 Post subject: Re: 2D Collider
PostPosted: 2016/10/08, 18:11 
Forum Adept
Forum Adept
User avatar

Joined: 2015/03/15, 02:49
Posts: 351
Location: Out there
Role: Hobbyist
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.

_________________
Hello there! Nice to meet you!
I have github. Apologies in advance for bad coding practices.


Top
 Profile  
 
 Post subject: Re: 2D Collider
PostPosted: 2016/10/08, 20:38 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 1949
Location: Germany
Role: Professional
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.

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
 Post subject: Re: 2D Collider
PostPosted: 2016/10/10, 15:11 
Forum Adept
Forum Adept
User avatar

Joined: 2015/03/15, 02:49
Posts: 351
Location: Out there
Role: Hobbyist
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!

_________________
Hello there! Nice to meet you!
I have github. Apologies in advance for bad coding practices.


Top
 Profile  
 
 Post subject: Re: 2D Collider
PostPosted: 2016/10/10, 20:17 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 1949
Location: Germany
Role: Professional
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 ^^

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
 Post subject: Re: 2D Collider
PostPosted: 2016/10/10, 23:12 
Forum Adept
Forum Adept
User avatar

Joined: 2015/03/15, 02:49
Posts: 351
Location: Out there
Role: Hobbyist
Ok, I'll try to make something small and try to see if the problem resurfaces.

_________________
Hello there! Nice to meet you!
I have github. Apologies in advance for bad coding practices.


Top
 Profile  
 
 Post subject: Re: 2D Collider
PostPosted: 2016/10/12, 14:30 
Forum Adept
Forum Adept
User avatar

Joined: 2015/03/15, 02:49
Posts: 351
Location: Out there
Role: Hobbyist
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

_________________
Hello there! Nice to meet you!
I have github. Apologies in advance for bad coding practices.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2, 3  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group