klabundee's Forum Posts

  • It is possible.. its not a single line of code but yeah..

    Here:

    stackoverflow.com/questions/39118528/rgb-to-hsl-conversion

    function rgb2hue(r, g, b) {
     r /= 255;
     g /= 255;
     b /= 255;
     var max = Math.max(r, g, b);
     var min = Math.min(r, g, b);
     var c = max - min;
     var hue;
     if (c == 0) {
     hue = 0;
     } else {
     switch(max) {
     case r:
     var segment = (g - b) / c;
     var shift = 0 / 60; // R° / (360° / hex sides)
     if (segment < 0) { // hue > 180, full rotation
     shift = 360 / 60; // R° / (360° / hex sides)
     }
     hue = segment + shift;
     break;
     case g:
     var segment = (b - r) / c;
     var shift = 120 / 60; // G° / (360° / hex sides)
     hue = segment + shift;
     break;
     case b:
     var segment = (r - g) / c;
     var shift = 240 / 60; // B° / (360° / hex sides)
     hue = segment + shift;
     break;
     }
     }
     return hue * 60; // hue is in [0,6], scale it up
    }
    
  • Create a new layer, put the image on it, set parallax to 0, 0on layer settings.

  • Hello! On this platform, is it possible to develop a game where the character it movement by SQM? In the Tibia style... Zezenia... Poke X Games... Rucoy Online... In these games the character moves by SQM independently to anywhere on the screen you click. How can we replicate that?

    Help me, please...Thanks...

    Try using tile movement behaviour on the player.

    construct.net/en/make-games/manuals/construct-3/behavior-reference/tile-movement

  • Is there any way to display information like chrome://gpu on an exported apk?

  • Very little going on in the profiler. On my laptop which has an integrated gpu, gpu doesn’t go above 3!! Its one layout, one non scrolling view port and 80 ish objects.

    Can you share your project?

  • This seems like a good solution klabundee. Does that mean the Date/Time data would be then stored on the device memory instead on the server?

    I guess it's very hard to hack a phone to change game data? Purely to cover all possibilities.

    You will have to store the Date/Time when the device goes suspended, on memory or storage.

    It is not impossible to hack.. the data can be changed.. even fake the URL api and send you a fake Date/Time.. but it sounds like a big effort to hack it..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you klabundee and blackhornet, if I understood correctly, the solution is to compare everything according to UTC time, as a reference point?

    For example, if the player lives in different UTC time zone, and If the player spent the entire energy, energy charging time should be calculated in according to the UTC time, regardless of the player's time zone?

    Does this mean that all this data required for comparison should be stored on an external server, for every player?

    Probably the best way is comparing suspended time.

    Set an action Browser->On Suspended ->Store the Date/Time from an external server;

    Set an action Browser->On Resumed ->Get the current Date/Time from an external server from same time zone as On Suspended and compare if the time is different;

    Is it different? OK so now you need to perfomance the life return, new gifts, etc.. based on this amount of time between on suspended and on resumed.

  • Thank you dop2000 and klabundee very much for help.

    I tried dop2000 example and this solution worked perfectly.

    Now I have discovered a new problem. After installing VPN and after changing my IP address (after connecting to different country and time zone), and time from server adjusted to the new zone too.

    New question is how to prevent cheating over VPN? Maybe the solution are in comparing the data saved on the device and the data from the time server, or it can be done in some other way, what do you think?

    If you only need to compare date/time, you could use a fixed time zone.

    For example:

    worldtimeapi.org/api/timezone/Europe/London.txt

    So, doens't matter if the device changes the time zone, the "amount of time" will be always correct.

  • NTP: Network time protocol

    ntppool.org

    You can request the current time and date.

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

    Extortion:

    "the practice of obtaining something, especially money, through force or threats."

    Are you being forced or threatened to acquire C3?

  • First of all, thanks for the replies! :)

    I agree with you guys, but it will be a little weird to do like you guys said. I'll explain why:

    If I suspend the game while its Sunny, there is no chance that will be Snowy in the next hour, it's like a cycle, and every weather change has a probability to happe. For example: If it's sunny now, there is 50% chance that will remain Sunny, 40% chance that will be partly cloudy in the next hour and 10% that it will be windy. See the image below:

    So let's say that the player went 10 hours offline and then came back to the game... I need to calculate the probability based in this cycle for every hour. Do you guys have any suggestion on how to do that? Nothing comes in my mind when I think about it..

    Other ideia that may work here, is creating an online server/site/whatever and make a global weather for each city in the game, so I can "upload" from this repository the last 10 hours weather condition. What do you guys think? Is this possible? Or the other idea is more effective?

    Thank you so much!!

    Hiho,

    your image is not showing..

    But, let me suggest to you:

    Variables:

    Weather, On_Suspended_Time, On_Resumed_Time, Suspended_Time.

    Create a function, "On_Resumed_Simulate"

    This functions will run every on resumed.

    On suspended:

    1 - Store the time to the var On_Suspended_Time;

    On resumed:

    1 - Store the current time to the var On_Resumed_Time;

    2 - Do the math between On_Suspended_Time and On_Resumed_Time to know hours or minutes that the game was suspended and store it to the var Suspended_Time;

    3 - Call On_Resumed_Simulate(Suspended_Time);

    Function On_Resumed_Time:

    1 - Receive the amount of hours suspended;

    2 - For each hours suspended

    2.1 - Compare var Weather = Sunny

    2.1.1 - Choose (Rainy, Cloudy) (If you need probability chance of pick, you can use here advanced random, Like 40% of Rainy, 60% Cloudy)

    2.1.2 - Do whatever you need after the change of weather, like if it will be on normal, running game..

    2.2 - Compare var Weather = Rainy

    2.2.1 - Choose (Sunny, Cloudy, Snowy) (If you need probability chance of pick, you can use here advanced random, Like 20% of Sunny, 60% Cloudy, 20% Snowy)

    2.2.2 - Do whatever you need after the change of weather, like if it will be on normal, running game..

    Im not sure if its clear to understand, but you need to do all the steps every On Resumed on "On_Resumed_Simulate"

    Ashley; why the forum does not respect the normal break lines?

  • Its normal here