NB: For that example to work properly in recent versions of CF2.5, you'll need to tick the box "Do not reset current frame duration..." in the object's properties (runtime options -> compatibility).
Type: Posts; User: MuddyMole; Keyword(s):
NB: For that example to work properly in recent versions of CF2.5, you'll need to tick the box "Do not reset current frame duration..." in the object's properties (runtime options -> compatibility).
You can also use multiple animation frames to give you multiple action points:
https://1drv.ms/u/s!Atq7cUIJ7uexg28l-ttFEEX-MBqr?e=xT7HhH
It's not too difficult.
The main thing to be aware of, is that using this "8-bit" method will give you 256 possible values (from 0 to 255). However, in most cases you can use a "blob" tileset...
This link should work: https://1drv.ms/u/s!Atq7cUIJ7uexgndFrVlwsskEQKme?e=7A4Juw
Why are you using the string tokenizer? Wouldn't it be easier to just use mid$()?
eg.
+ Always
-> Start loop "search", len(globalString) times
+ On loop "search"
+ find( stringA,...
I actually got a little of the terminology wrong myself in the last post, so it is confusing!
This example from wikipedia demonstrates the difference pretty well:
https://i.imgur.com/POO7rPI.png...
Yes, they are using different methods, because they are effectively using different color models (there are lots of different color models that contain a saturation component, and chroma is sometimes...
What NaitorStudios said. Noone is going to make such a specific example for you, for free.
It also seems strange that you would want to remake MK if you're concerned about licenses and intending...
Just use actives. The performance difference is absolutely tiny with DX11, and the memory difference is irrelevant (everyone has 8GB+ of RAM these days).
@Kage - Nice. Good luck with the game :)
Yep. Debugging DX11 shaders is definitely trickier than DX9, and I've experienced more "quirks" with it.
I've had non-working shaders that stopped...
That's very handy, thanks!
It turns out that in DX11, dithering can be simplified a lot, since there isn't the limit on constants. Instead of using four separate 4x4 matrices, you can just use a...
Okay, it's done. I'm sure there's room for improvement, but it seems to work now.
Download: https://1drv.ms/u/s!Atq7cUIJ7uextCXaMbyu28oU71G2?e=00Uh2n
Save it as an external image file, and then load it at runtime as an image parameter.
As I say, all of this requires a decent image editor, so if it's not working, most likely that's your problem.
The first file I linked to includes a little "Palette Exporter" tool that I made. If...
Thanks. I'm not having much success...
https://1drv.ms/u/s!Atq7cUIJ7uextCSw3THq6_a34AKy?e=nGVqgo
It's proving tricky to port to DX11, but I've combined a few of my older shaders into a kind of all-in-one 8-bit sprite shader:
https://s10.gifyu.com/images/8bitsprite.gif
- palette swapping
-...
Done. I've ported it to DX11:
https://1drv.ms/u/s!Atq7cUIJ7uextCOEJGR3L2zs59bu?e=32nlbY
Indexed colour on modern systems is actually not that straightforward, as everything's designed around true colour these days.
Having said that, I made a shader years ago that will do what you need:...
If you mean what I think you mean, you will need a decent graphics app (ie. not Fusion). It's essential that all of your sprites use the same palette, with colours in the same order, or you will...
You guys should use box-mode when importing graphics - it's just better.
"This option is very powerful: it allows you to capture several images contained in boxes in a single image file. In order...
I think I found the problem.
Weirdly, when I tried doing what you say, and it wasn't working - the fWidth refused to stay set, so as soon as I deselected the object, the parameter instantly reset...
If you're sure you haven't done something wrong (you're not setting the fWidth parameter above 0.5 in an event or something?), maybe we need to check with Clickteam? I can't see why it would work on...
Now that is strange. Works fine for me on both DX9 and DX11, both with pre-multiplied alpha enabled and disabled.
I was thinking something like this:
https://1drv.ms/u/s!Atq7cUIJ7uextCG3lX4uE1F4ImmA?e=mYrpGE
So you still have control over the width of the wheel, but you don't have to change the edge softness...
I don't see how the alpha component can be outside the range 0-1. I reckon there's something else going on, but I don't know what... I'll have a look later, but I'm about to go out right now.
A...
If that is the problem, the "clamp(x, min, max)" function might be what you need (or perhaps even "clip(x)").
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-clamp
That would require an absolutely immense amount of work, so I doubt it (although I've seen some very basic drawing examples that you could search for).
If you're serious about it, then just start...
Why not just pass it in yourself as a parameter?
Stable 60fps here.
Asus UX305F laptop:
800 MHz Intel Core M-5Y10c (2 GHz Turbo)
Intel HD Graphics 5300.
Would you care to elaborate?
Here's my attempt at maths:
Imagine you're looking down on the top edge of the card (red line), and rotating it to the blue angle.
https://i.imgur.com/fIVaigP.png
We'll just rotate around...
That's odd. I've never seen any ads at all, so I bet there's a way to turn them off.
I agree that the latest versions are not much of an upgrade - I'd still be perfectly happy using version 9.0 (the...
Like I said, it's broken, so I don't recommend anyone uses it...
https://1drv.ms/u/s!Atq7cUIJ7uextCAoMgZmI8Ewh_LJ?e=gDCJNL
I'll post it here anyway though, just in case someone who's better than...
It's an interesting problem...
The problem with shaders like the Quad shader and Werbad's 3D shader is that they use the positions of the 4 corners as inputs, which means that you have to do some...
It sounds like you just want your objects to have an alterable containing the default scale (usually 1.0, but in your example it would be set to 1.7), and then multiply that by the value of the...
Aseprite is definitely the most popular tool for making animated pixel art these days (in spite of the ugly GUI) - but it's not a general purpose graphics app. GraphicsGale used to be pretty popular...
This any good?
31064
Note the "Do not reset current frame duration..." option in the compatibility section of the object's runtime properties.
Just to answer that part of your question, and this might not be what you want, but I would have thought it more normal to pick the front-most object.
If you're only targeting the windows runtime, I...
1.) Aenever's suggestion will work here. There's no need for a separate "skin" or anything though - just replace the actions that set the object's angle, with actions to set the animation direction...
I feel like logically, the opposite of "<=" would be ">".
Likewise, the opposite of "<" would be ">=".
Since several people have asked me now, I've made yet another slight modification here:
https://1drv.ms/u/s!Atq7cUIJ7uextB8qMiHI8Q6E6Efs?e=78ZMoJ
The only changes are to the debug mode.
It now...
The surface object is only for debugging purposes, so that you can easily check you have your polygons set up correctly - you can safely remove it without affecting the pathfinding at all.
The only...
That's actually quite a bit of work to do properly. I made a simple fix here though:
https://1drv.ms/u/s!Atq7cUIJ7uextB6m5Ky7V3rvnVFB?e=GZBIJO
(there are some other very minor changes, such as...
Just another quick update, which you can download here: https://1drv.ms/u/s!Atq7cUIJ7uextB3Vg9Wjev7jbTHY?e=MHiZCR
Unless I get more (easy to implement) suggestions, this really should be it for a...
Probably not that hard, actually :)
The point-in-polygon test already returns the id of the polygon, so it should just be a case of looping through every wall in that polygon, and doing a...
This is an improved and commented version of the pathfinding example that I posted in a different thread (just trying to make it more searchable). I do have ideas for future improvements, but this is...
My example does a ton of calculations at the start of the frame, in order to minimize the amount needed during the actual pathfinding process. It probably wouldn't be hard to just create an...
My example does a ton of calculations at the start of the frame, in order to minimize the amount needed during the actual pathfinding process. It probably wouldn't be hard to just create an...
I haven't tested, tidied or commented it properly yet, but if anyone wants to try out the latest version of my polygon-based pathfinding example, it's here:...
I had a thought...
https://i.imgur.com/oJ2hImY.png
The idea is to separate the vertices used to define walls for line-of-sight tests, from nodes used in pathfinding (right now, they're the same...
If it turns out to be an easy fix, then there's no reason not to :)
It's not so important for this particular project though, as anyone making a Windows game can just just a pathfinding extension.
...
Yes, sadly it is.
LB's "Internal List" would be much better, but unfortunately it's for Windows only, so using it here would defeat the purpose, since you may as well just use a pathfinding...
Yes, I do. That's basically what we're talking about with "point and click pathfinding" (it's not quite the same as the method I was using, but it's very, very similar).
Have a look at this page:...
Thanks all!
Not sure about that point and click pathfinding. I did get fairly close, and in theory it's not that tough - it was just all those awkward edge cases that kept causing problems!
The...
Agreed. If you're only targeting Windows, an extension is the way to go - it's much easier than "rolling your own", and will run faster too.
Failing that...
Is there a specific example you're...
Ah, so it has been fixed in DX11 then :)
I appreciate it's not much of a problem anyway, since there are easy workarounds, like creating a larger motif in whatever graphics app - not the full size...
Does this actually make a substantial difference though?
I only ask because I was struggling with terrible performance just today, which I eventually traced to a Quick Backdrop using the "Motif"...
This is an example of a breadth first, flow-field pathfinding system.
It doesn't require any extensions, and therefore should theoretically be compatible with any and all exporters.
It is...
I tend to think with zombies, you probably don't need real pathfinding, since zombies aren't supposed to be capable of complex problem solving anyway. They don't need to be able to navigate through a...
I'm definitely no expert, but that may be the problem.
Apparently that's a very old / bad graphics card, and significantly slower even than mine:...
It's flickering between 60 and 61.
Given that my computer is a 2015 laptop / ultrabook (definitely not a gaming laptop), and it still manages 60FPS even when unplugged and using the battery saver...
I believe it's one of the peculiarities of the way the object scoping system works.
The fastloop is triggered as soon as it's encountered. The condition within the fastloop "filters out" all...
It's for when you add an object to the backdrop on top of an existing backdrop.
If you set it to "no effect on collisions" it will do exactly that - it will have no effect on collisions.
If you set...
It tends to be fairly game-specific, but at the most basic level, it involves considering every possible move, and somehow quantifying how "good" a move it is. For example, in "Advance Wars", when...
I remember there being some workaround for that, but it still involves applying the shader to the entire frame, not just the window, which makes it very inefficient and slow.
Subapps are the way to...
It shouldn't actually have anything to do with sampler settings. The way it checks for the pixel being within the quad is this part:
float a = (xA - texCoord.x) * (yB - texCoord.y) - (xB -...
eg.
https://1drv.ms/u/s!Atq7cUIJ7uextBcrLIoFjQT0X-IS?e=U6PzvI
Okay, soooo...
I just tested Werbad's shader on its own, and it actually works fine.
Which means that the problem is with the events - and I think I've found it!
The issue is with passing integers...
Nope. It's broken. The wall objects are being positioned and resized correctly, but that's not what the shader was for - the shader was to make the corners look right.
Have a look at this example...
That's strange...
I've just had another look though.
The latest version (which I decided to call "QuadPlus" for some reason) doesn't work -...
It's probably not you. I just tried the GTA building examples that I made years ago using Werbad's shader, which definitely DID work, but are now all broken. Clickteam must have changed something....
That's *exactly* the kind of artificial stupidity that I need!
In Microgue (and in my game) monster movements are entirely deterministic - there's no luck and no hidden information. Once you learn...
Agreed. And if it's not Discord, it's Twitter.
I really miss "The Daily Click" - it used to be such a great and active community, with frequent new game releases, great articles and a helpful forum....
The presentation is really great.
Normally, I'd say you don't need to stress so much about exactly how your zombies look, at this early stage in development - but apparently one of the keys to...
Unfortunately, knowing how to do something and actually doing it, are two quite different things.
I'm trying to keep a to-do list and set a small, achievable goal for each coding session, so that I...
Yes, it's unmistakeably Equin, but seems like you've made a lot of subtle improvements (it's funny to think that you can now see as well in a dark cave as you could during daylight in the old...
Congratulations on getting another game finished and released! I hope the launch went well :)
I never get bored of roguelikes (been playing a bit of "Labyrinth of Legendary Loot" recently, and just...
That's one of mine.
You can find the download on my OneDrive, here: https://1drv.ms/u/s!Atq7cUIJ7uexgQOl9E-_RJ1mfyxd?e=pCACGN
It'll be in the "stuff" folder, and I believe it's the one called...
That's true.
Stopping at the diagonals is actually quite tricky. Technically, my version does it, but you need to release two arrow keys at *exactly* the same moment, which is very difficult.
You...
I think the big issue here is not going to be mouse sensitivity, but your game's framerate. You know where the mouse is now, and you know where it was 1/60th of a second ago, but you have no idea...
That seems a little buggy - rotation towards a diagonal (NE, SE, SW, NW) is twice as quick as rotating towards one of the four cardinal directions (N, E, S, W), and it's also possible to hold an...
Using "Compare two general values" is usually a mistake, as it doesn't work when you have multiple instances (eg. more than one bullet). You need to store each bullet's distance in one of its...
1.) Yes, if you use the Ini++ extension, it can encrypt the file.
2.) Standard arrays are binary files, so you can't read their contents in a text editor. They are not actually encrypted though, so...
Yeah, the problem with a math-based solution is that if you later decide that you need different set of numbers, you'll need to work out a whole new formula (not always easy). Plus, if you come back...
You will need to use custom pixel shaders (any other solution will be way too slow).
All the formulae you need for converting between different colour models are on wikipedia:...
Volnaiskra's solution seems sensible - kind of the best of both worlds.
I definitely wouldn't go that route for a game using tile-based maps though, just because the CF2.5 frame editor makes a...
If everything's grid based, then you don't even need to use normal collision detection - you can just look up a value from an array directly.
The main thing is that each map tile needs a value to...
It's just the usual issue related to the fact that not all values can be expressed exactly as a float - google "floating point arithmetic" for an explanation of why that is.
eg....
On thinking about it, you don't actually even need the variable "totalMatches", as you can just use the loop index instead.
+ On loop "find"
+ Match > -1
-> Set searchFrom to Match + 1
->...
The built in "find" function takes an argument that specifies the point from which to search, so it's pretty simple to just do repeated searches, starting each one from the previous match, and...
There's no way to directly get the texture dimensions from within the shader (there's no fPixelWidth / fPixelHeight equivalent for image parameters), so you will need to pass them in as separate...
You have to click and drag from one square to another to create a door between them. It was just the simplest way to get the data into the array, to show how the main part of the example works. In...
Hmm, that looks a bit over-complicated, and not very smooth (only 32-directions).
Perhaps try something like this: 30077
Something like this: 30072 ?
Here: https://1drv.ms/u/s!Atq7cUIJ7uexsUq0RMKrOVcpn5-k?e=US4LNe
It's still buggy, and it's just using tiles I had lying around, but I made it work with corners now, using the method described above....
Yes, you've understood perfectly, and you're absolutely right - there is no real reason to have separate flags for both North and South, or for both East and West. I just seem to keep doing it out of...
I really love the overall visual style of the game! It looks like it could be really fun too - reminds me a bit of the very old click game "Plasma Warrior", and to a lesser extent of games like...
Nevermind, YVes beat me to it!
Looks like the same windows control as used in Wordpad then. Now that I try it, a lot of the other Wordpad keyboard shortcuts work too - you can align text left/right/middle, make it...
Haha, sounds like you just opened a can of worms...
I know exactly what you mean about offset entrance positions potentially leading to overlapping rooms, and I think that would be a problem. A...
What's the specific issue? It sounds like you just need to represent the 1024x1024 area using a 4x4 tile area of the mini-map?
To find the player's "world" position, you just need to know their room...
Or don't use ForEach loops at all. They're great, and much faster than comparing a spread id value against a loop index (which you will see a lot in old examples), but they're quite often used to do...
One of the examples in my "tile-based examples" pack (the frame called "virtual scrolling") does exactly that:
https://1drv.ms/u/s!Atq7cUIJ7uexhEshPV28NbAsPYq2?e=wrtjrr
(although, just looking at...
The part you left out is that also they dispose of the previously loaded chunks to make way for the new ones - if you leave an area and then come back to it, usually enemies etc will have respawned,...
Yes, it will be a (very) long process - that's unavoidable.
Global values are generally best avoided where possible. It's usually better to use object alterable values (if for no other reason than...
Fredetmumu beat me to it, but if you want a bit more control there's this...
Okay, so the orbit is a circle. We can find its circumference (distance around the edge) using the formula:
...
That's essentially the same, but instead of:
-> Object: Set posX to posX("Object") + (Cos(moveAngle("Object")) * moveSpeed)
...you would say:
-> Object: Set posX to centreOfOrbitX("Object") +...
The basic formula (for a missile or a racing car etc) looks like this:
+ Always
-> Object: Set posX to posX("Object") + (Cos(moveAngle("Object")) * moveSpeed)
-> Object: Set posY to...
Thanks all. It makes sense that it would be "feature" of the windows control, but I still can't imagine why Microsoft thought it was a good idea. And yes, an extension is certainly the way to go for...
Ah, the not so enjoyable/rewarding part of game development... Good luck and keep at it! :)
Yeah, there's no obvious logic to it, and the "-" isn't being ignored altogether (it does affect the sort order). It seems like it would actually take more effort to make it behave that way than to...
Importing of sprite sheets in box mode is not working correctly when images have an alpha channel (it loads sprites in column order, instead of row order).
I suspect it may be related to another...
That's a fair point. I've noticed a few other unicode characters aren't displaying on Android either, so I'll look at replacing or somehow fixing those too. I decided to make the page very modular...
Sorry, make that a 1-based index...
eg.
+ User clicks on saveButton
-> Start fastloop "saveGlobalVals", 75 times
-> Start fastloop "saveGlobalStrs", 75 times
-> ValueArray: Save file to...
You're getting the loopindex of "write global strings", on an event with the condition "on loop "write global values"" (and the same with loading). For that to work, you would need to be running...
Thanks for that. It's strange that the other arrows don't work, assuming it's using the correct font. I might need to declare the character encoding somewhere maybe, or something like that (I'm...
I was already aware that CF2.5 doesn't sort values in a List object according to numerical order, but up until now I'd always assumed that it sorted entries according to alphabetical order (ordering...
Thanks!
And yes Chrilley - a contents list is definitely needed. I was originally planning to make the sections collapse so just the title is showing (as a kind of contents list), and then expand...
Thanks guys, and especially Volnaiskra for all the excellent feedback (and the coffees are appreciated!).
I totally understand what you're saying, and considering the article is aimed at CF2.5...
That's actually one of my old articles (written 2008). Some of the content is a bit outdated now, so I've spent the last day or two on a replacement, which you can find here:...
A long time ago, I wrote an article on The Daily Click ( https://www.create-games.com/article.asp?id=1898 ), that was basically just a long list of useful formulae. It turns out that some people are...
I would recommend you just use the built-in feature to create the mirrored animations for you:
https://i.imgur.com/27LYT5r.png
This has the advantage that the hotspot and action point are also...
Yes, this is correct. Whether there's any performance gain, I don't know. Fusion is still having to check the same number of conditions - you're really just moving some of them from the second line...
That's not a problem - I've just updated the example to include rotating head and body segments (see line #24). Same download link as before...
So I put that example together quite late last night, and apparently was having trouble counting to five (see how the worms only have four body segments, even though they're clearly supposed to have...
See if this helps:
https://1drv.ms/u/s!Atq7cUIJ7uexrSKAWc-VOo9WqJfv?e=z8zoEd
Scaling up your graphics before you import them is a crazy. Don't do it.
Clickteam may well have fixed this issue by now (I haven't been keeping up), but back in the day, the main way groups affected performance was when fastloops were involved. As already stated, on...
I tried it using the Brackets Live Preview to serve the file, and it worked fine...
https://i.imgur.com/A1aJy2E.png
And obviously you need to set the array type as "Number array" (not "Text array" which is the default) with a "Base 1 index".
Firstly, you only need a 1-dimensional array, so use the action/expression that just takes an X position (not X and Y).
Secondly, global values are 1-based, so you need to add 1 to the global value...
As for the trig formula not working - Excel uses radians, whereas CF2.5 uses degrees. The " *180 / Pi" part is how you convert between the two. If you remove that and just say: ASin(Sin( Angle ))...
-90˚ to 90˚?
That's only a range of 180˚. The stackflow post is talking about -180˚ to 180˚, which makes a lot more sense, and could be solved with a simple statement using "modulus" (better for...
Indeed. They really don't do anything special. All that happens is that at runtime, Fusion finds all the events stored in behaviours, and just moves them to the bottom of the main event list.
The...
Honestly, you're better off just never using behaviours. Ever.
When they were introduced, it was for one purpose only - which is actually explained in the help file as follows:
"The great...
Okay, I have a confession - I was using an outdated version of the Webview extension. Sorry for the confusion!
You can try: https://www.whatismybrowser.com
With the old webview version, it was...
That extension doesn't seem to support WebGL - you can test it here: https://get.webgl.org
And since WebGL(2) is pretty much the only way 3d is done on websites, you're probably out of luck.
The...
Scrolling is not a problem.
eg. https://1drv.ms/u/s!Atq7cUIJ7uexrGoY6limQIuHgkCD?e=Df2XaV
The problem, I assume, is going to be performance.
If you look at how it works, you might notice...
I'm not saying it's a good solution, but it's a solution...
https://1drv.ms/u/s!Atq7cUIJ7uexrGllQwRFDwwrM7cV?e=aYfJSn
It uses a shader effect on an object the size of the entire frame, but in...
I haven't done any "kliking" in a very long time, so haven't maintained the website either. I'm not even certain which web host I was using, but I think it might have been 110mb.com, who appear to...
That lists are sorted alphabetically, and not numerically, is an important point if your list enters double-digits.
It means for example, that "10" will be sorted ahead of "2", because "1" comes...
Just put the HUD on a separate layer, and set the layer's X and Y scrolling coefficients to "0".
Seems to be a known issue: https://community.clickteam.com/threads/105504-Converting-DX9-shaders-to-DX11?p=746414&viewfull=1#post746414
In DX11, the sampler state can no longer be set from within...
When declaring the sampler in the .fx file, you can define various parameters, including MinFilter and MagFilter, which are what you need.
sampler2D bkd : register(s1) = sampler_state {
...
eg. If you had two players, with the names:
Jill
Emma
They're both 4 letters long, but you'd have to add another SIX spaces (spaces are also very narrow characters) onto the end of "Jill"...
Lists are "windows controls" and as such, are always displayed in front of everything else. There is no way to change this.
If you *really* need to move it to a different layer, then you will need...
That's not a monospaced font that you're using. You need to use a font where all characters (including spaces) are exactly the same width - in most fonts, a "W" character is very much wider than an...
Here: https://1drv.ms/u/s!Atq7cUIJ7uexn3sbKszHZG3Q12Ts?e=XVb2Aw
You don't need any loops.
I think you are going about this in completely the wrong way.
You need to separate the movement engine from the visible sprites.
You want to handle all movement, collisions and other interactions...
LETTERS + right$( "FIFTEEN_SPACES" + NUMBERS, 15 - len( LETTERS ))
I couldn't write it because the forums remove whitespace from posts, but "FIFTEEN_SPACES" should literally be a string containing...
Not sure why you're reviving an ancient thread, but anyway, what you suggest would be spectacularly slow.
It's just one of those things that CF2.5 is very, very poorly suited to, whereas it's a...
You have to remember the bug/feature in the way CF2.5's collision detection system works.
Let's say you have this condition:
ObjectA is overlapping ObjectB
When checking for a collision, CF2.5...
Sad but true, I think (although you missed out "...and are extremely lucky").
I don't have any first hand experience, but it definitely *seemed* like there was a brief golden age of indie game...
Oh, I never meant to leave that extension there (was just checking something).
Well, it's really more a lot of ideas that could be tried - some of which might help; some of which might make it...
Haha, thanks.
That looks interesting - probably overkill for my little curve. I think the solution I have now will work, but also, I'm beginning to think that even just approximating a curve using 2...
https://1drv.ms/u/s!Atq7cUIJ7uexnzmNbZVVEr5rlFLn?e=GvYNrY
To be honest, there's a LOT that could be changed to make it smoother and less buggy, but it was really just to demonstrate the basic...
Thanks - that's an interesting link :)
It turns out that what I wanted is actually physically impossible. There's precisely one location of Point_A where it is possible to reach an end point of 1,1...
For the standard built-in movements (8-direction, bouncing ball, etc) :
Pixels per Second = (SPEED * 6.25) * (Framerate / 50)
As per the help file, for the Sinewave movement (but probably...
I need to draw a very particular kind of line (approximating it using a logarithmic curve is not going to be sufficient). Any help would be very gratefully appreciated!
...
That flocking example is interesting (and aenever is right about the obstacles btw).
The problem is that while the fish / zombies will avoid walking *through* obstacles, there's nothing to make them...
Yeah, I'm not sure there is a way, other than to reload the sprite image from an external source, using "load frame" (I guess that would do it?) - but that's a lot of extra work.
Graeme's method...
The collision mask is very much integrated into CF2.5. When you create a backdrop or quick backdrop, or when you use the "add to backdrop" action of an active object, you can choose to make it either...
The collision mask feature allows you to test any pixel to see if it is an obstacle:
https://i.imgur.com/1QLOWCy.png
https://i.imgur.com/v7OCD5y.png
From the help file:
"Value of collision...
Oh, and there's also the background collision mask on those runtimes that support it. That should be very fast as all it's doing is reading 2-bits of data (although you do need to calculate the...
By "grid-based", I don't mean that the actual movement has to be grid-based - only that the map is grid-based. That way, a two-dimensional array can easily be used to label a grid space as either...
Yes, fine collision checks are slow. On the other hand, bounding box collision detection should not be computationally expensive at all, so try disabling fine collision detection in the object...
What you're talking about is "collision avoidance" (that's the proper term to google), as opposed to true pathfinding.
Dex's method seems like it should work.
Alternatively, I remember seeing an...
It won't be what you want to hear, but the simple solution is to just not use the built-in image editor. Honestly, it's complete junk compared to any number of other free image editors (GIMP,...
The action to start the ForEach loop is under: Active (Coin) -> Count -> For each object
...which is not an obvious place to look for it, I agree!
The matching condition for the second event is...
You have to wrap the collision event in a ForEach loop.
+ Always
-> Coin: Start ForEach loop
+ Coin: On ForEach loop
+ Coin: Overlapping Player
-> Add 1 to Score
-> Coin: Destroy
The diameter of circle1 is always going to be equal to the smaller of the screen width and the screen height (depends on whether its landscape or portrait).
The diameter of circle2 is always going...
Use a string tokenizing / parsing extension - there are quite a few to choose from - and set the delimiter to newline$ (or you can copy & paste a newline character from notepad).
Alternatively, you...
There's no need to use two ForEach loops there, although it wouldn't actually hurt if you did. If you do that, you're essentially just bypassing the built-in object pairing / scope system altogether....
It's actually not too complicated, but it's not documented at all in the help file, which isn't great...
I made a few little examples here:...
You've already got the formula there - you just need to strip out the max(), min() and turnRate() parts.
D = ((( ATan2( ship.y - YMouse, XMouse - ship.x ) - ship.angle + 540 ) mod 360 ) - 180 )
...
I just modified my previous example to use an array instead of a list (might be faster?), and took out all the graphics that aren't mine.
https://1drv.ms/u/s!Atq7cUIJ7uexjz7nSMD9J0JwKV72?e=Ff8qeb
...
Yes, I've had something like this working before for multiple targets, but only in a squad level turn-based strategy game, so performance was never a serious concern.
After a little experimentation,...
Not sure about why enemy movement goes wrong above a certain speed, but I'd guess it relates to your "MoveTimer" variable.
Having said that, I can see how the pathfinding engine as a whole could...
The hard way, I'm afraid - load it as a text file, and parse it yourself :(
You could also just make up your own syntax that's easier to parse - delimited strings are pretty simple...
eg.
...
I think scripted events can be seen as an extension of normal NPC conversations (which you will find discussed elsewhere).
Personally, I'd use XML or something similar.
Here's a quick example:
...
I would usually do something like this:
+ new target assigned...
-> Sprite: set targetDist to sqr(((targetX - posX("Sprite")) pow 2) + ((targetY - posY("Sprite")) pow 2))
// get a unit vector...
You should always think of the built in X and Y position values as being "write only" - always use alterable values to store an object's position coordinates as floats, and never retrieve an object's...
I don't think I have that particular example any more, but I also don't think it would be of much use to anyone either, as it wasn't a general purpose array editor - it was really just suited to...
Surely they shouldn't be picking random paths though? They should be going somewhere with a purpose.
eg. In a rollercoaster tycoon game:
If they're hungry (haven't eaten in a while), they should...
I feel like it should be do-able using a shader - something along the lines of:
return tex2D(img, float2(In.x - (fPixelWidth*xOffset), In.y - (fPixelHeight*yOffset)));
The challenge is to...
The built-in editor is fine for what it is - there's no point in trying to reinvent the wheel, when there are so many great third party image editors out there (including free ones).
The...
Try this:
25339
You could have inserted delimiters in the string, and then a tokenizing extension would have made it marginally easier.
Otherwise, use a fastloop to loop through the string in pairs.
eg.
+...
A flashlight (aka "shadowcasting") effect is actually very tricky to pull off - especially with multiple light sources (which is also likely to make it slow)....
Yeah, that would work - sounds like a very good idea actually.
The original version of my example didn't use actives - it just used a list of strings (to allow for a much more flexible level...
See the first event.
I get the feeling this is going to be one of those that's very specific to the *exact* thing you're trying to achieve, and there will almost certainly be some piece of information you haven't...
Are you using "paste into background" or "add as backdrop"?
"Auto tile" is the term you're looking for - google that and you'll find countless explanations.
There's at least one example on the clickstore, or my own here:...
Look into Brashmonkey Spriter - that's the closest you're going to get.
I've certainly never tried it, but I see no reason why you couldn't (although it's definitely not more flexible).
The potential issues that immediately spring to mind are:
* it would obviously only...
It wouldn't affect performance, but DO NOT do it.
You should create actives to use as containers for all the values that are used in the same part of your program.
For example, create an active...
Or this one: http://1drv.ms/u/s!Atq7cUIJ7uexjASWOFHWGkJ7NUpU
Although, if you're content with just rectangular obstacles, it could be made much simpler (and probably faster) - but I was going for a...
Unless I'm very much mistaken, the issue is not calculating whether or not a line of sight exists between two points, but actually showing the area that is visible to a character, like in the very...
You've pretty much answered your own question. If you get 300+fps with just the shadows, but that drops to 30fps in game, then obviously the problem is not with the shadows - it's some other part of...