Arima's Recent Forum Activity

  • MUCH better. I'm actually getting better framerates in FF than chrome!

    Edit: better framerates in one game, slightly worse framerates in another. Either way, vastly improved!

  • I would really, really like not only full file I/O, but also the ability to preview as an EXE instead of through a web browser like with construct classic - one click and an exe appears running on the screen. Reasons for this in order of importance, least to highest:

    File size - Not as much of an issue these days, but it seems a waste especially with needing 3 copies of each sound file in each backup of a game. However, it leads into...

    Saving times - true, saving as a project is faster, but even with a small game it can start to take a bit of a disconcertingly long time when imagining how much longer it would take to save a big game.

    Previewing times - while I haven't tested it yet, I'm concerned that at some point when working on a larger game it's going to start impacting preview times as well, as happened with construct classic. I realize C2 is written far, far more efficiently, but regardless that can be a lot of data to move around all at once and if some of it could be loaded at runtime when it's needed via actions instead it would make it much smoother.

    Updating files - if we want to update a piece of music, we have to go through the process of importing and replacing it each time. If we could have it load from disk, all we need to do is overwrite the file.

    Some people want to make EXE-only games - it would be very, very nice to preview directly via the output method they're going to use - no having to wonder if the game is going to work differently via the EXE exporter (bugs in awesomium or such, etc). A lot of bugs are found when testing other stuff in the preview - having to do a whole extra round of testing specifically for the export would be extremely inconvienent, especially for large games like an RPG!

    Webstorage issues - as browsers have limits of 2.5 or 5 MB for webstorage, that means if you want to use more than that you have to start resorting to swapping stuff in and out of webstorage to disk using clumsy save/load file from disk dialogs every time you want to swap between them, you have to keep track of which is which, and hope that is the dizzying process of making a game you don't accidentally save as the wrong file name and overwrite the wrong file or some such.

    Or then, what about on the user's side, if your save files simply need more than 2.5/5 MB, like if you include a level editor that the user can use? What then? Even with using EXE, there are simply no options other than asking the user where to save the file, then to load it later, both via a windows dialog box. Users aren't going to like that, it's not a smooth experience at all.

    What's worse, is when previewing via a browser, that's 2.5/5 MB shared for ALL games made with construct 2! Want to make multiple games that use a lot of data at once? Gotta swap webstorages every time.

    The full file I/O would really need preview as EXE to work well, though. Otherwise, you'd have to export to EXE each time to preview, which would be infuriating!

    If we had both preview as EXE and full file I/O, that would solve these problems completely and be a great working experience. Please, please add both to C2!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ahauuhahua +1 for bringing on Avatar :D

    I second that :D

  • Rory vladoss - Thanks!

  • I'm going to try to put loot pursuit on it. It's a humorous casual/arcade mini RPG I've been working on for about 3 1/2 years in construct classic.

    Subscribe to Construct videos now
  • Send an email to licensehelp@scirra.com, they'll get it working for you.

  • Yeah, I'm just playin'. XD

    Edit: Uhh... it's like 97% done. Like it was in January. -_-

  • I'd put Loot-Pursuit here too, it has pretty good graphics,

    <img src="http://www.amirai.net/forums/Renaevictory.png" border="0" />

    not great

    <img src="http://www.amirai.net/forums/Renaesad.png" border="0" />

    .. but it has a good style going!

    <img src="http://www.amirai.net/forums/Renaevictory.png" border="0" />

  • > FSM (finite state machine) architecture could be implemented in plugin. behavior would be better, I think, because it would allow you to have many objects in different states simultaneously.

    That's still possible with a variable, as each instance of an object can have a different value for the same variable.

    I call functions a "custom action" (they're synonymous right?).

    Close enough. Functions are entire event structures containing events, conditions, actions, groups, comments that get called as an action. So it works like this:

    Event one:

    Misc conditions

         - misc actions - place sprite somewhere, etc.

         - call function "function name"

         - other actions

    Event two:

    On function "function name" (this is a condition)

    Other condition, such as is sprite visible

         - actions, sub events, etc.

    As construct runs through the actions of event one, when it gets to the action 'call function "function name"' it puts event one on hold and immediately jumps to running event two. When it completes the event structure there, it goes back to event one and runs the rest of the actions there after the 'call function "function name"' condition. After finishing event one, it skips event two, because that only runs when then function is called.

    Why not apply the same thought to conditions? You can bundle a complex condition in a "custom condition".

    It does seem like it would be potentially useful to people. I'm not sure if I would use it though, as it seems like an extra thing I would have to keep track of and remember what it did while reading code.

    > Hmm... Instance variable groups?now what? That's actually better than what I proposed. As long as you could collapse the groups (both in the code editor and the layout editor), this should work fine.

    I like that idea too, as long as typing a variable name would search inside all of the variable folders the same way typing an object name does. Having a ton of variables on an object can make it take longer to find the one you're looking for sometimes.

  • rexrainbow - yeah, there was a finite state machine plugin for CC, but personally I find a simple variable easier to use. Each to their own, though.

  • > What was an issue was my inexperience designing code properly, which is how it turned into a tangled mess.

    My point is that everything that's complicated enough soon gets turned into a tangled mess.

    I guess we'll just have to agree to disagree here then. I'm not sure I communicated it properly, but since learning how to design code properly, I don't find things turning into a tangled mess anymore.

    The problem with that is that you have little reusability. For instance, this "If distance(enemy.x, enemy.y, player.x, player.y) < 100" could be compacted to a custom condition called "is within attacking range?" - you'll obviously need to repeat that all over your code.

    You also have similar cases, such as "is within field of view" and "no obstacles between me and player" which could be abstracted away.

    I'm not sure how that would benefit in this example, as a custom condition called "is within attacking range" would actually be more complex than a condition "If distance(enemy.x, enemy.y, player.x, player.y) < 100" as the definition of the custom condition would need to be defined somewhere else, and it would still be one condition.

    For more complex situations though, having a custom condition that has multiple conditions defined elsewhere could be handy I suppose, but personally I think it would actually be often harder to follow then just having the conditions laid out there instead. That's a matter of personal preference tho.

    Except when you're referring to instances such as:

    Similarly, if you have more than one condition that triggers "chasing code" or "pathfinding", you'll need to copy+paste the chasing/pathfinding code again at those positions, violating the "DON'T REPEAT YOURSELF" principle of software design - either that or you make a huge OR block with all the possible conditions that trigger pathfinding/chasing.

    That's what functions are for, which are in CC but not officially in C2 yet (there is a third party plug in). That basically takes the place of custom actions as well. Basically they allow you to run another event inside an action list or expression.

    The point about hidden variables is that I don't want to clutter the editor with tweakable properties (public variables), which are things I need to adjust to balance/polish my game, with internal stuff (private variables) which are just small storage bins that allow the object to do its work.

    You can edit/rename/delete/make public those hidden (private) variables, of course, it's just that they're hidden out of view in your normal workflow, similar to how you can lock a background object in the layout editor so that you can click your objects easily.

    Hmm... Instance variable groups?

    I wasn't very clear there - although you can encapsulate the "kamikaze attack" in a group, you can't say "there you go, enemy! time to do your kamikaze attack!!!"

    You can't do that without using weird workarounds like "is group active?" and "disable/enable group". It feels like a hack.

    Maybe I'm communicating wrong, because I don't have to use "is group active" or enable or disable groups using my example. I leave the groups all active and the instance switches between groups on its own based on the 'mode' variable. The code to define a behavior is going to have to be somewhere - in my example it's in the "attacking" group.

    It sounds like what you want are custom behaviors defined by events? Which are an awesome idea which has been mentioned before, and I'm hoping they are on the to do list. :)

    I know you didn't ask, but I'll give an example: I could have a sprite representing the turret body, another representing the beam (I'm thinking of a beam cannon), a particle object, a post-processing layer, and then have a big spaceship composed of other stuff, with multiple beam cannons across its surface. (the spaceship on the whole is a container composed of the hull, shields, hp bar, and then multiple copies of the "beam cannon" container).

    Yeah, you can do that stuff already, though it's not the simplest thing.

    On spaceship created

         for "loop" 1 to 10

              Create turret

              set turret.turretnumber to loopindex

              set turret.spaceshipid to spaceship.uid

    For each spaceship

         If turret.spaceshipid=spaceship.uid

              Place turret at spaceship action point turret.turretnumber

    For each laser

         if turret.uid=laser.turretid

              Place laser at turret

    I'm thinking specifically of the Factory Pattern and the Strategy Pattern

    I expect custom aces should make design patterns implementable.

    At least for one of those links, I think functions are what you want.

  • The standard way to implement AI in games is via a finite state machine. The example I mentioned is akin to one "state" of that machine (enemy). Things get a lot more complex when you have more states, and more complex behaviors. Sure, you can implement everything via events, but you can't easily go and change things once they're in place, and cascading states is also a lot more complex. Imagine your "power level" variable, now imagine 70 other variables like that, each used in a different context, by an enemy that already has to track things like distance to the player, current hp, current mp, max hp, max mp, list of available attacks, movement possibilities and tons of other stuff.

    I don't know, I've coded things using finite state machines in events before, and had no problem with it. The enemies in loot pursuit have 79 variables and the number of variables they have has never really been an issue that I can recall. What was an issue was my inexperience designing code properly, which is how it turned into a tangled mess. ^^ Subsequent designs have been much smoother.

    I do something like this:

    enemies

         wandering

              If enemy variable 'mode'="wandering"

                   Code for wandering about randomly

                   If distance(enemy.x, enemy.y, player.x, player.y) < 500, check angle for field of view

                        If player variable 'powerlevel' > enemy.powerlevel

                             set enemy.mode to "running"

                        If player variable 'powerlevel' < enemy.powerlevel

                             set enemy.mode to "chasing"

         chasing

              If enemy variable 'mode'="chasing"

                   chasing code, pathfinding, etc

                   If distance(enemy.x, enemy.y, player.x, player.y) < 100, no obstacle in way

                        set mode to "attacking"

         attacking

              If enemy variable 'mode'="attacking"

                   Code for charging towards player

                   If enemy overlaps player

                        Set player variable 'mode' to "hit"

    Which collapses to:

    enemies

         wandering

         chasing

         attacking

    Etc. Using this method I can make behaviors as complex as I want and still find it easy to work with.

    It quickly gets confusing, especially since we have no concept of "internal" variables - that is, variables that are specific to an instance, but that shouldn't be displayed in the editor, because they are used internally. A reload timer is a perfect example of this: you have the reload delay, which is a property of the object, and you have the reload counter, which the object uses internally to implement the reloading - you shouldn't see that second variable because you'll never want to mess with it in the editor.

    I'm afraid I'm not familiar with the term (even after several minutes of googling), and don't understand. What if you change your mind about what you want the value to be, or edit out that feature using that variable entirely, or change the variable name to something else? The variable has to be editable somewhere. Why not simply have it in the same list? It seems the most logical place for it. I think doing it some other way would be highly confusing.

    Wouldn't it be easier to code everything up in blocks and call those blocks something meaningful? I.E: this section means "run away from player", this section means "kamikaze attack", this other section means "try to ambush the player", and this one "flank the player" or "gang up on the player", and so on - if we had custom ACEs we'd be able to do that.

    Isn't that exactly what groups are? That's how it works the way I do it with my example above. Though I'm not arguing against custom ACEs, those would be awesome too.

    I hope containers can include other containers, and those sub-containers can contain other sub-containers, and that we can mix objects in those containers (not hard to imagine such a situation: think of a tank with a body and a turret [2 sprites], a buffer for dead reckoning in multiplayer [array object], player name [text object], post-processing layer [canvas object], health bar [another sprite] and effects [particle object]), and that we can dynamically include and exclude objects from containers.

    At least in construct classic, containers cannot include other containers (which is a great idea), but all the rest of what you said as possible regardless (dynamic ones could be created with the pairer object), having a tank with the two piece turret, etc. It works better if the health bar isn't part of the container though - all you need to do is create an instance of that for each instance of the tank, place it to the tank's position and set it to the tank's hp and it'll automatically place itself to the right instance.

    > Design patterns? I'm not quite sure what you mean by that?

    Code reusability is the capacity to reuse elements of an engine. How many times did you have to code a platforming engine? Wouldn't it be a lot better if we could just design one with all sorts of fancy stuff like double jumping, wall jumping, jetpacks, powerups and whatever, then plug a game in it and tweak the values by enabling/disabling parts of the engine, or perhaps sharing such engine in the forums? It's doable now, but what if you have to work such engine into an already in-progress game, instead of building a game from scratch on top of an engine? This process should be easier.

    I know what code reuseability is, that... wasn't what I asked. I asked about design patterns. ^^

Arima's avatar

Arima

Member since 11 Jun, 2007

None one is following Arima yet!

Connect with Arima

Trophy Case

  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Email Verified

Progress

19/44
How to earn trophies