Znirk's Recent Forum Activity

  • of course construct can easily handle it. Its just that it will be quicker and easier in Ren'Py i expect.

    ... a statement which may need a little explanation, particularly since I have a sneaking suspicion that Shii misunderstands the term "event-based" as applied to Construct. Sorry if you're totally clear on the concept. I'm basing my assumption on your question about keeping audio playing through several events, which I think is a really weird thing to ask if we're assuming the Construct sense of "event".

    By the way, it's perfectly OK to misunderstand stuff. I myself am not all that clear on this "visual novel" concept -- I'm picturing something like an illustrated and slightly animated, linear or perhaps CYOA-style branching, story; but I almost expect to be wrong.

    So, deep breath. Prepare for textdump in 3 ... 2 ... 1.5 ... 1 ...

    When people say that Construct is "event-driven" or "event-based", that's a programming technical term. It means that Construct programs aren't so-called "batch programs" which run through a to-do-list and then stop. Rather, a Construct program waits for "events" (with Construct, that's often things like keypresses, mouse clicks, sprite collisions etc.) to happen and responds to them as they occur.

    In other words: Instead of "Do A. Do B. Do C. Do D. If the result of D is below zero, do B again. Stop.", Construct works more like "Whenever n happens, do A. Whenever o or p happens, do B. Whenever q happens, do C.", with the implication that if n and p happen simultaneously, the Construct program will do both A and B.

    This is ideally suited for the more hectic kind of game, where a lot of things may or may not be happening at any given moment (Is the monster close enough to attack the perspective character? Did any bullets just hit anything interesting? Is the player pressing any movement buttons? Is the PC moving, or perhaps falling off a cliff? Has the background music ended and needs to be restarted?), and where there are only a few different "contexts" so that usually the same event calls for the same response.

    Now rewind to the top of this post, where I thought that Visual Novels are pretty much the opposite of such a game: Instead of few contexts and many possible events at any moment, such a program would have a lot of different scenes but spend most of its time waiting for one specific event per scene. Also, each scene would be a different context -- pressing [space], or whatever the canonical turn-the-page button is, should lead to scene 2 if it happens during scene 1; but pressing [space] again in scene two should probably do something other than restarting scene two.

    You can still do it in Construct -- particularly the shiny new Timeline object in the latest version (0.95.5, for posterity) would make a few aspects easier, I expect -- but it's a case where all the event-oriented Construct code would probably be more complicated to both write and read than something that looks more linear, movie-script-like. (Again, I'm merely assuming that Ren'Py is such a tool. I know little more than that it exists.)

  • I'm working on a visual novel-type game

    Just checking -- you do know about Ren'Py, right?

  • is exporting the game to run on other platforms still planned?

    - Pick up the SDL display class a previous user wrote and implement it with OpenGL, to provide an alternative renderer.

    - Look for people who can port this to other platforms.

    As I understand this, they want to split the job: They'll make an alternative runtime that uses SDL and OpenGL (which are available on several platforms) instead of DirectX (which is Windows-only); but the current Construct developers' version of the new "alternative renderer" will still only run on windows.

    But such an SDL/OpenGL version of the runtime will be much easier for someone else to port to a new platform. A port on the basis of the current DirectX runtime would have involved ripping out a lot of (DirectX-specific and therefore Windows-only) code and rewriting it to use something which works on the target platform (like frinstance SDL and OpenGL). But lo and behold, by version 1.4 or perhaps 2.0, the devs will already have done exactly that.

  • With "play music", the xAudio2 plugin pauses to reload the file -- the so-called "loop music" is more of a "start over as soon as the computer feels that now would be a nice time for it".

    You can "load resource to channel (+loop)" and "play channel" for gapless looping, but that won't work with an mp3 file.

    In any case, mp3 is a bad format for gapless looping: because it was originally designed for video soundtracks, it only supports lengths of multiples of ... 1/24 second or some such video frame rate. If you encode a sound of any other length to mp3, the end is padded with silence to the next frame boundary; so even with perfectly gapless looping, most mp3 files you can produce will have a gap encoded right into the sound data.

    In summary: sorry, I can't solve your problem unless you can make a _really short_ loop, save it as .wav and use it as a "sound" rather than "music".

  • WIYF.

    In short: While some motherboards are a bit more flexible, basically you need two identical modules. Not just the same size, but the same speed rating and chip configuration. To be on the safe side, buy the same model twice. Most manufacturers even offer "matching pair" packages of two memory modules. The main advantage of that format is that one package is cheaper to store and ship than two, so you might save a tiny bit of money.

    1 GB + 256 MB will never work in dual-channel mode, no matter how adventurous your motherboard is feeling. On the other hand, it might still be "better" than 2x 512 MB in some situations, simply because it's more memory. A bit slower, yes, but still much much faster than swapping to the hard disk.

  • >ATTACK SITE
    
    [with your bare hands]
    
    Violence isn't the answer to this one.[/code:2nu3ocnk]
  • Couldn't you just use separate Card Game objects?

    "Could", yes; but unless I'm missing something, "just" is a bit optimistic. Keeping separate decks would indeed be easy that way, but I'm assuming here usually a game that uses multiple decks would want them shuffled together into one big pile. You'd have to do something like:

    Check some flags to see which decks have cards left in them (and jump to the "No Cards Left" route if none have).

    Generate a random number between 1 and (number of remaining decks).

    Draw a random card from the chosen deck -- AFAICT there's no case switch statement and no way to pick an object based on the content of a variable, so this in itself is a whole christmas tree of ... I don't even know ... Compare events? Anyway, get that value and write it to a global variable; otherwise we'll have to write the deck-picking structure twice.

    If the card is "-1", that means the deck had no cards left after all: update the flags and start over. Otherwise, we're done.

    So, yeah, it's possible, but possible in a way that makes reimplementing the plugin in event code (or Python, once that's fixed) seem the easy option.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If this is turning into a feature request thread, I'd like to throw out a few suggestions for discussion.

    • Action: return card to deck (card number). Append the parameter to the end of the list of not-yet-drawn cards. (Perhaps perform a sanity check and complain via the debugger if the parameter is on that list already? But what if multiple decks are implemented?) Useful for games where cards can be drawn but not actually put into play, e.g. Solitaire. Also for games where you occasionally need to shuffle the cards that have been played, but not the players' hands (Crazy 8s and its five hundred million variants spring to mind). Alternative: maintain two lists. The "draw pile" is what is called the "deck" in the current implementation; the "discard pile" is initially empty and can have specific cards added to it via an action. Another action appends the discard pile (maintaining the order) to the draw pile and clears the discard. Problem: sanity checks become even more complicated ("User wants to add card #15 to the discard pile, so if the number of cards #15 in the draw pile plus the number of cards #15 in the discard pile equals the number of decks in use, throw an error message on the debugger.")
    • Conditions: same rank (card number, card number), same suit (card number, card number). Return true if the two parameters refer to cards of the same rank or suit respectively. For bonus points, accept an arbitrary number of parameters and return true only if they all match.
    • For convenience and readability, add "suit" and "rank" expressions that basically do card%13 and floor(card/13) respectively. (Or (card%13)+1 and ceil(card/13), if you prefer to number the ranks and suits from 1 rather than 0).
    • Allow multiple decks. This probably shouldn't be runtime-editable because removing a deck in mid-air is messy and underdefined. A property "number of decks" that defaults to 1 seems more plausible. Also, I don't expect users to want to know which specific deck a card came from; so a "draw pile" with two decks could simply(?) have two copies each of the numbers 1..52.
    • As an alternative, ignore everything I said above and go for flexibility: have a property "number of cards" that can be set to an arbitrary number. Remove all the conditions and let the users calculate (or look up in an array) what each number means in card terms. This would open the object as a shuffling mechanism for games with non-standard deck sizes (CCGs, Tarock and many more), but make it slightly less convenient for actual traditional card games.
  • placing a canvas object behind everything and pasting all the bones into it...then using image manipulator to save it

    Does that work, and how? According to the image manipulator's action names, it only copies from sprites, not canvasses. You can specify a canvas, or even the MouseKeyboard object, as the parameter; but using it that way doesn't seem to do much except crash.

  • [Reply to self -- found it.]

    It's all there, in System Expressions and Expressions.

  • You mean in your hands or inna face?

  • Before any objects, I'd like to see documentation on those math operators that are not expressions in an object. A plain uncommented list of what exists is the most important part of this -- I don't really need definitions of "integer division", "logarithm" or "sqare root", but I do want a place (other than the source code) to look up which ones are supported and what the exact spelling and syntax is.

Znirk's avatar

Znirk

Member since 14 Jun, 2008

None one is following Znirk yet!

Trophy Case

  • 16-Year Club

Progress

16/44
How to earn trophies