TableSearch with a lot of data

MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
edited April 2015 in Working with GS (Mac)

I´m working with a word search type game, and i´m looking for the best way to search a table with a lot of data.

For testing purposes, i used to have a small table of around 150 words. All in one column. When i did a TableSearch to see if a word i´ve selected in the game was in the table, everything went nice and smooth.

Right now i have a word database of almost 100k words. Again, all in one column.
In the rule that checks if a word is in the table, i have conditions on the ´otherwise´ section in case the word was not found.
It seems like the TableSearch function does´t work properly anymore, and it always fires the rule in the ´otherwise´ section.

Is 100k rows too much for the TableSearch function?
Does it make any difference if i change the table to have the 100k words in multiple columns and search those separately? Or should i add a timer in the ´otherwise´ rule so the TableSearch has more time to finish?

Or what would be the best way to do a search this big?

Note: I´m using the 0.13.9 RC. I can´t test if the TableSearch works with my method in the older versions, because the older GS creator crashes when i try to import the CSV file.

I´ll tag @Braydon_SFX here, because he always seems to have answers when tables and words are involved.

Mental Donkey Games
Website - Facebook - Twitter

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    It should be able to search 100k just fine. It seems like the otherwise is the issue. Try removing that. If it works, you know that was the problem. Then create a rule that would serve as the otherwise is now. So for example, if a match isn't found, you rule would look something like:

    If attribute game.search is less than 1,
    - execute code.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    I turned the otherwise rule off. The TableSearch didn´t work at all.
    The weird thing is, i re-imported the wordlist CSV file, and now it works without any changes made in the rules.

    Well, the TableSearch part works. Some other stuff is messed up now. I think the TableSearch takes a little more time to finish than it did with the smaller table, and can´t keep up with my other rules.

    But that´s a thing i think i can fix.

    Also, when the TableSearch happens, the game lags for a fraction of a second.

    Mental Donkey Games
    Website - Facebook - Twitter

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803

    http://marketplace.gamesalad.com/#query=gameteamone&product=31539

    You may want to take a look at this template. It has 243,346 words in 244 rows and 999 columns. Faster importing and faster searching because it groups words by the first 2 letters to narrow searching down.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    Thanks for the tip @CodeMonkey

    Mental Donkey Games
    Website - Facebook - Twitter

Sign In or Register to comment.