R0J0hound's Forum Posts

  • Here is a test of a way to do precise 3d raycasting against a triangle mesh.

    Construct doesn't provide a way to access the mesh of 3d objects, so this instead loads the triangles from an obj file into an array, and then uses mesh distort to display it.

    dropbox.com/s/uy6yfhpag7d1t2p/obj_loader_and_raycast.c3p

    Anyways, I'm pretty much at a stopping point with this. Developed further I can think of some uses, but performance isn't great with events, and currently I'd need to make the game work with the remaining 8 events.

  • Hello,

    Looking at the events that monsterSpeed variable is used four places.

    1. Where the variable is made as a global variable.

    2. Where it’s increased every time an enemy is killed.

    3. Under the every 3 seconds, it’s used to set the speed of newly created enemy.

    4. And when you hit space to reset the game. It’s set back to an initial small value. Most things get reset automatically when restarting or changing layouts, but when something is global it doesn’t reset automatically. This is useful for keeping scores between layouts or stuff like that. So anyways, in this case they wanted to reset it and not keep its value so it was done manually.

    I agree with you about the comment. It’s increasing the speed of the new enemies, not the rate they spawn.

    There seems to be lots of YouTube channels with video tutorials that may be useful to you. Especially if they explain what they are trying to do and explain each part.

    Anyways, here are my thoughts on how I’d come up with some of the enemy events.

    So first we have some enemies. We want them to move forward so we give them the bullet behavior and see them happily trudging forward.

    If it’s too fast or slow we adjust the speed in the layout editor.

    Ok cool. But these enemies seem pretty dumb. The player can avoid them easily. How about we have them chase the player? One way to do that is to change their angle to face the player.

    Every tick:

    — enemy: set angle towards (player.x, player.y)

    We test that and the enemies turn instantly to the player and pile up on him. The player can only get away if they are faster.

    So what if we made the the turning more gradual? Like maybe turn 1degree per frame toward the player? That would look like:

    Every tick

    — enemy: rotate 1 degree towards (player.x, player.y)

    The result is kind of nice now. Even is the enemies are a bit faster than the player you can out turn them. It gives the enemies a lumbering zombie like quality.

    However all the enemies seem to know where the player is at all times. What if their senses were more realistic. Like they could only detect the player if they were close enough.

    So how would we do that? There isn’t a compare distance condition. But we could use the compare values condition with an expression. There’s an expression called “distance” that will give you the distance between two points. So how close should the enemy and player be between each other for the enemy to year. Let’s say 200 or less so every position in a 200 pixel radius circle

    So we can change our event to

    Every tick

    Compare two values distance(player.x,player.y,enemy.x,enemy.y<200

    — enemy: rotate 1 degree toward (player.x, player.y)

    You can actually remove the every tick condition, since events are run every tick already.

    So anyways we test this and something seems amiss. It will work perfectly with a single enemy but with multiple it will seem to work with only the first enemy and not the rest. The reason has to do with picking. The system compare condition does no picking. It just uses the position of the first enemy instance in that distance calculation.

    Anyways we need to find the distance between each enemy and the player. One solution is use for each enemy to do that. What for each does is look at each instance one at a time.

    So the result is:

    For each enemy

    Compare two values distance(player.x,player.y,enemy.x,enemy.y<200

    — enemy: rotate 1 degree toward (player.x, player.y)

    Which works how we want it.

    Alternatively we could use a different condition like pick by comparison. It only will pick the enemies inside that radius. It will work the same for our purposes.

    System: Pick enemy by comparison: distance(player.x,player.y,enemy.x,enemy.y<200

    — enemy: rotate 1 degree toward (player.x, player.y)

    Anyways, hope some of that helps. I don’t have time to screenshot events so hopefully that text makes sense. I don’t usually write things so detailed but that is my thought process when I make events. The difference is over time you find more features you can utilize.

    -cheers

  • Probably just a typo or a misunderstanding when the behavior was made. Physics uses box2d, so looking at its manual it says damping can be any value from 0 to infinity.

    calhoun137.github.io/box2dgame/manual.pdf

  • I was going to google for some game names, as I know of some, but, eh. Reaching out to those companies can answer most of your questions about price, games they’ve ported, and if they can work with you.

    Most, if not all, that have replied so far in this topic haven’t actually used their porting services I’d guess? I really have no idea.

    Anyways, I have no skin in the game either way. I’m going to stop replying here.

    -cheers

  • I think there are two entities that have the ability to port capx to other platforms. But both require the source capx to do so as far as I know.

    Anyways I probably did you a disservice to say it could be possible to port an already exported game. If any new porting company emerges they too will require the games source to do it. Why? Because it’s much much harder to port games already exported to the point of not being worthwhile to attempt.

  • Nice. Glad it was useful and you were able to make tweaks to the logic and add stuff.

    -cheers

  • With enough money and time, anything is possible. There are limited entities with the ability and expertise to port capx and c3p files to other platforms. I suspect it wouldn’t be worth their while to take the extra effort to port over an already exported game. But hey, you could ask them. It may cost a lot more though.

    Old console games are made portable by emulators of those consoles.

    For construct games a web browser can be considered basically equivalent to an emulator. However performance, having a feature complete browser available, and even rules on certain platforms make that not feasible. Not to mention a lot of other complexity involved I’m not thinking of.

    I should also say that an emulator for a console is way less complex to make than a browser.

    Anyways, I shouldn’t be the one to ask. Contact the emails of those publishers and ask. They actually are the ones doing it so they know way better than me.

    There’s probably a reason there’s not many porting services or super simple alternate ways to port. It’s probably pretty complex to do.

    Having reservations about sharing the capx is fine. If they can’t help you otherwise is fine too. But never hurts to ask if they can work with you with your request.

    Worst case you just stick to the platforms already available.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I mean the porting services like that need the capx so they can tweak things to make it work on the given platform. Or maybe the conversion is automated? I seem to recall from what I’ve read is it’s mostly automated but they do some things manually to make it work better on a given port.

    You can set the terms and say you won’t give them the capx but only an already done export for them to use to make the port. If they agree they’ll probably quote you higher I’d imagine.

    I mean with my limited understanding of how the porting works they already have a lot to do to go from a capx. To go from an export would require them to mostly go from scratch or at least mostly reverse engineer a capx out of the export first.

  • Hi,

    Yes can do that and swap the meshes used on the fly no problem. I imagine it would work well for stop motion.

  • I mean you can do it like this. Get the array of instances and loop over them.

    var list = runtime.objects.position.getAllInstances();
    var count=0;
    for(var i=0; i<list.length; i++)
     If(list[i].instVars.pizza =="pepperoni")
     count++;

    Any particular reason you’re using JavaScript? It’s much simpler with events.

    Global number count=0
    
    Position: pizza=“pepperoni”
    — set count to position.pickedCount
  • You need to ask those publishers that. It depends on how they do the export to platforms that construct doesn’t support.

    Most if not all of them convert the capx to the export format. It’s up to them if they are willing to take an already exported game and try to convert it.

  • It’s up to you. If I said yes or no is irrelevant.

  • You can extract information out of it with the binary object most likely but there seems to be a lot put in there.

    developer.valvesoftware.com/wiki/Source_BSP_File_Format

    The most useful part would be how the polygons are put in a binary space partition which would allow quickly getting a perfectly ordered list of polygons to draw while culling the ones behind the camera.

    Anyways, probably not super useful with construct’s 3D. Maybe as a separate plugin to draw the polygons with api calls. But its probably simpler to just convert the file to something there already is a loader for.

  • dropbox.com/s/fnmu2kkvzg6sr7i/hex_pathfind4.capx

    So turned out we could do it with less events. The pathfinder doesn't need us to temporarily mark tiles as walls at all.

    * Now the player and an enemy can occupy the same tile.

    * Once on the same tile you can attack or step off the tile.

    * enemies are done one at a time. If they can't possibly get to the player they just don't move.

    I will say it probably doesn't match what you had in mind exactly. like you may want objects to just battle to the death when on the same tile and not have the option of retreat. Or maybe you want objects to bunch up instead of walking around the water so once a space opens up they are close. Anyways, you'll have to tweak and tailor to what you have in mind since i don't know everything.

    Also one thing i didn't touch is making objects sharing a tile not be right on top of each other. I had a smooth way of doing that in mind but you have some other way in mind.

    -cheers

  • Impressive and oozing with character as always! Very cool.

    When the reading of the pixels is wrong, could the image be flipped?

    Messing with webgl before to read pixels I ran into the issue of the image being flipped on some devices. Not sure why it wasn’t consistent. Anyways my solution was to check if the pixel data comes out flipped and then flip if needed. This would only need to be done once as the flipping was consistent. Anyways to do it i’d get the pixels from a 1x2 image with a white pixel over a black one. Then if the top read pixel was black we know the image was flipped, otherwise it wasn’t. That should be doable with the canvas too. Reading the image flipped should just be a matter of:

    RedAt(x, height-y)

    Anyways, Just an idea.

    -cheers