playMaker

Author Topic: Creating a Spelling Game with a Word List like Scrabble  (Read 22109 times)

wickedfrow

  • Playmaker Newbie
  • *
  • Posts: 7
Creating a Spelling Game with a Word List like Scrabble
« on: December 05, 2011, 02:21:14 AM »
I am trying to use PlayMaker and ArrayMaker to create a word game where letters come on to the screen and the player needs to spell out a word with the selected letters that he chooses to spell a word with.  I need to store a Word List and have every time the player submits the 'word' for the game to check whether or not it actually is a word. A lot like Scrabble or Words with Friends.  Please if anyone knows how to pull this off or if you can help me please let me know, I am very appreciative and I am extremely exciting about using PlayMaker to develop.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15602
  • Official Playmaker Support
Re: Creating a Spelling Game with a Word List like Scrabble
« Reply #1 on: December 05, 2011, 02:47:01 AM »
Hi Wickedfrow and welcome :)


 Yes, I don't foresee any problem in implement this with playMaker and arrayMaker. Tho, depending on the number of words, we could hit some performance issue ( but gut feeling is that it's going to be just fine hopefully).

Could you attach the list of word ( or send it to me via pm if under nda) so that I can do some stress test ( if the list is very long, it's important to make sure perfs are acceptable). Depending on the text format you send me, I can write a parser to read the text file and fill the array. That would be much better than inputing by hand all the words using Unity... pain! I've been thinking about builder a.csv parser for arrayMaker, that could be the perfect excuse to do it :)

As for learning playmaker, Please check all the available videos ( official and unofficial) to get a feel and learn how to user playmaker.

As for arrayMaker, I would be the one to talk too regards arrayMaker. If you install the package, you will find some test scenes and working samples to get a feel. But basically, it's very simple, it's just a wrapper, all the function you expect for arrays are available, so you will not be limited in that way compared to a conventionnal script.


So let's start by having sample ( or just tell us how many words) and then I'll work out a working sample to get you started.

Looking forward to help you on this :)

Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15602
  • Official Playmaker Support
Re: Creating a Spelling Game with a Word List like Scrabble
« Reply #2 on: December 06, 2011, 01:28:57 AM »
Hi,

 ok, I have done a stress test with a text file containing 58113 words, I think it's pretty much ok.

 Conclusion: lighting fast! :) of course... because it's just a wrapper around a regular variable, so no real surprised but just wanted to make sure.

 So basically, the system parse this text file just fine and without any glitches, and then I can search, get , access, do whatever I want to this, all this at 400 FPS + ( during editing, so it's really a lot more when published and editor out of the way). Literally, the limit is the delay I set in the event to loop back to prevent infinite loop warning :)

I have attached a screenshot showing a setup where I pick a word random, and then check if it's contained, just for testing. The nest step if to inject the word made up by the user and if found in the list, trigger a success event and done... :)

I will issue today or tomorrow a new version of arrayMaker that implement this option to load from a text file ( spliting lines into array).




Bye,

 Jean






wickedfrow

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Creating a Spelling Game with a Word List like Scrabble
« Reply #3 on: December 07, 2011, 06:03:43 PM »
WOW! Jean, this is excellent man!

I am so excited, you are the best!  Okay great so this is definitely possible, what's great is there is such a HUGE variety of ways to create word games.  I am extremely happy you've done this Jean.  Let me know when you've released the adapted arrayMaker?  Once again wow, thank you so much for showing this is possible with your arrayMaker man.  I can't wait to try t out.  If I have any questions I will give you a holler. :-D

In PlayMaker I can have my Letters Spawn and have my Player collect and build words and then use ArrayMaker to inject their submission to check if it's valid or not.  Unbelievable!  :D

Keep on winning,

-Jared

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15602
  • Official Playmaker Support
Re: Creating a Spelling Game with a Word List like Scrabble
« Reply #4 on: December 12, 2011, 06:24:00 AM »
Hi,

 OK, a new arrayMaker version is available featuring a new action to split a text asset. I wanted originally to make it available in the arrayMaker proxy, but there is too much work to be done for this to be convenient for the user ( basically, I want to rewrite the custom editor for an easier way to pre fill data). So I went for a simple custom action instead, which works just as good :)

 I have also created a working sample of a word match system with a simple gui where you type a word and it instantly check for a match. *All done in PlayMaker and arrayMaker* So this is where you should start from to learn how PlayMaker and ArrayMaker will allow you to do your game. Tho I suspect doing the gui might now be your biggest challenge :)
 
 You can download the package here:
https://hutonggames.fogbugz.com/default.asp?W715

 As always, do not hesitate if you have any question or trouble.

 Bye,

 Jean

wickedfrow

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Creating a Spelling Game with a Word List like Scrabble
« Reply #5 on: December 13, 2011, 12:27:38 AM »
First of all, I don't even know how to begin to thank you for your time and your expertise.  You've not only proven to me how power PlayMaker and ArrayMaker are but you've set me well on my way to creating my game.  So I want to genuinely thank you for all that you've done on this thread.  This is going to help everyone and anyone looking to create a word game in Unity. 
I am going to play around with this function and I will definitely let you know when I have a question, I know I will :-D

-Jared

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Creating a Spelling Game with a Word List like Scrabble
« Reply #6 on: December 20, 2011, 11:50:33 AM »
Jean, Thanks for this man it is great stuff.. I have a system for language conversion but i am thinking this might change how i do it.. Will have to download and look at the system closely but it sure seems like it would have the potential..

So i assume the current file type is CSV.. is there any reason to use an XML file or something else that would make creating text tables easier? I currently use a spreadsheet and export to CSV but i find it a bit of a pain converting and my client wants to be able to edit the file them selves.

Is it possible to make an XML parser?

Q

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15602
  • Official Playmaker Support
Re: Creating a Spelling Game with a Word List like Scrabble
« Reply #7 on: December 21, 2011, 12:14:35 AM »
Hi qHolmes

 Currently I only parse the text using the split system per line ( that can be changed easily tho), so no csv nor xml at the very moment.

 I am planning on doing a full csv and xml parser with xpath and all that. But at the moment it is not a priority over my other paid projects.

CSV Xml parser ( I would convert csv to xml I think for a better more reusable set of tool) would be easy as I have now a good base to work on with my arrayMaker experience. The big concern that I have from a technical point of view is to store xPath searches when several entities is returned, but I guess I would simply store the result into some either an xml proxy again or in a arrayList proxy :) This is necessary to search results and then be able to carry on with that refining the search, iterate etc etc.

If you need this "desperatly" as a christmas present, we can arrange something. Simply pm me.


How does your language conversion system works ? is it a translation system or a switch for the interface?

Bye,

 Jean

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Creating a Spelling Game with a Word List like Scrabble
« Reply #8 on: December 21, 2011, 02:59:49 PM »
No urgency on my end as i already have a solution but i would love to dive into ArrayMaker so thought it might be a good fit to start.

Currently it uses a CSV file with a format like this:

ID; Language1; Language2 etc...

It is a slightly modified version of the speech bubbles. that is on the Unity Store. Works good and the speech bubbles work good too.. i am slowly replacing them with EZ gui Gui stuff though but i still use the language translation portion for everything.

I just give it the ID which would be Button1 or Textbox6 etc and set the language i need globally and i get the proper translation of the Button1 text in the CSV file. My text is all technical lingo so my clients translate it for me so they are happy with it.. i did some translating using a free web service and just for fun i ran the translation in reverse and it was just gibberish I also put in Dutch where i was supposed to have German too... kind of a dumb moment i guess.. oh well ;D

Q

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15602
  • Official Playmaker Support
Re: Creating a Spelling Game with a Word List like Scrabble
« Reply #9 on: December 22, 2011, 01:40:31 AM »
Hi,

 I did have a serious look last night at csv and xml, and I have a parser working. I am going for the following approach:

 parse csv to xml then use xml xpath to query it and store in arrayMaker or in strings. the benefit from parsing csv to xml is xpath obviously where accessing data is just fun an easy. AND you can organise your csv data into more defined structure. currently I can allow you to define a column as being an attribute ( by  defining the column name for the first field with a starting ampersand : "@customerID"

the following csv:

Code: [Select]
GREAL,Great Lakes Food Market,Howard Snyder,Marketing Manager
HUNGC,Hungry Coyote Import Store,Yoshi Latimer,Sales Representative
LAZYK,Lazy K Kountry Store,John Steel,Marketing Manager
LETSS,Let's Stop N Shop,Jaime Yorres,Owner


I can output currently in
Code: [Select]
<?xml version="1.0"?>
<Customers>
  <Customer CustomerID="GREAL">
    <CompanyName>Great Lakes Food Market</CompanyName>
    <ContactName>Howard Snyder</ContactName>
    <ContactTitle>Marketing Manager</ContactTitle>
  </Customer>
  <Customer CustomerID="HUNGC">
    <CompanyName>Hungry Coyote Import Store</CompanyName>
    <ContactName>Yoshi Latimer</ContactName>
    <ContactTitle>Sales Representative</ContactTitle>
  </Customer>
  <Customer CustomerID="LAZYK">
    <CompanyName>Lazy K Kountry Store</CompanyName>
    <ContactName>John Steel</ContactName>
    <ContactTitle>Marketing Manager</ContactTitle>
  </Customer>
  <Customer CustomerID="LETSS">
    <CompanyName>Let's Stop N Shop</CompanyName>
    <ContactName>Jaime Yorres</ContactName>
    <ContactTitle>Owner</ContactTitle>
  </Customer>
</Customers>

then I can do for example xpath queries like "//Customer/ContactName" which will return *all* the contact names and I just inject that in an arrayListProxy and work with arrayMaker as usual from there. or simply selecting one node using "Customers/Customer[@CustomerID='GREAL']/ContactName" save it directly in a fsm string.


I working also on doing the following ( all fully author defined of course)

Code: [Select]
  <Customer CustomerID="LETSS">
    <CompanyName>Let's Stop N Shop</CompanyName>
    <Contact>
    <Name>Jaime Yorres</Name>
    <Title>Owner</Title>
    </Contact>
  </Customer>

by defining a xml template for each row like so and inject the csv data following that xml template:

Code: [Select]
<Customer CustomerID="[0]">
    <CompanyName>[1]</CompanyName>
    <Contact>
    <Name>[2]</Name>
    <Title>[3]</Title>
    </Contact>
  </Customer>


It's not critical, but xpath querys will be nicer if your data is properly organized.

Bye,

 Jean

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Creating a Spelling Game with a Word List like Scrabble
« Reply #10 on: December 22, 2011, 07:47:43 AM »
That is awesome!!!

Q

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Creating a Spelling Game with a Word List like Scrabble
« Reply #11 on: January 18, 2012, 04:10:07 PM »
Here is a question for you.. I currently use a simple system for my Language conversion.. works fine. Had a few issues with it lately which makes me think about using Array Maker but i am under too much of a deadline to start something new.. But one thing i am missing is formatting on my text.. Some of my text is supposed to be Bold and i can not do that with the Simple CSV Text file.

Is there some way with your parser to use formatted text? I have no idea how that would work but maybe you would.. You are very smart!

Q

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15602
  • Official Playmaker Support
Re: Creating a Spelling Game with a Word List like Scrabble
« Reply #12 on: January 19, 2012, 12:26:40 AM »
Hi,

 There are few things floating around for this:

http://forum.unity3d.com/threads/9549-FancyLabel-Multicolor-and-Multifont-label

http://forum.unity3d.com/threads/83370-Text-format-inside-GUI-elements

But I am afraid there isn't an easy way out of this.

Bye,

 Jena

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15602
  • Official Playmaker Support
Re: Creating a Spelling Game with a Word List like Scrabble
« Reply #13 on: November 16, 2012, 07:34:37 AM »
Hi,

 posting here for reference, I started on this xml system:
http://hutonggames.com/playmakerforum/index.php?topic=2583.0

the future of this is the following, Csv can be made as xml, Json can be made as Xml, so there is a huge potential in xml data handling form this point of view, especially when using XPath, which is utterly powerful when it comes to access a particular set of data within a xml file.

bye,

 Jean

Phuzz

  • Full Member
  • ***
  • Posts: 101
    • Bzilla Games
Re: Creating a Spelling Game with a Word List like Scrabble
« Reply #14 on: February 22, 2015, 04:19:18 PM »
Hello,

Just for sharing, I have implemented your amazing Example on the new unity UI, but I am actually giving it a shot in Arabic, I replaced the English words with Arabic words and letters, Right to Left, added Arabic font, and it is working flawless, now I could probably proceed to the actual project :)

Thank you very much!
Bzilla Games "Education with a Tickle!"
Qbucket Games "Voxel Games"