Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Announcements and Showcase
In this video, it's 3 months of working with ccb.

carlosm
Registered User
Quote
2019-12-29 01:19:42

Hello everyone,
In this video, it's 3 months of working with ccb.
The video is speechless. Because I am Brazilian and I know that many here are Americans or from another part of the world I do not speak English !!!
At the end of the video, I show how FPS changes the behavior of the player already configured!
Note that with less FPS, everything works, but when using a phase that is still being edited. The game with more FPS, due to lack of animated enemies and the whole scenario, if you notice that the player goes faster than desired, the jumps get very high and so on.

I need to make sure everything works normally on weaker, stronger computers. That way, on a powerful machine, the game will not work like the PC that was edited.

I ask if anyone knows how to solve this, help.
I believe it is linked to "deltaTime".

https://www.youtube.com/watch?v=IiT3fs9T1iQ


yalazkan
Registered User
Quote
2019-12-29 10:18:16

By the help of your closest friends, you can solve the problem. To do this, add a fps counter and ask them to tell you ıts value.
But turn the shadows on and use a higher screen res.
On the other hand, game is pretty good :)


Robo
Guest
Quote
2019-12-29 10:24:46

I cant offer much help on the low FPS but it did sound like your running on an old laptop right ?

I tested my own game on old laptop and the FPS only get as low as 55 FPS so its ok for now though I don't have many animated meshes as yet. Maybe that makes a difference ?

Try hiding some of these animated meshes and re-test to see.
Maybe somewhere in your code you are running some unnecessary calculations ?

I have reduced in my game the number of timers and reduced how often they repeat to as low as still looks ok - smallest is 50ms while longest is every 7 seconds... I am considering changing animated mesh Action from every frame to my own say at 50ms instead (thats a 3x reduced load if I did that).

Looks very good though and better than my 6 months using CC so well done...


just_in_case
Moderator
Quote
2019-12-29 13:16:03

First of All i would like to appreciate your work and patience the visuals are really neat and have pretty decent animations.

Now for your problem regarding fps you might double check your coding if there is any sometimes a faulty code and an ingine loop slow down the game which results in low fps.

I seems that all the platforms are visible since starting, you can use on proximity behavior to show and hide the levels or platforms which will decrease the render time and will give you a boost in fps. Try adjusting camera z-far value this can also be usefull in rendering.

Use an fps counter to calculate the frameeate am pretty sure its more slower while screen recording than the normal gameplay.

For the jump i can't understand what you are trying to say.


carlosm
Registered User
Quote
2019-12-29 14:36:07

@yalazkan.

Really the problem is deltaTime!
Today I will try to solve this .. Thanks.

@Robo.

Yes the computer is old, I have 12 - enemies in the scenario but a boss.
all with walking animation_ and patrolling from one point to another.
They chase and attack the player as they approach their area of ​​attack and also return to their routine if the "player" runs away.

I had more animations because the is old pc, had to remove many things from the game.

Thanks for the tip , I will try to decrease the number of processes that are running.

@just_in_case


About jumping is a matter of FPS. With a backdrop full of lively items and meshes everything works one way but in another things seem overkill.

I have a video of you about the lightmap, but I haven't done it yet to make the game light and beautiful. I think after having the good lightmap I can remove the lamps from the scenery and get more FPS.
Thanks.

Problem with FPS searching here in the forum I found this code and I will try to use.

var Delta_Time_Last_Update = Date.now ();
var Delta_Time_Now = 0;
var Delta_Time = 0;

var delta_time_enterframe_handle = requestAnimationFrame (delta_time_enterframe);
delta_time_enterframe function (event)
{
Delta_Time_Now = Date.now ();
Delta_Time = (Delta_Time_Now - Delta_Time_Last_Update) / (1000/60);
Delta_Time_Last_Update = Delta_Time_Now;


carlosm
Registered User
Quote
2019-12-29 19:56:16

Problem solved! "Delta_Time" in ccb.
I searched here in the forum and found:
https://www.ambiera.com/forum.php?t=5786

Thanks to @ tim12345 for messing up your solution.
now or my character runs as animations and moves correctly with 60FPS and 20FPS.

total smoothness and gained more FPS in the game!


bracer
Registered User
Quote
2019-12-31 19:58:39

Yes Deltatime is very important, for anyone of you encountering this problem.

Implement this code on your HTML WebGL side to retrieve Delta time.

var Delta_Time_Last_Update = Date.now();
var Delta_Time_Now = 0;
var Delta_Time = 0;

var delta_time_enterframe_handle = requestAnimationFrame(delta_time_enterframe);
function delta_time_enterframe(event)
{
Delta_Time_Now = Date.now();
Delta_Time = (Delta_Time_Now - Delta_Time_Last_Update) / (1000/60);
Delta_Time_Last_Update = Delta_Time_Now;

//Or you can access this variable anytime you like, don't just have to be inside this function.
$("delta_Time").html(Delta_Time);


delta_time_enterframe_handle = requestAnimationFrame(delta_time_enterframe);
//cancelAnimationFrame(delta_time_enterframe_handle);
}

NOW IT SHOULD BE NOTED THAT IN AN IDEAL WORLD, the native movement/positioning-over-time codes of CopperCube SHOULD already have deltaTime built into it.

We should not have to handle this on our side.


just_in_case
Moderator
Quote
2020-01-06 17:57:36

If anyone can post an example of deltatime to move an object using every few seconds do something , then change position of a scenenode to a fixed position. now if framerate drops the position change is not accurate it decreases by some value, eveytime the framerate drops.

am continuosly working on a game demo of helix jump clone from 3 days, sitting in front of Computer more than 8-9 hours a day, after more than 500 trials and errors... I am finally satisfied with the result. started capturing video with my screen recorder which results in low framerate and i got envolved with this same issue.

and my brain is so jammed that am unable to understand any bit of this Delta time thing.

I know that if i try it after few days i will resolve it by myself. But i want to post the Helix Jump demo as fast as possible. So , it will be really helpfull if one can provide a simple example on how to change a fixed position of an object using at every few seconds using the Delta time.

also right now am running my whole bunch of code within the ccbRegisterOnFramEvent and still position of the node decreases by some value if frame rate drops.


carlosm
Registered User
Quote
2020-01-07 11:32:44

Sorry for the delay ..
for me it worked!

I declared deltaTime at the root node of the scene ...

just like the post I found here in the forum.

after using a delta variable in all movements.
pos.x + = value / speed * deltaTime.

The only problem that sometimes happens is that if you start the project and take the focus off the game window when things come back, you will no longer see a difference in movement, meaning if the window loses focus, the game will be stopped. And when you come back to it, there may be a difference in movement.


just_in_case
Moderator
Quote
2020-01-07 14:08:44

Nevermind its working fine now, i don't know what was the problem before. Maybe screen recorder might had cause the problem will try to record again and then check if the problen still exist.


ultramelon
Registered User
Quote
2020-01-10 05:31:10

Looking great. Did you do any programming, or just use available -Behaviors- ?


carlosm
Registered User
Quote
2020-01-11 15:37:44

Hi, @ultramelon
I made some schedules!
Player control is not the default behavior of CCB.
A mobs patrol.
and close combat system.

There are many parts that can be used by ccb owners.
and others I made my own based on the ones that already exist.


srfstudio
Registered User
Quote
2020-01-12 22:08:14

Game is looking very good, watched & liked the video, also subscribed :) There are some issues with fps in the video, hopefully you managed to fix it.


carlosm
Registered User
Quote
2020-01-13 02:32:10

@srfstudio,
Thank you.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact