New to coding, need help with deeper modifications
- plaguedoctor
- New member
- Posts: 7
- Joined: Fri Sep 21, 2018 02:47
New to coding, need help with deeper modifications
I'm new to coding (and to minetest) and I have some rather ambitious goals for a project using minetest as it's base.
And when I say new to coding, I mean really really new.
I would like a tiny bit of help editing some of the core components of the game. For a start, I would like to see if I can fix the accelerating/wobbly/skating mouse and make it snappy and responsive, but despite all my searching I can't find any help on how to begin finding the right parts of the game to edit. In fact, I can't seem to find anything written in c++, just the LUA files.
I'm not expecting you to hold my hand through all of this, but if you could quickly point out to me which files I need to open and where they are, that would be greatly appreciated. I can sift through and start working it out for myself from there.
Thanks.
(Edit) I've already made an item, familiarized myself with how to make basic skins/mobs and a little work on biomes and I found all of that exceedingly easy.
And when I say new to coding, I mean really really new.
I would like a tiny bit of help editing some of the core components of the game. For a start, I would like to see if I can fix the accelerating/wobbly/skating mouse and make it snappy and responsive, but despite all my searching I can't find any help on how to begin finding the right parts of the game to edit. In fact, I can't seem to find anything written in c++, just the LUA files.
I'm not expecting you to hold my hand through all of this, but if you could quickly point out to me which files I need to open and where they are, that would be greatly appreciated. I can sift through and start working it out for myself from there.
Thanks.
(Edit) I've already made an item, familiarized myself with how to make basic skins/mobs and a little work on biomes and I found all of that exceedingly easy.
- DrFrankenstone
- Member
- Posts: 231
- Joined: Tue May 24, 2016 05:36
- GitHub: treer
- Location: Australia
- Contact:
Re: New to coding, need help with deeper modifications
You might have cinematic mode turned on, it's normally bound to F8 and toggles between snappy and easedplaguedoctor wrote:For a start, I would like to see if I can fix the accelerating/wobbly/skating mouse and make it snappy and responsive
The Minetest engine (mostly C++) is separate to "Minetest Game" (mostly Lua), so you might be looking at minetest_game, the engine is at https://github.com/minetest/minetest and there's plenty of cpp files in /srcplaguedoctor wrote:I can't seem to find anything written in c++, just the LUA files.
- plaguedoctor
- New member
- Posts: 7
- Joined: Fri Sep 21, 2018 02:47
Re: New to coding, need help with deeper modifications
I didn't, but cinematic makes it much much much worse. I guess I'm just a stickler for snappy mouse control from playing competitive FPS games.You might have cinematic mode turned on
-_- omg I knew it would turn out I had done something stupid. Right there, camera.cppthere's plenty of cpp files in /src
Even lets me adjust FOV, nice.
Thank you for graciously indulging my stupidity.
- Linuxdirk
- Member
- Posts: 3218
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: New to coding, need help with deeper modifications
There's something wrong on your side then. Mouse works properly. :)plaguedoctor wrote:I didn't, but cinematic makes it much much much worse. I guess I'm just a stickler for snappy mouse control from playing competitive FPS games.
- plaguedoctor
- New member
- Posts: 7
- Joined: Fri Sep 21, 2018 02:47
Re: New to coding, need help with deeper modifications
Like I said, I play a lot of competitive FPS games at a high level, I'm 30 years old and have been doing so since I was 16. I'm accustomed to very very snappy and responsive mouse controls, and I have very snappy responses in the games that I play regularly. I have a very expensive Asus RoG mouse and I have modified my OS settings for accuracy.Linuxdirk wrote:There's something wrong on your side then. Mouse works properly. :)
I'm sure it's not an issue for most people, but there is absolutely mouse lag in minetest. :)
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: New to coding, need help with deeper modifications
Does setting fps_max in advanced settings to, let’s say, 999 help? (Restart may be needed)
- plaguedoctor
- New member
- Posts: 7
- Joined: Fri Sep 21, 2018 02:47
Re: New to coding, need help with deeper modifications
Yes! That's really good! Thanks! :Dtexmex wrote:Does setting fps_max
- Linuxdirk
- Member
- Posts: 3218
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: New to coding, need help with deeper modifications
When I was 16 Counter-Strike was still a Half-Life mod in early beta state. Back then competitive gaming wasn’t “ranked matches” between teams but “clans” had “clan wars” and we were actually good in this and were local celebrities (oh glorious time … I miss this so much) till people moved away (yes, Internet gaming was not an option back in 1999).plaguedoctor wrote:I'm 30 years old and have been doing so since I was 16.
Oh and remember Quake III Arena? Had a small clan there, too and together we ran a medium popular server. Just getting all the nostalgic feels right now … Later on I was part of a semi-successful OpenArena team but since then I stuck to Sauerbraten (which unfortunately is pretty much dead except Venice Inferno and Rigatoni Rugby – I wish there were people interested in reviving Ogros, though).
Sorry, still can’t confirm after sharing some nostalgia with you :)plaguedoctor wrote:… but there is absolutely mouse lag in minetest. :)
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: New to coding, need help with deeper modifications
Cool! That bug has been pestering me since the start. What’s your platform?plaguedoctor wrote:Yes! That's really good! Thanks! :Dtexmex wrote:Does setting fps_max
- plaguedoctor
- New member
- Posts: 7
- Joined: Fri Sep 21, 2018 02:47
Re: New to coding, need help with deeper modifications
Which is very easy to do when you're...errm I mean when you ignore the comments where someone else had the same problem, and their solution worked for me :)Linuxdirk wrote: Sorry, still can’t confirm after sharing some nostalgia with you :)
Last edited by plaguedoctor on Fri Sep 21, 2018 18:59, edited 1 time in total.
- plaguedoctor
- New member
- Posts: 7
- Joined: Fri Sep 21, 2018 02:47
Re: New to coding, need help with deeper modifications
Ubuntu 18.04.1 LTS, radeon card (not sure that it's relevant here but it seems to be an issue in a lot of games)texmex wrote:Cool! That bug has been pestering me since the start. What’s your platform?plaguedoctor wrote:Yes! That's really good! Thanks! :Dtexmex wrote:Does setting fps_max
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: New to coding, need help with deeper modifications
Hmm, I’ve only seen it on macOS up until now. Please take the time report this in https://github.com/minetest/minetest/issues/2697 as this is now on at least two platforms and also because macOS alone is a too small of a platform (?!) for core devs to care.plaguedoctor wrote: Ubuntu 18.04.1 LTS, radeon card (not sure that it's relevant here but it seems to be an issue in a lot of games)
- plaguedoctor
- New member
- Posts: 7
- Joined: Fri Sep 21, 2018 02:47
Re: New to coding, need help with deeper modifications
I'm sure it's on more than that. Everyone on youtube seems a tiny bit "floaty" to me. It's just that it's too fine for most people to notice, and most people don't care either. And it doesn't affect gameplay.texmex wrote:this is now on at least two platforms
I'll submit a request.
A few other bits of information: I have 2 screens, one proper computer monitor at 1080p and a cheap television at (supposedly) 1080p (which doesn't work so well, it runs on a slightly shrunken aspect ratio which doesn't fill the screen properly but it's the best I can do). I'm also overclocked to 5ghz (which could potentially cause issues, maybe sort of possibly. It's far higher than anything available and might cause issues in specific cases.) Any of that the same for you? Dual monitor especially?
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: New to coding, need help with deeper modifications
External cheap 1080p monitor is what I use. Old MacBook. I believe the engine is quite unoptimized. Compare with Build A World, which engine is also built on Irrlicht.
- Hybrid Dog
- Member
- Posts: 2828
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
Re: New to coding, need help with deeper modifications
There's the code related to fps_max:
https://github.com/minetest/minetest/bl ... .cpp#L3906
I've set fps_max to 61 some time ago because I thought that maybe something bigger than 60 fps may avoid trigger sleeping when vsync is enabled.
Now I changed code to print messages always when fps_max is exceeded:
Surprisingly it constantly sleeps although I set fps_max to 61, something bigger than my screen fps, and vsync is enabled (I did not start minetest with vblank_mode=0).
It also slept while loading the game, this did not slow down loading because it's another thread.
I tried to find the threshold of the fps_max setting where it does not sleep.
When setting it to 120 it still sleeps, but less frequently and mostly only about 1 millisecond.
fps_max was introduced 6 years ago: https://github.com/minetest/minetest/co ... 4162eR1211
https://github.com/minetest/minetest/bl ... .cpp#L3906
I've set fps_max to 61 some time ago because I thought that maybe something bigger than 60 fps may avoid trigger sleeping when vsync is enabled.
Now I changed code to print messages always when fps_max is exceeded:
Code: Select all
diff --git a/src/game.cpp b/src/game.cpp
index 34606172..05f0fcdd 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -3901,9 +3901,13 @@ inline void Game::limitFps(FpsControl *fps_timings, f32 *dtime)
? g_settings->getFloat("pause_fps_max")
: g_settings->getFloat("fps_max"));
+ bool slept = false;
if (fps_timings->busy_time < frametime_min) {
fps_timings->sleep_time = frametime_min - fps_timings->busy_time;
+ errorstream << "fps_max exceeded, sleeping " << fps_timings->sleep_time
+ << "ms!" << std::endl;
device->sleep(fps_timings->sleep_time);
+ slept = true;
} else {
fps_timings->sleep_time = 0;
}
@@ -3914,9 +3918,15 @@ inline void Game::limitFps(FpsControl *fps_timings, f32 *dtime)
* device rather than calculating it by adding sleep_time to time.
*/
+ u32 t_before_sleep = time;
+
device->getTimer()->tick(); // Update device timer
time = device->getTimer()->getTime();
+ if (slept)
+ errorstream << "actually slept " << time - t_before_sleep << "ms."
+ << std::endl;
+
if (time > last_time) // Make sure last_time hasn't overflowed
*dtime = (time - last_time) / 1000.0;
else
Surprisingly it constantly sleeps although I set fps_max to 61, something bigger than my screen fps, and vsync is enabled (I did not start minetest with vblank_mode=0).
It also slept while loading the game, this did not slow down loading because it's another thread.
Code: Select all
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 8ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 8ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 4ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 4ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 7ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 2ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 2ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 7ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 6ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 6ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 8ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 7ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 7ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 6ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 6ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 5ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 5ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 8ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 9ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 8ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 8ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 5ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 5ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 2ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 3ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 7ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 7ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 7ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 7ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 7ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 7ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 7ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 7ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 8ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 8ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 8ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 5ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 6ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 7ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 7ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 6ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 6ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
2018-09-30 20:37:09: ERROR[Main]: actually slept 7ms.
2018-09-30 20:37:09: ERROR[Main]: fps_max exceeded, sleeping 7ms!
When setting it to 120 it still sleeps, but less frequently and mostly only about 1 millisecond.
fps_max was introduced 6 years ago: https://github.com/minetest/minetest/co ... 4162eR1211
- Linuxdirk
- Member
- Posts: 3218
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: New to coding, need help with deeper modifications
And it still does not work properly.Hybrid Dog wrote:fps_max was introduced 6 years ago: https://github.com/minetest/minetest/co ... 4162eR1211
Who is online
Users browsing this forum: No registered users and 6 guests