caymanbruce

Members
  • Content count

    172
  • Joined

  • Last visited

  • Days Won

    1

caymanbruce last won the day on June 27

caymanbruce had the most liked content!

About caymanbruce

  • Rank
    Advanced Member
  1. A HTML5 Beginner, Guide Me Please

    Dont worry mate. I have built and launched a realtime multiplayer game from scratch using javascript but I still didn't get a job as a game developer. When you know you are there you are there. Sometimes it just takes time.
  2. About game hosting

    You can try a VPS. Just for $10 a month. But I doubt Node.js is suitable for the backend. Not just being speculating, I have developed a realtime multiplayer game with Node.js. I was aiming for 200 concurrent players. It works super smooth on my computer. But when I put it online it really upsets me. Have you tested the game running for a whole day, or a few days?
  3. I host it on VPS. I will never host it on a free space because I have to concern with the security of the source code. But I haven't shown it to the publisher though. I am also interested to find a sponsor though.
  4. Dom element vs PIXI.Text performance

    @themoonrat OK so using multiple text objects is inevitable. And if I want to have different colors for different rows it will be more complicated. In this case I guess using Dom element may be a good choice.
  5. Dom element vs PIXI.Text performance

    Does that mean I need to use multiple text objects if I need to align many lines? Here is a question I posted on stackoverflow.com. I am curious about how to achieve the same result with PIXI.Text object.
  6. Dom element vs PIXI.Text performance

    @themoonrat Thanks for the info. I don't have a lot of experience with PIXI.Text. But I still use PIXI.Text in other part of my game when I need the texts to animate a lot. Maybe PIXI.Text can have fancier looks but aligning the texts is not so easy. I just need a quick and neat way to display the texts which align left and right at the same corner of the screen and I find that using Dom element saves my time. And I only want the texts to stay on top of every thing. But I am happy PIXI.Text suits your case. I am curious about changing size of texts written in different languages to fit an area. As I need to put different languages into one display area, with PIXI.Text I try aligning the texts and padding left and right but always failed to do so. I may consider doing that in the future if this looks really nice. But I guess this requires a lot of tweaking.
  7. Dom element vs PIXI.Text performance

    In WebGL mode both methods give me 60FPS on my 5 years old laptop. But I am very happy with the html formatting. I hope PIXI.Text can do better formatting in the future though.
  8. Dom element vs PIXI.Text performance

    I want to display some simple dynamic texts on the screen of my game. The texts change every few seconds. There are two options for me. One is PIXI.Text, but I've read some discussion about performance issues rendering texts in PIXI. And I can't format the texts easily. The second reason kills it for me. So I am not very sure if this is a good idea. Another option is to use a dom element. This way it is easier for me to format the texts using html elements. But I am not sure about the performance to use it within a PIXI application too. Which one should I choose?
  9. Thanks that sums it up. How about mixed situation? Such as a MiniMap. I have read some discussion about writing MiniMap in Phaser using RenderTexture. I used to do that with simple sprite and container. A MiniMap has a lot of static objects, in the mean time it also shows local player movements in a constrained space. Let's make it simple so that I only use a dot to represent the local player. So there will be one moving sprite, but maybe hundreds of static sprites on the map. In this case, performance-wise, is it better to use a container or a RenderTexture?
  10. I am confused with the two main methods to animate objects in pixi.js. The first one is to build a sprite and put it in a PIXI.Container. I can then add this container as a child of the PIXI stage. Every tick of the animation I just need to update the sprite's position and PIXI will handle the rest for me. I can also build a sprite or a displayObject and create a RenderTexture which is about the same size of what I want to render. Then I use renderer.render(DisplayObject, RenderTexture); to render it on the screen. This works fine too. I still need to update the position on every tick so the displayObject will animate. But what is the difference between using a Container and a RenderTexture? There must be a reason we have two options to render something. What use cases are these two methods best fitted in?
  11. The container just jitters to left or right (I can't tell which direction as it happens too fast). Also if I want to place a PIXI.Text at the bottom left of the camera, I used to do it like this: this.textInfo.x = this.camera.x + 35; this.textInfo.y = this.camera.y + this.renderer.screen.height - 40; Then the camera position changes with the player. Camera is a plain object not a PIXI object here. But how can I do this using "toLocal" method? I do it like this: const pos = this.container.toLocal(new PIXI.Point(35, this.renderer.screen.height - 40)); this.textInfo.position.set(pos.x, pos.y); But it creates a new PIXI.Point on every update which is not optimized. Any better solution? One other thing I notice is that using toLocal for all the positions in animation makes my game look less smooth. Not sure if it is because I coded it incorrectly
  12. i want to zoom to player position using pixi features. According to this comment. A camera is as easy as setting container pivot point to user position and move the container position to the canvas center. How about do a little more and zoom to the user position and make it look natural? I am currently using this const scaleDelta = -0.1; const offsetX = - (user.x * scaleDelta); const offsetY = - (user.y * scaleDelta); const currentScale = container.scale.x; let nScale = currentScale + scaleDelta; container.position.x += offsetX; container.position.y += offsetY; container.scale.set(nScale); This works when I am not using a camera, but looks jumpy when I add a camera. What is the solution with a camera?
  13. How to cull objects out of camera view?

    i think viewport means the camera object you mentioned in your question.
  14. I am stuck in low FPS.

    thanks i havent looked into this optimization before. i dont have enough time to rewind back to pure canvas2D APIs for now. Do you mean i can still do the optimization with PIXI using canvasRenderer? If so i am a bit released. Otherwise i might need to switch to webGL and rewrite it with Canvas2D later when I feel necessary.
  15. I am stuck in low FPS.

    Ah that'll be a long battle. When I began my project I started with Canvas2D but after a few months of struggling I found PIXI. Now I thought I am so close to finishing my game but I have to rewind back.