iKiwed's Forum Posts

  • I'm curious about this too. Palette swapping has always been such a fundemental tool in game development it would be amazing if we could just load palette files in and swap them as needed. I've never had results with replace colour that I am satisfied with and it's also a pain to set up, expensive on processing etc.

    Well now, I have had this experiment for a while, and I think it's, at the moment, the best match. In fact, it's a mix between what I want and what I can with Construct 3.

    As we said, if you use the replace color effect directly with the object, for some reason it does not work well enough, especially with low-end PCs (and other devices as well).

    As dop2000 said, the best solution for a palette system would be to use the layer where these objects are going to be placed to apply the effect. In this way, the objects can change color without corrupting the performance.

    Now, my game is divided into many layers since it's a top-down game, but by excluding the HUD we have 3 major layers:

    - LayerBG1 (the objects you can see they're above everything)

    - LayerBGz (the objects with most of the aesthetic choices and are connected with the z escalation and the player)

    - LayerBG0 (the objects which are below everything, like the ground or stuff that don't require z escalation).

    These 3 layers are all connected to the main layer, which I called "GAMEMAP".

    In GAMEMAP you can add as many effects as you want - the "replace color" effect works well enough in this way. However, as you might notice, the palette changes ALL the objects in these 3 sub-layers.

    My middle-ground solution would be to use part of the "replace color" effect on the other 3 layers as well, in this way that effect will only be applied to the selected layer. For example, if you have a chair in LayerBGz and a parquet in LayerBG0, you can use the same effect with two different results, like I can turn the chair red and the parquet blue.

    I hope it helps someone. Again, it's not the best way for me, but instead of getting everything in one color, you can have a little bit more of freedom.

    Additionally, you can add a boolean valuable to the objects in question in case you want that these effects should or should not replace color.

    Overall, these are my experiment results during these 2-3 weeks.

  • I have remembered i found a video by a guy name winstreak who has made an easy way for editing a color palette even in game save me time on art work

    Thank you for the suggestion! With your input I have found the video, which is basically what I did in my game. The problem with this technique, as explained by dop2000, is that this does not work well at all if there are multiple objects.

    If it's just a single object, like the player, it runs normally, but my intention is to apply this effect to most of the objects in the room, by selection.

    The middle ground is to apply the effect on the layer instead of the object.

    The game seems to work better this way.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Some effects are bad for performance, especially when you add them to many objects. Applying the effect to the layer instead is a common way to fix this.

    Without seeing the game it's difficult to suggest, but the obvious solution is to make multiple copies of the same objects with different colors, or multiple animations in a sprite.

    If the objects are static and not animated, you can apply the effect on the start of layout, then paste them on a drawing canvas, then destroy the original objects or make them invisible.

    Thank you for the kind answer!

    To be honest I did try all you said here. Applying these effects on objects seems to not work well, so I am back to applying effects via layers, although it's not as customizable as I wished to.

    The solution of making multiple copies of the same objects with different colors isn't exactly the thing I want to make for my game.

    At the moment, the idea of making an out-of-palette object (while following the color theory) may help make the objects more unique in shape and color, but ultimately my color change idea comes to an end quickly... Which is actually an option to consider, maybe...

    About the drawing canvas, I did try something similar to what you said, but it did not work as intended. I am about to try your suggestion, but I am not positive about this solution due to the fact that there are many objects that can be moved.

    So in short, it's either keeping the replace the color effect of layers or start making copies of the same objects with different colors.

    One thing, though: Thanks to you I have the confirmation that applying the effects on multiple objects can cause a bad execution process!

  • Hello! I would like to make a game with a specific number of colors in a palette, however, I would like to change these colors to provide differences among the levels.

    In these months I have tried some things by using the "replace color" effect.

    For example, I used multiple "replace color" effects for some objects

    That worked alright, except that it was ok only for high-end PCs. playing on low-end PCs brought a high level of latency; therefore, the game ran with less than 20fps.

    I tried the same thing, only on specific layers. For unknown reasons to me, the game was less stressed out by this and could run smoothly enough. But I don't want this.

    I want that the game is optimized enough to run decently everywhere.

    To pick the first sentence, I would like to ask you if you have a better way to introduce a change in palette color for the objects on Construct 3.

    Thank you!

  • Hello again! I think I have solved this myself. Yes, I thank you for letting me giving time to find out a way. Sometimes this is the best way for a novice.

    Short answer: use canvas and the "paste object".

    Long answer: I remember lecturing me about the "reflection" effect and someone suggested using the canvas, which to be frank it's a feature I never used.

    Anyway, I did my tests, and overall I thought that the reflection was not needed.

    I closed the experiment and moved on.

    Just a couple of hours ago, At 2 AM, I got a brain blast: Use a canvas with a bump map effect on it.

    After all, the idea behind the mapping effect is that you "map" the area. So, it's as if it takes a picture of the map and uses an effect on it.

    Place your canvas(es?) in the preferred layer(s) with the bumpmap effect on it and use this as a base for your event code.

  • Hello! As the title suggested, I think I want to use the children to apply the effect "bumpmap".

    The catch is that the child should be the same as the object's parent with the same animation and the same frame. A true clone with only no collision effects and bumpmap effect on, all implemented by events (so no manual).

    If I use the "spawn another object" action, the object spawns with the first animation and first frame as default.

    I can't use the "set animation" and "set animation frame" actions to point to the original object's animation and frame.

    I can use the "Pick last created" event to apply bumpmap and no collision, but I can't change animation or frame in any way.

    As a patch-eye solution, I duplicated the interested object so the game could easily understand what is what and who is who. But these are two different objects.

    I just want one. If by any chance I have to change one of these objects aesthetically, the map effect wouldn't fit.

    So to sum up, I want that the object in question can spawn another identical object with the same position, size, animation, frame, but at the same time with no collisions and with the bumpmap effect on.

    Thank you for reading!

  • Hello! So I am testing out the artstyle and design and whatnot, and I love the idea of using bumpmapping, because the result is great. Some objects look made out of metal, which is exactly what I am looking for.

    But I have some questions about how bumpmapping works.

    For example:

    - Do I have to duplicate the object I have interest?

    - Will bumpmapping all the objects make the game harder to run technically-wise?

    - Is there a way to optimize its inclusion in the game without manually duplicating the interested objects? In particular...

    - Can bumpmapped movable objects work synchronically with the base? If so, how?

    - Are there any other alternatives to bumpmapping?

    - Is it worth using it, in your opinion?

    I can't find any topics about bumpmapping, which I think it's weird...

    How and where can I document more about this technique?

    Thank you!

    Tagged:

  • Hello! Usually, I am in "How to...?", but today I just want to talk with other developers and see the feedback, albeit incredibly approximate due to not knowing exactly how the game works. But I am going to explain shortly!

    In this top-down game, you control a sort of space vacuum cleaner that has to collect pink dust from a series of rooms. You can freely control your so-called Roomba with the 4 directions.

    As you can see in this screenshot, you have more or less a good view of the room you're in. Plus, this Roomba is, at its max speed, so satisfying to drive, yet a bit too fast.

    After having fun driving around in this room, I admit that I have two issues:

    - I think the screen size since it's somewhat big, kind of "spoils" the size of the room and the objects placed. I want a veil of mystery coming from how it looks.

    - Because of the spoiler of the room size, I feel like it makes the other objects not as big as they should be. and it's also probably due to the Roomba's speed.

    On a side note, I have considered that many pixel games such as Part-Time UFO or Celeste have a small screen size (in-game). The screen size in the game I am making is currently 960 x 540. I think this might be the problem: Maybe I have to resize the screen, make it small a little.

    The blue room I made and I showed you in these screenshots is meant to be medium size.

    So I tried making experiments, just for the sake of trying, with the premise that I changed only the assets that were worth to try changing for this experiment.

    The first thing I tried was to decrease the size from 960x540 to 480x270.

    Now the game feels claustrophobic, and I don't like it. The Roomba is the sole protagonist, and its speed is now so fast that may make someone feel nauseous.

    So I had the idea of making the Roomba smaller. I also decreased the speed by half.

    I think that I am up to something. Of course, I didn't fit all the assets for this test, this is why the HUD is still too big for 480x270. And the Roomba is a bit too small. But overall, I see the approximate result, the experiment in this, and think that it may be a solution.

    But I want to hear your opinions because I think having a big screen size has its own benefits. Maybe 480x270 is too small? 640x360 could be a thing? Maybe this idea doesn't work well for a top-down game? I don't know, I am ok to hear opinions on this matter. Please let me know in the comments below.

    PS: I have some videos on Twitter but I don't know if it's classified as self-commercial - that won't be my intention, I have nothing to commercialize for a product that doesn't exist in the market yet.

    Thanks for reading!

  • Ok time to answer all of you

    to count tiles:

    little example of a vacuum mechanic, probably not really what you are trying to do though:

    https://drive.google.com/file/d/1DFmATBH-gtIYrIbpnbeOIWqNO36mWEAA/view?usp=sharing

    fedca

    Thanks for the counting tiles!

    As for your demo on google, this was actually my previous gameplay for obtaining dust.

    I still have this style saved on my project, easily togglable, 100% functional and it does its job.

    The motive I decided to try another way is because I wanted to have more freedom on the type of dirtiness coming from the dust. I was hoping I could do that, but if this tiling issue gets harder for me to produce, it's fine - I'll go back to that.

    After all, from 72677 tiles to 82 pieces of dust, the difference is noticeable.

    Plus, I don't have to make a dictionary for counting the pieces of dust in this way.

    ... Yeah, maybe this is the most convenient idea... I'll think about it for my project, but in any case, I want to see if there is some way to produce the effect I'm asking for in this topic.

    In the meanwhile, thank you so much for reading and answering this topic!

    You may get better performance with a canvas instead of tilemap.

    Even with a tilemap with 1x1 tiles its slow even just erasing.

    dropbox.com/s/0jkp71pl9nvyw08/roomba_tilemap.capx

    An alternate idea is to grab a screenshot and use some JavaScript to scan the image for set pixels. It works, but it needs to flicker as I need to hide the other layers for a frame.

    dropbox.com/s/il3xbkj19f8n78n/roomba_screenshot.capx

    So here's the example using the C3 canvas. It works well for erasing but loops in events are slow, so here it does the scan of the pixels over multiple frames. Seems to work well, but if you resize the game window in any way the canvas will clear. May need some more logic to periodically save the canvas and reload it as needed.

    dropbox.com/s/ki35vb1bx2xztuf/roomba_canvas.c3p

    If you have the full version of c3 you could also handle the canvas pixel scanning in javaScript as that would be much faster.

    R0J0hound

    Thank you so much for your demos! I appreciate your help! I admit I have never used the drawing canvas and by judging the difference I believe it's the one working better.

    Deleting 1x1 tiles in-game doesn't affect the performance unless you're always counting (just as proved in your first demo). In fact, the whole idea of using this feature would work if it wasn't for the progression bar.

    Yeah I own the full version of C3 alright, I'm not the best at javascript but I bet it can do better.

    As I mentioned before with fedca, I'll keep in consideration all the help to make a resolution for this feature.

    Throwing some ideas out here - instead of counting tiles, generate the dust dynamically and simply keep track of how much was created in the first place.

    Or set up a loading screen style transition when running the counting event, if it's only a one-time thing.

    oosyrag

    Thank you for your ideas! Yes, as I mentioned before, I do have a similar technique in my game, which is currently suspended to try a new, (possibly) better way to collect dust. This feature is similar to the demo provided by fedca.

    In the game, I have also tried to add random dust across the map, in different sizes and shapes. Of course, the more you add, the worse it gets with the performance. After 5000 pieces of dust, you see a downgrade. Luckily you don't need to go for 3000 pieces, just the ones you need, which usually go from 80 to max 500 depending on how to use them.

    As I said to fedca, I was trying to see if I could make the roomba more of a rubber erasing scratches. While this works in-game, it doesn't go well when it's about data and calculations. Since I'm a sort of a newbie, I'm open to all ideas but at the same time keep acknowledging that some of these can't be made at the moment. So yeah, it's highly probable that I'm going back to the previous technique for getting dust since overall it works well.

  • 72677 for just a small area sounds like an amount that will very likely lead to performance problems, I would suggest changing the game design to allow for larger dust particles.

    I have tried different types of dust types.

    There is another type of dust that the roomba collects, which uses particles. But the purpose of that type of dust is completely different and is visually speaking different for a motive. Let's call it "special dust" just for reference.

    Using the same technique for normal dust isn't ideal and doesn't fit well with a vacuum cleaner. This is why using tilemaps works incredibly well. It's as if the roomba is a rubber on a sheet full of scratches. Unfortunately, the tiles are tiny, and therefore for each counted tile you get big numbers like 72677.

    I have tried with bigger tiles and sadly they don't fit well with the rest of the game, aesthetic-wise.

    At this point, I'm going to either find another way to make normal dust or just decide to see if there is another way to not calculate all the tiles (I don't know how, but we'll see).

    store tiles as x-y positions in a dictionary, use key.count as progression bar

    Yes, I'll let you know if it works!

  • Hello! Let me explain the game I am making and the problem.

    The Game:

    You are a roomba collecting dust from the floor.

    Months ago I used a technique that allowed the roomba to collect dust. The problem was that the dust collection was an extensive hierarchy of objects, which slowed the initial calculation when you boot the game up.

    A couple of days ago I have finally changed to tiles. I can draw whatever I want on the floopr and the roomba can delete these tiles by passing by in-game with no issue.

    Everything works as intended and the game doesn't suffer from the slow calculation.

    The problem:

    I want that the progress of collecting dust is expressed through a bar in the HUD.

    The more you collect, the more the bar gets bigger, until it's done.

    At the moment, the only thing I have thought of was to count the number of tiles in the game and subtract once the roomba collides with them.

    I have followed this Construct 2 tutorial, which worked for Construct 3 as well.

    construct.net/en/tutorials/working-tiles-tilemap-count-1427

    The problem is that the game now takes a lot of calculation for counting the tiles since they are 1 pixel each. A small square full of dust may contain 72677 tiles, for example.

    My questions are:

    1) Is there a better way to count tiles or make the counting faster?

    2) If not, do you know a better way to make a progression bar for the collected dust?

    3) If not, and if you think this technique is not necessary or ugly, do you know a better way to make dust in-game without freezing the game?

    Thank you so much... Have a good day!

  • Hello! I explain shortly: I'm making a game where you're a vacuum cleaner.

    At this moment, I've used a particle that spawns sprites (1x1 cubes) that can be collected on the map. To make the particle standstill, I set the particle time scale to 0 once it spawned enough sprites.

    The problem is that it takes time (1-2 secs max, depending on the number of sprites) each time I restart the layout, probably because the game has to render the particle every time.

    I was wondering if it's possible to pre-render the particle action.

    Also, if you have better ideas for how the "dust" particle works, please let me know!

    Thank you so much.

    Tagged:

  • Oh my gosh. I think I did it...!

    By reading a second time what calminthenight said, I noticed I made a mistake.

    The two conditions must align in the same event, and not in two.

    On Start Layout
    Global.MusicPlaying = Music.mp3 > Set Global.MusicPlaying to Music.mp3
    				> Play Global.MusicPlaying looping from Music at db (tag "music")
    
    

    Before that I had the two conditions I thought I had to search for a specific event action that would have helped me to "resume" the music. But this event is clearer and better. Nice!

    I hope this helps someone.

  • Hello! I have a similar issue but I didn't want to open a new topic, so I'll explain here.

    Basically, the player can restart the layout whenever they want, to keep it easy to try again. However, the selected music for that layout won't stop restarting.

    I did get an idea of what calminthenight said, but I don't know exactly how to execute it through the events.

    ^^^^

    This is basically what I wanted to say. Here below I am about to give extra thoughts.

    I guess the game should recognize that the game has already the music played. I guess one possible way to do this is through global variables, although there is an issue with the audio tag.

    On start Layout > Set Global.MusicPlaying to music.mp3
    			> Play Global.MusicPlaying looping from Music at 0db (tag "music")
    
    Global.MusicPlaying = music.mp3 > ???
    

    I could use the "Set Paused" event in the state of "Resume", but it requires the audio tag ("music"), which, by restarting the layout, gets removed and added once the layout starts again. Meaning, I doubt it's the solution.

    Let me know in the comments, I'm super open to suggestions! Thank you so much!

  • Hello! It's my first attempt to use a dictionary for collecting some data.

    I would like to count every time the player manually restarts (like pressing a button) or dies from the game in that specific layout, for each layout in the game. Ex:

    Room1

    Restarts: 5

    death: 2

    Room2

    Restarts: 3

    death: 1

    and so on. So in a sense, it's an array.

    Since it's been a while I made even the simplest database ever, I was wondering if it's possible to use the dictionary for this purpose. Once the game is ended, it will release a downloadable .json file with the written data.

    This is all I have to say that doesn't make the question more confused.

    Here below some of my experiments:

    Before posting this topic, I tried following my instinct and worked it out with trial-and-error. The project partially works: In each layout, the game creates a new dictionary with the name of the room on it, plus all the details like I mentioned before. There are two problems, however: If you go to the next layout, the first dictionary may take the name of the next layout. Furthermore, the data from the first dictionary continue to get collected even after passing through another layout.

    When I extract the text file, the data from the layouts I played are redundant.

    What do you think I should do next?

    Thank you!