Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Optimized main loop, fixed in-world menu bug
Browse files Browse the repository at this point in the history
I have applied to large optimizations to the main loop to make it run more efficiently. Firstly, the program will now check if one of the menu states has changed overall and act upon that, rather than checking each. Secondly I have organized tickone and ticktwo, and I have changed the priorities of the the igm and the time scale (I swapped them).
Lastly, I have resolved the bug where the combat menus (and alike) are uncontrollable by limiting the frametime to the minMenus variable.
  • Loading branch information
Drahsid committed Oct 21, 2018
1 parent e117bf2 commit e700bc5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct UserConfig {
double requestedMinFrameTime = 0;
double requestedMinFrameTimeMenus = (double)1LL / (double)60LL;
double requestedMinFrameTimeNoFocus = (double)1LL / (double)24LL;
double mainThreadUpdateCoef = 3;
double mainThreadUpdateCoef = 2;
float igmState0Override = 1;
float igmState1Override = 2;
float igmState2Override = 4;
Expand Down Expand Up @@ -57,7 +57,7 @@ namespace Config {
<< "requestedMinFrameTimeNoFocus=0.041666666666\n\n"
<< "#How many times per frame should the main loop run? Raising this will increase the CPU usage of the program. If you're experiencing performance problems, consider lowering this.\n"
<< "#I suggest not going below one, because that will make the program much less accurate. 0 will crash the program. [Reccomended: User Preference]\n"
<< "mainThreadUpdateCoef=3\n\n"
<< "mainThreadUpdateCoef=2\n\n"
<< "#IGMState overrides change the base multiplier for each state. Default: 0=1, 1=2, 2=4 [Reccomended: User Preference]\n"
<< "igmState0Override=1\n"
<< "igmState1Override=2\n"
Expand Down
Binary file modified FFXIITZAFPSU.cpp
Binary file not shown.
28 changes: 23 additions & 5 deletions FFXIITZAFPSU.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,17 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level2</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WholeProgramOptimization>true</WholeProgramOptimization>
<MinimalRebuild>true</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -109,12 +114,17 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level2</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WholeProgramOptimization>true</WholeProgramOptimization>
<MinimalRebuild>true</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -125,14 +135,17 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level2</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<MinimalRebuild>true</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -145,14 +158,19 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level2</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<MinimalRebuild>true</MinimalRebuild>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down

0 comments on commit e700bc5

Please sign in to comment.