jayderyu's Forum Posts

  • OK. My experience with NW.js is that you need to use the address the DHCP gives the computer. If your on a router then it's going to be 192.168.x.x or some such number. Using the address that the router is using won't work as that address is the router address. Then once you have the server running on the local internal address that it's assigned. You will need to do some port forwarding.

    I would also suggest avoiding port 80, a lot of ISP block hosting on port 80 although internal networks are still fine.

    "Error: listen EADDRNOTAVAIL" - Error ADDRess NOT AVAILable

    I get this error everytime when I use anything but the computer assigned address. This is why know that the address NWJS must use is the computer assigned address.

  • Are you using your external IP or the computers internal IP address?

    192.168.1.??

    or

    235.64.215.43 something like this

  • C2MP does not do cloud storage. How about using just saving your data on Googleplay since it's an online game anyways. Some games using multiple services to do stuff. 1 Connection to handle data, rooms, group chat, and then use another server for the action.

  • R0J0hound

    Thanks a lot. I am now understanding a lot more on SOL instance management than I did before. I got the system to work. Now I just need to finish the features. You R0ck

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, i'm still doing something wrong. Just as a quick reference to what I'm doing

    var items = {};
    
    AssociateObject Action
    items.type = type   from object in the action
    items.instances = type.getCurrentSol().instances;
    items.select_all = type.getCurrentSol().select_all;
    
    ReAssociate CND
    items.type.getCurrentSol().instances = items.instances;
    items.type.getCurrentSol().select_all = items.select_all;
    [/code:1vca2k9w]
    
    This is what I'm doing, and this is not working. I'm probably overthinking the problem and i'm being stupid and  missing something critcal.
  • R0J0hound

    Thanks for responding. I was kinda getting a little desperate on trying to get this to work. Sound simple and I'm going to try this out. However I could use some help on the follow up.

    What would be the best way to make sure I'm not trying to use dead objects when the game changes layout? The Plugin is Global single. Is there away to check if the object is destroyed on a layout change?

  • Gamepad controls are currently:

    Analog/d-pad - Cannon rotation/movement

    X - Shoot/Action (hold for charged shot)

    A - Jump

    Y - Enter/Exit vehicle

    B - Shield (also pulls in item drops)

    Left trigger - Speed boost powerup

    Right trigger - Brake

    Left shoulder - Weapon select (multiple selections)

    Right shoulder - Weapon cancel

    Start - Pause/map

    Yep. I agree.

    Rotation to the mouse

    Move to keyboard

    LMouse: Shoot/Action

    RMouse: Jump

    KeyDown(S/X): Brake... what would S do for vehicle controls except for brake? if it does something then X Q or E

    E or F: Enter Vehicle

    Scroll Wheel and/or 2/3: Weapon selection

    1/ScrollWheelClick: Weapon cancel

    Escape: Pause/Map

    Not a big problem with controls here.

  • Just a note. I have not solved this problem. Simply put. I just want to store the SOL list, and rebuild it later from the SDK.

  • It's not ok to have a PC game without Keyboard/Mouse option to play. I'm curious, could you do a table of your games input mapped to a controller. From a personal design point. I often start with the most minimal input viable for games ie NES like controls(D pad, A/B, Start, Select). And if I MUST use more then I will. I also aim for context sensitive input to reduce the the number of buttons used. If buttons are linked to a UI windows, then I may just lump them down to a UI button and say use a secondary dpad/analog radial pop up to show what to select.

  • Kali

    This is more applicable to the GPU rendering pipeline rather than canvas. A GPU can render images extremely quickly if the GPU does not need to change the texture in the GPU memory. We are talking about 10,000's of sprites being drawn in a insignificant amount of time. A GPU stores 1 texture in the render pipeline. That texture max size is always a power of 2 square. New GPU's store 4096x 4096, however the current target standard 2048x2048. so let's pretend 2048 is your GPU's limit for this discussion.

    (numbers are sample figures at this point because actual figures go into higher decimal points)

    If you can store 10 "sprite" images onto 1 texture. And the gpu can draw 10k pixel fill per drawcall. Let us also set it up that there are 10 types of bullet graphics that we cycle the colour through. All of them stores in one texture. When we shoot 10k bullets, and cycle through the colours that's 1k of each bullet graphic. And let's say it takes 0.0016 of a second to make one drawcall. That will allow you to have 10k bullets drawn at 60fps. As it's only doing 1 draw call and are figure ways it's ok to draw 10pixel draws per call

    ok. now let's say you make 10 sprite objects(I am talking about individual Sprite Objects, not Copy/Paste of of a single sprite object) 1 object per bullet type. The situation is the same. We are going shoot 10k bullets, cycle through creating a bullet so we will use each SpriteObject bullet 1k. Since each bullet graphic is on a different texture(details in a sec). This will force the GPU to have to swap the texture in ram for each bullet type and do another drawcall for that bullet type. So if it takes 0.0016 seconds for 1 draw call. that now takes 0.016. Which isn't 60fps anymore. it's 10 times longer. it's 10fps not 60fps.

    And what's worse is what if those bullets overlap each other. Then the GPU needs to swap again back to a re-used texture because it needs to draw over an image of another texture. This could lead to even far less fps. However if you pack all 10 bullets onto 1 texture, then the gpu can write over itself a ton of times without ever needing a new draw call.

    And to take advantage of drawcalls in c2. C2 packs images into textures based on Sprite Objects. So 2 different sprite Objects will be 2+ different textures. C2 will pack as many images in the frames and animations into a single texture of that Sprite as possible. However any images in a different SpriteObject will always garunteed be a different texture.

    So developers who use 1 SpriteObject per graphical UI element, enemy, environmental objects are killing their performance.

    tunepunk

    I doubt it would be a massive performance. In this suggestion it's more about development performance and organization. Write new features for large projects using ES is not optimal.

  • Optimization for a Unity game

    http://robotinvader.com/blog/?p=438

    I work in Unity at a game programming company. And even our "simple" core mechanics still get's micro optimization treatment.

    http://venturebeat.com/2015/07/17/pac-m ... on-mobile/

    Even unreal engine 4 has topics about optimization

    https://docs.unrealengine.com/latest/IN ... index.html

    C2 does a lot of optimization, but this doesn't mean optimization efforts shouldn't be worked on. As the first link shows a game that would barely run was made it to playable on old devices.

    Micro optimization 10 different areas does add up. but be prepared for a lot of work.

  • ThunderLion

    As others have suggested it's difficult to really say what you should be aiming for. However from experience here are a few tips as guidelines.

    1. Try to aim for CPU usage on a pc of 5% to 10%. This goes up the newer the minimal mobile hardware you are using. So iPad 3 and the most recent Android you could aim about 20% to 30%.

    2. Try to keep collisions to a few hundred. Even on PC there is little reason to go over a few hundred.

    3. Turn off object behaviour(collisions, movement...) when you don't need them. Such as when they are off the screen.(unless you need world simulation)

    4. Group Sprites images, layout images, Hud wisely. Don't make a ui where 1 image counts as 1 sprite. all Menu UI should be on 1 sprite object, all game UI on 1 sprite object. If you need ui elements on both. It's ok to have 1 sprite object that exists in both game layouts and menu layouts.

    5. Use Plugins more than Event Sheet. Try to keep ES code to just plugin interaction. If you need a feature, find a plugin or write one in the SDK as a plugin.

    6. Try to keep your active game memory to 150 or less.

    7. Constantly check you game on a device. If it's annoying. Check your game on the device after every new feature. If you add 5 new features and are finding performance problems. Only 1 of them might be the problem and you won't know which one.

    8. Fx/Shaders are a total hit and miss on mobile. There should be(but isn't) a list of what FX/Shaders will run on mobile effectively and others that kill performance.

    9. Ashley and I don't agree on optimization efforts. Maor at one point was told not to bother doing optimization. There was little he could do with enough performance impact. The game ran at 5fps(on mobile) and crashed. We sat down for 2 months going back and for over email and got the game running to 50fps+.

    10. Study a lot of graphic texturepacking. C2 does texture packing for you, but you need to understand the effects of texture packing has on hardware so you can best take advantage of C2 texture optimization.

  • Ok, I can use some help here in regards to the SOL system.

    I have a player based plugin i'm working on. the player plugin stores profile information and handles other stuff in the background. What I want to do however is associate an object type and instances to a player. And when the plugin triggers an event on the player, the associated objects are re-selected(without an event sheet condition).

    So the idea here is

    [EventSheet]PlayerSprite.CustomVarPlayerID is 1
    -- PlayerPlugin.AssosiateObject( ObjectType, Player )
    [/code:1yzxfxqy]
    
    ok so now a PlayerSprite is associated and stored in the PlayerPlugin. So when a condition occurs to trigger the PlayerPlugin I would like the event to build the SOL for the associate PlayerSprite
    
    [EventSheet]
    [code:1yzxfxqy]
    PlayerFooCondition
    -- PlayerSprite.DoSomeBehaviourThing
    [/code:1yzxfxqy]
    
    My thought was to get
    [code:1yzxfxqy]
    instanceProto.Acts.AssociateObjectToPlayer(object, id){
      player[id].solType = object;
      player[id].solMod = this.runtime.getCurrentEventStack().solModifiers
    }
    
    instanceProto.Cnds.PlayerDoesFoo( foo )
    {
      player[ cur_id ].solType.pushCopySol(  player[ cur_id ].solMod  );
    }
    [/code:1yzxfxqy]
    [li]All code is psuedo and the actual code does not reflect the above. The above is only the what I'm trying to do.
    
    However this doesn't seem to work. If this direction should work then I'm doing something wrong. I thought about storing the instances. However that has the problem on Layout changes. If the layout changes then I don't want to maintain the links in the Plugin associated object. I would rather the plugin fail finding the objects.
    
    Help getting this to work would be fantastic.
  • I've been thinking of tinkering with a Fighting game myself(Street Fighter/Smash Bros). And I thought about memory, loading times when it comes to layouts. Here is my suggestion.

    Each character is it's own Sprite. Each Character is then part of a Family. That way play is handled by reference to Family, but you can specifically load the fighter and their image assets as needed.

  • I suggest creating a minimal sample CAPX of this. IE nothing but the elements required to duplicate the issue. Then submit a bug report.