megatronx's Recent Forum Activity

  • Glad you’ve found it useful. I’m not currently developing it further. I coded myself into a corner and would need to take time to figure out the best way to rewrite it and I don’t have the same momentum or time to do that at this time.

    Its great little plugin. I just programmed hightmap generator from noise.

    I'd acctually say that more important then 3d physics or animations would be fixing shadow issues, adding another light options for extra lights, and adding more texturing options.

    It would be really nice if this plugin would get updated. Really!

  • Thanks! I will check it ASAP!

    You can use image shaders to trick AA or just render in higher resolution with high quality up scaling and downscaling.

  • R0J0hound Question re MeshTag:

    I don't suppose there is mesh IID or UID, isn't it?

    Would be cool to be able to set up all meshes of same group with single action without loops. Ie: MeshTag: cube, MeshId = 0 - pick all else pick nth.

  • That’s called “broad phase” collision detection. Basically doing approximate collision detections by using a distance check or something. Other ways are using bounding boxes, bsp, quad tree, collision cells, etc. construct already does it somewhat with the overlapping condition.

    Anyways you can do that with events but you’d have to actually do it and test if it improves performance. The overhead of implementing those things with events can often result in things being slower oddly enough.

    Anyways the logic of the distance check you describe could be:

    For each sprite

    For each terrain

    Compare distance between sprite and terrain <100

    Sprite overlaps terrain.

    But with events you already reduce the terrain loop by doing this instead:

    For each sprite

    Sprite overlaps terrain

    For each terrain.

    But that’s mainly because internally construct can filter the objects faster than you can do manually with events which are slower.

    You other idea of adding and removing objects as needed is another idea. But you’ll have to test it. This plugin was made so you only have to make events to update objects you want to move. All the static objects will just redraw fairly efficiently. Adding/loading on the fly would be slower but it may end up being faster in the long run. But you’d have to actually test it out.

    All right, thanks, I'll be testing. I want to streamline the code. My current performance is smooth solid, but it hits 95% to 98% on i78750h with 1050ti and 32gb of hyperx ram. 70% of it are draw calls. Each terrain sprite has 4 meshes attached to it and there are 4 rojo3d plugins on different layers. SO my hope is that I can lower the cpu usage, and with array technique i can lower the number of 3d objects. Will test :)

  • I aim for simple and easy to read with my events if I can. Using arrays to store object info instead of sprites may or may not be better, it just depends on how you want to implement it.

    You can sort arrays, but you can also sort sprites with “for each ordered”, just use the stop loop action when loopindex=0 if you just want the closest. Or use a higher number to do stuff with more.

    The only time I use an array for terrain is if it’s in a grid formation, in which case a tilemap can work too for 2d. If the terrain is different sizes and whatnot I’d just use sprites.

    Not sure I grasp your distance calculation. Would a 3D distance calc work better?

    Sqrt((x1-x2)^2+(y1-y2)^2+(z1-z2)^2)

    I have no technical expertise with the fov behaviour. I find behaviours seldom do what I want so I’m more inclined to do stuff from scratch than do things to bend behaviours to my will.

    For your last question I think there’s a misunderstanding.

    You get the position of objects with the x,y and z expressions as I recall.

    The orientXX/Xy...Zz expressions is the orientation matrix of the 3D object. Aka. How it’s rotated.

    You can think of those as three vectors.

    OrientXX/Y/Z is the left vector of an object

    OrientYX/y/z is the up vector of an object

    OrientZx/y/z is the forward vector of an object.

    Ok, cool. Thanks for the answers and 3d distance calculations. I will think of its use for sure.

    But let me elaborate. The distance would be there to first check for objects within radius form the actor, and after that those objects that are near the actor are checked for collisions with it. Atm I'm doing isOverlapping,for each overlapping to test collision with grounds and walls for all actors. But since this is the only top condition to pick and check collisions, my idea is to get rid of those sprites and just test for nearby 3d objects with data inside array and then do radius check if actor is colliding.

    Also the level loading is dynamic, or rather positioning of the objects is based on what is in the level array. If player has LOS to position, I pick idling terrain sprite, then set all of its values from data stored in array, then pick mesh and set it's parameters with values taken from the sprite. I've created level exporter you see. It exports everything in to array. Then I'm applying that data live based on objects XY in the array using LOS. This way I can have big levels with number of sprites under 200. But for each sprite I do need to update 3d mesh, static once, but others like those for actors or liquid and billboards all the time. In this case it feels like sprites are only a middle-man, and could be completely omitted. I already got rid of sprites for billboards like trees etc. But my worry is that 2k objects in array that needs to test against number of actors so that i can select which ones will be testing collisions against might impact performance more then if i have 111 terrain sprites at all times.

    Idea is to narrow it down by first testing which level objects are visible to the player and then put them all in to it's own array and do sorting based on distance and only check collisions for those objects that have distance lower then some value, and stop the loop. And then do the same for other actors in the scene. I imagine this is how its done when picking overlapping objects, with the difference that if the sprite object has collision poly with more points then 4, like in my case my ellipses have 12, that collision check might have same or bigger impact on performance then simple distance check for nearby objects and then testing each for collision with radius from the center of each object.

    Ik this is a lot in realm of theory. I guess I have to try it and if it won't perform well, I will get back to using sprites.

  • R0J0hound

    Hi, maybe you cold give me a technical advice?

    My game is moving forward every day, with the method "two steps forward, one step back".

    I'm at the point where I have thought trough stopping using standard sprites (with roughly 12 collision mask points) and instead focus solely on 3D objects with assumption that it will release some of the cpu.

    So far I've been using sprites as a collision detector as well as reference for 3d mesh.

    With collisions the event started like this:

    - for each actor, actor overlapping terrain, for each terrain.

    but since I want to make sprites redundant I am thinking of putting all terrain data in to arrays. So first all level data will be in an array, roughly 2k objects with their data per level, or roughly 200 objects per room in a level. These are terrain object and each of them is a cell contenting Json data with npc's and other things that I load temp array with and place on the map. Checking if their are active can be done trough var change in an array. but I'm also considering having another array just with id's and distance to npc, so that I can sort it quickly according to distance and stop loop if distance is greater then a value.

    Here are my doubts come in:

    - if I sort array with 100 entries (if I use active objects array) or 2k entries ( if I do all checks inside map array), then check distance up to a certain distance and then pick those objects and do my collision code ( which is ellipse radius calculation done twice, once on xy plane and another on plane created by calculated radius and z to calculate z to place object on. Also first radius calculation is used as collision with walls if player is below floor range). Will that work as good or better then using LOS plugin to check x'y in one of the arrays, or work as good or better then checking overlapping with sprite? And how would that work if I had 40 npcs needing to check their surrounding to see if they are colliding with anything?

    Also, the checks are spread across several ticks with counter, so if counter is 1 I do this and that, and then counter = 2 and so on. Obviously that is necessary.

    Also, if id go with that, which 3D object position property would be mirroring of a sprite. Would that be XX, YX, ZX or XX, XY, XZ? I don't understand why there is so many variants for position in 3D, please explain.

    Best

    M

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Someone else just posted about how much you can do with just 50 events. I think there is indeed quite a lot of scope to do things within that limit. You can certainly make interesting mini-games and such.

    Something I've noticed from around a decade working in commercial software is no matter what the free limits are, someone will come along and argue there should be more available for free. We have to run as a business though. If we give too much away free and nobody buys the software, we'd go out of business, and then the software wouldn't exist at all. You can throw around some big changes to the whole business plan, but I can assure you many of them would also totally ruin us. We have our own unique market and niche and we've put a great deal of thought in to it already, and I'm pretty happy with where we've ended up.

    With 50 events, using plugins, one can make a full game with right strategy.

  • The plugin is at the point where some design choices early on make it hard to change things without breaking stuff. Plus the event system's speed and limits make it hard to allow the amount of flexibility I'd like without being overly verbose and complex. Anyways, that's partially personal opinion. Construct makes some complex stuff simple and some simple things overly complex.

    As for your wishlist:

    *The view distance is just an artifact of how the fog is implemented. There are pros and cons of either. Rewriting the plugin to have alternative options for everything would be an option i suppose.

    *As I recall I try to fit the shadow frustum to just fit around the view frustum for maximum shadow detail. It's not perfect because some things off camera aren't being included due to some approximations on my part. There are alternate ways to do it, such as fitting the shadow frustum over the whole scene, but the tradeoff is giant scenes would have low res shadows. But I agree more work would need to be needed with shadows but it turned into just fiddling with settings to see what works well which was too time consuming.

    *blend modes would be nice.

    *opacity is already doable. You just have to turn on "transparent yes" in the object settings. The caveat is it's done per object. So it just draws objects back to front. Per polygon would be better, but more complex to do with how the renderer is implemented, also it still would have cases where the sorting would be off. Best would be an algo called "depth peeling" but it's slower.

    *normals are already in the plugin. As long as an obj file has normals in it you'll have normals, which is used for smooth shading. If you mean normal textures, then no, only one diffuse texture is used.

    *Collisions and raycasts are highly requested things. I have a good idea how to do them but I don't find I enjoy finding a way to make it usable in the limits of construct's event system.

    Overall, I may work on this more, but I'm more inclined to work on other things first if I find the time and motivation to code.

    -cheers

    Thanks for the answer. I meant normal maps. Shadows are not usable in first person view unfortunately, because they shrink the moment the object casting the shadow is at angle and behind the camera. Transparency is also not very usable in many cases because it does glitch often and also if I recollect correctly mesh with transparent texture will show back faces and also becomes more white, and I didn't find an option to set object's opacity other than either trough transparent texture or transparent layer ( maybe I've missed it? ). But that's ok, for now, I work within limitations. Since I'll be doing proper mesh for each sprite type, then for shadows I might end up just doing the old school circular gradient or something. But I hope something will inspire you soon to work on it. Cheers M

  • R0J0hound

    Brilliant. As you wrote this is probably only for squarish type shapes. Still it will be useful to have. I'll be implementing it.

    On the further note, IK you won't probably do anything more with the plugin, but there are aspects that if improved would make it a perfect 3d plugin (for me, in order of importance):

    - Camera view in the distance should be a flat plane and not sphere, so that all objects in the viewport appear and vanish together.

    - Shadow matrix should be independent of camera view or layout angle. Camera view is changing the layout angle making shadows shrink and expand.

    - blend modes for meshes

    - Opacity for meshes

    - Normals

    - per poly collisions

    I did look in to the plugins code, but I'm too weak at coding for it.

    Still, I am very thankful for this plugin. It finally allowed me to realise potential of c2 and my ideas ( never was happy that c2 is only 2d, and made several dozens of prototypes, some with your help, but never fully engaged with it to work on a complete game )

    Best

    M

  • R0J0hound

    Hi, I'm having a problem with creating a mesh and I wander if you could help me.

    Since transparency is causing a lot of glitches depending on the angle of the camera, so I figured I need to create a mesh that is in a shape of the sprite I want to display as billboard. But I can't figure out how to get my code to work. I have imagepoints corresponding to verts I want to create, but after looping trough them I'm getting a broken mesh. If you could help out that would be great.

  • Looks Boss

  • Well done! Congrats!

    So the game is running inside some sort of wrapper for consoles, correct?

megatronx's avatar

megatronx

Member since 25 Sep, 2008

Twitter
megatronx has 1 followers

Connect with megatronx

Trophy Case

  • 16-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

23/44
How to earn trophies