b10b

Members
  • Content Count

    558
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by b10b

  1. Yes, told you it was going to be fun This is getting a bit out of my comfort zone ... our approach was using Nginx as the load balancer (with sticky sessions). PM2 approach works fine with this - with each NodeJS application instance running the service on a sequential port and sharing data between them with either a DB or Redis. The Nginx maps inbound requests to each server via internal-IP, and each instance via the port. So let's say 2 servers x 4 core = 8 instances with 8 ports. New user comes to IP:80, Nginx routes them to one of those 8, and remembers which one (so that Websockets can persist). Nginx configuration determines whether inbounds are round-robined or more elaborately determined - it's doing all the smart stuff automagically. It's certainly been solved before, so it's a matter of implementation rather than invention.
  2. From the NodeJS documentation: That is, setInterval can only "try" to call in the prescribed time. If it's blocked, then the time elapsed will overrun. Game updates can be heavy and so can easily create blocking scenarios, even at 30 FPS. I don't want to provide code because I'm not yet sure I like the use of setInterval for this purpose? I'd instead suggest reading this and properly exploring all the options: https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/ Plus getting a good understanding of delta-time (in respect to game updates) will be a valuable foundation: https://en.wikipedia.org/wiki/Delta_timing
  3. What do you want your IAP service to do? Just collect money and issue a token? If so, because we're talking "web games", that's just regular "e-commerce" not "IAP"! There's no vendor walled-garden here. PayPal will work, there's no need to share your revenue with anyone else. Don't like PayPal? How about Google Pay, Stripe, or any of the other dozens of payment processors? If you want your payment platform to also provide an audience, community, achievements etc then try Kongregate or FB IG and share some of your revenue for the value they add. Maybe because they're in the business of high-volume-churn associated with low-value eCPM? Rather than the high-quality, high-retention user-experience needed for successful premium purchases? Different horses for different courses.
  4. Cool, we have some HTML5 games available for license, partnerships or customisations: https://b10b.com
  5. With NodeJS there are several ways to benefit from multiple cores, or other process distribution. My preference is usually "PM2". Then within your application design you will need to engineer how each instance defines and manages its own responsibilities - e.g. which games it is managing, what happens if that instance fails, and so on. https://pm2.keymetrics.io/ You may also wish to reconsider using setInterval as a reliable thresholded tick? An alternative might be to loop faster than desired, measure the cumulative deltaTime within the loop, and if greater than the minimum tick then run the respective game updates (passing the deltaTime forwards), and resetting the cumulative deltaTime. Additional checks for unacceptably slow deltaTimes can trigger other strategies - such as passing responsibilities to other instances, or spinning up more instances etc. Many challenges lay ahead in this topic - enjoy the journey!
  6. b10b

    Which implementation?

    How about using factor-of-two multipliers? Spells can upgrade at their own rate, likely linearly. Staffs multiply the value. An upgraded Staff is x2 the power of the previous Staff. The primary benefit is that getting a new staff is likely the most significant upgrade, and reaches across all the Spells / upgrades in an obvious way (i.e. the Player knows what they want to achieve and what happens when they achieve it). The secondary benefit is that it'll make testing and progression-design easier as there are more discrete "phases" of power. The approach can also be applied to multiple Weapons. For example Staff multiplies Healing spells, Armor multiplies Defence spells, Sword multiplies Attack spells and so on. But probably only do that if the game is leaning towards mid-core rather than casual?
  7. There are some extra workflow benefits of using an atlas. These might be more tangible than modern marginal blitting performance gains? Separates concerns between what is a production asset (e.g. the raw png) and what is a build asset (e.g. a pngquanted atlas png representing a collection of production assets) Reduces file volume, repository overheads and other potentially slow directory-listing-style issues (these can be painful when dealing with thousands, or tens of thousands of frames) Can be faster to export from animation tooling, and easier to manage in code for technical animation (if using name based states and frame counts) Represents a standard of sorts, which can allows animation artists and QA to test animations in other environments or applications independent to a game which may be work-in-progress Reduces runtime network calls which can significantly improve loading performance for players (and therefore retention) Can significantly reduce runtime-memory by using best-fit heuristics (e.g. removing most of the blank spaces around individual frames, or de-duplicating frames) - which can improve runtime performance dramatically if memory is otherwise exhausted These can add up to sizeable development and runtime performance gains. Drawback is that there's an extra step in the workflow, and potentially another license dependency / fee. There are some capable free tool options, and the commercial tools are usually worth their price. For our games we don't atlas "everything", and there's plenty of reasons why balance and case-by-case decision is important. But we do favour atlases for animation collections.
  8. Free might seem best to some, but I wouldn't presume any unfair intent? Ultimately the portals are in the same boat as the gamedevs: limited revenue from a diminishing eCPM. They have the slight advantage in that they aren't producing the games so have more options from where they source them. But if their imagination for sourcing only extends to syndication services containing "free" revenue-split-in-game-ad-based-games then it's fair to assume that the Player experience will be unremarkable on that portal. Instead look to publishers with more imaginative revenue streams and player experience goals ... or adopt that commercial role for yourself.
  9. A couple hundred bucks a month? For sure. That revenue represents a couple hundred thousand plays (which is quite viable with a small collection of quality games). Yes, we achieve that, and more. Worth it? Not so sure. In 2019 ~$1 eCPM seems to be the web-game normal these days (and trending downwards?) which likely demonstrates that in-game ads are becoming worthless to an advertiser. It's important to take a moment and pause ... perhaps even say this aloud to let the reality hit ... "I've created and shipped a game that has been played one thousand times. I have earned $1. With luck on my side I will collect that $1 within the next ninety days.". Cool!? Also let's follow the money and consider the other side of the coin. From an advertiser's perspective $1 eCPM isn't a bargain, it's probably junk - possibly needing millions of impressions to create a meaningful engagement (i.e a sale). The only consistent winner is the broker, they can trade low eCPM and make their rake at volume. Fortunately advertisers are quickly wise to weak inventory and can move their placements to new supply very quickly (often automatically). Unfortunately games cannot attract new demand so fast (the proposition is narrower), so end up outbidding one another over a tiny pool of all online advertising channels (again often automatically).
  10. @espace Your code returns the correct "1" for me (Chrome v77 desktop). Perhaps this is implemented inconsistently across engines? If so try filtering the array and removing the nulls before the Math.min: var min=Math.min(...arr.filter(v=>v!=null)) A more optimal solution might be needed if your array is large?
  11. Suggestion: include an exe in the github releases. I understand you feel strongly about the subject and thank you for a free tool. Similarly I think TexturePacker serves a particular audience well, and it's perfectly ok to expect compensation / payment when value is delivered.
  12. Without detail I can't offer anything but generic suggestions. FB "banning" stuff is usually because of a breach of rules, or similar claims. Yes it'll feel unfair ... but there is no entitlement to profiteer from FB's audience. How is your quiz "Viral" if it has very low players? Dwindling audience is always due to a "viral coefficient" of less than 1 - rise to that challenge and FB is a great place to be (use shareAsync() to provide relevant and fun messaging, and bots to re-engage smartly). Also remember - new privacy constraints are imposed regularly, and competition mounts daily - so legacy successes always had an easier ride to market share.
  13. Yes, you're right - I'd forgotten about that (recent) extra "requirement"! Thanks for your compliment and good luck to you, whichever platform you end up on.
  14. @128p yes opt-in for iOS seems like a reasonable option, especially initially. I'd imagine from FB's perspective they'd prefer to present their blue app as a consistent platform / experience that transcends device? E.g. it'd be a bit odd if some features were available everywhere except when the user picks up their iPhone? Plus politics ... Apple sure like their rake, so given the lack of opt-out this is an unsurprising (if frustrating) requirement. Questions to consider are ... how are you imagining monetizing your game, and how does FB help you do that in ways that can't be achieved by going to individual platforms directly? The $100 gift to Apple probably shouldn't be the barrier.
  15. That's cool, the benefits of having typed resource addresses include avoiding typos and ensuring required assets exist. In Haxe we do similar with a Macro that directly reads the assets folder (so there's no need for additional tooling or generating a static list). I do miss those macros when working with other languages so its great to see alternative approaches.
  16. b10b

    Alexa and HTML 5 Games

    Likewise I've signed up, thanks for the link @mentuat. @Chelsea looking forward to discovering more about your work on Alexa and Amazon 2.0.
  17. Sounds cool. Why not use the gamepad API? https://html5gamepad.com/for-developers Perhaps map this to your key input manager (if you have one) so that it runs optionally alongside keyboard inputs.
  18. b10b

    Rotation values

    Fair question. I'm not actually sure of the philosophical truth about 2D representations of rotations >2Pi? But from a pragmattic gamedev perspective I often want to know full rotations. Or rather I like to know whether a rotated value has rotated "more" than a previous one. In other words, I expect that when incrementing a value the result goes up (rather than potentially going down). And vice-versa for decrements. Fortunately modulo to 2Pi for resolving back to the expected range doesn't seem expensive these days? That being said I avoid relying on the rendering-engine to "own" such model data (for non-rendering purposes) and prefer to use a little helper class to answer such comparisons. I also avoid Radians (and Degrees), but that's off topic. So ... maybe you're right and ranges beyond 2Pi have no value (to me) in a rendering library?
  19. b10b

    MTB Hero

    Excellent "expert" time - you've definitely got the hang of it!
  20. I'm currently scoping a high-retention idle / incremental game-engine for some client work, and imo the above list doesn't scratch the surface of a game like "Adventure Capitalist". Pixi and UI design aside there are multiple core game systems to consider, and only a few are genuinely trivial. Perhaps these are the "enhancements" you wish to personally expand later, but you may do better to include more in the initial design and foundation? Also consider the requirement to "test" the game economy without exhaustively playing ... i.e. lots of statistical analysis on where the overlaps of upgrades, ranks and yields occur (much of the game design for a successful idler will be from a spreadsheet).
  21. b10b

    MTB Hero

    Yes, quite different to the car games and "expert" mode is hard-by-design (just out of reach until perfection). Jumps ... well .. irl I don't jump. Any more. Still hurts. So that might influence some artisitc direction? It's a very valid point though and jumping would be a cool feature - I just haven't figured it out. Help me out, how should this work exactly? Jump initiated as a scenery-item or as a user-input (considering single-touch)? Make gates jumpable without penalty? Swap some gates to jump sections instead? Left-right moveable in the air?
  22. @coderontheroad Thanks for the code. I see only that you are randomising the start position, and rejecting such positions where another car overlaps it. I don't see anything about movement, or any heuristic that considers whether a lane is open to the player either side of their current lane? Usage of Prime Numbers for movement speed ratios would negate the need to randomise the starting Y or to check for overlaps. Yes both the cars (and the player's opportunity to move) are not strictly confined to integers so some creative interpretation of this theory is needed - but the underlying quantizing will be good-enough to make the chances of an open lane (or imminent open lane) a higher probability than using random alone. Or at least that's my "theoretical idea" ... In simpler words, don't randomise the start position, do use Prime based ratios between each lane's speed (e.g. 7, 11, 13, 17).
  23. @coderontheroad Yes, looks like the forum no longer allows uploads, so remote hosting them is the way forward. The image looks similar to what I imagined. Terms like procedural generation and heuristics are quite broad. Procedural Generation is where the creation details are determined by an underlying process. Heurists are where the system can self-improve - rarely are they perfect, but just good enough. To elaborate on a possible solution: Prime Numbers. E.g. if lane 1 moves at 7, lane 2 moves at 11, lane 3 moves at 13, lane 4 moves at 17 then the odds of them coinciding are considerably reduced. Ask any cicada! Change the example Primes to any other distinct Prime, and multiply all by any constant to arrive at the on-screen velocity.
  24. @coderontheroad the image didn't work but I think I understand the problem. If you are new in game development I'd encourage you to think about a general solution for creating patterns of "Entities" (such as cars on a road). Basically random is almost always a mistake; it's chaotic, untestable, poorly designed, cheap, nasty, and prone to unwinnable scenarios. It's not the "real" solution because it doesn't consider all the inputs. Instead begin to think of using smart "Factories" to create Entities ... The pattern of creation should be deterministic and regular, based upon a configuration and an elapsed state. For example a deck of cards is not random, it is shuffled (a seeded rearrangement) and then each card turned modifies the state in a pre-determined way. The dealer has the choice to either arrange the deck in such a way that desired interplay occurs (procedural-generation aka "cheating"), or automatically reshuffle when non-desirable interplays are detected (simulation and heuristics). In the 4-lane road game scenario a procedural-generation approach might involve the use of prime numbers to ensure gaps between vehicles occur. Or a heuristic approach might run the sequence in simulation (prior to the level starting) and remove any 3 lane overlaps. A very simple old-school alternative is to have a fixed dataset, and to use that exact same sequence of cars for that level every time - if the playtester can complete the level then the data is acceptable because it will be replicable for other players. All that being said the most commonly used solution is to introduce a new game mechanic that sweeps an existing issue under the carpet. Or "that's not a bug it's a feature". Who said games should be fair?