Centra's Forum Posts

  • I like your approach to handling the elevators by searching for the best option first (ie, an agent chooses the elevator which travels to both his current loc, and destination) Then the second choice if an elevator which travels nearest to the location and exiting.

    I would like to know how one might actually implement a Depth First Search algorithm in Construct 2?

  • I'm struggling with the implementation of a pathing system for agents who exist in a 2d building, where floors are only accessible via elevators which transport agents between floors.

    youtu.be/muiP9EZ2Cek Here is a YouTube clip to better illustrate what I mean by this.

    During the course of a play, floors and elevators may be built (and shafts expanded up and down), so the paths must be updated. In the image below, an agent on the 1st floor wishes to go 5th floor but there is no direct path. It must find a path using multiple elevators.

    Image: imgur.com/a/N9ef7Tc

    My approach thus far is to equip each agent with a stack which determines their actions via an Finite State Machine (states: idle, move, and performAction), the elevator cars also have a stack which receives movements based on agent needs, but it the whole thing lacks central planning.

    My question is how would others approach this problem? Some more savvy friends have suggested that it is a graph problem, but I'm not sure on how to technically implement something like that into Construct 2. As in how to implement a shortest path algorithm into an array containing the connected floors. Any insights would be helpful and greatly appreciated

    Edit: Realising now there is a C2 'How do I?.."

  • Thank you so much! Very cool

  • Hey, it's a nice inventory structure,

    I was led here by looking for stuff about arrays and level building, I thought your capx might be insightful but the link is down

  • I don't think this is the place, but I dislike and am not interested in C3 because of the choice to make it only work in the browser instead of stand alone desktop application. Is that how it will remain or is there any plan to make a desktop version?

  • Hello everyone,

    I'd like to setup a real time 24 hour day night cycle by taking the current time (from a 24 hr clock but maybe it's easier with a 12 hr clock) and syncing it with how dark/light the layout should be.

    I found an example of a day/night cycle using sine https://www.scirra.com/forum/day-to-night-cycle_t72435?start=20

    which I've used as a base (because I believe that's how F.Lux works) but I haven't been able to figure out how plug in my in game clock and have it work.

    I read in the manual that sine works in degrees, but I'm working with seconds and have no idea how to convert that into the Period of sine, if that's even what I should be doing...

  • How did you figure out clean path finding up/down stairs? Are you using the path finding behavior? I played with it but haven't come up with a good solution yet. I'm trying to figure something out for A.I. pathfinding in a lemmings style game

  • Hey! Thank you for your reply

    I've set up the php file and served it but I can't seem to get it to retrieve in Construct

    I'm wondering if it's because I'm running Construct locally

    link to screenshots

    http://imgur.com/a/jSITG

    I've split the event sheets so that a request is made before going to the new layout, and I removed the every 5 seconds update.

    Add an Ajax - On Completed event but still comes out to daynightOutput = NaN

  • Hello,

    I was wondering if it's possible to run a construct 2 build on a server where the system clock can be synced to the game clock.

    To illustrate, let's say the construct 2 build has a day night cycle synced to real time, so anyone who visits the server and plays the game will notice that the game is taking on the servers clock to set the day/night phase.

    I was looking into rex's timeline plugin https://rexrainbow.github.io/C2RexDoc/c2rexpluginsACE/plugin_rex_timeline.html

    but I am curious how others might go about this or if I'm on the right track?

  • Updated to include the mirror bug example

    Description:

    When loading from a save, mirrored objects do not hold their mirroring. This could be a symptom of the family spawning an extra instance if you observe the sprites in the bottom right, the arrows should always face the same direction. When loading from a save an extra instance of the 'head' will appear and maintain the correct mirror while the actual head (pinned to the body) will mirror incorrectly upon hitting a bounding edge (green line)

    Download:

    https://drive.google.com/open?id=0B0rmjtd4YynXc0NjTVBYUmdJRUE

    Construct 2 Version: r233 (64 bit)

  • Also it looks like sprite mirroring doesn't save and load properly

  • you use a lot of fancy terminology in this last post explaining your solution. I ran into a similar problem after trying to load a layout and in my case I'm picking UIDs because objects are connected in some way, like a head and a body. Would it be a viable work around if I did for example:

    Global var x = 0

    Parent on Created -> spawn child

    ->Parent - set instance var 'identifier' is x +1

    ->Child - set instance var 'identifier' is x +1

    -> set x to x +1

    where X is updated +1 after each spawn use so that it lets each family have a unique identifer that can be called when needed instead of by UID

  • Problem Description

    ____ A concise description of your problem here ____

    (Family) On created - spawn sprite2

    Save game. Change layout

    Load game.

    Two (family spawned) sprites (sprite2) exist where only one is expected.

    When a Family uses the spawn action and a layout is saved and then loaded, that action somehow is creating two instances of the object.

    The capx makes it very clear.

    Attach a Capx

    ____ Upload a Capx to this post ____

    https://drive.google.com/open?id=0B0rmj ... mtvNm9ZeW8

    Description of Capx

    ____ Concise description of what this CapX does ____

    User spawns an instance from a family, family instance spawns an object (sprite2), save layout, go to new layout, load save and return to the first, now the family instance has created two sprite2s. Expected only one.

    Steps to Reproduce Bug

    • Step 1 run in debug (or don't I added a textbox that shows object count)
    • Step 2 click create menu button
    • Step 3 click save button
    • Step 4 click next layout button
    • Step 5 click go back to first layout button

    Observed Result

    ____ What happens? ____

    There are two instances of sprite2

    Expected Result

    ____ What do you expect to happen? ____

    Only one instance of sprite2 should exist

    Affected Browsers

    • Chrome: YES
    • FireFox: YES
    • Internet explorer: YES Operating System and Service Pack ____ Your operating system and service pack ____ windows 10 Construct 2 Version ID ____ Exact version ID of Construct 2 you're using ____ Construct 2 - 233 (64 bit)
  • Short version: You can assign instance variables to objects themselves before they are created as an instance, which remain true when they are created. I used this to narrow down the random Family object creation.

    Long version: I was struggling with a need to create random object instances while also needing to limit what could be created from them. Specifically I wanted to create sprite people who could be either male or female but they were lumped into the same Family for easy spawning but I had no way to know which were male and which were was female (from event perspective) so I couldn't further more specific characteristics to them such as random female names, and random female names which corresponded to their appearance.

    It finally dawned on me that you can set the instance variable directly to the object and it holds that value on creation, thus I can create objects using the family, then check when they are created if it holds a male or female variable and assign further attributes accordingly.

    I hope this helps someone else out there, though it may be obvious looking back.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • While testing my current project I encounter this crash after about 10 mins of run time, fps drops significantly, Object count remains less than 200 and cpu usage hasn't been a good gauge, last time I observed the crash, debugger said cpu usage was around 30%, but normally while the games running it says around 70-80%. My assumption is that it's something a memory leak or bad code somewhere but I don't know how to decipher the crash report and thus where to start looking. Is there anyway to tell why/where the memory is being eaten?

    Maybe someone can tell me how to view function logs?

    I see from the shift + cntrl + k console log something like

    saved state to indexedb adding up storage space, any idea what causes it?

    update - I'm retarded and left an old piece of code to save the game state with no conditions, so it just constiniously saved

    Now I'm seeing [Construct 2] Function object: used 'Param' expression when not in a function call I wonder if it's normal function logging or an error involving one

    Crash report below

    It's obviously a memory related crash but debugger isn't giving me any clues as to why, it's not too many instances

    [quote:25nnoq7p]AdapterDeviceID: 0x0116

    AdapterDriverVersion: 8.15.10.2353

    AdapterSubsysID: 00000000

    AdapterVendorID: 0x8086

    Add-ons: %7B972ce4c6-7e08-4474-a285-3208198ce6fd%7D:44.0.2

    AvailablePageFile: 1344450560

    AvailablePhysicalMemory: 178819072

    AvailableVirtualMemory: 280121344

    BIOS_Manufacturer: INSYDE

    BlockedDllList:

    BreakpadReserveAddress: 45023232

    BreakpadReserveSize: 67108864

    BuildID: 20160210153822

    CrashTime: 1457221840

    EMCheckCompatibility: true

    FramePoisonBase: 00000000f0de0000

    FramePoisonSize: 65536

    IPCFatalErrorMsg: Error deserializing 'length' (uint32_t) of 'IndexUpdateInfo[]'

    IPCFatalErrorProtocol: PBackgroundIDBTransactionParent

    InstallTime: 1455449974

    JSOutOfMemory: Reported

    MozCrashReason: MOZ_CRASH(IPC FatalError in the parent process!)

    Notes: AdapterVendorID: 0x8086, AdapterDeviceID: 0x0116, AdapterSubsysID: 00000000, AdapterDriverVersion: 8.15.10.2353

    D3D11 Layers? D3D11 Layers+ WebGL? EGL? EGL+ GL Context? GL Context+ WebGL+

    ProductID: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}

    ProductName: Firefox

    ReleaseChannel: release

    SafeMode: 0

    SecondsSinceLastCrash: 99735

    StartupTime: 1457220646

    SystemMemoryUsePercentage: 94

    TelemetryEnvironment: {"build":{"applicationId":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","applicationName":"Firefox","architecture":"x86","buildId":"20160210153822","version":"44.0.2","vendor":"Mozilla","platformVersion":"44.0.2","xpcomAbi":"x86-msvc","hotfixVersion":"20160128.01"},"partner":{"distributionId":null,"distributionVersion":null,"partnerId":null,"distributor":null,"distributorChannel":null,"partnerNames":[]},"system":{"memoryMB":3020,"virtualMaxMB":4096,"cpu":{"count":4,"cores":2,"vendor":"GenuineIntel","family":6,"model":42,"stepping":7,"l2cacheKB":256,"l3cacheKB":3072,"speedMHz":2095,"extensions":["hasMMX","hasSSE","hasSSE2","hasSSE3","hasSSSE3","hasSSE4_1","hasSSE4_2"]},"os":{"name":"Windows_NT","version":"6.1","locale":"en-US","servicePackMajor":1,"servicePackMinor":0,"installYear":2011},"hdd":{"profile":{"model":"TOSHIBA MK3275GSX","revision":"GT00"},"binary":{"model":"TOSHIBA MK3275GSX","revision":"GT00"},"system":{"model":"TOSHIBA MK3275GSX","revision":"GT00"}},"gfx":{"D2DEnabled":false,"DWriteEnabled":false,"adapters":[{"description":"Intel(R) HD Graphics Family","vendorID":"0x8086","deviceID":"0x0116","subsysID":"00000000","RAM":null,"driver":"igdumd64 igd10umd64 igd10umd64 igdumdx32 igd10umd32 igd10umd32","driverVersion":"8.15.10.2353","driverDate":"4-4-2011","GPUActive":true}],"monitors":[{"screenWidth":1366,"screenHeight":768,"refreshRate":60,"pseudoDisplay":false}],"features":{"compositor":"d3d11","d3d11":{"status":"available","version":41216,"warp":false,"textureSharing":true,"blacklisted":false},"d2d":{"status":"blacklisted","version":"1.0"}}},"isWow64":true},"settings":{"blocklistEnabled":true,"e10sEnabled":false,"telemetryEnabled":false,"isInOptoutSample":false,"locale":"en-US","update":{"channel":"release","enabled":true,"autoDownload":true},"userPrefs":{"browser.cache.disk.capacity":358400,"browser.newtabpage.enhanced":true,"browser.shell.checkDefaultBrowser":false,"browser.startup.homepage":"<user-set>","browser.startup.page":3},"addonCompatibilityCheckEnabled":true,"isDefaultBrowser":true},"profile":{"creationDate":15598},"addons":{"activeAddons":{},"theme":{"id":"{972ce4c6-7e08-4474-a285-3208198ce6fd}","blocklisted":false,"description":"The default theme.","name":"Default","userDisabled":false,"appDisabled":false,"version":"44.0.2","scope":4,"foreignInstall":false,"hasBinaryComponents":false,"installDay":15598,"updateDay":16845},"activePlugins":[{"name":"QuickTime Plug-in 7.7.2","version":"7.7.2.0","description":"The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more ","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/sdp","application/x-sdp","application/x-rtsp","video/quicktime","video/flc","audio/x-wav","audio/wav"],"updateDay":16517},{"name":"QuickTime Plug-in 7.7.2","version":"7.7.2.0","description":"The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more ","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["audio/aiff","audio/x-aiff","audio/basic","audio/mid","audio/x-midi","audio/midi","audio/vnd.qcelp"],"updateDay":16517},{"name":"QuickTime Plug-in 7.7.2","version":"7.7.2.0","description":"The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more ","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["audio/x-gsm","audio/amr","audio/aac","audio/x-aac","audio/x-caf","audio/ac3","audio/x-ac3","video/x-mpeg"],"updateDay":16517},{"name":"QuickTime Plug-in 7.7.2","version":"7.7.2.0","description":"The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more ","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["video/mpeg","audio/mpeg","audio/x-mpeg","video/3gpp"],"updateDay":16517},{"name":"QuickTime Plug-in 7.7.2","version":"7.7.2.0","description":"The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more ","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["audio/3gpp","video/3gpp2","audio/3gpp2","video/sd-video","application/x-mpeg","video/mp4","audio/mp4","audio/x-m4a","audio/x-m4p","audio/x-m4b"],"updateDay":16517},{"name":"QuickTime Plug-in 7.7.2","version":"7.7.2.0","description":"The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more ","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["video/x-m4v","image/x-macpaint","image/pict","image/x-pict","image/png","image/x-png","image/x-quicktime","image/x-sgi","image/x-targa"],"updateDay":16517},{"name":"QuickTime Plug-in 7.7.2","version":"7.7.2.0","description":"The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more ","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["image/tiff","image/x-tiff","image/jp2","image/jpeg2000","image/jpeg2000-image","image/x-jpeg2000-image"],"updateDay":16517},{"name":"Adobe Acrobat","version":"11.0.2.0","description":"Adobe PDF Plug-In For Firefox and Netscape 11.0.02","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/pdf","application/vnd.adobe.pdfxml","application/vnd.adobe.x-mars","application/vnd.fdf","application/vnd.adobe.xfdf","application/vnd.adobe.xdp+xml","application/vnd.adobe.xfd+xml"],"updateDay":15751},{"name":"Adobe Acrobat","version":"11.0.2.0","description":"Adobe PDF Plug-In For Firefox and Netscape 11.0.02","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/pdf","application/vnd.adobe.pdfxml","application/vnd.adobe.x-mars","application/vnd.fdf","application/vnd.adobe.xfdf","application/vnd.adobe.xdp+xml","application/vnd.adobe.xfd+xml"],"updateDay":15751},{"name":"Google Update","version":"1.3.29.5","description":"Google Update","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-vnd.google.update3webcontrol.3","application/x-vnd.google.oneclickctrl.9"],"updateDay":16832},{"name":"Windows Live™ Photo Gallery","version":"15.4.3555.308","description":"NPWLPG","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-wlpg3-detect","application/x-wlpg-detect"],"updateDay":15407},{"name":"Silverlight Plug-In","version":"5.1.20513.0","description":"5.1.20513.0","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-silverlight","application/x-silverlight-2"],"updateDay":15838},{"name":"Java Deployment Toolkit 7.0.90.5","version":"10.9.2.5","description":"NPRuntime Script Plug-in Library for Java(TM) Deploy","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/java-deployment-toolkit"],"updateDay":15663},{"name":"Google Earth Plugin","version":"7.1.2.2041","description":"GEPlugin","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/geplugin"],"updateDay":15985},{"name":"DivX VOD Helper Plug-in","version":"1.1.0.6","description":"DivX VOD Helper Plug-in","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-divxovshelper"],"updateDay":15145},{"name":"DivX Plus Web Player","version":"2.2.0.52","description":"DivX Plus Web Player version 2.2.0.52","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["video/divx"],"updateDay":15321},{"name":"Best Buy pc app Detector","version":"1.0.0.1","description":"Best Buy pc app Detector Plug-in","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-bestbuypcappdetector"],"updateDay":15215},{"name":"Shockwave for Director","version":"11.6.5.635","description":"Adobe Shockwave for Director Netscape plug-in, version 11.6.5.635","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-director"],"updateDay":15456},{"name":"Shockwave for Director","version":"11.6.7.637","description":"Adobe Shockwave for Director Netscape plug-in, version 11.6.7.637","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-director"],"updateDay":15560},{"name":"Shockwave Flash","version":"11.6.602.168","description":"Shockwave Flash 11.6 r602","blocklisted":false,"disabled":false,"clicktoplay":false,"mimeTypes":["application/x-shockwave-flash","application/futuresplash"],"updateDay":15759},{"name":"Uplay PC","version":"1.0.0.1","description":"Uplay PC Plugin","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-uplaypc"],"updateDay":15723},{"name":"Uplay PC Hub Plugin","version":"1.0.0.1","description":"0.3","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-uplaypchub"],"updateDay":15723}],"activeGMPlugins":{"gmp-gmpopenh264":{"version":"1.5.3","userDisabled":false,"applyBackgroundUpdates":1},"gmp-eme-adobe":{"version":"15","userDisabled":false,"applyBackgroundUpdates":1}},"activeExperiment":{},"persona":null}}

    Theme: classic/1.0

    Throttleable: 1

    TotalPageFile: 6331199488

    TotalPhysicalMemory: 3166552064

    TotalVirtualMemory: 4294836224

    URL: http://localhost:50000/debug

    Vendor: Mozilla

    Version: 44.0.2

    Winsock_LSP: MSAFD Tcpip [TCP/IP] : 2 : 1 : %SystemRoot%\system32\mswsock.dll

    MSAFD Tcpip [UDP/IP] : 2 : 2 :

    MSAFD Tcpip [RAW/IP] : 2 : 3 : %SystemRoot%\system32\mswsock.dll

    MSAFD Tcpip [TCP/IPv6] : 2 : 1 :

    MSAFD Tcpip [UDP/IPv6] : 2 : 2 : %SystemRoot%\system32\mswsock.dll

    MSAFD Tcpip [RAW/IPv6] : 2 : 3 :

    RSVP TCPv6 Service Provider : 2 : 1 : %SystemRoot%\system32\mswsock.dll

    RSVP TCP Service Provider : 2 : 1 :

    RSVP UDPv6 Service Provider : 2 : 2 : %SystemRoot%\system32\mswsock.dll

    RSVP UDP Service Provider : 2 : 2 :

    useragent_locale: en-US

    This report also contains technical information about the state of the application when it crashed.