Appsurd
Member
Hi guys,
Before I forget, I use GMS1.4. For a couple of days I'm struggling with the following situation. I want to create a game like Wordfeud or Ruzzle where players can select or enter certain letters and I want to check whether the word they used is a valid word. Therefore I found online a free word list (not quite a real dictionary, since it contains words only and no explanations). All words in the txt file are seperated using enters. I also converted the txt file to a csv file (and also made a json version). I tried the following possibilities.
Try 1.
Result: Not possible, arrays may contain only 30k elements
Try 2.
Result: Works, but in practise terribly slow due to csv->list conversion. I personally guess this is due to the fact that in each iteration, you need to increase the size of the list, which makes it slow.
Try 3.
Result: the reason I use a ds_list and not a ds_map is that searching in the keys of a ds_map is too slow to use in-game. Furthermore, this method is undesirable due to having to convert ds_map to ds_list every time the user starts the game. Naturally, the downloading will take place only once, but since I can't save a ds_list and load a ds_list directly from a file, this seemed a viable solution but isn't after all.
Try 4.
Result: This method works absolutely fine in a game of Wordfeud, but is a disaster in a Ruzzle game. Depending on the user's internet, the game 'shocks' every now and then because the game is waiting to get answer from the server. (Don't worry, checking if a word exist in a mysql database is super fast, like less than 0.1 sec) So this is not a viable option.
Try 5.
Result: This solution was recommended to me, but isn't what I'm looking for. The problem with this asset is that I cannot change nor tweak the contents of the word list. But moreover, I cannot add support for multiple languages.
================================================================================
And that's about it. At the moment, I really don't know what to do. I'll put down a summary of what I think I require in-game. If anybody knows some fantastic method, please let me know
- Need to either download the file from a server or add it as an Included File to the game. Simply sending a PHP request to a database makes the game lag on fast-paced games.
- Word list must be in ds_list format since ds_map searching is too slow, array cannot be big enough (and searching isn't possible at all) and I'm unaware of any possible formats.
Before I forget, I use GMS1.4. For a couple of days I'm struggling with the following situation. I want to create a game like Wordfeud or Ruzzle where players can select or enter certain letters and I want to check whether the word they used is a valid word. Therefore I found online a free word list (not quite a real dictionary, since it contains words only and no explanations). All words in the txt file are seperated using enters. I also converted the txt file to a csv file (and also made a json version). I tried the following possibilities.
Try 1.
Code:
- Load the word_list.csv from a webserver. ~10sec
- Split word_list on enter and save it to array
- Array contains all words
Try 2.
Code:
- Load the word_list.csv from a webserver. ~10sec
- Split word_list on enter and save it to ds_list ~50sec
- ds_list contains all words
Try 3.
Code:
- Load the word_list.json from a webserver. ~10sec
- Convert json to ds_map with json_decode
- Convert ds_map to ds_list ~20sec
- ds_list contains all words
Try 4.
Code:
- Enter all words into a online mysql database
- At every word, use a PHP script to check whether the given word exists in the database
- Return if it exists or not
Try 5.
Code:
Use https://marketplace.yoyogames.com/assets/448/dictionary
================================================================================
And that's about it. At the moment, I really don't know what to do. I'll put down a summary of what I think I require in-game. If anybody knows some fantastic method, please let me know
- Need to either download the file from a server or add it as an Included File to the game. Simply sending a PHP request to a database makes the game lag on fast-paced games.
- Word list must be in ds_list format since ds_map searching is too slow, array cannot be big enough (and searching isn't possible at all) and I'm unaware of any possible formats.