Agar.io Cell Splitting and Merging

Get help using Construct 2

Post » Wed Aug 03, 2016 4:10 pm

Here are my attempts for recreating the essenial Agar.io functionality. None of them works as should. I have spent numerous hours trying to make this work. Here are the best results possible. I begin to doubt if it can be done at all. Perhaps a programming background is needed.

Check out my capx and please improve on them. Let's make agar.io clone. This would be something as there is not any "playable" multiplayer tutorial made. This would be the ideal result.

Can agar.io be recreated?
Can you improve on my attempts. Share capx if you can!

Ps: I might have gone little wild while making the events in some of my capx. Please don't hold it against me. I have been trying hard to push the idea into practice no matter what!

Copy the URL from between " ". I could not post it any other way.

[email protected]!#[email protected]$" dropbox.com/sh/xm3yui69q09rxez/AADJMd_xnEo6AQ8vXt_OSJ7Pa?dl=0 "[email protected]!#[email protected]$
B
13
S
2
G
1
Posts: 50
Reputation: 1,233

Post » Thu Aug 04, 2016 4:48 am

You are using too many 3rd party addons for me to really bother and load your capx files.

I can say though, for certainty, that what you want to do is totally possible. It really just depends on exactly how you want it to look, and what other features you are including (does your blob have a "bendable" border on it? - does it have the same "wobble" effect?)

Anything that is 2D is possible in C2 - anything. It's always just a case of creative thinking (for non-programmer) or knowing the proper math (for programmer).

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Thu Aug 04, 2016 2:03 pm

I admit i installed some addons for various projects. Nevertheless, "Addons free" construct 2 that i have just installed on another computer requested only "move to" and "push out solid" addons. I suppose two is not that many. While "move to" might not be relevant, Push out solid seemed to me to be crucial and is used in the events. Therefore two addons is not that many in my opinion. Even God in many religions has three forms. According to the alert i received, i have not exceeded the "holy" number.

I have not attempted recreating the bendable effect and any other special effects.

All i want to have is
1) cell splitting that do not overlap with each other while they do overlap with the enemies. (i did that with bullet behaviour but the cells unexpectedly self anihilate, i did that with push out solid but when there are too many cells, they still overlap or "get trapped").
2) cells merge with each other after a while.
3) all that in the moving motion that is also flexible i.e some cells seem to move a bit faster at times.

Basically the problem i encounter is an overlapping prevention for the cells, while they can still overlap with other enemy cells.

I did a thorough research on the forum and there have been some attempts to make a "relative overlap" while moving but no one succeded as far as my research is concerned.

It could be that some clever math has to be implemented but i am clueless where to learn how to implement it.

I think the agar.io functionality might be problematic in a sense of not being straightforward, because there are some youtube tutorials on how to recreate growing and shrinking (even in a multiplayer fashion). However there is none on the essence i.e multiple cell splitting while following mouse movement without overlaping for the player while allowing overlaping with the enemy.

Perhaps agar.io surcecode could be helpful but getting it seems dubious.

Perhaps i shall post images of my events.

I appreciate any hints or even better, the solution itself.

It has been driving me crazy. I literally spent three months trying to figure it out.

Thanks in advance!
B
13
S
2
G
1
Posts: 50
Reputation: 1,233

Post » Thu Aug 04, 2016 2:43 pm

Ok let me think about this and I will see what I can come up with :)

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Fri Aug 05, 2016 11:52 am

Great! I am looking forward to that! I hope you will bring balance and calm my obsession by making it work the way it is in the game!
B
13
S
2
G
1
Posts: 50
Reputation: 1,233

Post » Fri Aug 05, 2016 12:30 pm

OK so working on this idea for a bit - I've figured out a few things that might help you.

I'm still working through the logic of getting this to work how you're wanting it to and it's getting fairly complex already... but hopefully I am commenting it enough to help with that.

I will post it up after I've got it working a bit nicer :)

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Fri Aug 05, 2016 1:41 pm

This is it so far HERE - because I will be going to bed shortly. I will continue on it later, but maybe so far it will help with a few features that are working.

I still need to make the split cells spread out from each other, and make the initial split cell "shoot" forward a bit. I also need to clean up the merging after the split timer expires because currently with more than one split, they all just instantly merge to the main cell instead of gracefully "flying" into it.

For the enemy cells it may be easier to create a totally new enemy cell object for the client reactions. Having the player cell as an instance could get messy.

Currently what is working (but could probably do with adjustment to amounts/figures) is the speed based on mass and distance to mouse cursor, and splitting/merging cells (as long as they're at least Mass 8). You can set the instance variable to the Cell before you run it to have different mass on start, or add event to startup for desired beginning mass.

Hope this helps so far at least. Will improve hopefully tomorrow a bit more.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Sat Aug 06, 2016 5:41 pm

Thanks for the contribution. Unfortunately, i have not viewed it yet, because i am being cut off from my computer for the weekend. i am fidgeting to see it though. I hope you will make it as good as it can be. My goal would be to actually make a clone. There is not any tutorial on a fully playable and engaging multiplayer out there. It would be awesome to make it following agar.io. Just by reading your post, I am a bit concerned whether i can pull this off on my own since i could not even make the splitting / merging. It seems it is even more complicated than i expected. Anyway, i am already very thankful that you took interest in the idea and made effort to make it happen. I would have been stuck anyway if it had not been for you. Therefore you have already pushed it forward from the plateau!
B
13
S
2
G
1
Posts: 50
Reputation: 1,233

Post » Tue Aug 09, 2016 12:27 pm

What you have done is really awesome, you have BRAINZ and you know how to use it! However the biggest issue appears to remain that is cell overlap prevention... Could you or anyone fix it?
B
13
S
2
G
1
Posts: 50
Reputation: 1,233

Post » Wed Aug 10, 2016 2:00 am

Sorry I haven't had much time lately to look further into this.

I was planning on adding the BOIDS PLUGIN in order to get a "flocking" system going. I could possibly write a vector function to control this - but it would likely be less efficient than using the boids plugin.

Hopefully I'll get some time soon to take another look at this.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Next

Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 12 guests