00Rez's Forum Posts

  • > EDIT: Here is a quick implementation of the plugin version using pre-calculated light/sight arrays. Left click to create a "House" which blocks sight. PLEASE NOTE: The slow down is caused by the number of black blocks, not related to the plugin! This is just a simple example to show the speed difference so nothing fancy!

    And what a difference it makes!

    The event driven demo runs with 4 to 26 fps on my pc, the plugin version runs with 58 to 65 fps (slowing down to 26 as soon as the black blocks are drawn).

    But I must say the event driven demo reminds me more on some topdown minecraft thingy :D

    Yeah it has all fancy opacity events and is based on the mouse position. None of that in the second test. I'm glad the speed is better still more to do. Need to find a way to show the field of view without the use of blocks maybe. Definitely influenced by Minecraft and roguelikes. <img src="smileys/smiley2.gif" border="0" align="middle">

  • I've edited my first post to include a demo of the field of view plugin which uses pre-calculation. Needs more work still but getting there!

  • great work so far sir,

    i love roguelikes myself.

    please carry on.

    Thanks harrio!

  • No capx yet <img src="smileys/smiley2.gif" border="0" align="middle" />

  • Yeah I already have an idea how to implement. Can't wait for tile maps and especially families!! Thinking maybe having a FOV plugin then a light source behavior attached to any object then you can have multiple light sources! Will have to see how it goes...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks cowtrix! <img src="smileys/smiley20.gif" border="0" align="middle" /> To optimise further I was thinking of working through every grid position and calculating the fov then keeping this information to refer to. Will test this idea eventually unless something better comes along! Considering the above example uses events it works quite fast!

  • Thanks Danny! If I can optimise it enough then yeah! Got a few other plugin/behaviour ideas in the pipeline as well basically geared towards grid based role playing games. Already tested a container behaviour for an object so you can add/remove other objects. Basically I want to simplify the common needs of an rpg so anyone can make and focus on the creative side of the design process.

  • Yeah it is a bit low in Firefox, I get between 18-30 in Firefox and 40 or more in Chrome which isn't that bad. It's quite performance hit until I get it optimised further.

  • It uses rays which stop as they hit blocks. Think I will definitely try the pre-calculated way.

  • Thanks! The radius is pretty small so not much of a performance hit at the moment. Trying to think of ways to optimise it using maybe a pre fov test for every coord in the grid done when the game starts then using that as a look up. Do this for all the static objects then use a dynamic version for moving objects!

  • Hi,

    Here's an example of my lighting/field of view test I've been working on. It uses a custom plugin I wrote which uses Bresenham's line algorithm. This was all done using events and is still not very optimised (at the moment) and needs a semi decent system to get a decent frame rate. Eventually I will turn this into a grid based lighting/fov plugin AND optimise the hell out of it! <img src="smileys/smiley5.gif" border="0" align="middle">

    Original grid based lighting example (not optimised)

    (Move the mouse to move the light)

    • Rez

    PS I'm a fan of roguelikes, can you tell? <img src="smileys/smiley2.gif" border="0" align="middle">

    Edit 5 (24/09/11): Here is the latest pretty example. This is a bit more decorated example, it has skeletons which don't do anything! It crashes at the edges so I wouldn't go there! (Forgot to put a barrier.) Seems the rendering can slow alot of computers down so try the speed test below.

    Edit 6: Here is a speed test. You can change the radius with +/-. The grid is 60x60. Please if you can, post your fps at each radi and your computer spec e.g. high, medium, low! Thanks.

    Edit 7: Here is an alternate way to render the shadow and light which is a bit faster.

  • Thanks for the reply Ashley. I've worked with families in Construct which would work. The idea is based on this article:

    Generic item system

    The item system works like a tree and starts from a few generic item types. My idea is to have an "item" behavior which is attached to a Sprite then you can create/add "features" e.g. "light" (item produces light) which are controlled by "conditions".

    The conditions determine the effect e.g. the "onoff" condition when true turns the light on, etc. The dynamic properties are set using object variables such as radius, etc. The conditions can be checked through an event in C2 to see if it is true or false.

    To me it would make programming complex items and effects using the C2 event sheet a lot easier although I might be wrong. The only problem I'm having is I can't copy the features and conditions to a new object. I have a generic light set up and I want to create a "Sunrod" (an exceptionally strong light) like the article but I don't want to redo all the events in C2 rather just have an action "Inherit" which takes all the information stored in the generic light.

    I could just program this myself in the runtime but I was wondering if there's a way to access another objects specific behavior data within another behavior runtime?

    Hmm, this is quite difficult to explain I'll do a bit more work and see if I can upload an example :/

  • Amazing <img src="smileys/smiley32.gif" border="0" align="middle" /> this will be massively useful! Thanks Kyatric.

  • This question is aimed at plugin / behavior developers.

    Is it possible to have an object Action such as "Inherit from object" which takes the internal values/properties of a specific behavior of the chosen object and add/update these to the original object the Action is based on? (basically a way to inherit)

    The idea is for an item system. E.g. have a base "generic" type then create a "weapon" type and inherit the original values/features from the generic type.

    Haven't spent much time thinking about this so I could be missing something alot simpler, just wanted some feedback and advice! (and maybe some specific functions for the runtime)

    Thanks for your time,

    Rez

    P.S. I've been working on an inventory behavior which turns any object into a "container" and will use the web storage to save the container. Combining the above item behavior and this container behavior should provide a very robust item system. Well that's the plan!

    Lastly, to all the Scirra team thanks for producing such an amazing piece of software!! <img src="smileys/smiley32.gif" border="0" align="middle" />

  • Thanks!