Fimbul's Recent Forum Activity

  • At this point, you're better off doing the tutorials than asking around in the forums.

  • You seem to already have the answer - just check if the distance between the coordinate you want to check and the center of the object is smaller than the circle radius - if it is, there's a collision.

    if you want to check between two circles, the process should be very similar, and extremely simple as well: the distance between the objects should be less than the sum of their respective radii for a collision to happen.

    If you need something else, try this:

    Collision detection and reaction

    it's made for AS3, but one with your knowledge level should be able to port the code easily :)

  • think it's possible to send the OGG/MP3 stream over TCP to make a sort of voice chat?

  • I'd advise you to move away from Heroku, not because it's bad or anything, but because they'll offer you many things you won't use/need, and you'll still have to pay the price.

    If you *MUST* work with heroku, I'd advise you to pick PHP hosting, since you won't have to change anything to host your game.

    Do keep in mind you'll be paying for PHP functionality even though you won't use it.

  • Cool!

    By the way, Ashley, any hints to when containers are coming?

  • 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.

    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" can think of more complex examples, I'm sure you could too...

    My reasoning is this: you said that you don't want to repeat actions, and bundling them in functions would be the way to go. I call functions a "custom action" (they're synonymous right?).

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

    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.

    Maybe I'm communicating wrong, because I don't have to use "is group active" or enable or disable groups using my exampleah, I'm the one communicating wrong, I understood your example... I just meant to explain how I'd go about doing custom actions with the current system.

    On a similar note, you can define custom conditions using boolean variables, but that feels like a hack as well.

    Yeah, you can do that stuff already, though it's not the simplest thing. follow your logic, but this feels like it would get really complicated really fast, especially if you had to come back to your project after a month. I'm really anxious for those containers!

  • 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.

    enemies

         wandering

         chasing

         attacking

    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.

    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.

    Violating the DRY principle is bad for obvious reasons.

    I'm afraid I'm not familiar with the term (even after several minutes of googling)

    I'm sorry about that part - they are known as variable visibility - there are public variables (what we have at the moment) and private/protected variables, which are related to inheritance (we can already do multiple inheritance via families, which is cool).

    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.

    It's weird having a ton of internal variables mixed with normal variables, and having to resort to prepending "__" or similar to internal stuff.

    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 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.

    At least in construct classic, containers cannot include other containers

    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).

    I asked about design patterns. ^^

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

    I expect custom aces should make design patterns implementable.

  • Don't get me wrong: I don't think construct should implement scripting, because I believe in the power of "eventing". However, construct "eventing" should be a bit more "object oriented".

    If you use lots of groups, sub-groups and sub-events well, I find it to be extremely organized, as an entire section of code can be described in a group name.

    In other words: we have something akin to "named code folding".

    You can actually do A.I. with events as they are, and it's not almost impossible at all. You could do what you described above by combining some of the player's character's stats into a 'power level' variable that could be compared to the enemy power level, and to fight or run depending.

    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.

    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.

    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.

    Containers are made for exactly that. :) They're not in C2 yet though.

    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.

    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.

    As for design patterns, you'll have to read more on that, there are a ton of them.

  • Well, Ashley, I think events are as powerful as coding, if not more. All drag'n'drop game making tools have this discussion at some point and the result is always more or less the same: there's nothing you can't do with eventing that you'd be able to do with coding.

    However, there are issues. Construct 2 isn't object oriented, for instance. There's no way to simplify coding, everything is always all over the place, it's like procedural programming all over again! We cannot make our custom ACEs with construct events, and that makes artificial intelligence in c2 games almost impossible - you can prototype the pieces, but you can't assemble them - it would be nice to have something like [if I have a shot at defeating the player] then [chase player], with all the complexities (that I coded myself) hidden away.

    In addition, object-oriented concepts such as an object composed of multiple sub-objects each with their responsibilities, code reusability, design patterns and other things feel very weird (and that's not just with construct).

    I think stuff like that has to change before "eventing" can be considered up to scratch.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Though a debugger is in ashley's todo list, so maybe in the future we'll have something like a breakpoint

  • well that's very interesting!

    Think you could bias certain terrain areas to create stuff like biomes and other terrain features?

  • While foreach ordered is nice, this proposal makes things a a lot easier, and it's cleaner too.

    A "set z-order" action and a "get z-order" expression would solve everything.

Fimbul's avatar

Fimbul

Member since 12 Aug, 2011

None one is following Fimbul yet!

Trophy Case

  • 13-Year Club
  • Email Verified

Progress

14/44
How to earn trophies