Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heretic: update P_GroupLines and (re-)create BLOCKMAP if necessary #1136

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

JNechaevsky
Copy link
Collaborator

As always, few remarks:

  • I believe old P_GroupLines code is from Doom 1.2, as according DoomWiki, Heretic itself is based on Doom 1.2.
  • Comment about "...from Chocolate Doom" is deliberately, as released source code Doom 1.10 have minimal difference in P_GroupLines (notably, Z_Malloc).
  • I have slightly changed final printf in P_CreateBlockMap and excluded printf below this line to better match of Crispy Heretic printfs since there is no "better logging" like in Crispy Doom.
  • That testing map15 (replacement for E1M1) is still a thing. Now it is loading fast and hitscans no longer crashing the game in wide areas. Free noclip walking through the map is still dangerous for performance. After porting Pr+ de-facto optimizations few times, I can only say it's not that complicated, but the diff is not that small as well. It was discussed before, so it is out of question, of course.
  • All SM Speed world records demos from dsdarchive.com have successfully passed -timedemo runs. All of them are all recorded under DSDA.
  • Only spaces and not tabs in replaced Heretic's code, and as small diff as possible. ☝️

Copy link
Owner

@fabiangreffrath fabiangreffrath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement, thank you!

@JNechaevsky JNechaevsky merged commit 48a5819 into master Jan 10, 2024
6 checks passed
@JNechaevsky JNechaevsky deleted the htic_psetup branch January 10, 2024 18:34
@JNechaevsky
Copy link
Collaborator Author

Actually... I was thinking to ask you and @rfomin for small recommendation, and as always totally forgot about it. 🙂
It's very simple. When I need to see how much time any function is taking, I'm adding two such lines to the function, like:

void P_SlowFunction (void)
{
    const int starttime = SDL_GetTicks();

    ...

    printf("executed in %d ms.\n", SDL_GetTicks() - starttime)
}

It is working perfectly fine and having milliseconds is all what is really needed. But it requies SDL.h header to be provided. So I would like to ask, is there any possible way to make it simpler? Probably, macrocized somewhere in upper level's header file, which already have SDL.h file included? Or is there a better way to gather such execution time?

@fabiangreffrath
Copy link
Owner

You won't get away without including any headers, but SDL is surely a heavy-weight. Here's an implementation I used to benchmark different openal-soft backends:

kcat/openal-soft#930

@rfomin
Copy link
Collaborator

rfomin commented Jan 16, 2024

You should have I_GetTimeMS() which is the same as SDL_GetTicks(). It's in i_timer.h.

You also have the microsecond precision timer I_GetTimeUS(), it's much better for measuring the runtime of functions.

@JNechaevsky
Copy link
Collaborator Author

Oh, this really will cover all possible needs, I even have to investigate how to use all these functions more or less properly.
image

Thanks very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants