Jump to content

Web based Cognitive task boilerplate design


AlbertTJames
 Share

Recommended Posts

Hey everyone,

 

I am currently coding a boilerplate for scientist like myself who wish to create web based tasks using the latest technology the web has to offer ;) This boilerplate is not aimed to be babylon.js specific but the two main example from which users could build upon would be in 3d in BabylonJS and in 2D probably using ... phaser ? did not decide yet.

The design needs to be built independently of the game engine used and I was wondering if you had any advices on how i should build my object hierarchy.  What is special with experimental tasks is that everything has to be collected at the millisecond, well stored, exportable etc. So beside the general hassle of building a robust game state system I need to handle inputs and data asynchronously.

 

I created this little flow chart that you are welcome to modify if you have any relevant comment/idea, I'll be very glad to have any input from you guys !

https://drive.google.com/file/d/0BxggOFF8_iXkLUpXeXlyTkh2a2c/view?usp=sharing

 

Thank you !

State Manager.png

Link to comment
Share on other sites

Ahah,

 

Well maybe the real question is, how do you keep track of states in a video-game ? Should inputs be treated always asynchronously or should we built some kind of Event heap to treat them in series at each update.

 

For example I want my system to be able to keep track of the exact time a target appeared on screen, the exact time the subject pressed a key to respond, then wait for a fixed amount of time after keypress before showing a feedback etc.. While making the system high level enough to adapt to any lower level design constraints.

the way Babylonjs handle event is through the actionManager no? But that is very low level (although it is very powerful and asynchrone).

I am currently working on the stateManager and I think the object hierachy will work, but since I want to share it with the community and make a good project people could build upon, I'd like to really nail this state management in the best way possible and not make something that just "work" or reinvent the wheel. I am sure people must have thought about this problem before me and came up with great solutions... no? :) 

Do you have any advice on how to manage states at a higher level, the level of the game, or the scene.. ? Or maybe a good ref. on how professional game designer manage states in complex vieogames ?

 

 

Link to comment
Share on other sites

it depends on the game and the technology

 

On the web using JS, there is no asynchronous per se, so you have to deal with event in a serial way. Things seem async but they are not

There is only one thread and this is a constraint to keep in mind. babylon.js is ultimately using events from inputs (mouse, webvr, touch, etc..) to keep track of input states.

 

Then on every frame, it updates objects state

Link to comment
Share on other sites

You might use a scene level after renderer to record anything you like, or schedule things to happen on the next frame.  I use one to set my system wide time for the next frame, so all objects will have the same time.  This enables either realtime or fixed FPS.  Also useful for system wide animation pause / resume.

Link to comment
Share on other sites

On 8/10/2016 at 4:29 PM, JCPalmer said:

You might use a scene level after renderer to record anything you like, or schedule things to happen on the next frame.

Just to clarify, I believe JC was talking about scene.afterRender = function() { record whatever and even hot-swap scene.beforeRender function! }.

One other thing.  The scene collision system is "rubbery".  I highly suggest that you NOT use mesh.collider.onIntersect ... to position real-life nano-surgery probes or other "mission critical" robotics.  ;)

kbye.  :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...