Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Jewel Match Framework

Discussion in 'Assets and Asset Store' started by kurayami88, Aug 30, 2013.

  1. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493

    i made a fix for this before ...perhaps i forgot to implement it in the actual JMFP release... it's a straightforward fix but i'll get back to you again tomorrow as I was bz this Sunday. Sorry and thanks for your patience~!
     
  2. johnnydj

    johnnydj

    Joined:
    Apr 20, 2012
    Posts:
    211
    thanks a lot!
     
  3. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    hi,

    concerning the portal panels...
    the definition ( AKA description ) of the panel "isFillable" was incorrectly defined... the definition was fixed in the template and the main PanelDefinition but was left unaltered in the ready-made custom scripts...

    long story short, just go to PortalA PortalB scripts and change the "isFillable()" to return false instead of true...
     
  4. johnnydj

    johnnydj

    Joined:
    Apr 20, 2012
    Posts:
    211
    damn that is an easy fix :D
    thanks a lot!
     
  5. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    Hi i have bought the basic version of this framework and it is amazing and easy to change things but i have got a couple of questions. With the basic version you needed 2dtoolkit which i already had anyway but the pro version is saying it is optional why is this? I'm just wondering because i also have ngui and it has worked with the basic because i have done the menu with that. So was wondering if with pro you do not need the 2dtoolkit can you easily implement ngui because i know that better. Another question is can you upgrade to pro with being lower cost or do i have to just by it at total cost. Because i,m liking the portal in pro and also just wondering do you have to have just a square board because i have noticed on candy crush the game its not all square. Maybe if not will there be an update coming out so you could have different shape boards. Last question is i have noticed there is a score that popsup and then disappears and am just wondering if the score popups can float up in y direction then fades out, if it can how would i do this. Sorry for long question just mainly wondering if pro would be worth getting.
     
  6. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    thx for your interest in JMF~!


    i simply removed 2d Toolkit codes and optimisations and used Unity components in replacement. it's a crude replacement as the drawcalls are not optimized ( can be done but much more tedious - and not implemented by default in the JMFP-Unity2D version).
    You are welcome to change which ever part you need to another GUI system by changing the codes in the script which refers to their respective GUI components.


    these are two different assets in the store and the Asset Store manages the accessibility. I cannot do much about it. If you really want, I can perhaps offer you access to my assets privately at a discounted rate though this will no longer be as 'official' as obtaining it from the asset store. if you are interested you can PM me (perhaps you would like to read the other answers before making the decision).


    at the moment the entire engine revolves around the board being square as the logic framework for odd-shapes is not yet available. It might be in the future but as of this moment, there isn't such functionality nor any plans on it work in the near future. I will consider the request and prioritize it if a lot of people request it :)

    The big thing is... I believe the logic for square boards and logic for 'other-shaped' boards are totally incompatible with each other... the match-system, as well as the power gem system are all incompatible with each other~
    I believe i would need to re-write nearly the entire engine to support other type of boards.... something not easily done =/


    There's a script called HudPopUp within the 'Area 51/GUI related' folder.. you can adjust the behaviour easily via scripting (if you know how to script the desired behaviour)
    can be done... shouldn't take more than a few mins if you know what you are doing...



    if you are planning to make further custom panels and pieces i strongly advice to get the PRO version as it is easier to manage. It also has better features on the board Layout not available on the Basic version.
     
  7. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    Thank you for your answers.
     
  8. UnityHB

    UnityHB

    Joined:
    May 24, 2014
    Posts:
    20

    Hi.... Looking to do the same thing in the new version. would like to display portrait
     
  9. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493

    wow... that is a really old post... it was since i moved from NGUI ...
    animsCamera was found to be slighly redundant as object z-order still superceeds it (but that is besides the point) .. and the current 2dToolkit version, animsCamera already inherit settings from the mainCamera thus no modification is needed on its part anymore.

    but aside from those irrelevant points above, to create a potrait mode is as simple as changing the camera size in it's settings and re-arranging the GUI elements to their new appropriate place.

    as for supporting BOTH landscape + portrait mode, that is a whole different story... you will need to create BOTH landscape+portrait GUI elements and turn the others on/off depending on the user device's orientation. (something quite tedious to do and i don't encourage pursuing until you actually have a game going) ... i advice to support dual orientation only AFTER the game is produced and as a bonus thing to the users. (unless you can spare more development time lolx )
     
  10. UnityHB

    UnityHB

    Joined:
    May 24, 2014
    Posts:
    20
    Thanks for the help I was able to adjust
     
  11. UnityHB

    UnityHB

    Joined:
    May 24, 2014
    Posts:
    20
    I do have a question hopefully someone can help. I noticed with android the app freezes after screen times out(goes black) or press sleep button. Anyone else experience this issue. On IPhone the app seems to work just fine.
     
  12. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Sorry never noticed this... Tested on galaxy s2 s4 some other low end phone. What device did you test on?
     
  13. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    Hi i have been trying to understand the scripts which is going alright i think. I have looked at the winning conditions script and have been trying to implement some like on candy crush first level where you have 300 to score and only have 6 moves just wondering how would that be done. Where if you reach the score it goes to another scene and if you don't make the score it takes a life and it don't go to next level and also if the moves are all gone it has a gameover and lose life. Also how would i change the score for normal and special pieces.




    edit: I have worked out how to change the score on each piece but how would i have it if the score is reached 300 but you do have moves left you can keep playing until the moves are 0 left.

    edit: Sorry for the edits i only really need to check the ismovesgame instead but problem is i still need the target to be 300, how would i do this. More and less saying if no moves are left and target is reached then go to next level. If no more moves left and target score is not reached then its game over. thanx in advance
     
    Last edited: Jun 2, 2014
  14. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi,

    the winning conditions is primarily based on your own game's needs and your own ability to code the desired outcome. In your case, you would need some if-else statements to verify if score has been reached and whether there is any moves/time left etc...
     
  15. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    So would i put that in the winning conditions script or make my own script referencing the winning conditions script. I must tell you i still learning scripting and some scripting like if-else statement i still haven't grasp sorry still a noob.
     
  16. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    just modify the current WinningConditions script...no need to create another script :) ...
    study the scripts in there so that you get a better understanding of how it works as well as to improve your coding knowledge :)
     
  17. rickcollette

    rickcollette

    Joined:
    Mar 17, 2013
    Posts:
    304
    ok - I've gone totally daft here. I started working with JMF Pro again after a long break.. and the background image.. I cannot figure out how to change that for the life of me...

    is there a doc or video on this?
     
  18. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    hi,

    please refer to this video... it's fairly simple process :)
    *** sorry for the poor vid recording as i was sick that day =/
     
  19. rickcollette

    rickcollette

    Joined:
    Mar 17, 2013
    Posts:
    304
    it must be early.. still on the first cup of coffee.. i don't see a video :)

    Edit: Got it. Searched Youtube.. watching it now:
     
    Last edited: Jun 10, 2014
  20. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    whoops... i copy the link.. forgot to paste it into the text box... haha... sorry for that >.<
    but you got it :)
     
  21. rickcollette

    rickcollette

    Joined:
    Mar 17, 2013
    Posts:
    304
    Yeah - I was going nuts, I would change the texture in the inspector, then run the game, and it was changing back. :)
     
  22. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    yea... that doesnt work... probably cached somewhere thats why.
    but deleting/removing the entire background sprite "gameObject" works :).. just have to re-create it :D
     
  23. jjiwa

    jjiwa

    Joined:
    Jun 28, 2014
    Posts:
    8
    so good asset , it has many fuctions.i feel this asset has more fuctions than the others for the match 3 games.
    when playing the demo ,i feel your asset need the game pause button , some users have to pause the game to deal with the other things such as mobile phone or read message.
     
  24. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493

    Hi,
    Thanks for your interest :D
    the pause button is actually very easy to do... add a new button and put this code into it...
    Time.timeScale = 0;
    will do the trick... however, gems can still be swapped so i suggest either putting a restriction that will soak the "pieceTracker" actions or anything equivalent... there are a few many ways to 'disable' the swap. i believe the easiest way is just to put a new sprite (it can be invisible if you want) that will soak-up/block the UI raycast hitting the PieceTracker...

    or...

    you can even go to the PieceTracker and add an "if" condition... if Time.timeScale == 0, then 'return' (aka don't proceed) ... also as easy :)
    P.S.> i believe the newest version if JMFP has the new "PanelTracker" ... of which tracks panel clicks... no need to disable this as it does not affect gem swap...
     
  25. jjiwa

    jjiwa

    Joined:
    Jun 28, 2014
    Posts:
    8
    thanks for your answering

    maybe the last method is easy method . i think ,
    if you put the spirit into your asset, it maybe make it more functional, although it is so easy.
    maybe it is not as easy as you speak. must think of much parameter.
     
    Last edited: Jun 30, 2014
  26. InfiniDJ

    InfiniDJ

    Joined:
    Jul 17, 2014
    Posts:
    8
    I have managed to switch all the sprites to a custom atlas sprite. The only difference I see on the import settings is the sprite is multiple instead of single. I have also attached an animator to each piece to handle the sprite animations.

    I'm not using the 2DTK and just decided to use the native 2D version.
    For some reason when I switch on Pooling with Pool Manager 5.5.2, the pieces and panels don't autosize and the scale is vector3 (1, 1, 1).

    I notice that the box colliders autosize properly, but the sprites do not autosize like they do when pooling is switched off.
    Where should I look (i.e. Script) to resolve this? It only happens if I switch on pooling, which I will need for mobile.

    I have tried removing the pool manager and reinstalling, but that doesn't fix it. Hopefully it's an easy fix and I don't have to resort to custom scaling.

    Any help is appreciated.
     
  27. InfiniDJ

    InfiniDJ

    Joined:
    Jul 17, 2014
    Posts:
    8
    I'm thinking it may be the way Pool Manager parents the pieces to the Pool prefabs on Despawn() and then they are reparented back to the the Game Manager Spawn()?...
     
  28. InfiniDJ

    InfiniDJ

    Joined:
    Jul 17, 2014
    Posts:
    8
    I fixed it, but I don't like the way I did.

    before every call to the autosizer I added code like this:


    defaultPanel.transform.localScale = Vector3.one;

    JMFUtils.autoScale(defaultPanel);


    This made sure that the local scale is set to (1, 1, 1), which is weird because every prefab is set to Vector3(1, 1, 1).

    Great Asset btw, very customizable. This is the best Match 3 asset on the store.
     
  29. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    thanks for your interest and feedback :)
    not sure why the auto-resize isn't working... but then again the unity2D version lacks testing as appose to the 2D Toolkit version so you are the first to report the issue :O

    it looks crude and that code would only affect the default panel (not all panels, especially custom panels with front/back positioning) ... if you did it for all other panels it should be ok...

    will investigate the issue. Thanks for reporting it :)
     
  30. InfiniDJ

    InfiniDJ

    Joined:
    Jul 17, 2014
    Posts:
    8
    I changed the position of

    gameObject.transform.localScale = Vector3.one;
    (Where gameObject is defaultPanel, backPanel, etc...)

    in the scripts to right before the gameObject is Despawn() by PoolManager just like "thisPiece" does

    because placing the code snippet before every autosize call was lowering the framerate.

     
    kurayami88 likes this.
  31. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    thx for the feedback, i'll note that down :)
     
  32. Frog76

    Frog76

    Joined:
    Jun 9, 2014
    Posts:
    4
    Hi, I bought your pro version and I think it's pretty darn cool! It's quite complicated to get your head around it but I'm slowly breaking it down. I just wanted your input on something I've been playing with. I would like to create an option for power ups where the player can change one of the default game pieces to a selected piece based on what's available on the board. I can't work out how to do this so any pointers would be great. Like I said, I'm playing about with the solution to try and extend for my game but already hitting stumbling blocks. I am new to Unity and still in the process of learning C#
     
  33. Frog76

    Frog76

    Joined:
    Jun 9, 2014
    Posts:
    4
    I actually managed to get this working by using the convert to special. What would be nice is example scripts on how to use these :) it would save quite a bit of time hunting around. Still, it's a great product so well done sir
     
  34. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493

    Hi,
    Thanks for your interest in JMFP... and yea... some pointers would be good... i'll note that down :)
    glad you found the solution you needed :)
    there are a few custom panels/pieces script that are there by default... you can use them as samples :)
     
  35. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    to @InfiniDJ

    i've retested and pooling works even on the Unity2D version...
    did you ensure you have the actual poolManager 5 before selecting that option?
     
  36. Frog76

    Frog76

    Joined:
    Jun 9, 2014
    Posts:
    4
    Hi kurayami88

    I do have a question for you after-all. I'm trying to create the scenario whereby a player could use items to match against the basic normal game pieces. So for instance they can place a yellow ball on the board to match against the yellow normal pieces, and the board would treat it as though it was a yellow normal piece. I hope that make sense :) I've dug into the scripts but can't quite workout how it does it's matching. It seems to use a list to store the results but I got a bit lost after that..!

    Many thanks

    Frog
     
  37. InfiniDJ

    InfiniDJ

    Joined:
    Jul 17, 2014
    Posts:
    8
    I've tried a fresh download from the asset store and I was getting the same result with my Mac and Windows machines.

    But, recently, I added a preload screen with:

    int progress = 0;

    while (progress < 100)
    {
    int finalCount = 0;
    int currentCount = 0;
    SpawnPool spawnPools = PoolManager.Pools.Values();
    foreach(SpawnPool pool in spawnPools)
    {
    foreach(PrefabPool prefabPool in pool.prefabPools.Values())
    {
    finalCount += prefabPool.preloadAmount;
    currentCount += prefabPool.totalCount;
    }
    }

    progress = finalCount / currentCount;
    Debug.Log(string.format("Progress: {0}%", progress))
    yield return null
    }

    And was able to remove the code snippets before Despawn() by using preloaded prefab amounts to lower growing pools during runtime and this cloning of the prefabs seems to get rid of the bug I was seeing. Thanks very much.
     
  38. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi,

    Each custom PieceDefinition script has its own match conditions *example below*

    Code (csharp):
    1.  
    2. public override bool matchConditions(int xPos, int yPos, List<Board> linkedCubesX, List<Board> linkedCubesY){
    3.         if ( linkedCubesX.Count > 1 && linkedCubesY.Count > 1) { // + or T or L-type match special pieces
    4.             gm.board[xPos,yPos].convertToSpecial(this); // makes the cube a special piece
    5.             gm.board[xPos,yPos].panelHit();
    6.  
    7.             //lock the piece for just created power piece
    8.             StartCoroutine(gm.lockJustCreated(xPos,yPos,0.3f));
    9.             return true;
    10.         }
    11.         return false;
    12.     }
    13.  
    but the above code still depends on the main PieceDefinition's "CheckPattern()" method to determine the same piece to be matched... ** please refer to the actual PieceDefinition script of which custom scripts inherit from; from there, there is a checkPattern() method which is at the bottom **

    the checkPattern basically says that if the custom piece is not a special type (AKA matchable) and that the slotNumber is the same as it's neighbour piece, then add them to the list....
    the "matchConditions()" method mentioned above is the 2nd step of which you can define how many linked Pieces must be in a row to ensure a match and/or turns into a special piece.

    *** NOTE ***
    for advance requirements, and if you know how to code it well,
    I left the "CheckPattern()" main method override-able ... so you can actually specify a custom checkPattern for a specific custom PieceDefinition of your liking...
    the package is flexible that way... but it's up to you to harness its power :)

    ---------------------------------------

    I have no idea why you need this code snippet as the asset should work Out-of-the-box directly... and even so... this code snippet currently makes little sense as you are waiting to count the total amount, but yet did not give allowance for pool manager to actually pre-load the asset... your loop does not break to allow PoolManager to execute pooling behaviors and what the code actually does is count the same pool values over and over again until 100 count is reached... redundant I believe...
     
  39. InfiniDJ

    InfiniDJ

    Joined:
    Jul 17, 2014
    Posts:
    8
    You're right it does work out-of-thebox and the profiler clocks this asset at 600-750 frames per second with 10-15 draw calls and an ipad 2 runs at 60 fps almost the whole time.

    So there is no question your assets is awesome.

    I also enabled the preloading feature in the per-prefab option for all the pools and set a preloaded amount for all the required gems and panels, because for artistic reasons I've chosen to add animations and limit the colors of gems to 5 different colors. I also wanted to maintain the awesome framerate your asset allows. The reason I am adding a small load screen (generic for now) is because I have alot more assets (animations, .fbx files, textures) then your asset is originally designed for. I'm sorry if you think my code sucks and is redundant, but this was the only solution I saw at the moment vice preloading the assets and not having the user wonder if the app is hung.
    I am using Unity Pro version 4.5.2 and Pool Manager 5.5.2. I can send you a video of a clean install and you can see that the gems and panels shrink when pooling is turned on the Unity2D version.

    The first fix I did was add
    gameObject.transform.localScale = Vector3.one;
    in the places I mentioned in earlier posts and this fixed it.

    When I turned on preloading in the per-prefab option, this also got rid of the scaling issue and I was able to get rid of the setting the local scale to Vector (1,1,1).

    I just though you would like to know as I'm only trying to help.
     
  40. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi,

    No offense meant... perhaps you didn't understand what I said...

    I meant to say that your code snippet was flawed because it does not take current data from PoolManager. You loop cycles itself using the same data until it satisfies itself ( if I understood your code correctly)

    At the present moment, it is better for you to have a static scene that says "loading..." and do a "Application.LoadLevelAsync(your-actual-game-scene)" to fully load the assets without appearing 'hung'.
     
  41. JamesArndt

    JamesArndt

    Unity Technologies

    Joined:
    Dec 1, 2009
    Posts:
    2,913
    I wanted to ask the question posed earlier about simply clicking on any piece and destroying it (removed from board). I found a function called OnPieceClick() in JMFRelay.cs. It appears to be detecting a piece being clicked. What other script do I need JMFRelay.cs to hook into to call a Destroy() function or something? Is there any helper functions for destroying a piece, updating the board, and moves, etc?
     
  42. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    I will need to create a help file for method calls ...

    in the mean time... all scripts will have summaries on the top of the script (check the '+' sign for collapsed comments if any)...

    some methods also have explanation on what they do commented on top of it...
    while some other complicated process will have side comments inferring what they do...

    :)
     
  43. jjiwa

    jjiwa

    Joined:
    Jun 28, 2014
    Posts:
    8
    can you add some boosts or items for this asset? i think it will make your asset attractive .
     
  44. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    item management requires a seperate 'engine' by itself already... (especially item quantity and which item is "equiped" etc).... it also goes hand-in-hand with user/character account management... so it will be a very complicated as well as massive addition of which normally other developers will probably be better off building from their perspective and customize it themselves.

    as for the typical needs of newbies to the asset.. i wanted to include a doc to the asset itself... then thought perhaps it will be easier for an online reference of which i can update directly, and also allow users to comment/request info/contribute to the document.
    here's the link to get started...
    http://goo.gl/quVcTH
     
  45. jjiwa

    jjiwa

    Joined:
    Jun 28, 2014
    Posts:
    8
    you can add the booster or item in your game,just for some gold , can buy some item or skill using gold. gold can be get when passing some games. and get some treasure.
     
  46. InfiniDJ

    InfiniDJ

    Joined:
    Jul 17, 2014
    Posts:
    8
    Maybe in the doc add some suggestions in how you accomplished some of the features in Curse You Ninja~!

    like the default kit has the pieces fall one at a time.

    -What if a dev wanted to have the pieces fall in their column together like in Curse You Ninja~!? What are some recommended settings to fall delay and such.

    -What if someone wanted to add pieces like those pesky ninja's that act as blockers?

    -What are some script change/addition recommendations for adding bonuses?

    I'm sure you have common customization FAQ's and that would be a good recommendation. to add.
     
  47. InfiniDJ

    InfiniDJ

    Joined:
    Jul 17, 2014
    Posts:
    8
    Links to your Youtube videos may help some people too.
     
  48. johnnydj

    johnnydj

    Joined:
    Apr 20, 2012
    Posts:
    211
    I thought you guys want to check out what I made with this awesome kit in less than 2 months.
    I'll just leave the youtube video link here. The android beta version of the game can be found in the video description.

     
  49. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    wow... that's awesome :D
     
  50. fabiobh

    fabiobh

    Joined:
    May 28, 2013
    Posts:
    92
    Hi, I want ot understand something about the winning conditions script.

    I see when I use the isTimerGame option combined with the isScoreGame, the winningConditions script finish the game when the time is over, but it won't show if the user reach the minimum score to complete the level.

    Is this correct? Which I need to modify to verify the time and score at the same time?