Robsta's Recent Forum Activity

  • Just wondering if anyone else had ideas, preferably ones that didn't require a what is effectively a manual rewrite of part of the multiplayer object.

  • Well, as the asteroids example shows, you can do a lot in 100 events if you use them well, but number of events doesn't necessarily mean efficiency.

    I've written quite a few games that use over 100 events, because they're more complicated then asteroids.

  • Functions and arrays is what I use a lot of because I come from a programming background, and I used a ton of functions and arrays in code.

    I would keep ATT and DEF as instance variables since you're likely going to have different ATT/DEF for every player/enemy.

    Having the abilities in an array is better because that way you can give the same ability to multiple people and reference it. (And it packages the ability's variables together quite nicely.)

    I'm glad my post was helpful.

  • Well, construct does allow you to do math in most(all?) variable changes, so how I would do it is:

    Stats associated with each player/enemy (HP, ATT, and DEF)

    Stats associated with each ability (POWER, Anything else needed (maybe cooldown, mana cost, w/e) -> This could be organized in an array.

    Then when you detect the collision, I would probably call a function "Damage Enemy" with the parameters EnemyID, ATT and POWER

    In this function, you pick the correct enemy and run an event such as

    Enemy -> Subtract from instance variable "HP" -> Amount = ATT * POWER / Enemy.DEF

    Then make a sub event checking (if Enemy.HP <= 0)

    Enemy -> Destroy

    You can also add other things into this function such as creating floating text displaying the damage dealt or sound effects for the enemy being hit.

  • For additional precision you could use

    "string" = "0"

    or

    int("string") != 0.

  • In ghost shooter, when a ghost is destroyed, a the monster sprite is removed and a explosion sprite is created where it dies. What you want to do is when the ghost is destroyed, create a textbox where it dies. This is done in event 5 of the tutorial version of ghost shooter. You need to create a textbox and add the fade behavour to it. Then change the event.

    The event currently looks like this:

    Condition:

    Monster -> health <= 0

    Actions:

    Monster -> Destroy

    Monster -> Spawn "explosion" on lair "main" (image point 0)

    Explosion -> Set angle to "random(360)" degrees

    System -> Add "Monster.Movement.Speed" to Score

    You want the event to look more like this:

    Condition:

    Monster -> health <= 0

    Actions:

    Monster -> Destroy

    Monster -> Spawn "Diabetes Text" on lair "main" (image point 0)

    Diabetes Text -> Set text to "Diabetes is a group of diseases in which there are high blood sugar levels."

    System -> Add "Monster.Movement.Speed" to Score

    You may also want to create a dictionary or array of text about diabetes and set the diabetes text to a random message from it

  • troublesum I spent some time over looking over your code, and I see what you're doing. This is a much more hands on approach the the default multiplayer, and it works quite well in the example, but what you appear to be doing is circumventing a some of the functionality of the multiplayer plugin. Here's how:

    You're getting around the problems with desync compensation by just teleporting the object to the location it's supposed to be. While this does fix some of the problems I mentioned above (with the desync compensation leaving the player floating), it however can look jerky at times, especially since it only syncs position when the player stops moving (this includes at the top if they're jump!).

    You fix the problem of the player not seeing the correct events happen by letting the player decide where they are and send it to the host. I like this in that it's the player who needs to see what they're doing, in order to make informed decisions about what to do next. I don't like however, That this means the host doesn't have an accurate representation of where you are, and thus it's just transferring the problem from the player to the host. This might be fine in a cooperative game like I'm hoping to make, but I never would want to do it in a competitive game where this would make it possible to hack.

    It doesn't appear to do too well with lag. Sure no multiplayer options do too well with lag, but without a smooth desync compensation it looks to me to be just a little jerkier then the basic multiplayer plugin's sync option.

    So in conclusion, thank you for the example, I may take some ideas from it and implement it, for example I do like how you force-teleported without desync compensation sometimes, so I might use that. But I don't think I'll do this for everything in the game.

  • So I've been working on networking a platforming game, and I've seen some unusual behavior, specifically with how the the second player interacts with moving platforms.

    The server is perfect, it always gets everything right.

    On the client side the second player sways back and forth while on a moving platform that goes side to side. In extreme cases this can cause the player to fall off the platform on the client's side, but not on the server side, therefore causing a frantic desync interpolation fix fairly quickly.

    When on a platform that goes up and down it doesn't display jumping correct most of the time, and this can lead to the player jumping onto a platform on the server side, but not on the client side. The client side tries to fix this desync error by moving the player up, while gravity's pulling it down, so when the player's actually on a platform the client sees them self hovering below the platform.

    These problems increase if I "simulate lag" by a fair margin. These problems both sound like the moving platforms are not accounting for lag between the server and client, but as I'm using the platform behaviour, I do not know when to do lag compensation on the platforms to make the client and server sync up nicely.

    Here's a version of my .capx

    [attachment=0:360nubhk][/attachment:360nubhk]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Now that's the hard part, collision means the objects are overlapping, meanwhile you could check relative positions, that presumes that you'll never have any tunneling problems. (This will work if your frame rate is high and your player moves slowly). However, another way to check is by checking the player's velocity at the time of the collision.

    You could just try checking Player.Platform.MoveAngle > 180 (This should make it so that you can only break bricks while moving upwards).

  • The AI can be as simple or as complicated as you make it, but I find it likely that the best simple solution to use a checkpoint system, then 1 step better then that is to use it in combination with ray casting to make sure the cars don't run into any walls or potholes.

  • Yes, that's why I said it suggested that you just use sprites instead of a tilemap for the breakable tiles.

  • Yes, you'll find the option in the system conditions.

    Let's start with creating 3 global variables names i, j and k.

    Add event -> System -> Compare two values -> i * j = k

    or you could also do

    Add event -> System -> Compare Variable -> i = k/j

    Both these should return true as long as i = 2, j = 3 and k = 6.

    Or if you want to just take 2 globals and do pure math, try using an Action.

    Add action -> System -> Set Value -> k = i * j

Robsta's avatar

Robsta

Member since 17 Jan, 2014

None one is following Robsta yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies