Advice on better implementing text-based puzzles

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hi all,

    I've just released my new flash puzzle game, ir/rational redux, on newgrounds. I'd very much like to do another, but first I want to start my code from scratch and build it so that it's actually time efficient to just slot visual, text and puzzle content in later.

    If you'd like to help, it'd be great if you could take a look at the game (no need to play through, you just need to see a puzzle screen to get the idea).

    Please login to see this link.

    I'm currently puzzling over how to handle puzzles in the game. In the current version I just have a whole hell of a lot of image files, and I cycle though the animations on those to display different text screens. This is obviously a really backward way of doing it and I need something better.

    What's the best thing to do?

    I might want to be able to call any puzzle from a single puzzle level / screen, since otherwise if I had a different level for each puzzle it might take me a long time to go through each level updating art art assets etc. Of course, perhaps there is some smart way to avoid such problems? Is there some obvious method I'm missing for having sort of a template level which I can just update and have changes automatically accross the game? That's a pretty newb question I guess.

    I'd also prefer to be able to call the texts from an external document so that I can just edit that document (and use spell check!) in order to edit texts accross the game. Would aiming for an iOS version in any way change the sorts of documents I can reference, and how would I go about doing it?

    Will having to program in a text parsing thing that turns lines in a document into dialogue spoken by one character or another be a bigger challenge?

    Also - I've just been bought the full version of MMF2 by Jayisgames. Is there anything important in MMF2 Dev that I'll regret not having for this sort of game?

    If anyone cares to take a look at the program file I'd be happy to mail it to you.

    It amazes me that I've gotten this far with such basic knowledge, so thanksfor any help you can offer!

    Cheers,

    Tom

    Edited once, last by TJ (July 13, 2012 at 1:43 PM).

  • Well done on your success with the game. I tried it for a bit earlier this week, Ill have to give it another go.

    I also have mmf2 but not the dev versions. The main things personally im going to miss are the gamecenter objects (leaderboard , achievements and in app purchases) but if my ios games do well hopefully ill get some money to upgrade.

  • It's only in MMF2DEV when it comes to MMF2, but it's available to all standard iOS developers. I don't have the iOS runtime (or a Mac, or a iPhone), but I do remember reading on the iOS forums about GameCenter only being for MMF2DEV.

    My Please login to see this link. (which I actually use), my Please login to see this link. (which I mostly don't use), and my Please login to see this link. (which I don't use anymore pretty much at all really). If there are awards for "'highest number of long forum posts", then I'd have probably won at least 1 by now. XD

  • Hello, Tom. Congrats on the great reception your game has had! Good and original game too, I played it yesterday when it was announced by ClickTeam on Facebook.

    You should display your texts as strings and not as images (Active or Backdrop Objects). Have a String object to display them, that will make it easier if you need to change a text later on.

    Are you gonna create another Flash game? If you do, you have to buy the Flash Exporter for your MMF2. It's important to know the target platform beforehand as in most portals (like Newgrounds) you usually can't upload more files than a single SWF file for each game (you can embed some kind of files to that SWF file, but I think you gotta update 'em every time you build the game). So I would try to not rely on external files for Flash projects (besides INI).

    Try to use global objects and global events. Global objects are created once and can be used in any frame, if you make any changes all instances of that object will be changed. You can have global string objects so you can have all your text there and call it from any frame (use paragraphs to keep your text tidy).

    You can create a template by using global events in conjunction with global objects, so you can place those objects in any frame and display different puzzles just by altering some parameters. For the kind of game you are making I would probably try that, that would make it more dynamic.

  • Thanks for your help!

    For a text-based puzzle game, wouldn't having a single global string mean storing an awful lot of text there? This would make testing a nightmare. The reason I went with images last time was because the different ways computers render fonts makes integrating the interface so locsely with the text a chore. With all texts in a single string it becomes even more convoluted.

    Also, with strings there no ability to format individual words. I'd really like to highlight the operator words in a different colour...

    I'm also mostly thinking about iOS development rather than only flash.

    I do appreciate the idea, though, I'm going to give it a whirl! And global objects for other elements will be awesome.

    Edited 2 times, last by TJ (July 14, 2012 at 1:58 AM).

  • You have to separate your text in paragraphs. Each string object can hold many paragraphs of text and then you can select which one to display. So is not all your text in a really long string.

    The text formating is not impossible but it would be very tricky.

    If you want to create a solid engine and plan to re-use it a lot, you can make a bitmap font system with active objects, that would eliminate the problems with fonts and would allow you to highlight words. Would take some extra time but it's highly reusable in many projects :D

  • Thanks for your help on this. The game is now announced! Please login to see this link.

    The next thing I want to make sure I have right is the typeface and how I'm controlling it. Currently I'm using multiple strings - unique ones for each puzzle - since unless I've mistaken something storing all text for the whole game in one object with multiple paragraphs would be hell to edit. I'd have to leave room for each and every line, since there doesn't seem to be an insert option, I'd need to keep track of where each dialogue started and ended... sounds like a nightmare.

    However, now I'm concerned that I don't have global control over typeface. I can set all string objects to a certain font during runtime, but that doesn't help me for editing. Is there a way I can change all properties globally? Seems crazy to move ahead without the option to change my font at a later date.

    On a related note, can anyone tell me anything about font licensing? I'm shooting for iPhone and PC. Are all fonts included in MMF2 compatible with iPhone? Is there a way to import free fonts? Are there any that are cheaper in the MMF2 package?

    Thanks for your help!

    Tom

  • Cool game. :)

    Dude... use text blitting. This is the answer to all of your problems. Not only can you set it up to be any font you want, but you can later change the font by just changing the one image map. You can also use as many colors/fonts you want, as long as you make separate images for them. Check out Chris Burrows' tutorials page. He has incredibly awesome tutorials for this:

    Please login to see this link.

    It also only uses basic objects so it will work across all platforms. :) Good luck!

    Please login to see this link.

    My examples:
    Please login to see this link.
    Please login to see this link.
    Please login to see this link.

  • Great link, Konidias! There's an example there of a bitmap font system using only active objects similar to the one I was talking about. I would go for that, bitmap fonts are much better for games as they are precise, unlike TT fonts that may be displayed differently depending on each user settings and ruin how the text is displayed.

    There are free fonts available online, Please login to see this link. just check individually the license for each font. You can convert TT fonts to bitmaps.

    You are right the multiple paragraph text thing can get messy, you can try to use an array instead, don't save it, just add the text to it at runtime. something like array > write string "blah blah blah" to 1, where 1 is the paragraph number. This, however has a limitation, strings are limited in size. You could do something similar with an INI file, but I think limitations also exist.

    Also, don't forget to edit your Newgrouds game file and put a link to your project on Steam, so you can spread the word and have your current players voting for your game there. Also, post it on these forums on the Steam Greenlight topic so more people can vote for it. Good luck!

  • Konidas - that is perfect, thank you!

    Oruga - good tips, thanks.

    Now, is there any possible way to edit array files outside of MMF2? Ideally I would be able to just write the text to the array, and then load it in game - that way I have all the text in one place and don't have to go into the code to edit it. I think it's not possible - every editor I open the array files in corrupts it. It's not essential - I can work from strings in-game - but it'd be nice!

  • TJ - There's always the List object: This uses standard .txt files you can edit in Notepad and load at runtime. I tend to prefer it over the Array object because I can easily see and edit the values.

    Kevin Ayre Please login to see this link.
    My iOS Apps: Please login to see this link., Please login to see this link. and Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!