• Content count

  • Joined

  • Last visited

  • Days Won


feudalwars last won the day on May 17 2015

feudalwars had the most liked content!


About feudalwars

  • Rank
    Advanced Member

Contact Methods

  • Website URL

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

1,883 profile views
  1. [Phaser] Strike Tactics: free-to-play HTML5 RTS

    Hey sorry, I didn't see your reply until now. I do use the particle storm emitter but frankly i could have gotten the job done just as easily with the built-in vanilla Phaser emitter. The main advantage of PS is that it comes with tons of juicy examples to work from. Surprisingly, particles have never been a bottleneck for me. One thing you can do is to only emit particles when the object is in camera. Here's a look at my code which does the smoke and vapor trails (I don't think there is any other use of particle emitters in my game). Another thing I do is create an index of all the emitters I will need and re-use the same emitter the next time I need it. The rocketTrailEmitter global keeps a reference. Note that this function has default options which can be overriden by passing an options object. Hope it helps! function createSmokeTrail(rocket, uniqueEmitterKey, howOftenEmit, imageKey, blendMode, justOnce, emitX, emitY, options) { if (!enableEmitters) { return; } if (rocketTrailEmitter[uniqueEmitterKey] == undefined) { var lifespan = { min: 500, max: 1000 }; var scale = { min: 0.10, max: 0.30 }; var vx = { value: { min: -0.50, max: 0.50 }, control: [{ x: 0, y: 0 }, { x: 0.5, y: 1 }, { x: 1, y: 0 }] }; var vy = {}; if (options != undefined) { if (options.lifespan != undefined) { lifespan = options.lifespan; } if (options.scale != undefined) { scale = options.scale; } if (options.vx != undefined) { vx.value = options.vx; } if (options.vy != undefined) { vy = { value: options.vy, control: [{ x: 0, y: 0 }, { x: 0.5, y: 1 }, { x: 1, y: 0 }] } } } var effect = { image: 'bullets', blendMode: blendMode, lifespan: lifespan, scale: scale, vx: vx, vy: vy, alpha: { value: 1, control: [{ x: 0, y: 0 }, { x: 0.2, y: 1 }, { x: 1, y: 0 }] }, rotation: { value: { min: -180, max: 180 }, delta: { min: -5, max: 5 } }, frame: getFrameIndexFromAll(undefined, imageKey, false, game.cache._cache.image.bullets), }; manager.addData(uniqueEmitterKey, effect); } if (!justOnce) { rocketInterval(rocket, uniqueEmitterKey, howOftenEmit); } else { if (rocket == undefined) { // if (coordsInCamera(emitX, emitY)) { rocketTrailEmitter.emit(uniqueEmitterKey, emitX, emitY); // } } else { // if (coordsInCamera(rocket.x, rocket.y)) { rocketTrailEmitter.emit(uniqueEmitterKey, rocket.x, rocket.y); // } } } } function rocketInterval(rocket, uniqueEmitterKey, howOftenEmit) { rocket.rocketInt = setInterval(function() { if (rocket.alive == false || rocket == null || rocket == undefined || rocket.crashing) { window.clearInterval(rocket.rocketInt); return; } if (game.paused) { return; } if (rocket.inCamera && rocket.visible) { rocketTrailEmitter.emit(uniqueEmitterKey, rocket.x, rocket.y); } }, howOftenEmit); rocketInts.push(rocket.rocketInt); }
  2. Some of you all might remember Strike Tactics, the HTML5 RTS game. Well, I've made a spin-off in which you can control every Strike Tactics unit as a hero which levels up. Destroy the enemy command center to win. Enjoy! http://stba.io
  3. Just launched this week! Play free here: http://striketactics.net/play
  4. I have been unable to find good information as to the usefulness/practicality of the perMessageDeflate option/module. Suppose I have messages that are 1000 bites (the length of the text string), being sent out 10 times per second (every 100 ms), is compression worth it there? I have heard that perMessageDeflate can be a monster on CPU usage. I imagine it is not cost-effective if your messages are really small and infrequent. Anyway, does anyone have any idea what the threshold is? At what point in packet size and frequency (i.e. bandwidth) is using perMessageDeflate a smart idea?
  5. [OWN - Closed Alpha] Testers needed!

    Looks neat. nice jog Skeptron!
  6. Server-side Physics Advice

    Don't calculate physics on the server side, that is a recipe for disaster. Calculate physics on the client side - server should only be used for relaying and validating data between clients. It will be extremely difficult to hide lag if your clients are reliant upon the server for everything that happens in the game.
  7. Latency issues with Node JS game and VPS

    Yeah, if your game can't handle 20-30MS ping, you've gotta rewrite some things on the client side because 20-30MS is actually a best-case scenario. My game (Strike Tactics) is in beta and even 300+ ping will not be noticeable (got players in Germany playing players in US with no problem). Sure, it's not ideal and things aren't 100% where they should be at 300+ ping, but everything still looks the same. I've learned that the perception of perfectly mirrored simultaneous running environments is the only thing more important than actual perfectly mirrored simultaneous running environments. Also, each player is the authority of his/her units (it's an RTS game), so no matter what the ping is, the game objects which you are looking at most of the time will have zero movement lag (my networking layer is completely non-deterministic). I've not had a single person complain about lag. I'm the only one who can tell the difference between a 50MS latency game and a 300MS latency game, and that's because i know what things to look for. So the secret is interpolation and clever client-side networking code.
  8. Is Gamejolt useless

    Pretty much any website for promoting games is useless. Better to use all your time an energy on development of the game itself.
  9. What Raggar said will work - ping every server and have the player join the one with the lowest ping. It really doesn't need to be more complicated than that. If you want to get the actual location, you can do so from the IP address.
  10. Game getting only 40ish FPS on other computers?

    I realize that, which is why I qualified my post with "this is bad, don't do this." It's a dirty hack and introduces tons of problems. Believe me, I know!
  11. Game getting only 40ish FPS on other computers?

    It's more of a dirty hack than a recommended strategy :). I use a hack for now because it would require some rewrites to abstract the logic away from game loop update speed. In my RTS game (Strike Tactics), workers collect resources and move to drop resources off in silos. Seems simple, but what if the game framerate drips to 30, the worker is now moving at half speed and is much less efficient. And since I'm increasing the amount collected on every framerate (stupid, bad coding), that works against its collection speed as well. I also do a lot of complicated things with game.time.desiredFPS. Basically, constantly update desired FPS based on current framerate (how well the CPU is doing currently). This complicates things as well. It's kind of a mess right now, to be honest. But the end result after a lot of hacking is that resource collection rates are pretty much independent of framerate.
  12. Game getting only 40ish FPS on other computers?

    What i do is change my time-dependent constants based on FPS. e.g. if a constant is 5 @ 60FPS, and the FPS is 20, I will change the constant to 4 (20 divided by 5). Re: refresh rate affecting performance. Does not surprise me in the least. I have a computer which uses a giant 32-inch LED monitor with a monster graphics card that performs poorly, while my weak mac air with a crappy integrated GPU runs like a dream. I stopped trying to predict Phaser/webgl performance based on hardware a long time ago.
  13. Advanced Timing Plugin: FPS graph, meter, text

    Showing the webgl draw count ... you have no idea how long i've searched for a plugin or extension that does that.
  14. How to render a rectangle with color?

    Or just use a sprite with whatever color you want as an image texture. That would be the best from a performance point of view. If you create a graphics object, you're creating a whole new webgl call. Bitmap data would be even worse on performance than graphics as you're creating a whole new canvas object.