Machiene independent speed won't really fix it, you have to use deltatime for the game to run at the same speed on any frame rate
I did make a guide on gamejolt for that you can check: Please login to see this link.
This is excellent! Thank you for the resource. I have a highly competitive game which I have been changing over to delta time as events are required to fire at the same time regardless of the frame rate. The guide and your added information really helped and I have my objects moving at the correct rate regardless of framerate.
I have been trying to figure out the best way to replace the following events using delta_time and this is what I have come up with using the forum search as a major helpful resource! I figured I would drop this here in case it can help others out and I am also having some odd issues which I am hoping you, or others, may have some insight into. I have been trying to wrap my head around it, but for some reason it just isn't clicking for me. I just need to be pointed on the correct path.
You can assume everything laid out in the guide linked above is the same for my project.
The Always Event
(This appears to work properly. Upon looking this doesn't appear like it needs to be changed as it is based on the engine timer and should always fire properly..?)
[ EXAMPLE EVENT ]
* Loot_HP of OBJECT >= 1
+ Always
- Set Y position to Y( "OBJECT" ) + ( Game_DeltaTime )
The Every Event
(I am not sure how to do this yet as I require an event to fire randomly every 1 to 4 seconds.)
[ EXAMPLE EVENT ]
* Every RRandom(1000,4000)
- PERFORM CUSTOM ACTION
The Timer is Greater than XX"-XX Event
(I am sure I just need to change this out to check the "timer" and fire the event once it reaches a certain number.)
[ EXAMPLE EVENT ]
* Timer is greater than 20"-00
+ Timer is less than 23"-00
+ Run this event once
- PERFORM CUSTOM ACTION
BONUS Odd Issue Event using mod
(This is more of a question to see if anyone has some thoughts on what could be happening here. As per seeing some information on this forum, I tried replacing the Always event below with a "mod 2" against the timer value. I am new to what mod is and have limited understanding, but my assumption is that if the mod 2 = 0, on every 2nd frame my event would fire. This appears to work fine when I just run the frame of the game. Here is the Bonus odd issue! When I run the application and start on my main menu page, there are two buttons you can click at the bottom of my game. One button moves the camera to the left to a "game" section and once the camera centers here, the Game Frame is loaded. All the movements using the below "mod 2 = 0" code work completely fine and the speed is accurate. BUT if I click the other button, it moves the camera to the right to a "home" section of the main menu frame without loading a new frame. If from here you then click the "game" button, the camera moves to the left to the "game" section and once the camera centers here, the Game Frame is loaded like before, BUT this time the speeds of my objects are reduced even though the framerate, delta_time, etc. appear to be all the same. It is a mystery that has been keeping me up at night because it doesn't make sense...lol)
[ EXAMPLE EVENT ]
* Loot_HP of OBJECT >= 1
+ Global Value(timer mod 2) = 0
- Set Y position to Y( "OBJECT" ) + ( Game_DeltaTime )