GDR Forum Index
Podcast Podcast
Dev Dev Logs
Search Search
RSS RSS
Register Register
Log in Log in
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Development Log - run-on words
View previous topic :: View next topic  
Author Message
Diablo
Contributor

Joined: 19 Nov 2015
Posts: 388
Location: :( :(
PostPosted: Thu Jan 18, 2018 11:22 pm    Post subject: Development Log - run-on words Reply with quote

Started this recently on a whim. Easy enough to program that I can convince myself to actually do it, but interesting idea. Just a couple of "levels" so far, try it in your browser and see if it works ok.

link it

I've got a handful of ideas for adding some complexities to the game, but it all centers around making the words blend together.
View user's profile Send private message Visit poster's website
Diablo
Contributor

Joined: 19 Nov 2015
Posts: 388
Location: :( :(
PostPosted: Fri Jan 19, 2018 11:28 am    Post subject: Reply with quote

Minor design conundrum. I'm going to be adding multiple rows to the game, so for example:



I may keep the "space" tiles in the game - wasn't really intentional, but seems like it'd work ok. Then you could have a valid row without blurring words together, as the space would be like starting a new "sentence." (Probably will also include "voided" tiles though, where you can't drag to / beyond)

Anyway, take a look at this more vertical idea though



Mainly, it's the O character I'm thinking about. Can player drag it in either direction, or only one direction? Or option 3 - can't move that tile at all, because it wouldn't be fair to exclude a direction without excluding the other direction too.

The main concern about allowing drag in either direction is making the word scrambles hard in a stupid way. I don't think I want levels where there's 3 horizontals, 3 verticals, and you have 30+ letters everywhere that could theoretically go on any row, or any column. Seems like it'd just be too overcomplicated. OTOH if I keep things isolated in their own row/col, then I can have the larger levels while still retaining some grip on sanity. you still would have to figure out a good letter arrangment to get the crossword valid, but instead of having 30 different places a letter can go, you just have to track a handful.

Maybe I use "movement blocking lines" to solve this one. that's already on the agenda - I render a "hard" line between 2 tiles, and that means a letter on the left isn't allowed to swap with any tile to the right of it, and vice versa. So on these intersection tiles (e.g. that O tile), when I make the level I just decide whether that intersection will be horizontal only or vertical only. This might be the best solution, assuming I don't want to allow complete freedom on both axes within intersections. And, it'd leave me with that "overly complicated" approach as an option, I'd just leave out the movement blocking lines and then freedom is restored. I think this is probably the answer I'm looking for. Other ideas still welcome. But, thanks, keyboard.
View user's profile Send private message Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10971
Location: Canadia
PostPosted: Fri Jan 19, 2018 12:36 pm    Post subject: Reply with quote

Total side note: I misinterpreted the first word as the Japanese pronoun "ore" (oh-ray). I forgot there was an English word: ore.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Diablo
Contributor

Joined: 19 Nov 2015
Posts: 388
Location: :( :(
PostPosted: Fri Jan 19, 2018 5:52 pm    Post subject: Reply with quote

I thought I was going to just use table cell borders to handle the "letter movement boundaries" but check this out, it wasn't quite good enough



So if you just turn off one side of the border, then the corner becomes a no man zone, and the result probably isn't what anyone would want. It introduced unsightly artifacting into the "lines" and I had to change plans, just using some absolute positioned divs on the edges of all the tiles that need the boundaries. This resolves the artifacting issue quite well. Now I'm trying to decide how I want to present "progress" to the player, because the original idea of drawing a colored line above and/or below the word has a couple issues:



Issue 1 - how many lines am I going to show the player? illegal word boundary, valid word progress, maybe I can add in an XP system and have a bar for that too everywhere? ????
Issue 2 - with 2 dimensional levels where there are words going across, down, and intersecting, issue 1 is cross multiplied many times over - game will start looking like that old windows screensaver with the dancing lines

On the plus side, I spent the proper time to make word lookups "rightly coded" today. Before, I was just checking table.tr[0].tds, left to right. This had 0% chance of working when I added more than 1 row to a level, or vertical words. The logic is a little bit complex, because I'm allowing spaces between words, and maybe a single letter has spaces on both sides which I decree as a "valid word" (in so much as I don't bother checking it, I consider it a purely vertical word in that case), and void spaces on the screen itself like in a standard crossword. But, so far I think it's doing its job well... just have to improve / make clearer the presentation of progress. I'm thinking I'll probably do a "full fill" behind the row/column, as opposed to a thin line. Or, maybe I could just manipulate the colors of the tiles themselves, maybe they turn green as they begin forming valid word. Damnation. What about this scenario, though?

Code:
WORD
  WORD


If I do a horizontal background fill on both rows (because word is a word both times), it overlooks the fact that "RW" is not a word, the verticals all have to be valid words as well. Damnations! Separate colors for horizontal and vertical? Yellow color for "valid in one direction, but not the other" and green color for "cool, valid in both directions" ? ?

Quote:
Total side note: I misinterpreted the first word as the Japanese pronoun "ore" (oh-ray). I forgot there was an English word: ore.

That NA localized version of Monster Hunter can't come out soon enough. Your import copy is taking its toll
View user's profile Send private message Visit poster's website
Diablo
Contributor

Joined: 19 Nov 2015
Posts: 388
Location: :( :(
PostPosted: Sat Jan 20, 2018 1:48 pm    Post subject: Reply with quote

Damned firefox was rendering the body element as 0px tall, so the background didn't render at all. Just a giant white background, thanks firefox. (fixed)

Couple new game mechanics more or less done, this includes the "can't drag through me" boundary


and also the proper implementation of multi-row levels, with the option of having boundaries on either axis


It's been made clear to me I need to more thoroughly explain the game concept of making words string together, so I'll have to give that some more thought. Considering adding some kind of "word breakdown" feature where I tell the player, "your letters are CATANKRE - this gives you CAT, successful links the T for TANK, but RE are used". This of course would become more complicated ni levels with multiple lines, vertical and horizontal, intersections, etc. Perhaps I could include it only in the first handful of levels, these being essentially tutorial levels - once the concept is ingrained, player won't need it anymore anyway.

I did settle on color coding for showing progress, but instead of a background fill I just changed the tile colors themselves. Green means part of valid word from start to end, and yellow means part of valid word in one direction but not yet in the other direction. I deem this is a reasonable and functional solution to the problem.

You can start from level one, or you can skip to level four for the new concepts.

I think I'm gonna start in on adding vertical dragging now. it already checks for the boundaries and other illegal moves, which is good, just have to follow through on legal moves now. Thinking about a better way of handling level completion too - it's very sudden at the moment, so sudden that it almost feels like some kind of failure screen. Soon as it detects all words are valid, instant black and fade in of next level title. A bit harsh. I think I know what I'll do about that, I've got a visual fx in mind to show the words you got and such.
View user's profile Send private message Visit poster's website
Diablo
Contributor

Joined: 19 Nov 2015
Posts: 388
Location: :( :(
PostPosted: Sun Jan 21, 2018 11:12 am    Post subject: Reply with quote

Slogging through code, and I'm already into some dirty hacks, like saying "+32 pixels to you here, +16 pixels to you there" to make things line up how I want them. And in theory it should work fine (damn you firefox, I know you're gonna prove me wrong), but what the hell. I've made some progress on the victory scenario. When level is complete, it points out all of the words you made, so if the word is LEVELONE, it calculates the fewest words possible (LEVEL and LONE, ignoring EVE, ONE, and such words). Then it takes the first word LEVEL and prints those letters above the row for a second before sending them to the "my words" list in the corner of screen. When it sends the first word to that list, it fades those tiles off the screen and moves to the next word e.g. LONE. Print word, transition to corner, fade tiles. This repeats until all words have been displayed to player, and at the end of this process all of the tiles on the board will be faded out, leaving black screen. This triggers the transition to the next level. So, this looks reasonably cool and also very much solves the "instant next level that is so sudden it almost implies a failure" problem I had, and for the novice player it should also help to reinforce the concept of the game itself, with the linking requirement between words.

But, so far the logic can only handle horizontal rows. Multi-row levels don't process correctly, and downward words aren't considered at all, so that's the next step. I have a debug level full if intersecting words, and I'm very much looking forward to seeing it do terrible things and trying to use the debugger to find out where my code is screwed up.
View user's profile Send private message Visit poster's website
Diablo
Contributor

Joined: 19 Nov 2015
Posts: 388
Location: :( :(
PostPosted: Sun Jan 21, 2018 11:13 am    Post subject: Reply with quote

Also it would help if I stopped doing things like this
Code:
if (array > 0) // when I really want if (array.length > 0)
View user's profile Send private message Visit poster's website
Diablo
Contributor

Joined: 19 Nov 2015
Posts: 388
Location: :( :(
PostPosted: Sun Jan 21, 2018 1:26 pm    Post subject: Reply with quote

Alright, it works. It was almost as much "fun" to program as I figured, but check it out..

View user's profile Send private message Visit poster's website
syn9ne
Contributor

Joined: 09 Jan 2010
Posts: 375

PostPosted: Sun Jan 21, 2018 9:05 pm    Post subject: Reply with quote

looks pretty good - and hard :)
_________________
The Hideout Games :: Pinterest :: YouTube :: Bandcamp
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Diablo
Contributor

Joined: 19 Nov 2015
Posts: 388
Location: :( :(
PostPosted: Mon Jan 22, 2018 8:56 am    Post subject: Reply with quote

Damned word recognition logic still isn't qutie right. I rearranged these

Code:
S T U P I D G A M E
into
G U T S I D E A M P


Which should give GUTS, SIDE, IDEA, and AMP - these are the connected words that make it a valid play. But for some reason it's not including IDEA, instead it just takes the DE (which is a valid word in scrabble dictionary, that's not an issue but it shouldn't be included in the results because it's a sub-word of a longer word already). Maybe it's because of the extreme overlap, SID and IDEA sharing 3 of the 4 letters each. In theory the game takes the longest word possible, so it starts by taking GUTS the longest word starting with a G.

The next word it takes should be the word that reaches farthest to the right. So for sake of argument, let's pretend UTS is a word. (Actually, in scrabble dictionary it is a word, so this is great.) Game says great, UTS is a word - but then it's going to keep checking that original word of GUTS, because UTS is utlimately a useless word, because you already reached the 4th letter with GUTS.

Okay, so now let's pretend that TSI is a word. It's not a valid word, not even in the scrabble dictionary, but let's pretend it is. So this is really good, we've got a valid word that reaches all the way to the 5th letter, so now G U T S I are all part of valid words - GUTS and TSI. (Remember, just pretending that TSI is a real word here...) The game is happy, but not satisfied - it's going to keep looking through that original word GUTS, because maybe there's still a word that can reach farther than the 5th character. And there is, when it checks on the S, it sees that SIDE is available as a word, and that reached all the way through 7 letters, a new record. So, we take the most efficient route to that 7th character - instead of returning GUTS, TSI, and SIDE, the game should ignore the TSI and simply return GUTS and SIDE, that's all you need to get to the 7th character. At this point.. I'll have to check the logic here (and think about it some more too, as it's just not quite working as intended), but probably it should then start stepping through SIDE, starting at the second letter in the word. Of course it finds IDEA, and then when it finds DE, the same logic as in the last check should apply - great, DE is a word, but IDEA is a word too and it reaches farther to the right, so only return IDEA and forget about DE. However this is unfortunately not the case at the moment - ugh.

Hmmmm. I had an idea, wondering what would happen if I added this bit of code to the word validation function

Code:
    if (word.toLowerCase() === "tsi")
        return true;


I thought that perhaps the same bug would occur, where the game would return GUTS, TSI and SIDE erroneously, kind of like it's doing with the DE in IDEA (although it doesn't return IDEA at all, for whatever reason), but it is with dismay that it still does not include TSI in the result here - it does the job properly, only giving GUTS and SIDE. That's too bad, probably means the bug is going to be harder to track. I also saw some bug behavior when clearing words on the test level in that last video - when I changed the letters around significantly, at least one of the tiles decided not to fade out after all its words had been shown on screen. Such a bummer, when you work through some complex code, maybe throw in a couple hacks here and there (everyone does it) and it looks like it works - then you find some edge cases where it doesn't. I'm sure that whatever I do to fix these bugs will make it so that the previous bugs return.
View user's profile Send private message Visit poster's website
Diablo
Contributor

Joined: 19 Nov 2015
Posts: 388
Location: :( :(
PostPosted: Mon Jan 22, 2018 10:54 am    Post subject: Reply with quote

Okay, it was a reasonably simple logic problem. I was discarding longer words for shorter words if word2.x > word1.x. This resulted in the DE versus IDEA bug - it wasn't taking into consideration that even though DE starts farther into the string, it ends sooner and thus should not have the priority.

I also kind of sorted out the tile fading bug - I kind of went with another minor hack here, where I just said "guarantee at least one tile fades for vertical words." The problem appears to be that if the words ... bah, I have hardly any damned idea what the problem was. I'm feeding it a variable called "disposable tile count" which is what it uses to determine how many letters it can fade out (e.g. GAMEROVE has GAMER and ROVE, when fading out GAMER you can dispose of 4 tiles, but you must keep the R so that you can show ROVE), and the debugger said there were 0 disposable tiles. Not sure why this would ever be the case, which probably means I'll have to set up a test level with a vertical word and find out it's still not behaving properly. Whatever...



Ignoring the fact that there's probably still some bug to fix in there, there's also still a problem with the order in which it applies the fades. I want the fades to go from left to right, top to bottom like the lines in a book. But when I have multple words in a downward string, it's processing all of those as soon as it can. I'll probably have to queue them all up or something, then sort the queue and loop it afterwards. I'm not sure I'd actually care that much, except that the confirmation word always appears above the tiles, and as you can see in the video, this leads to the confirmation word colliding with some letter tiles, so you can't get a good look at what the word is until it slides to the corner.
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1696
Location: Your consciousness.
PostPosted: Tue Jan 23, 2018 7:03 am    Post subject: Reply with quote

???

_________________
0xDB
View user's profile Send private message Visit poster's website
Diablo
Contributor

Joined: 19 Nov 2015
Posts: 388
Location: :( :(
PostPosted: Tue Jan 23, 2018 7:48 am    Post subject: Reply with quote

It's all valid according to official scrabble dictionary, which definitely has some interesting words in it, especially the 2/3 letter words.

TASPIGUMED can create the following words, which all blur together

TAS this is the weird one, but grep 'TAS' words.json confirms it's ok
ASP
PIG
GUM
MED

So even though "taspigumed" looks like the most invalid word in the history of earth, it's a valid play to complete the level because all of the subwords link together.
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1696
Location: Your consciousness.
PostPosted: Tue Jan 23, 2018 8:01 am    Post subject: Reply with quote

And I was just randomly pushing letters back and forth being too tired and too lazy to think. ^^
_________________
0xDB
View user's profile Send private message Visit poster's website
Diablo
Contributor

Joined: 19 Nov 2015
Posts: 388
Location: :( :(
PostPosted: Fri Jan 26, 2018 8:39 am    Post subject: Reply with quote

I found a "letter tile" graphic pack on one of those open game art type sites, and also browsed through some tiled backgrounds and added one of them to the page. So it looks a little prettier now - it's a start.

I also inserted a couple of new levels to the order, trying to do my best in introduce concepts in the right order, and making the levels fairly easy for the new concepts.

I've still got a few ideas I haven't impelmented yet. I've thought about having a wildcard character, so you could have QUI*EALOT - the * could be a T for QUIT, and then morph into a Z when forming ZEALOT. So it's basically kind of a way of cheating. We'll wait and see on that one, though - I suspect it'll be something considered part of "hard levels" primarily. (And now I realize the Z would work for QUIZ and ZEALOT, so it's not a good wildcard example, sorry.)

I think I noticed some buggy behavior on the game parsing out words on downward letter tiles. So, that may be fun to work on.

Another idea I've had is to either have certain ranges that you must guarantee the letters in that range form a valid word. So it'd be like this, at start of level:

Code:

R A N G E X A M P L E

// on a standard level, this is a valid play already - RANGE is word, and EXAMPLE is word and they share the E
// however, let's define a certain sequence of tiles wherein the letters must form a valid word within that range, like this...

R A N G E [X A M] P L E // the brackets here define a series of tiles that must also form a valid word on their own

// so in this scenario, not only must you have valid words from left to right with shared letters, but the letters between the brackets
// must form a valid word as well.  kind of deep, right?  so X A M is not a word, thus the level is not complete
// we would have to have a solution like... let's see if I can figure one out....

// okay, good news - this is a valid solution
R A N G E [M A P] L E X


So, here's why this works. RANGE, GEM, MAP, PLEX. Yes, PLEX is a word, whatever that means. But not only that, but the letters within the brackets are [M A P] so that too is a valid word. Thus, the level is valid in all regards and you can move on to the next level. IMO it's a super interesting idea, although I'm completely aware that the level of difficulty it adds to the game. And also I'd have to program it, though in a word game like this, most of the problems can be brute forced if I'm really feeling lazy. (What a great attitude toward programming I have, let's just guess at the solution until something looks like it works, what could go wrong???) The other thing to consider is, how do I represent this type of level requirement to the user? Maybe I really do use brackets, like blue or green or something? (And I guess I'd want to change the color to represent whether or not the letters wtihin the brackets formed a valid word) So there's a game difficulty factor, a programming effort factor, and UI considerations. Much to consider.

This means that most likely, I will ignore any other bug that is probably more important to fix (like the downward letter parsing issue) and instead dive into the brackets stuff.

View user's profile Send private message Visit poster's website
Diablo
Contributor

Joined: 19 Nov 2015
Posts: 388
Location: :( :(
PostPosted: Fri Jan 26, 2018 6:07 pm    Post subject: Reply with quote

Fixed the bug with the downward word parsing. Problem is that I copy/pasted the same logic from horizontal to vertical, and I have 2 almost identical blocks of code (one for each direction). After I copy/pasted, I ended up making an edit to the horizontal code and (oops) forgot to make the same change for vertical. Do as I say, not as I do.

I have the bracket concept coded for horizontal words now, as well. Later I'll copy paste the code and edit it for vertical words, and then probably make a change to one or the other and forget to apply it to both. So, here you can see me trying the new level again, hoping I can find a valid solution before too long. I think I did ok.

View user's profile Send private message Visit poster's website
Diablo
Contributor

Joined: 19 Nov 2015
Posts: 388
Location: :( :(
PostPosted: Fri Feb 09, 2018 8:40 am    Post subject: Reply with quote

Alternate mode. Quite sure I've seen a game that did this already, where you have to move numbers around, but what the hell, not like it's the first ripoff I've ever programmed....

View user's profile Send private message Visit poster's website
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Development Log - run-on words
Game Developer's Refuge
is proudly hosted by,

HostGator

All trademarks and copyrights on this page are owned by their respective owners. All comments owned by their respective posters.
phpBB code © 2001, 2005 phpBB Group. Other message board code © Kevin Reems.